beardedwhispers Posted December 23, 2019 Share Posted December 23, 2019 (edited) Hey everyone, I've been botting with OSBot for a while, decided to try my hand at making my own bot. Specifically a few bots all connected, a wood cutter and a fletching/alcher. I haven't added in the trading or wood cutting section yet, just wanted to work on the actual fletching/alchings steps first. It's supposed to sit at the GE and pull out the items from the bank, combine them, then alch the results, the issue i'm seeing is that occasionally it'll click on the banker by accident and they script will close from there. Also, after using it for less than a week while i was sitting here testing it, my account got banned. I've spoken to a few people and was advised that it doesn't seem to be moving the moues at all, rather just teleport clicking on the options, however i was under the impression that the item().interact() functions moved the mouse automatically to the item in question. Anyone have any thoughts on this? i've included the snippet of the fletching alcher below, any suggestions would be appreciated. EDIT: Mainly look for help with making the mouse more closely emulate human movement and also click on the items properly, rather than what it's currently doing. import java.awt.Graphics2D; import org.osbot.rs07.api.ui.RS2Widget; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.api.ui.Spells; import org.osbot.rs07.api.ui.Tab; import org.osbot.rs07.input.mouse.MouseDestination; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; import org.osbot.rs07.api.Mouse; @ScriptManifest(author = "ME", info = "Bracelets", name = "AlchBot-1.1", version = 1, logo = "") public class main extends Script { @Override public void onStart() { log("Let's get started!"); } @Override public int onLoop() throws InterruptedException { MouesDestination == getMouse().move((MouseDestination) getObjects().closest("Grand Exchange booth"); getBank().open(); new ConditionalSleep(5000) { public boolean condition() {return getBank().isOpen();}}.sleep(); getBank().depositAllExcept("Nature rune"); if (getBank().contains("Yew longbow") || getBank().contains("Yew longbow (u)")) { getBank().depositAllExcept("Nature rune"); if (getBank().contains("Yew longbow")) { getBank().withdrawAll("Yew longbow"); getBank().close(); new ConditionalSleep(5000) { public boolean condition() { return getBank().isOpen();} }.sleep(); new ConditionalSleep(3000) { public boolean condition() {return !getBank().isOpen();}}.sleep(); } else if (getBank().contains("Bow string") && getBank().contains("Yew longbow (u)")) { getBank().withdraw("Bow string", 1); getBank().withdrawAll("Yew longbow (u)"); getBank().close(); new ConditionalSleep(3000) { public boolean condition() { return !getBank().isOpen();} }.sleep();; } } else { getBot().getScriptExecutor().stop(false);} // } // add string while (getInventory().contains("Nature rune") && getInventory().contains("Yew longbow (u)")) { int bracelets = (int) getInventory().getAmount("Yew longbow (u)"); if (getInventory().contains("Bow string")) { inventory.interact("Use", "Bow string"); new ConditionalSleep(1000) { public boolean condition() { return getInventory().isItemSelected(); } }.sleep(); inventory.interact("Use", "Yew longbow (u)"); new ConditionalSleep(1000) { @Override public boolean condition() throws InterruptedException { long braceletsNew = getInventory().getAmount("Yew longbow (u)"); if (bracelets != braceletsNew) { return true; } return false; } }.sleep(); } else if (!getInventory().contains("Bow string")) { getBank().open(); new ConditionalSleep(5000) { public boolean condition() { return getBank().isOpen();} }.sleep(); if (!getInventory().isFull()) { if (getBank().contains("Bow string")) { getBank().withdraw("Bow string", 1); getBank().close(); new ConditionalSleep(5000) { public boolean condition() { return !getBank().isOpen();} }.sleep(); } else { getBot().getScriptExecutor().stop(false); ; } } else { getBank().depositAll(); if (getBank().contains("Bow string")) { getBank().withdrawAll("Nature rune"); getBank().withdraw("Bow string", 1); getBank().withdrawAll("Yew longbow (u)"); getBank().close(); new ConditionalSleep(3000) { public boolean condition() { return !getBank().isOpen();} }.sleep(); } else { getBot().getScriptExecutor().stop(false); } } } } // alch RS2Widget alchWarn = getWidgets().getWidgetContainingText("Click here to continue"); getTabs().open(Tab.MAGIC); while (getInventory().contains("Nature rune") && getInventory().contains("Yew longbow")) { skills.getExperience(Skill.MAGIC); if (getTabs().getOpen().equals(Tab.MAGIC)) { magic.castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY); sleep(random(250,750)); } inventory.interact("Cast", "Yew longbow"); new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { long magicNew = skills.getExperience(Skill.MAGIC); long magicOld = 0; if ((magicNew != magicOld) || (alchWarn != null && alchWarn.isVisible()) && getTabs().getOpen().equals(Tab.MAGIC)) { return true; } return false; } }.sleep(); new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { if (getTabs().getOpen().equals(Tab.MAGIC)) { return true; } return false; } }.sleep(); if (alchWarn != null && alchWarn.isVisible()) { break; } if(getInventory().contains("Yew longbow") && getInventory().contains("Nature rune")) { sleep(random(250,750)); magic.castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY); } else { break; } } return 0; } // EoL @Override public void onExit() { } @Override public void onPaint(Graphics2D g) { } } Edited December 23, 2019 by beardedwhispers clarification Quote Link to comment Share on other sites More sharing options...
Naked Posted December 23, 2019 Share Posted December 23, 2019 It does move the mouse. I'd look at trying to prevent making a pattern. 1 Quote Link to comment Share on other sites More sharing options...
Gunman Posted December 23, 2019 Share Posted December 23, 2019 Please next time just put it in a paste bin like this https://pastebin.com/cwqfW560 so it's easier to read. Or use the code function built into OSBot's page Also you can see if the mouse is teleporting or not if you go to Settings, Options, Debug, Then check mouse trail. It will put a red X where the mouse is. The interaction method should be moving the mouse and not teleporting it like a touch pad. I didn't look through it much, like at all honestly.... But I would suggest making the script use one action per loop of the onloop. Like how Explv does in his tutorial here at 15. My guess of why it breaks is because of lag or something and it just collapses the whole script into like a NPE and stops it or something. Doing this would probably fix it or help at least. Quote Link to comment Share on other sites More sharing options...
beardedwhispers Posted December 23, 2019 Author Share Posted December 23, 2019 10 minutes ago, Naked said: It does move the mouse. I'd look at trying to prevent making a pattern. Do you mean prevent the mouse from making a pattern? or randomize the order of steps it takes while doing the alching process? like withdraw 26 unstrung bows, then 1 bowstring, then the next rotation doing 1 bowstring then all unstrung bows? i'm not sure what you mean or even how to go about preventing a pattern.. Quote Link to comment Share on other sites More sharing options...
Naked Posted December 23, 2019 Share Posted December 23, 2019 Just now, beardedwhispers said: Do you mean prevent the mouse from making a pattern? or randomize the order of steps it takes while doing the alching process? like withdraw 26 unstrung bows, then 1 bowstring, then the next rotation doing 1 bowstring then all unstrung bows? i'm not sure what you mean or even how to go about preventing a pattern.. Kind of. Interact with a bowstring and a bow in a random slot. Make your own banking that utilizes "Withdraw x". Sometimes click "withdraw all" when it won't break shit. Open some random tabs. Quote Link to comment Share on other sites More sharing options...
beardedwhispers Posted December 23, 2019 Author Share Posted December 23, 2019 What i don't understand is how would this script get me banned, yet i know of other people who use an AutoHotKey script to do essentially this same thing for hours a day, for weeks at a time, and they have yet to get banned. Their AHK script move the mouse in straight lines and runs the exact same pattern each and every time. How is this any different? Just confusing to me is all. Quote Link to comment Share on other sites More sharing options...
Prolax Posted December 29, 2019 Share Posted December 29, 2019 On 12/23/2019 at 10:32 PM, beardedwhispers said: What i don't understand is how would this script get me banned, yet i know of other people who use an AutoHotKey script to do essentially this same thing for hours a day, for weeks at a time, and they have yet to get banned. Their AHK script move the mouse in straight lines and runs the exact same pattern each and every time. How is this any different? Just confusing to me is all. Combination of your script and the OSBot client. Quote Link to comment Share on other sites More sharing options...