Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Graphics;
- import java.util.Map;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- @ScriptManifest( authors = { "Botter118" }, category = "Wise", name = "FactGiver", description = "Says RS Facts")
- public class FactGiver extends Script {
- public long startTime;
- public int randomLine;
- public String textToSay;
- public int sentCount;
- public int secondsTilNext;
- public void chooseText(int randLine, String whatToSay) {
- if(randLine == 1) {
- whatToSay = "This";
- }else if(randLine == 2) {
- whatToSay = "Is";
- }else if(randLine == 3) {
- whatToSay = "Sparta!";
- }else{
- whatToSay = "!!!!!";
- }
- }
- public void sayText(String whatToSay) {
- sendText(whatToSay, true);
- sentCount++;
- }
- public void randomizeRandom(int randLine) {
- randLine = random(1, 4);
- }
- public void doItAll(int randLine, String whatToSay) {
- chooseText(randLine, whatToSay);
- sayText(whatToSay);
- }
- public void countDown(int seconds) {
- while(seconds > 1) {
- secondsTilNext = seconds;
- wait(1000);
- seconds--;
- }
- }
- public int loop() {
- if(!isLoggedIn()) {
- login();
- }
- if(getCurrentTab() != TAB_CLAN) {
- openTab(TAB_CLAN);
- }
- secondsTilNext = 0;
- randomizeRandom(randomLine);
- doItAll(randomLine, textToSay);
- moveMouse(random(2,5), random(12,20), random(2,30), 30);
- countDown(170);
- return random(1, 10);
- }
- public void onRepaint(Graphics g) {
- if(isLoggedIn()){
- long millis = System.currentTimeMillis() - startTime;
- long hours = millis / (1000 * 60 * 60);
- millis -= hours * 1000 * 60 * 60;
- long minutes = millis / (1000 * 60);
- millis -= minutes * 1000 * 60;
- long seconds = millis / 1000;
- g.drawString("Run Time: " + hours + ":" + minutes + ":" + seconds, 7, 5);
- g.drawString("Sent " + sentCount + " messages", 7, 17);
- g.drawString("Seconds Until Next Message:" + secondsTilNext, 7, 29);
- }
- }
- public boolean onStart(final Map<String, String> args) {
- return true;
- }
- public void onFinish() {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement