Advertisement
Guest User

Untitled

a guest
May 29th, 2017
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.79 KB | None | 0 0
  1. import java.awt.Graphics;
  2. import java.util.Map;
  3.  
  4. import org.rsbot.script.Script;
  5. import org.rsbot.script.ScriptManifest;
  6.  
  7. @ScriptManifest( authors = { "Botter118" }, category = "Wise", name = "FactGiver", description = "Says RS Facts")
  8. public class FactGiver extends Script {
  9.  
  10.     public long startTime;
  11.     public int randomLine;
  12.     public String textToSay;
  13.     public int sentCount;
  14.  
  15.     public void chooseText(int randLine, String whatToSay) {
  16.         if(randLine == 1) {
  17.             whatToSay = "This";
  18.         }else if(randLine == 2) {
  19.             whatToSay = "Is";
  20.         }else if(randLine == 3) {
  21.             whatToSay = "Sparta!";
  22.         }else{
  23.             whatToSay = "!!!!!";
  24.         }
  25.     }
  26.  
  27.     public void sayText(String whatToSay) {
  28.         sendText(whatToSay, true);
  29.         sentCount++;
  30.     }
  31.  
  32.     public void randomizeRandom(int randLine) {
  33.         randLine = random(1, 4);
  34.     }
  35.  
  36.     public void doItAll(int randLine, String whatToSay) {
  37.         chooseText(randLine, whatToSay);
  38.         sayText(whatToSay);
  39.     }
  40.    
  41.     public int loop() {
  42.        
  43.         if(!isLoggedIn()) {
  44.             login();
  45.         }
  46.  
  47.         if(getCurrentTab() != TAB_CLAN) {
  48.             openTab(TAB_CLAN);
  49.         }
  50.  
  51.         randomizeRandom(randomLine);
  52.         doItAll(randomLine, textToSay);
  53.  
  54.         moveMouse(random(2,5), random(12,20), random(2,30), 30);
  55.         wait(170000);
  56.         return random(100,1000);
  57.     }
  58.  
  59.     public void onRepaint(Graphics g) {
  60.         if(isLoggedIn()){
  61.             long millis = System.currentTimeMillis() - startTime;
  62.             long hours = millis / (1000 * 60 * 60);
  63.             millis -= hours * 1000 * 60 * 60;
  64.             long minutes = millis / (1000 * 60);
  65.             millis -= minutes * 1000 * 60;
  66.             long seconds = millis / 1000;
  67.             g.drawString("Run Time: " + hours + ":" + minutes + ":" + seconds, 7, 5);
  68.             g.drawString("Sent " + sentCount + " messages", 7, 17);
  69.         }
  70.     }
  71.  
  72.     public boolean onStart(final Map<String, String> args) {
  73.         return true;
  74.     }
  75.  
  76.     public void onFinish() {
  77.  
  78.     }
  79.  
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement