Jump to content

nills3

Members
  • Posts

    8
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

nills3's Achievements

Newbie

Newbie (1/10)

1

Reputation

  1. Hello. I have a question. Is there any way of adding code after a conditional sleep? What I am trying to do is quite simple; changing a boolean before attacking which would be the easy part, and then changing back the same boolean when the NPC is dead. I can achieve this, but it would result in spamming the change of the boolean. Thanks in advance if anyone can help me out.
  2. Got it all working now, thanks.
  3. Got it working now, thank you for the contribution. This has made me scratch my head for a while now.. RS2Widget wid = getWidgets().get(162, 53, 2); if (wid != null && wid.isVisible()) { if (wid.getMessage() == "Leather") { widget = "Widget is visible and text is leather"; } else { widget = "Widget is visible but text is " + wid.getMessage(); } } else { widget = "Widget is not visible"; } Notice the "Widget is visible BUT text is Leather". wid.getMessage() returns Leather so I don't understand what the issue is. Anybody has any idea? EDIT: Now this issue has appeared. I'm also having trouble interacting with widgets (as you can see above). getKeyboard().typeString("5"); getKeyboard().typeEnter(); //Tried this method aswell a few days ago and it worked fine. Until now getKeyboard().pressKey((char) KeyEvent.VK_ENTER); getKeyboard().releaseKey((char) KeyEvent.VK_ENTER); Why am I having these weird issues? Edit again: Ok so turns out this simple code works out when I use it in a basic script class that I use purely for bugtesting. But within my code it wont work. Alot of random sleeps I know it's just because I couldn't get a hang of it. RS2Widget pSearch = getWidgets().get(162, 53, 2); if (pSearch != null && pSearch.isVisible()) { logs = "pSearch finns"; log("pSearch inte"); getMouse().move(random(220, 306), random(373, 388)); getMouse().click(false); sleep(random(300, 600)); } else { logs = "pSearch finns inte"; log("pSearch finns inte"); sleep(random(500, 800)); getKeyboard().typeString("leat"); sleep(random(500, 700)); getMouse().move(random(351, 403), random(371, 396)); getMouse().click(false); sleep(random(500, 700)); } getMouse().move(random(224, 246), random(203, 220)); //sleep(random(300, 600)); getMouse().click(false); // sleep(random(300, 600)); getKeyboard().typeString("5"); sleepR(); getKeyboard().typeEnter(); getKeyboard().pressKey((char) KeyEvent.VK_ENTER); getKeyboard().releaseKey((char) KeyEvent.VK_ENTER); sleepR(); sleep(random(300, 600)); getMouse().move(random(250, 269), random(280, 295)); sleepR(); getMouse().click(false);
  4. Thank you for trying to help.
  5. Hello. This thing really bugs me. Recently switched from poopbot (lmao it automatically changed to poopbot that's hilarious. heard some rumours about the source code being stolen) to osbot so I'm still tryna learn the ropes. My script crashes, doing the simplest thing in the tutorials here. And I can't check the logger because it gets stuck, but I am still logged in-game. If you're wondering what the code is; final Bank bank = new Bank(); if (bank != null) { log("Bank isnt null"); bank.open(); } else { log ("Bank is null"); } Tried doing it both this way, and this way; NPC banker = npcs.closest("Banker"); if (banker != null) { banker.interact(("Bank")); sleepR(); bank.depositAll(); sleepR(); Not sure why this doesn't work. But my main issue is the logger. I need to see what causes the crashes so.. Any ideas? Does it get logged anywhere else where I can check?
  6. Thank you, then I don't need to worry about that.
  7. Hello. Just switched from poopbot, heard OSBot would be much better. Anyways, let's say my script is using the Grand Exchange, maybe a bank, or anything clickable in the game. getGrandExchange().sellItem(itemId, price, quantity); getBank().open(); Would getting the correct widgets/object and clicking on random points within the interfaces be better than using the actual API? An example, instead of using 'getBank', is it better to find the bank and clicking on a random pixel be better? This is just for reducing bans. Thanks in advance.
×
×
  • Create New...