August 5, 201411 yr Creates Iron Knifes in Varrock. Start in varrock bank with hammer in inventory. Will take out iron bars, go to anvil and smith them into knives, bank and repeat. Virus scans: https://www.virustotal.com/en/file/ce1dcf4b012b6ca750affd09dc20a5aaecdf3e66a0b9fbcea274b548a02530ab/analysis/1407213632/ http://virusscan.jotti.org/en/scanresult/0e82097f1114456abed8dd39254222ad7a846bf1 Download: http://www.mediafire.com/download/2e5l8i9psjcml98/BasicSmither.jar import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.api.map.Position; import org.osbot.rs07.input.mouse.EntityDestination; import org.osbot.rs07.input.mouse.MiniMapTileDestination; import org.osbot.rs07.utility.Area; import java.awt.*; @ScriptManifest(author = "Gilaga", info = "Basic Iron Knife Smither.", name = "Basic Smither", version = 0, logo = "") public class BasicSmither extends Script{ private static final Area SMITHING_AREA = new Area(3185,3420,3190,3427); private enum State{ SMITH, BANK, WALK_TO_SMITH, WALK_TO_BANK }; private State getState(){ if(inventory.contains("Iron bar") && SMITHING_AREA.contains(myPlayer().getPosition())){ return State.SMITH; } else if(!inventory.contains("Iron bar") && !SMITHING_AREA.contains(myPlayer().getPosition())){ return State.BANK; } else if(inventory.contains("Iron bar") && !SMITHING_AREA.contains(myPlayer().getPosition())){ return State.WALK_TO_SMITH; } else{ return State.WALK_TO_BANK; } } public int onLoop() throws InterruptedException{ switch(getState()){ case SMITH: outerIf: if(!myPlayer().isAnimating()){ sleep(1000); if(!inventory.contains("Iron bar")){ sleep(500); break outerIf; } int failSafe = 0; while(!myPlayer().isAnimating()){ sleep(50); failSafe++; if(failSafe >= 10){ inventory.interactWithNameThatContains("Use", "Iron bar"); RS2Object anvil = objects.closest(2097); mouse.click(new EntityDestination(bot, anvil)); if(interfaces.get(312) != null){ } sleep(1500); mouse.move(370,180); mouse.click(true); sleep(250); mouse.move(365,250); mouse.click(false); sleep(1000); keyboard.typeString("27"); sleep(500); break outerIf; } } } break; case BANK: RS2Object bankBooth = objects.closest("Bank booth"); if (bankBooth != null) { if (bankBooth.interact("Bank")) { while(!bank.isOpen()){ sleep(250); } bank.depositAll("Iron knife"); if(bank.contains("Iron bar")){ bank.withdraw("Iron bar", 27); } else{ stop(); } bank.close(); } } break; case WALK_TO_BANK: walkTile(new Position(3185,3436,0)); break; case WALK_TO_SMITH: walkTile(new Position(3185,3426,0)); break; } return random(200,300); } private boolean walkTile(Position p) throws InterruptedException { mouse.move(new MiniMapTileDestination(bot, p), false); sleep(random(150, 250)); mouse.click(false); int failsafe = 0; while (failsafe < 10 && myPlayer().getPosition().distance(p) > 2) { sleep(200); failsafe++; if (myPlayer().isMoving()) failsafe = 0; } if (failsafe == 10) return false; return true; } public void onPaint(Graphics2D g) { } }
August 5, 201411 yr Looks nice, any chance you could fix the messed up code snippet? or is it just showing up white every other line for me If that's the code then it's clean - glad to see some more free scripts flying around!!
September 2, 201411 yr Author the bot is fine i think the new client update broke this script can you fix it? What is wrong with it, what happens when you run it?
October 9, 201411 yr Please add a 1 or 2 second delay inbetween "Withdraw 'x' amount of bars" and the amount to withdraw as it tries to withdraw them before the "x" amount interface has even opened resulting in the amount it is trying to withdraw being typed into the chat box. Apart from that the rest of the script works great, Thanks.
December 2, 201411 yr bots broken man i may try to fix it studying up on scripting a bit looks like it would be a good place to start
June 19, 201510 yr I don't see why people would make iron knifes when you don't profit that much. Either way good job on release.