Jump to content

Nothing happening?


system64

Recommended Posts

So i wrote a simple guild ranger script. No errors when compiling, shows up on script loader. But when I start it nothing happens.

 

 

Source:

 import org.osbot.rs07.api.map.Position;
import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.api.model.RS2Object;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
 
import org.osbot.rs07.utility.Area;
 
 
import java.awt.*;
 
        @ScriptManifest(author = "system64", info = "range guild", name = "range Guild", version = 0, logo = "")
        public class range extends Script {
 
 
        private enum State {
                SHOOT_TARGET
        };
 
        private State getState() {
                if(!myPlayer().isAnimating())
 SHOOT_TARGET
                        return State.SHOOT_TARGET;
 
         return State.SHOOT_TARGET;
   }
   
public int onLoop() throws InterruptedException {
     switch(getState()) {
     
     case SHOOT_TARGET:
         interactWithJudge();
         playMinigame();
     break;
   
     }
     return random(200, 300);
}
 
 
private void playMinigame() throws InterruptedException {
          RS2Object target = getObjects().closest("Target");
                if(target != null) {
                        for(int x = 1; x >= 10; x ++) {
                                if(target.interact("fire at target")) {
                                        sleep(100);
                                }
                        }
                }
        }
 
 
private void interactWithJudge() throws InterruptedException {
    NPC judge = getNpcs().closest("Competetion Judge");
    if(judge != null){
        judge.interact("Talk-to");
        sleep(500);
    }
 
    if(getInterfaces().getChild(548, 116).isVisible()) {
        sleep(random(600, 1000));
        dialogues.clickContinue();
        sleep(random(600, 1000));
        dialogues.selectOption("Sure I'll give it a go");
        sleep(random(600, 1000));
    }
}
 
}
Edited by system64
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...