Jump to content

Athylus

Members
  • Posts

    156
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by Athylus

  1. public class CObject extends MethodProvider { public boolean finished = false; public boolean onLoop() { if (...) this.finished = true; } } public class Main extends Script { private CObject obj = new CObject(); public void onStart() { obj.exchangeContext(getBot()); obj.onStart(); } public void onLoop() { switch (state) { case 1: if (obj.onLoop()) then Main.state = 2; break; case 2: Main.state = 3; break; case 3: log("Code never reaches this point. Why not?"); break; default: break; } } } Why does case 1 not work? It does not seem to read the variable correctly.
  2. Received a p2p ban after 30 mins botting, lol. Only did three quests. Then some by hand. Another acc banned after 5 hours p2p botting private hunter script. Starting to think f2p is the way to go, even member accs get instant banned.
  3. Oops! Something has happened! Session has expired due to inactivity or VIP is needed to run multiple bots at the same time and be purchased at out store at www.osbot.org! Ok, cool. But I am running one instance of OSBot with one bot on it, with a running script. Restarting doesn't help. What can I do?
  4. Kernighan and Ritchie for C (the one explv linked). If you want to learn more about memory management and scheduling algorithms you can read Tanenbaum on minix.
  5. Proper introduction time! I've been around for a while, and I have come back to give back to the community. Scripting for runescape is what got me started on this journey/career path. As a kid I was fascinated with runescape and also cheating at games, at one point I found a website that is probably long gone. It was a java bot back in 2007, with some little robot thing icon which I remember clearly. I downloaded and script and was amazed with runescape 'playing itself', and so my journey started. Now I am here, at OSBot, currently writing my free questing script. Hello!!!
  6. I've had unexpected behaviour in the past when running the same script on multiple tabs in the same client.
  7. Shocker! Good luck with study my man.
  8. Life can be tough, especially when you feel like you have lost meaning. Perhaps you can find it in another way in the navy.
  9. I thought using streams and accessing databases is blocked from within OSBot. Also you can simply have your accounts add your mule and then use your private status to trigger an event (trading in this case).
  10. Possibly because you are calling the Axe class from GoGetAxe class and have not exchangedContext between these two classes. Can't say for sure. Let me know if that works, or if it does not.
  11. Cool. Following. Made a 500M profit myself last year with a fletching farm. It's all doable, if the desire is there.
  12. In my farming script I want to a certain amount of time before relogging after being done with my patches. To do this I run from command line and allow norandoms. When my run is done, I logout and Thread.sleep(x). Then the script resumes. Is this foolproof? Sometimes my script glitches out, and when I run two accounts it might get stuck. Is this because of the Thread.sleep? Then there's the ScriptExecutor. I could allow randoms, logout, pause(), use a Timer object and resume(). What would be the best, fool proof way?
  13. Same behaviour patterns, perhaps. It's all a guess anyway. Also just bot 24 hours a day. Got 45M fletch XP that way.
  14. I see it now, cool! I was mixing up the the array result with the array actions. Thanks.
  15. Cool, thanks! Can you elaborate on this line? Entity nextObj = getObjects().closest(obj -> Arrays.asList(names).contains(obj.getName()) && Arrays.asList(actions).contains(obj.getActions()[0]) && (getMap().canReach(obj) || obj.getName().equals("Crate")) && !obj.equals(previous)); Why .contains(obj.getActions()[0])? Why the [0], that's got me stuck. What is it's purpose here?
  16. It would be. I commend you for creating your own methods for the GE. Are you certain that "Buy" is the right interact string? When hovering I see "Create Buy offer". Alternatively, you can ask for the x, y coordinate of that widget and create a rectangle based on the x, y, width and height. Then you can click on that with the mouse class.
  17. Have you looked at this? https://osbot.org/api/org/osbot/rs07/api/GrandExchange.html#buyItem-int-java.lang.String-int-int-
  18. Do you have the required axe in your bank at all? Aftering checking if the bank is open, nest another if statement (or use a logical operator on the same line) that checks whether the axe is in your bank at all. If (bank.contains(Axetouse) && bank.withdraw(Axetouse, 1)) new ConditionalSleep(3000, 25). Return on that sleep whether your inventory contains the axe.
  19. Doesn't the message listener only work on the class that extends Script tho? So I would have to place that in the main loop, even though my farming patches are handled in separate classes. Kind of like explv's tutorial island script. In the meantime I'll see what if I can work this out. Edit: Just using the message listener in my main class now, it's working like a charm! Now I will just have to pass that info around to my other classes, make some variables and setters... and actually, I need to use configs now as well instead of counting the seeds. And optimize the whole damn thing, my I5 6500 can barely handle two of these scripts! And it's only OSBot that is lagging, not my other open applications. So it must be my script. Thanks for the helps bros! Another thing I want to add is a circular linked list with accounts so that multiple accounts can take turns. You will have to wait after a farming run, so better to let another acc do a run. That would mean a complete overhaul of the script... if anyone is interested in helping me you can shoot a PM.
  20. Cool idea! I was thinking of that. But what if you get to the next farming patch, and the same message from the previous patch is still there? Maybe I can work around it. Definitely worth trying!
  21. Fellow Script Writers, I have a 'working' farming bot, but it does not necessarily function the way I want it to. There's a problem: I cannot seem to check whether a patch has been treated with ultracompost. What I've tried: config bits, but they only tell us the stages of the weed in the patch or whether a crop has been planted. When treating the patch with compost the id of that patch does not change either. When right-clicking inspect on a patch, the game will tell us whether it has been treated with compost or not. So how can we get this data? Reliably. Checking the amount of compost in our inventory is not fool proof and can cause the script to get stuck.
  22. You are welcome! And I would like to mention you are well under your way. Remember that an enum is just a way to store data, just like a string. You could make a string array of 'states' and use that in the same mechanism as well. For widgets I only check if they are null and that works for me.
  23. For readability you might want to change your main loop. Instead of writing a lot of code under your case <enum>:, call methods. And if possible call other methods inside the methods for readability. It's not such a big issue in this script, mainly because it's 'private'. But it's good to get in the habit of doing that if you want to get better at this. When you start writing bigger scripts such as a farming script, it will be really hard to trace back errors and such. Readability is good practice. Perhaps you can put multiple nested if statements together by using logical operators. About the widget, make sure the text is spelled right. One single letter is an error and the widget will not be found. If you want to test this easily learn to use paint and debug there what you want to test. If widget != null then g.drawString("widget can't be found", 10, 15); Put that in a separate project. It will make your life easier. Good luck!
×
×
  • Create New...