Everything posted by Token
-
how do i get mirror mode to work on a mac?
Mirror mode doesn't officially support OSBuddy, you will have to load runescape in a browser instead
-
[CSE Help] Improve this algorithm?
public static int rec1(int n) { c1++; if (n == 1) { return 1; } else if (n % 2 != 0) { return 1 + rec1(n - 1); } else { return 1 + rec1(n / 2); } } static int c2 = 0; public static int rec2(int n) { c2++; if (n == 1) { return 1; } else if (n % 2 != 0) { return 1 + rec2(n - 1); } else { int sum = 0; do { n = n / 2; sum++; } while (n % 2 == 0); if (n == 1) return 1 + sum; return 1 + sum + rec2(n - 1); } } public static void main(String[] args) { System.out.println(rec1(3128) + "; iterations: " + c1); System.out.println(rec2(3128) + "; iterations: " + c2); } Output: 16; iterations: 16 16; iterations: 5 If you studied CPU architecture you should know every function call creates a new stackframe and new local variables with each call, taking up a lot of memory. SP = stack pointer register BP = base pointer register They are in your CPU, BP points to the base of the stack and SP points to the top stackframe aka the function call being executed by the CPU at a given moment. Recursion is very inefficient memory-wise so the second function, which is still recursive but has an iterative component for powers of 2, is obviously superior.
-
Herb Cleaning
No matter what you use, you will still check what you actually have in your inventory The API fortunately doesn't provide a Herblore#cleanAllGrimyHerbsInInventoryThenBank()
-
Herb Cleaning
Try mouse.click(), it should be faster than interact() because it has no sleeps
-
Eat a dick ivy league
All successful people dropped out of ivy league, people who actually graduate are no better than others
-
CLI help
Nope HTTPS proxies only work in browsers
-
CLI help
Remove the proxy and script flags, if either makes the command work then you know which flag is wrong
-
CLI help
Is it a local script or SDN? Is your proxy functional?
-
CLI help
Replace the sensitive information with fake information instead of blocking it, there is definitely a syntax error in there that we cannot see
-
Mald please.
That's not a mention so he didn't get notified
- Mald please.
-
Mald please.
@@House @Maldesto is COMMUNITY ADMINISTRATOR, not SDN ADMINISTRATOR SDN and git requests are reviewed by the development team
-
Went 2 the gym today..
I have that heart beat rate while sleeping
-
@weebs
If I were ruling the internet I would send all weebs to Auschwitz
-
Gaming Glasses // Blue light filter
The blue light filter is on the glasses in that pic
-
Gaming Glasses // Blue light filter
No, just took a break from the weebs Well, I use many programs since I'm a programmer, but mostly Eclipse, Linux terminal, PhpStorm, Visual Studio or Google Chrome
-
Gaming Glasses // Blue light filter
Nein
-
Gaming Glasses // Blue light filter
I use them for programming but I got blue light filter (not orange like in that vid), my doctor recommended me to use them because she knows I work a lot on my PC (at least 10 hours a day) I got them for ~$100
-
Random handler
Handle them in your script code if you really want to
-
There goes my gpa for this year
I always had good grades because I didn't care about grades at all. It's like women - you have to treat them bad to get them
-
I think i found some people here on OSbot
Rabbits 'n booze
-
Case switching question.
Just post your whole source code, I doubt there is anything wrong with the code above
-
Case switching question.
Then canReach may not be good enough either, just insert a max distance of 8 or so to your tree as condition
-
Case switching question.
Yes it is a problem in the CHOP case as I stated. Invoking interact() on an Entity will create a default InteractionEvent instance which will walk to that Entity if it's too far. InteractionEvent will create a WalkingEvent instance and set it as its child. This WalkingEvent instance will create a LocalPathFinder instance that will generate a path to the closest position from which the target of the InteractionEvent can be accessed. The problem in here is that LocalPathFinder will only generate paths to tiles that are on map, which results in this weird behavior depending on how the current region loaded. Those entities that are not on minimap cannot be walked to, but they are not null so your bot will be stuck there trying to find a path to it. case CHOP: Entity treeToChop = objects.closest(tree); GroundItem birdNest = groundItems.closest("Bird nest"); treeToChop.interact("Chop down"); StatusUpdate = "Chopping " + tree + " logs"; new ConditionalSleep(10000) { public boolean condition() throws InterruptedException { return !treeToChop.exists(); } }.sleep(); if (birdNest != null && pickupBirdsNests == true) { birdNest.interact("Take"); } break; Adjusted some code in there. You already null check the tree in your getState() so the if is redundant. There are many ways to check to check if you can walk to that specific Entity, easiest would be private State getState() { Entity treeToChop = objects.closest(tree); if (inventory.isFull() && powerChop == false) return State.BANK; if(inventory.isFull() && powerChop == true) return State.POWERCHOP; if (treeToChop != null && map.canReach(treeToChop)) return State.CHOP; else return State.WALK; } You can also go with LocalPathFinder lpf = new LocalPathFinder(bot); lpf.findPath(tree); And use lpf.foundPath() As condition to verify if you can walk to your tree. tree.getPosition().isOnMiniMap(bot) Is good but not perfect, it leaves out the 1 in a million case where trees are arranged in such way that the tree is on minimap, but there is no tile on minimap from which you can access it
-
Case switching question.
You missed the case where you are outside the bank but there are no nearby trees, using areas or any other predefined sets of data is generally not a good idea. Remove the areas in your logic and it should look like this private State getState() { Entity treeToChop = objects.closest(tree); if (inventory.isFull() && powerChop == false) return State.BANK; if(inventory.isFull() && powerChop == true) return State.POWERCHOP; if (treeToChop != null) return State.CHOP; else return State.WALK; } And a state that doesn't do anything at all is just bad practice, simply returning from the current loop iteration without performing any actions will yield the same result. PS: you also have the case where you are at the desired location to chop trees but all tree instances are depleted, but since you know the destination you can add this condition to your states Edit: You should post the case CHOP as the error is definitely there