Guest User

Untitled

a guest
Jul 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.46 KB | None | 0 0
  1. import java.awt.Color;
  2. import java.awt.Font;
  3. import java.awt.Graphics;
  4. import java.util.Map;
  5.  
  6. import org.rsbot.bot.Bot;
  7. import org.rsbot.bot.input.Mouse;
  8. import org.rsbot.event.listeners.PaintListener;
  9. import org.rsbot.script.Script;
  10. import org.rsbot.script.ScriptManifest;
  11. import org.rsbot.script.wrappers.RSTile;
  12. import org.rsbot.script.wrappers.RSTilePath;
  13.  
  14. @ScriptManifest(authors = {"toAlec"}, category = "Development", name = "toKebab", version = 1.00)
  15. public class toKebab extends Script implements PaintListener {
  16. ScriptManifest properties = getClass().getAnnotation(ScriptManifest.class);
  17. RSTile[] walkKarim = {new RSTile(3271, 3166), new RSTile(3276, 3170), new RSTile(3273, 3181),};
  18. public long startTime;
  19. public boolean onStart(Map<String, String> args){
  20. startTime = System.currentTimeMillis();
  21. log("Thank you for using my script!");
  22.  
  23. return true;
  24. }
  25.  
  26. public void onFinish(){
  27.  
  28. log("Thank you for using my script!");
  29. }
  30.  
  31. @Override
  32. public int loop() {
  33.  
  34. return random(300,900);
  35. }
  36.  
  37. public boolean walktoKebab(){
  38. final RSTile[] randomizedPath = randomizePath(walkKarim, 2, 2);
  39. final RSTilePath path = new RSTilePath(randomizedPath, this);
  40. try{
  41. return path.walkToEnd();
  42. }catch(final InterruptedException e){
  43.  
  44. e.printStackTrace();
  45. }
  46. return false;
  47. }
  48.  
  49. @Override
  50. public void onRepaint(Graphics g) {
  51. if (isLoggedIn()){
  52. boolean infolock = false;
  53. boolean statslock = false;
  54.  
  55. long millis = System.currentTimeMillis() - startTime;
  56. long seconds = millis / 1000;
  57. millis -= seconds * 1000;
  58. long minutes = seconds / 60;
  59. seconds -= minutes * 60;
  60. long hours = minutes / 60;
  61. minutes = hours * 60;
  62.  
  63. g.setColor(new Color(26, 24, 26, 170));
  64. g.fillRoundRect(320, 347, 170, 110, 10, 10);
  65.  
  66. g.setColor(new Color(26, 24, 26, 190));
  67. g.fillRoundRect(320, 432, 170, 25, 10, 10);
  68. g.setColor(new Color(26, 24, 26));
  69. g.fillRect(403, 432, 4, 25);
  70. g.setColor(Color.white);
  71. g.setFont(new Font("Tahoma", Font.BOLD, 12));
  72. g.drawString("Info", 349,446);
  73. g.drawString("Stats", 434, 446);
  74.  
  75. if(inInfo(infolock)){
  76. g.setColor(new Color(228, 36, 144));
  77. g.setFont(new Font("Tahoma", Font.BOLD, 14));
  78. g.drawString(properties.name(), 334, 362);
  79. g.drawString("_________", 334, 363);
  80. g.drawString("by toAlec",399, 375);
  81. g.setColor(new Color(43, 214, 20));
  82. g.setFont(new Font("Tahoma", Font.BOLD, 11));
  83. g.drawString("version " + properties.version(), 334, 400);
  84. infolock = false;
  85. statslock = true;
  86. }
  87. if(inStats(statslock)){
  88. g.setColor(new Color(43, 214, 20));
  89. g.setFont(new Font("Tahoma", Font.BOLD, 12));
  90. g.drawString("Run Time... " + hours + ":" + minutes + ":" + seconds, 334, 362);
  91. statslock = false;
  92. infolock = true;
  93. }
  94. }
  95. }
  96. public boolean inInfo(boolean infolock){
  97. Mouse m = Bot.getClient().getMouse();
  98. if(!infolock){
  99. if(m.x >= 320 && m.x < 403 && m.y >= 432 && m.y < 432 + 25){
  100. return true;
  101. }else
  102. return false;
  103. }else
  104. return false;
  105. }
  106. public boolean inStats(boolean statslock){
  107. Mouse m = Bot.getClient().getMouse();
  108. if(!statslock){
  109. if(m.x >= 407 && m.x < 490 && m.y >= 432 && m.y < 432 + 25){
  110. return true;
  111. }else
  112. return false;
  113. }else
  114. return false;
  115. }
  116.  
  117. }
Add Comment
Please, Sign In to add comment