Guest User

Untitled

a guest
Dec 9th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.28 KB | None | 0 0
  1. import java.awt.Color;
  2. import java.awt.Graphics;
  3. import java.awt.Graphics2D;
  4. import java.awt.Point;
  5.  
  6. import com.rsbuddy.event.listeners.PaintListener;
  7. import com.rsbuddy.script.ActiveScript;
  8. import com.rsbuddy.script.Manifest;
  9. import com.rsbuddy.script.methods.Camera;
  10. import com.rsbuddy.script.methods.Mouse;
  11. import com.rsbuddy.script.methods.Objects;
  12. import com.rsbuddy.script.methods.Players;
  13. import com.rsbuddy.script.methods.Walking;
  14. import com.rsbuddy.script.util.Random;
  15. import com.rsbuddy.script.util.Timer;
  16.  
  17. @Manifest(name = "Paint an Npc", authors = { "Prestige" }, version = 1.0, keywords = { "misc." }, description = "Paint your player!")
  18. public class PaintNpc extends ActiveScript implements PaintListener {
  19. @Override
  20. public int loop() {
  21. antiban();
  22. sleep (0, 60000);
  23. return 0;
  24.  
  25. }
  26.  
  27. private void antiban() {
  28. int rnd = Random.nextInt(0, 35);
  29. switch (rnd) {
  30. case 1:
  31. Camera.setCompassAngle(Random.nextInt(0, 360));
  32. break;
  33. case 2:
  34. Mouse.moveRandomly(0, 35);
  35. case 3:
  36. Objects.getLoaded()[Random.nextInt(0, Objects.getLoaded().length -1 ])
  37. break;
  38. }
  39.  
  40. }
  41.  
  42. public void paintPlayer(Graphics g) {
  43. if (Players.getLocal() != null) {
  44. g.setColor(Color.BLUE);
  45. Players.getLocal().draw(g);
  46. }
  47. }
  48.  
  49. public void paintObject(Graphics g) {
  50. if (Objects.getNearest(38786) != null) {
  51. g.setColor(Color.RED);
  52. Objects.getNearest(38786).draw(g);
  53. }
  54. }
  55.  
  56. private void drawMouse(Graphics g) {
  57. Point x = Mouse.getLocation();
  58. g.drawLine(x.x - 1000, x.y, x.x + 1000, x.y);
  59. g.drawLine(x.x, x.y - 1000, x.x, x.y + 1000);
  60.  
  61. }
  62.  
  63. int colorint = 0;
  64. public Color[] colors = {
  65. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  66. Random.nextInt(0, 255)),
  67. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  68. Random.nextInt(0, 255)),
  69. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  70. Random.nextInt(0, 255)),
  71. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  72. Random.nextInt(0, 255)),
  73. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  74. Random.nextInt(0, 255)),
  75. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  76. Random.nextInt(0, 255)),
  77. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  78. Random.nextInt(0, 255)),
  79. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  80. Random.nextInt(0, 255)),
  81. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  82. Random.nextInt(0, 255)),
  83. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  84. Random.nextInt(0, 255)),
  85. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  86. Random.nextInt(0, 255)),
  87. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  88. Random.nextInt(0, 255)),
  89. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  90. Random.nextInt(0, 255)),
  91. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  92. Random.nextInt(0, 255)),
  93. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  94. Random.nextInt(0, 255)),
  95. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  96. Random.nextInt(0, 255)),
  97. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  98. Random.nextInt(0, 255)),
  99. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  100. Random.nextInt(0, 255)),
  101. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  102. Random.nextInt(0, 255)),
  103. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  104. Random.nextInt(0, 255)),
  105. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  106. Random.nextInt(0, 255)),
  107. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  108. Random.nextInt(0, 255)),
  109. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  110. Random.nextInt(0, 255)),
  111. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  112. Random.nextInt(0, 255)),
  113. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  114. Random.nextInt(0, 255)),
  115. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  116. Random.nextInt(0, 255)),
  117. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  118. Random.nextInt(0, 255)),
  119. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  120. Random.nextInt(0, 255)),
  121. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  122. Random.nextInt(0, 255)),
  123. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  124. Random.nextInt(0, 255)),
  125. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  126. Random.nextInt(0, 255)),
  127. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  128. Random.nextInt(0, 255)),
  129. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  130. Random.nextInt(0, 255)),
  131. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  132. Random.nextInt(0, 255)),
  133. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  134. Random.nextInt(0, 255)),
  135. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  136. Random.nextInt(0, 255)),
  137. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  138. Random.nextInt(0, 255)),
  139. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  140. Random.nextInt(0, 255)),
  141. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  142. Random.nextInt(0, 255)),
  143. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  144. Random.nextInt(0, 255)),
  145. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  146. Random.nextInt(0, 255)),
  147. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  148. Random.nextInt(0, 255)),
  149. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  150. Random.nextInt(0, 255)),
  151. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  152. Random.nextInt(0, 255)),
  153. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  154. Random.nextInt(0, 255)),
  155. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  156. Random.nextInt(0, 255)),
  157. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  158. Random.nextInt(0, 255)),
  159. new Color(Random.nextInt(0, 255), Random.nextInt(0, 255),
  160. Random.nextInt(0, 255)) };
  161. Timer t = new Timer(5000);
  162.  
  163. public void onRepaint(Graphics g1) {
  164. Graphics2D g = (Graphics2D) g1;
  165. g.setColor(colors[colorint]);
  166. if (!t.isRunning()) {
  167. if (colorint < colors.length - 1)
  168. colorint++;
  169. else
  170. colorint = 0;
  171. t.reset();
  172. }
  173. drawMouse(g);
  174.  
  175. }
  176. }
Add Comment
Please, Sign In to add comment