Jump to content

Butters

Lifetime Sponsor
  • Posts

    650
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by Butters

  1. It will check on each loop iteration, yes. Though if you're task runs forever on each loop iteration, it might not check for 1 minute, 2 minutes or however long.
  2. I would do it like this (pseudo code): public abstract class Task { abstract boolean validate(); abstract boolean process(); void run() { if (validate) { if (!checkPK) process(); } } boolean checkPK() { if (IM_ATTACKED) GO_RUN_AWAY_OR_SOMETHING; return true; } } Main Script class ArrayList<Task> taskList = new ArrayList<>(); onStart() { taskList.add(new DoSomethingClass()); taskList.add(new DoSomethingElseClass()); } onLoop() { taskList.forEach(t -> t.run()); } } Task classes: class DoSomethingClass extends Task { boolean validate() { if (I_CAN_DO_IT) return true; } void proccess() { JUMP_ROPE: } }
  3. If you're using task based stuff, you probably have an abstract class for your task classes. So you can create a concrete method there which checks if you're attacked. Can add it into you're "check if task can be run" method or anywhere really. Another option is to put it in onLoop. Can do whatever suits you best really.
  4. Try to open with this in terminal "c:\programfilesx86\Java\jre1.8.0_151\bin\java" -jar "OSBot 2.4.146.jar" While being in the directory where OSBot is. Probably Desktop, so do "cd Desktop" first. Use this if you also have java 9 installed (specify the full path to Java 8 when launching) to verify your default java version run this command in terminal java -version
  5. Butters

    Java Books

    Lol this is basically a library. Thanks
  6. Glad to see Alek back. Anyway, I know this is unrelated to the mentioned updated parts, but is anyone else having trouble with onMessage()? Only started in this version. Seems that the method doesn't fire after the bot runs for 20-30 minutes (not on all bots - maybe around 50%). Added some debug messages on each onMessage() call and eventually ain't getting any output from the method.
  7. Title says it all. Any way to write my own key listener and add it to OSBot canvas? Can't seem to find any methods like there is for mouse listener (getBot().addMouseListener())
  8. Yep basically this. I've noticed that inventory methods sometimes don't work properly when inventory is not open. Best to check if inventory is open, if no then open it and then check whatever you need in it
  9. Just curious. but after looking at your code (didn't run it), what happens if you start mining a rock and some other dude mines it first? Does the script continue to mine until it's animation timer ends (doesn't switch to a non mined ore)?
  10. If it really is a username issue, which it seems it is, then will need to change your username. I think only mods can do that
  11. Correct me if I'm wrong, but a dedicated server is usually 2-3 times more expensive than a vps with same specs. Is it 2-3 times better? I think no. Better grab a couple of vps's for the same price and you'll be able to run more.
  12. This was giving me a huge headache onResponseCode() gets called at the end of loop iteration.
  13. Which one of you guys was it
  14. Imps are very pesky to kill. All locations mentioned here: http://oldschoolrunescape.wikia.com/wiki/Imp Any combat script with banking should work, but probably will start attacking an another imp when the currently attacked one "teleports".
×
×
  • Create New...