March 5, 20178 yr So... even if it gets stuck in the while loop, it should log "check4" then immediately log "check5" I am very fucking confused. Easy fix... just moved the "action=isAnimating" to the top of the while statement... Just really not understanding what exactly happened here
March 5, 20178 yr You need brackets { and } around the statements you wish to loop or that while statement will only loop the statement below it.
March 5, 20178 yr Without brackets around your code block after the while loop it will only use the next line ^^ So it makes a lot of sense actually ;) Other things I see in here: - Stop using while loops, Use the onLoop properly instead. (Basicly the onLoop is already a while loop you need) - Stop using interactable or Entity classes, use RS2Object instead to get the Tree. - Why are you saving the animation in a boolean? Could just put the animation check inside the statement. Saves you some memory - if(action == true) can just be if(action) There is still room for a lot of improvements here, try to read some book about java and you'll understand it way way better. Edited March 5, 20178 yr by Khaleesi
March 5, 20178 yr Apart from the cancer that is now in my eyes from the code, the above answer is correct. Java is different than python in this respect. Execute multiline chunks after for/while/if statements with brackets.
March 5, 20178 yr Author Ahhh, I see... back when I learned java (err 10 years ago now?) there wasn't eclipse... Compiling would only tell you the line that an error was on. I thought the new software inserted the { } for you since it tabbed the things for you but I guess not. I tried starting with the boolean statement in the () but it gave me an error so I moved it to the outside, probably just typoed something. Thanks for the suggestions. Wouldn't it be more memory efficient to keep it in a while loop that simply checks for an action rather than re-running through the entire onLoop? I also count each onLoop and use that for antiban properties so racking up that count uncontrollably wasn't really desired. Have it take different paths, bank different, and going to have it examine random objects/right click players/hover stats/go off page and such every few hundred onLoops. And to K9... This is my first program after not touching programming since Highschool. I've managed to get a script capable of running error free with more anti-ban than most the scripts out there in 2 sessions that were a few hours long... Instead of calling it cancer, make helpful suggestions like Khaleesi and Zeni did. Welcome the new member to the community. Just because this is the internet doesn't mean it's necessary to be a dick.
March 5, 20178 yr Please post in the scripting help section in the future if you have questions about scripting. This section is more for general updates on scripts people are making