fractal 7 Share Posted October 24, 2019 Hi eveyone, thought I would share my cow killer script. It takes breaks between actions, with times from a gamma distribution whose shape is defined by the action type. It collects hides and banks when inventory is full. It also opens that pesky gate if trying to attack a cow outside the pen. It doesn't cook meat or eat or care about health, so kill a few chickens or goblins first before botting on a new account (the script can be edited to include a different area/different target NPC/different loot). Remember to bot responsibly, and let me know if you have any problems or suggestions! import org.dreambot.api.methods.Calculations; 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; import org.dreambot.api.wrappers.interactive.GameObject; import org.dreambot.api.wrappers.interactive.NPC; import org.dreambot.api.wrappers.items.GroundItem; @ScriptManifest(author = "fractal", name = "FractalCowKiller", category = Category.COMBAT, version = 1.0, description = "Kills cows, loots their hides, and banks") public class CowKiller extends AbstractScript { public enum actionTypes { walking, interactive, spam, afk } int walkingShape; int runningShape; int interactiveShape; int spamShape; int scale; int reaction; // minimum wait between actions int patience; // minimum wait between running to a new spot while still running. patience is doubled while walking int latency = 250; // how long does it take the game to register your actions? change this depending on CPU/RAM/lag Area cowPen = new Area(new Tile(3265, 3296), new Tile(3253, 3255)); int cowHide = 1739; int gate = 1558; @Override public int onLoop() { farmHides(); return 0; } public void onStart(){ reaction = Calculations.random(200,400); patience = Calculations.random(1500, 3000); walkingShape = Calculations.random(2,5); runningShape = Calculations.random(2,4); interactiveShape = Calculations.random(2,4); spamShape = 1; scale = Calculations.random(400,1000); // proxy for variables in your physical environment affecting your attention } public int farmHides() { String[] targets = {"Cow", "Cow calf"}; Integer[] loot = {cowHide}; if (getInventory().isFull()) { bankItems(loot, false); } else { combatLoot(targets, loot, cowPen); } return 1; } public void combatLoot(String[] targets, Integer[] loot, Area area) { if (!area.contains(getLocalPlayer())) { go(area); } else if (!getLocalPlayer().isInCombat()){ NPC target = getNpcs().closest(t -> t!= null && !t.isInCombat() && elem(t.getName(), targets)); GroundItem prize = getGroundItems().closest(loot); if (prize != null && target != null && prize.distance(getLocalPlayer()) < target.distance(getLocalPlayer())) { prize.interact("Take"); sleep(latency); sleepUntil(()-> !getLocalPlayer().isMoving(), 60000); antiban(actionTypes.interactive); } else if (target != null && !getLocalPlayer().isInCombat()) { GameObject g = getGameObjects().closest(o -> o.getID() == gate); if (!area.contains(target) && g.hasAction("Open")) { g.interact("Open"); } else if (target.interact("Attack")) { sleepUntil(() -> getLocalPlayer().isInCombat(), 60000); sleepUntil(() -> !getLocalPlayer().isInCombat(), 60000); } antiban(actionTypes.interactive); } } else { sleepUntil(() -> !getLocalPlayer().isInCombat(), 60000); } } public void bankItems(Integer[] itemIDs, boolean all) { if (!getBank().isOpen()) { getBank().open(getBank().getClosestBankLocation()); antiban(actionTypes.interactive); } else { if (all) { getBank().depositAllItems(); antiban(actionTypes.interactive); getBank().close(); antiban(actionTypes.interactive); } else { getBank().depositAll(item -> elem(item.getID(), itemIDs)); antiban(actionTypes.interactive); getBank().close(); antiban(actionTypes.interactive); } } } public boolean elem (Object elem, Object[] list){ for (int i = 0; i < list.length; i++){ if (list[i].equals(elem)){ return true; } } return false; } public void go(Area area) { if (!area.contains(getLocalPlayer())) { getWalking().walk(area.getRandomTile()); antiban(actionTypes.walking); } } public void antiban(actionTypes action) { if (action == actionTypes.walking) { if(getWalking().isRunEnabled()) { int time = (int) (Calculations.nextGammaRandom(runningShape, scale)) + patience; sleep(latency); sleepUntil(() -> !getLocalPlayer().isMoving(), time); } else { int time = (int) (Calculations.nextGammaRandom(walkingShape, scale)) + patience * 2; sleep(latency); sleepUntil(() -> !getLocalPlayer().isMoving(), time); } } else if (action == actionTypes.interactive) { int time = (int) (Calculations.nextGammaRandom(interactiveShape, scale)) + reaction; sleep(time); } else if (action == actionTypes.spam){ int time = (int) (Calculations.nextGammaRandom(spamShape, scale)) + reaction; sleep(time); } } } Link to comment Share on other sites More sharing options...
Invidious 1 Share Posted January 22, 2020 On 10/24/2019 at 5:21 AM, fractal said: Hi eveyone, thought I would share my cow killer script. It takes breaks between actions, with times from a gamma distribution whose shape is defined by the action type. It collects hides and banks when inventory is full. It also opens that pesky gate if trying to attack a cow outside the pen. It doesn't cook meat or eat or care about health, so kill a few chickens or goblins first before boting on a new account (the script can be edited to include a different area/different target NPC/different loot). Remember to bot responsibly, and let me know if you have any problems or suggestions! Thank you for posting this. Sorry you didn't get an immediate response from other members but i'm sure the community appreciates it. Link to comment Share on other sites More sharing options...
Luukerd99 1 Share Posted February 23, 2020 Thanks!! Link to comment Share on other sites More sharing options...
Foxtrees 0 Share Posted February 26, 2020 How do I download script Link to comment Share on other sites More sharing options...
nena1 0 Share Posted April 3, 2020 hi! i was wondering.. can u compile that .txt in .jar 4 me pls? 😢 Link to comment Share on other sites More sharing options...
Crazeysniper 1 Share Posted July 8, 2020 I think his set latency at 250 is what jagex looks for in a bot to ban....kind of a giveaway, how can you get rid of it and have the game still not smoothly? Link to comment Share on other sites More sharing options...
Crazeysniper 1 Share Posted July 8, 2020 Run smoothly* Link to comment Share on other sites More sharing options...
pica32019 0 Share Posted August 3, 2020 I used this code and got banned shortly after. Specially since a lot of people are using this code, and cows are bot hotspot area. Tis life. But thanks for providing this. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.