package scripts; import java.awt.*; import org.tribot.script.Script; import org.tribot.script.ScriptManifest; import org.tribot.api.General; import org.tribot.api.Timing; import org.tribot.api.input.Mouse; import org.tribot.api2007.Inventory; import org.tribot.api2007.NPCs; import org.tribot.api2007.types.RSNPC; import org.tribot.script.interfaces.Painting; @ScriptManifest(authors = { "Sloth" }, category = "Tools", name = "Rare Camper", description="This script will CAMP rare spots, rather than hop worlds at a certain spot.") public class RareCamper extends Script implements Painting { public int raresFound = 0; public long startTime; private final Color color1 = new Color(0, 0, 0, 165); private final Color color2 = new Color(0, 0, 0); private final Color color3 = new Color(255, 255, 255); private final BasicStroke stroke1 = new BasicStroke(1); private final Font font1 = new Font("Arial", 0, 9); int counter; int pHats[] = {1038, 1040, 1042, 1044, 1046, 1048}; int startCount = 0; @Override public void onPaint(Graphics g1) { long currentTime = System.currentTimeMillis(); Graphics2D g = (Graphics2D)g1; g.setColor(color1); g.fillRect(367, 260, 144, 74); g.setColor(color2); g.setStroke(stroke1); g.drawRect(367, 260, 144, 74); g.setFont(font1); g.setColor(color3); g.drawString("Sloth's Rare Camper - v1.0", 373, 274); g.drawString("Time ran: " + Timing.msToString(currentTime - startTime), 373, 294); g.drawString("Rare(s) found: " + raresFound, 373, 304); g.drawString("Searching for: Partyhats.", 373, 314); } @Override public void run() { startTime = System.currentTimeMillis(); while(true) { Mouse.setSpeed(General.random(100, 160)); try { RSNPC all[] = NPCs.getAll(); int amountOfNPCS = all.length; while(counter < amountOfNPCS) { RSNPC NPCtoCheck = all[counter]; if((NPCtoCheck.getName().toLowerCase().contains("partyhat") || NPCtoCheck.getName().toLowerCase().contains("cracker"))) { Mouse.setSpeed(General.random(190, 240)); println("Rare is visible, attempting to get."); while(NPCtoCheck.isOnScreen()) { NPCtoCheck.click("Take"); } } counter++; } //For loop not working, too tired, fix it in the morning u cunt //u wot m8 how dare u speak to me like that //lol #alone //fixed it u chubby funster for(int count : pHats) { raresFound = raresFound + Inventory.getCount(pHats[count]); } int Randy = General.random(1,100); switch (Randy) { case 1: Mouse.move(General.random(1, 766),General.random(1, 502)); println("Anti-sleep"); break; } sleep(200,400); counter = 0; } catch(Exception e) { return; } } } }