-
User input click handling
It's not overkill, it's managing your code better. You could also replace your image's x/y rendering with a call to that rectangles x/y coords, and use that in the future if you ever need to re-position your image/button.
-
User input click handling
You would use a rectangle for that. Something along the lines of: public static final Rectangle BUTTON_AREA = new Rectangle(413,388,58,70); // (x,y,width,height) @Override public void mouseClicked(MouseEvent event) { int x = event.getX(); int y = event.getY(); if (BUTTON_AREA.contains(x,y)) { powerfishing = !powerfishing; displayImage = powerfishing ? powerImg : normalImg; } } @Override public void mouseMoved(MouseEvent event) { int x = event.getX(); int y = event.getY(); tooltip = BUTTON_AREA.contains(x,y); }
-
Stuck in dialogue
No, you're is checking if "please wait" has already been clicked, and if so try to click continue... You're using the wrong method.
-
Amount input
But he did. Going by the code he posted he's using that in some sorta loop, and breaks out of it if it's null...
-
Widget help - wrong option being clicked
True, but it is a close second.
-
Widget help - wrong option being clicked
Well, you want to talk programming guidelines... https://en.wikipedia.org/wiki/Race_condition Under the software heading: By just slapping a program (or in the case a script) together like that, you're creating more difficult less maintainable programs. I once thought the same as you there actually, but look how parabot turned out....
-
Widget help - wrong option being clicked
No, you should never do that. You end up with a fucking mess of code you'd never be able to clean up. ex: if (state.getTextual() == "Interacting with Fountain") { return random(1300, 1900); }
-
Widget help - wrong option being clicked
The fact that the script engine runs in a separate thread, and if you're constantly querying the client (in another thread mind you)for information in that manor, there will eventually be a race condition. So there is, if you actually understood how java works. Edit:and having the same method call everywhere is only not wasteful resource wise, it makes you look retarded.
-
Widget help - wrong option being clicked
Are you the guy that was told about race conditions like a few days ago? plus calling widgets.get(219, 0, 1) every time is uh, wasteful.
-
Need Some Help and Improvements
Token only explained half of the increment stuff, you can also do "++cc". The only real difference is that "cc++" returns the old value of cc, whereas "++cc" returns the incremented value. And example: int i = 5; System.out.println(++i); // increment i, then print value (6) // the variable i now equals 6 System.out.println(i++); // prints out value (6), then increments //the variable i now equals 7