Guest User

Untitled

a guest
Dec 12th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. package NoWinners;
  2.  
  3. import java.awt.Graphics;
  4. import java.awt.Graphics2D;
  5.  
  6. import org.rsbuddy.tabs.Inventory;
  7.  
  8. import com.rsbuddy.event.listeners.PaintListener;
  9. import com.rsbuddy.script.ActiveScript;
  10. import com.rsbuddy.script.methods.Game;
  11. import com.rsbuddy.script.util.Random;
  12.  
  13. public class random extends ActiveScript implements PaintListener{
  14. public int tokenID;
  15. public int tokensStart;
  16. public int tokensGained;
  17. public int currentTokens;
  18. public int tokensHr;
  19. public int runTime;
  20. @Override
  21. public int loop() {
  22.  
  23. return Random.nextInt(10, 20);
  24. }
  25. @Override
  26. public boolean onStart() {
  27. if (Game.isLoggedIn()) {
  28. tokensStart = Inventory.getCount(tokenID);
  29. return true;
  30. } else {
  31. log("Please start the script logged in!");
  32. return false;
  33. }
  34.  
  35. }
  36. @Override
  37. public void onRepaint(Graphics g1) {
  38. Graphics2D g = (Graphics2D)g1;
  39. currentTokens = Inventory.getCount(tokenID);
  40. tokensGained = currentTokens - tokensStart;
  41. tokensHr = tokensGained/runTime*60;
  42. }
  43. }
Add Comment
Please, Sign In to add comment