Advertisement
Guest User

Untitled

a guest
Jul 7th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.82 KB | None | 0 0
  1. package scripts;
  2.  
  3. import java.awt.*;
  4.  
  5. import org.tribot.script.Script;
  6. import org.tribot.script.ScriptManifest;
  7. import org.tribot.api.General;
  8. import org.tribot.api.Timing;
  9. import org.tribot.api.input.Mouse;
  10. import org.tribot.api2007.Inventory;
  11. import org.tribot.api2007.NPCs;
  12. import org.tribot.api2007.types.RSNPC;
  13. import org.tribot.script.interfaces.Painting;
  14.  
  15.  
  16. @ScriptManifest(authors = { "Sloth" }, category = "Tools", name = "Rare Camper", description="This script will CAMP rare spots, rather than hop worlds at a certain spot.")
  17.  
  18.  
  19.  
  20. public class RareCamper extends Script implements Painting {
  21.  
  22. public int raresFound = 0;
  23. public long startTime;
  24. private final Color color1 = new Color(0, 0, 0, 165);
  25. private final Color color2 = new Color(0, 0, 0);
  26. private final Color color3 = new Color(255, 255, 255);
  27. private final BasicStroke stroke1 = new BasicStroke(1);
  28. private final Font font1 = new Font("Arial", 0, 9);
  29. int counter;
  30. int pHats[] = {1038, 1040, 1042, 1044, 1046, 1048};
  31.  
  32. int startCount = 0;
  33.  
  34. @Override
  35. public void onPaint(Graphics g1) {
  36. long currentTime = System.currentTimeMillis();
  37. Graphics2D g = (Graphics2D)g1;
  38. g.setColor(color1);
  39. g.fillRect(367, 260, 144, 74);
  40. g.setColor(color2);
  41. g.setStroke(stroke1);
  42. g.drawRect(367, 260, 144, 74);
  43. g.setFont(font1);
  44. g.setColor(color3);
  45. g.drawString("Sloth's Rare Camper - v1.0", 373, 274);
  46. g.drawString("Time ran: " + Timing.msToString(currentTime - startTime), 373, 294);
  47. g.drawString("Rare(s) found: " + raresFound, 373, 304);
  48. g.drawString("Searching for: Partyhats.", 373, 314);
  49.  
  50. }
  51.  
  52. @Override
  53. public void run() {
  54. startTime = System.currentTimeMillis();
  55. while(true) {
  56. Mouse.setSpeed(General.random(100, 160));
  57. try {
  58. RSNPC all[] = NPCs.getAll();
  59. int amountOfNPCS = all.length;
  60. while(counter < amountOfNPCS) {
  61. RSNPC NPCtoCheck = all[counter];
  62. if((NPCtoCheck.getName().toLowerCase().contains("partyhat") || NPCtoCheck.getName().toLowerCase().contains("cracker"))) {
  63. Mouse.setSpeed(General.random(190, 240));
  64. println("Rare is visible, attempting to get.");
  65. while(NPCtoCheck.isOnScreen()) {
  66. NPCtoCheck.click("Take");
  67. }
  68. }
  69. counter++;
  70. }
  71.  
  72. //For loop not working, too tired, fix it in the morning u cunt
  73. //u wot m8 how dare u speak to me like that
  74. //lol #alone
  75. //fixed it u chubby funster
  76.  
  77. for(int count : pHats) {
  78. raresFound = raresFound + Inventory.getCount(pHats[count]);
  79. }
  80.  
  81. int Randy = General.random(1,100);
  82. switch (Randy) {
  83. case 1:
  84. Mouse.move(General.random(1, 766),General.random(1, 502));
  85. println("Anti-sleep");
  86. break;
  87. }
  88. sleep(200,400);
  89.  
  90. counter = 0;
  91. } catch(Exception e) {
  92. return;
  93. }
  94. }
  95.  
  96.  
  97. }
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement