hitlab89 0 Posted August 27, 2016 Hello Dreambot community! I will be recording my experiences and journey with Dreambot here. I just came back to OSRS for nostalgic reasons and looked into the botting community. Wow has it improved a lot! I have not botted in any games for a while (I used to use screen scrapping methods back in the day). The API available for botting are amazing now. A little about myself: I bot casually for fun and not for RL profit. I have botted extensively in past for many games and have never been banned, and I intend to stay that way. I have experiences with Java, however I have not worked professionally in writing software for more than 7 years so I will be rusty. It will not take long for me to pick it up again though! I always write my own scripts to bot in games. I feel this helps in preventing me from getting banned since I write bare-bones, easy to read code. I am a big believer in agile programming and use development cycles to add to functionality to my scripts as I need, I believe this helps big time in preventing any obscure bugs from occurring and for anti ban reasons. I will be posting my scripts here for free. Hopefully this will be useful to beginners learning Java or people looking for some scripts to use on their own. My scripts are suited for the casual botter who wishes to remain unbanned long-term or the main account who just wants some simple low-risk scripts to help out for repetitive tasks now and then. I am playing on a fresh account on OSRS and willl be playing F2P to start off. Will move onto P2P once my stats are higher. I am sure you will be seeing more interesting scripts from me in the future as my account progresses. If you have feedback to my code please post below. I am always looking to improve. Woodcutting Just a simple WC script to get started and familiarize myself with the API. I read Apaec's starting tutorial here. http://dreambot.org/forums/index.php/topic/628-scripting-tutorial-in-depth-no-prior-knowledge-needed-where-to-get-started-by-apaec/ Then edited the code to do woodcutting. I parked my character at the forests in Lumbridge (although this can be done in any location with trees) and started leveling up WC. This script runs around and cuts trees, once the inventory is full it drops all the logs. As easy as it gets! easyChop.jar import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.container.impl.Inventory; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.script.Category; import org.dreambot.api.wrappers.interactive.GameObject; @ScriptManifest(author = "Hitlab", name = "easyChop", version = 1.0, description = "Simple level WC", category = Category.WOODCUTTING) public class main extends AbstractScript { public void onStart() { } private enum State { CHOP, DROP }; private State getState() { if (getInventory().isFull()) return State.DROP; else return State.CHOP; } public void onExit() { } @Override public int onLoop() { switch (getState()) { case CHOP: GameObject tree = getGameObjects().closest("Tree"); if (tree != null && tree.exists() && getLocalPlayer().getAnimation() == -1) { tree.interact("Chop down"); sleep(2000); } break; case DROP: Inventory inv = getInventory(); inv.dropAll("Logs"); break; } return Calculations.random(500, 600); } } Mining Stand in front of a rock and repeatedly mine it, once inventory is full drop all the ores. easyMine.jar import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.container.impl.Inventory; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.script.Category; import org.dreambot.api.wrappers.interactive.GameObject; @ScriptManifest(author = "Hitlab", name = "easyMine", version = 1.0, description = "Simple Mine Rock", category = Category.MINING) public class main extends AbstractScript { private int currID = 0; private int validRock = 0; private GameObject rock; public void onStart() { rock = getGameObjects().closest("Rocks"); validRock = rock.getID(); log("valid rock id = " + validRock); } private enum State { MINE, DROP }; private State getState() { if (getInventory().isFull()) return State.DROP; else return State.MINE; } public void onExit() { } @Override public int onLoop() { switch (getState()) { case MINE: rock = getGameObjects().closest("Rocks"); currID = rock.getID(); log("current rock id is " + currID); if (validRock == currID && rock != null && rock.exists() && getLocalPlayer().getAnimation() == -1 && !getLocalPlayer().isMoving()) { rock.interact("Mine"); sleep(2000); } break; case DROP: Inventory inv = getInventory(); inv.dropAll(); break; } return Calculations.random(500, 600); } } Combat This script kills cows at lumbridge or falador. Works with melee, ranged or magic (auto cast). killMonster.jar package killMonster; import org.dreambot.api.methods.Calculations; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.script.Category; import org.dreambot.api.wrappers.interactive.NPC; @ScriptManifest(author = "Hitlab", name = "killMonster", version = 1.0, description = "Kill cows", category = Category.COMBAT) public class killMonster extends AbstractScript { public void onStart() { } private enum State { KILL }; private State getState() { return State.KILL; } public void onExit() { } @Override public int onLoop() { switch (getState()) { case KILL: NPC monster = getNpcs().closest(npc -> npc != null && npc.getName().contains("Cow")); if (monster != null && monster.canAttack() && !getLocalPlayer().isInCombat()) { monster.interact("Attack"); sleep(Calculations.random(500, 1000)); } break; } return Calculations.random(500, 600); } }
hitlab89 0 Author Posted August 27, 2016 Welcome Welcome and good luck! Hello, and welcome Thanks for the warm welcome Updated for a power mining script.
hitlab89 0 Author Posted August 28, 2016 Welcome to dreambot, if you have any questions feel free to ask. Thanks, will do yo:) Welcome Ty Updated a cow killing script
Recommended Posts
Archived
This topic is now archived and is closed to further replies.