Jump to content

matt123337

Members
  • Posts

    11
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

matt123337's Achievements

Newbie

Newbie (1/10)

1

Reputation

  1. 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.
  2. 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); }
  3. 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.
  4. 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...
  5. 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....
  6. 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); }
  7. 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.
  8. 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.
  9. 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
×
×
  • Create New...