Everything posted by harrypotter
-
Low CPU Mode
This is 100% caused by the way the code is executed. You need to structure it in a way that if it does fail it will simply try again on the next loop. Here is an example of one of my banking methods: if (!script.inventory.contains("Coins")) { if (!Banks.LUMBRIDGE_UPPER.contains(script.myPosition())) { script.getWalking().webWalk(Banks.LUMBRIDGE_UPPER); } else { if (!script.getBank().isOpen()) { if (script.getBank().open()) { Sleep.sleepUntil(() -> script.getBank().isOpen(), Script.random(5000, 10000)); } } else { if (script.getBank().contains("Coins")) { if (script.getBank().withdrawAll("Coins")) { Sleep.sleepUntil(() -> script.inventory.contains("Coins"), Script.random(5000, 10000)); } } else { script.stop(false); } } } }
-
Can't switch boolean from another class
Make hans static (However I'm sure that's a bad idea unless they're final) or in your main class have a method that's responsible for updating the value? I.e: public class Main { public boolean hans = false; public void setHansValue(boolean val) { this.hans = val; } public int onLoop() { Processing p = new Processing(); p.exchangeContext(getBot(); log("Hans is" + hans); p.Loop(); return 500; } } public class Processing { public void Loop() { m.exchangeContext(getBot()); log("Switching hans to true)" Main.setHansValue(true); } }
-
Low CPU Mode
Try something like this: public void openBank() throws InterruptedException { if (!getBank.isOpen()) { if (getBank.open()) { Timing.waitCondition(() -> getBank.isOpen(), 6000); } } else { // Bank is open } } I've never had problems with handling banks in this way.
-
Walking Paths
Would I have to separate a path that has two separate stairs into separate paths? for example would this work: if at first stairs handle stairs walk to second stair area else if at second stairs handle second stairs else walk path
-
Walking Paths
Can somebody show me an example of walking a path - without using web walking - that handles doors or stairs? I can't really find any good examples or tuts on how these are handled for paths containing multiple objects. An example path would be from lummy cow pen to top floor bank in lummy. Thank you all in advanced!
-
sleepUntil
I suggest reading @Explv's Scripting 101 Tut: All this plus a lot more useful info can be found there.
-
Inventory contains all items
I know the API has: inventory.contains(); However this will return true as long as 1 item from the selected exists. I want to confirm that the inventory contains all of the items however. What's the best way to do this rather than a statement for each item? Thanks for your help!
-
S A S $1
there's nothing more annoying than a faggot on a scooter.
-
Quest Completion dialog
Unfortunately not, still stuck trying to right click a set of stairs that are hidden because of the popup
-
Quest Completion dialog
How do I detect and close the quest completed popup dialog? I've tried closing via the "X" widget as well as continuing the dialog via the API but can't seem to find the correct solution. Can anyone please point me in the correct direction?
-
Potter's Tanner [GE Support]
17 hours, excellent!
-
Potter's Tanner [GE Support]
Of course not, but I have to use those as there's no way for me to know what they will actually sell for
-
Potter's Tanner [GE Support]
Using osbuddy prices you will lose money with greendhide: 1 Green dragon hide is: 1,730 gp * 1.1 = 1903 1 Green dragon leather sells for: 1,881 gp * 0.95 = 1787 Tan cost is 20gp per hide. 1787 - 1903 - 20 = -136gp per hide
-
Potter's Tanner [GE Support]
Which hides? this suggests that you are losing money based on those prices.
-
Beginner in RS scripting, Need some help
Not sure if this is the best way but I would do something like: if (invetory.isEmptyExcept(ItemID) && invetory.contains(ItemID)) { }
-
Potter's Tanner [GE Support]
Hotfix pushed - download v1.3
-
Potter's Tanner [GE Support]
I'm unable to reproduce this, do you have skype so we can talk there?
-
Potter's Tanner [GE Support]
Thanks for the report, it sounds like there is an issue getting the prices so it's defaulting to 1gp. I stupidly didn't push my latest code to my repo so I can't access the latest code from the machine I'm currently one! I'll work on a fix once I'm home and let you know! You can manually buy for now and disable GE Mode if you like!
-
Potter's Tanner [GE Support]
Strange, does it do that with all hides? I'll release a fix later tonight once I'm home.
-
Potter's Tanner [GE Support]
Can you send me a screenshot of your setup (gui)
-
Potter's Tanner [GE Support]
What did you have the input buy multiplyer set at?
-
Door Handler
You could be right, flew straight over my head the naming there haha!
-
Door Handler
Sorry my snippet should read: NPC juliet = script.npcs.closest("Juliet"); log(getDoorHandler().canReachOrOpen(juliet.getPosition())); This still returns true for the position, even if behind a door.
-
Door Handler
According to the API I can check if an entity is reachable: https://osbot.org/api/org/osbot/rs07/api/DoorHandler.html#canReachOrOpen-org.osbot.rs07.api.model.Entity- However the following always returns true even if it should return false: NPC juliet = script.npcs.closest("Juliet"); log(getDoorHandler().canReachOrOpen(juliet.getPosition()));
-
Potter's Tanner [GE Support]
It's something I can add, I'm adding it to my planker so I can just copy+paste that logic across!