Jump to content

Impensus

Scripter I
  • Posts

    1070
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by Impensus

  1. I will have a look into this one tonight. Sounds simple and useful so perfect for a free script
  2. Hey guys, I've been a member here for a while now and constantly dipping in and out of botting due to various reasons. I'm back now and I want to earn my scripter rank and provide some decent free scripts for the members of osbot to use. Does anyone have some suggestions of free scripts that osbot may be lacking and that I could work on? Cheers!
  3. 1. Sometimes if I wait the script stops. Other times I have to force kill it. I’m guessing that after I’ve ran and stopped it too many times the client eventually becomes unresponsive and needs to be killed. 2. I can see the logs, there are no visible NPEs 3. It’s likely that it is one or more sections of the script. However I don’t think it’s code that is currently running (if that’s possible) as like I mentioned in the body the code in this loop worked fine before I added new classes. I’m guessing some errors occur during class/variable instantiation that cause these errors but don’t give visible NPEs etc.
  4. Hi guys, I recently made a big expansion to a script of mine. I went from the classes Farming, Banking & Teleports to a script that contains about 13 classes total. The reason I mention this, is that since then my script eats about 500mb RAM (fair bit more than it did originally) and is sometimes unresponsive/takes a while to stop. I've noticed this behaviour even when the script is looping in the "Farming" methods, despite this behaviour not existing before the additional classes were added. No changes have been made to the original classes so I am unsure why they now are a lot slower. I'm wondering if you guys have any generic tips/anecdotal advice on problems you have encountered causing similar behaviour. Thanks!!
  5. Hi guys, I'm trying to use a script with multiple classes. For the context of this we have: Main, Farming, Banking. In Main I have the following: public class Main extends Script { private Farming farming = new Farming(); private Banking banking = new Banking(); public void onStart() { farming.exchangeContext(getBot()); banking.exchangeContext(getBot()); } public int onLoop() { //do stuff } } In Farming I have: public class Farming extends MethodProvider{ private Banking banking = new Banking(); public void myMethod(){ if(xyz == true){ banking.BankingMethod(); } } } And finally Banking: public class Banking extends MethodProvider { public void bankingFunction(){ //Do banking stuff } } Now my issue is, whenever I call the functions from Banking by instantiating the Banking class inside Farming, I always get a NullPointerException and the programme crashes instantly. This happens regardless of the classes I use. How do I properly instantiate and use classes from within another class, where said class isn't main? I tried doing this by just calling Banking.bankingFunction() and got the error in the title. Many thanks, - Impensus
  6. Noticed the script will take out ring of duelling(8)s for every trip. I've got tonnes of 7s just sat in the bank after it deposits them when banking.
  7. Any chance I can get a trial?
  8. I’m willing to test. Could I get an auth?
  9. @Patrick any chance you could have a look at getGrandExchange.buyitem() ? It is known to attempt to navigate the menus far too quickly and therefore cause issues. I have recently had to write my own method to handle this. Additionally, getWorlds.hop() sometimes fails to hop to a specified world. It seems the cause is when it attempts to scroll to the world but it isn't in visibility in the menu.
  10. I changed my code to look like this: https://gyazo.com/1a3d0091e8cb007ff954291595ec0ea7 The code now runs asynchronously but crashes due to a NPE which I am unsure of why. https://gyazo.com/2b411b90ec904c9b08f3bc127815de86 Any idea?
  11. No It didn't unfortunately. Token was helping me in Discord and it seemed I had a fair few errors with this. Can you potentially add my discord (Impensus#2428) to give me some assistance?
  12. When I change the code to this I require a return statement. What is this? I know its of type event but I dont see why I should have to return a Value as I just want the thread to run and listen for the terms and then activate the Escape function.
  13. That is what I am aiming to do. However with the Async listener it will block onLoop from running and just sit listening for all the terms in the listen event which work correctly. I will try the other suggestion and see if that works!
  14. Hi guys, I am looking for a bit of help with getting the syntax of my Async events correct. I have implemented them as follows. In main exist this Event: public Event Listen(){ while (true) { try { log("Listening for escape terms"); if(rimmyPortal.contains(myPlayer()) && !LUMBRIDGE_BANK.contains(myPlayer()) && !getMap().isInHouse()){ log("Escaping as outside portal."); doEscape(); } Thread.sleep(250); } catch (InterruptedException e) { e.printStackTrace(); } } } And this is initated as so within onStart. @Override public void onStart() { log("Starting XXX XXXXX"); execute(Listen()).setAsync(); } This works correctly as I imagined. However, this Listen event just runs constantly and doesn't let any of the onLoop run. Is there any reason for so? I assume that my implementation is incorrect somewhere (I mostly dev Python not Java). Thank you for the help as always!!!
  15. The client should automatically update when you run it and place the old .jar in a folder in the same directory it is contained within named 'old osbot jars' or something along those lines.
  16. Hmm strange. I couldn't get that to work. I even tried getWorlds.hoptoP2p() (cant remember full function name) and that would not work either. Only specifying the world without its 3 or 4 prefix would be accepted as an argument (that worked). @Patrick Are we able to have any clarification of this is expected behaviour or just a unique instance?
  17. Thanks for the help guys! Issue was that for hopping worlds it uses 1,2 etc. But getCurrentWorld returns the actual value so you have to compare with 302 etc... This is why it reached my log calls but timed out
  18. Hey guys, I am wondering if I may be missing something with the world hop function. My code looks like this: if(getWorlds().getCurrentWorld() == n) { log("In " +n); worlds.hop(302); log("Hopping to P2P world"); new ConditionalSleep(10000, 250) { @Override public boolean condition() throws InterruptedException { return getWorlds().getCurrentWorld() == 302; } }.sleep(); } The world hop function is reached and the world switch menu is opened. It however just idles but doesn't crash. The log line is reached and once the ConditionalSleep times out, the loop restarts (not shown). Is there something I am missing or are there know issues with world hop?
  19. What script did you super glass make with? And did you do it at GE?
  20. Okay thank you for your help Czar! I will make these changes now, the link would be useful too!
  21. Hi guys, I am occasionally having strange interactions with getting ground items and camera rotations which I have not been able to pinpoint the reasoning for. What is happening is that when I go to pick up a stack of items below me occasionally the camera will rotate constantly while trying to pick up and move to a weird spot. The script will then idle for 5/10 seconds and then try banking (will sometimes get the bank option or missclick on the teller). After this idle it will bank the items and find them on the floor afterwards but the wasted time is what is the issue. The snippet of code is as follows: if (getGroundItems().groundItems.closest("Item name here") != null){ log("Found some items went to the floor"); int x = myPlayer().getX(); int y = myPlayer().getY(); for (GroundItem g : getGroundItems().filter(getGroundItems().get(x, y), new NameFilter<>("Item name here"))){ log("Picking up floor item"); if (g != null && g.exists()){ Long invitemnameamount = getInventory().getAmount("Item name here"); g.interact("Take"); new ConditionalSleep(10000) { @Override public boolean condition() throws InterruptedException { return getInventory().getAmount("Item name here") == invitemnameamount+1; } }.sleep(); } } } Replaced variables & strings so they do not show item names. You get the idea. Thank you for any help!
  22. I would 100% recommend getting started. You really appreciate it seasons 3-6 but the first few seasons are slow as they set the scene (which is very important). I think season 7-8 have sloppier writing due to the books not being released but are still good. I would deffo recommend watching especially if you aren't going to get deep into the lore/books like I do and then get slightly disappointed as the TV show moves away from the books.
  23. https://gyazo.com/9cd6d7fc404827de8a8ec2a5b1810556 this shits annoying fam
×
×
  • Create New...