Allowkid 5 Share Posted April 27, 2015 import java.util.Random; import org.dreambot.api.methods.interactive.GameObjects; import org.dreambot.api.methods.map.Area; import org.dreambot.api.methods.map.Tile; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; @ScriptManifest(author = "Allowkid", category = Category.UTILITY, description = "Best kebabo out there", name = "Kebabo", version = 1) public class Kebabo extends AbstractScript{ enum State {BANK,WALKBANK,BUYING,KEBABWALK,IDLE} Area bankArea = new Area(3272, 3161, 3265, 3273); Area kebabArea = new Area(3277, 3183, 3270, 3179); public State getState(){ if(!bankArea.contains(getLocalPlayer()) && getInventory().isFull() || !getInventory().contains("Coins") && !bankArea.contains(getLocalPlayer())) return State.WALKBANK; if(bankArea.contains(getLocalPlayer()) && getInventory().isFull() || !getInventory().contains("Coins")) return State.BANK; if(!kebabArea.contains(getLocalPlayer()) && getInventory().onlyContains("Coins")) return State.KEBABWALK; if(kebabArea.contains(getLocalPlayer()) && getInventory().contains("Coins") && !getInventory().isFull()) return State.BUYING; return State.IDLE; } public int onLoop() { switch(getState()){ case WALKBANK: log("WALKBANK"); getWalking().walk(new Tile(3270, 3166, 0)); break; case KEBABWALK: log("KEBABWALK"); getWalking().walk(new Tile(3277, 3180, 0)); getGameObjects().closest("Door").interact("Open"); sleep(random(1000, 3000)); getWalking().walk(new Tile(3274, 3180, 0)); break; case BANK: log("BANK"); if (getBank().isOpen()){ sleep(random(1000, 2000)); getBank().depositAllExcept("Coins"); sleep(random(1000, 2000)); getBank().close(); }else{ getGameObjects().closest("Bank booth").interact("Bank"); sleep(random(1000, 2000)); } break; case BUYING: log("BUYING"); if (getDialogues().inDialogue()){ getDialogues().clickContinue(); sleep(300, 600); getDialogues().chooseOption("Yes please."); }else{ getCamera().rotateToEntity(getNpcs().closest("Karim")); getNpcs().closest("Karim").interact("Talk-to"); } break; default: log("Default"); sleep(5000); break; } return random(50, 300); } public static int random(int min, int max) { int n; int mean = (min + max) / 2; int std = (max - mean) / 3; Random r = new Random(); do { double val = r.nextGaussian() * std + mean; n = (int) Math.round(val); } while (n < min || n > max); return n; } } Link to comment Share on other sites More sharing options...
Val 125 Share Posted April 27, 2015 Can vouch for him, watched him make the script on Skype + working proof! Thanks for the script man, cant wait to see more in the future. Link to comment Share on other sites More sharing options...
XYZ 32 Share Posted April 27, 2015 import java.util.Random; import org.dreambot.api.methods.interactive.GameObjects; import org.dreambot.api.methods.map.Area; import org.dreambot.api.methods.map.Tile; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; @ScriptManifest(author = "Allowkid", category = Category.UTILITY, description = "Best kebabo out there", name = "Kebabo", version = 1) public class Kebabo extends AbstractScript{ enum State {BANK,WALKBANK,BUYING,KEBABWALK,IDLE} Area bankArea = new Area(3272, 3161, 3265, 3273); Area kebabArea = new Area(3277, 3183, 3270, 3179); public State getState(){ if(!bankArea.contains(getLocalPlayer()) && getInventory().isFull() || !getInventory().contains("Coins") && !bankArea.contains(getLocalPlayer())) return State.WALKBANK; if(bankArea.contains(getLocalPlayer()) && getInventory().isFull() || !getInventory().contains("Coins")) return State.BANK; if(!kebabArea.contains(getLocalPlayer()) && getInventory().onlyContains("Coins")) return State.KEBABWALK; if(kebabArea.contains(getLocalPlayer()) && getInventory().contains("Coins") && !getInventory().isFull()) return State.BUYING; return State.IDLE; } public int onLoop() { switch(getState()){ case WALKBANK: log("WALKBANK"); getWalking().walk(new Tile(3270, 3166, 0)); break; case KEBABWALK: log("KEBABWALK"); getWalking().walk(new Tile(3277, 3180, 0)); getGameObjects().closest("Door").interact("Open"); sleep(random(1000, 3000)); getWalking().walk(new Tile(3274, 3180, 0)); break; case BANK: log("BANK"); if (getBank().isOpen()){ sleep(random(1000, 2000)); getBank().depositAllExcept("Coins"); sleep(random(1000, 2000)); getBank().close(); }else{ getGameObjects().closest("Bank booth").interact("Bank"); sleep(random(1000, 2000)); } break; case BUYING: log("BUYING"); if (getDialogues().inDialogue()){ getDialogues().clickContinue(); sleep(300, 600); getDialogues().chooseOption("Yes please."); }else{ getCamera().rotateToEntity(getNpcs().closest("Karim")); getNpcs().closest("Karim").interact("Talk-to"); } break; default: log("Default"); sleep(5000); break; } return random(50, 300); } public static int random(int min, int max) { int n; int mean = (min + max) / 2; int std = (max - mean) / 3; Random r = new Random(); do { double val = r.nextGaussian() * std + mean; n = (int) Math.round(val); } while (n < min || n > max); return n; } } Thnks for posting this, now get me a proggy Link to comment Share on other sites More sharing options...
Swaq 243 Share Posted April 27, 2015 Oh, thanks for making it open source, and grats on first release Link to comment Share on other sites More sharing options...
James 256 Share Posted April 27, 2015 grats on release Link to comment Share on other sites More sharing options...
Spaisins 2 Share Posted April 27, 2015 Any way to download this script? Will get you some proggies afterwards. The previous kebab buyer script which was on SDN was removed I suppose this could be great replacement. Link to comment Share on other sites More sharing options...
James 256 Share Posted April 27, 2015 Any way to download this script? Will get you some proggies afterwards. The previous kebab buyer script which was on SDN was removed I suppose this could be great replacement. I think you save the text in notepad and change it to a java file, not completely sure though sorry. Link to comment Share on other sites More sharing options...
Novak 35 Share Posted April 27, 2015 I think you save the text in notepad and change it to a java file, not completely sure though sorry. no you would have to compile it into a jar and put it in the dreambot scripts folder Link to comment Share on other sites More sharing options...
Stormscythe 263 Share Posted April 27, 2015 Congrats on release :-) Will be of good use to get some food stocked for combat Link to comment Share on other sites More sharing options...
Spaisins 2 Share Posted April 27, 2015 no you would have to compile it into a jar and put it in the dreambot scripts folder Could you or someone else compile it for me and others please? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.