RsBot Script Help

Discussion in 'RuneScape 3 Cheating' started by Go L Den, Feb 15, 2009.

RsBot Script Help
  1. Unread #1 - Feb 15, 2009 at 10:05 PM
  2. Go L Den
    Joined:
    May 1, 2007
    Posts:
    84
    Referrals:
    0
    Sythe Gold:
    0

    Go L Den Member
    Banned

    RsBot Script Help

    Hey guys, I'm very new to scripting for RsBot, and I was wondering if someone could give me some help with a Nullpointer error.

    I created an extremely simple script using a tutorial to open a bank booth, but I keep getting a nullpointer error whenever I run it.

    Here is the script code:

    Code:
    }
    import java.awt.*;
    
    import com.speljohan.rsbot.bot.Bot;
    import com.speljohan.rsbot.event.listeners.PaintListener;
    import com.speljohan.rsbot.script.Script;
    import com.speljohan.rsbot.script.wrappers.*;
    
    public class AutoBank extends Script implements PaintListener {
    
    
    
    
    public void onRepaint(Graphics g) 
    {
    Bot.getEventManager().addListener(PaintListener.class, this);
    }
    public double getVersion() 
    {
    return 1.0;
    }
    public String getScriptCategory() 
    {
    return "Auto Bank";
    }
    public String getName() 
    {
    return "AutoBank";
    }
    public String getAuthor() 
    {
    return "Go_L_Den";
    }
    
    public boolean onStart(String[] args) 
    {
    
    return true;
    }
    
    public void onFinish() {
    
    }
    int id1 = 36831;
    boolean first = true;
    boolean foundobject = false;
    
    RSObject bankbooth = findObject(id1); 
    
    public int loop() {
    
    
    
    if(first) {
    
    foundobject = true;
    log("Found an object!");
    first = false;
    
    }
    if(foundobject,"Use-quickly") {
    
    atObject(bankbooth);
    }
    
    return 1000;
    }
    }
    
    
    and here is the nullpointer error that I get whenever I run the script (it occurs after the object is found):

    Code:
    java.lang.NullPointerException
    	at com.speljohan.rsbot.script.Methods.atObject(Methods.java:2081)
    	at AutoBank.loop(AutoBank.java:62)
    	at com.speljohan.rsbot.script.Script.run(Script.java:102)
    	at com.speljohan.rsbot.script.ScriptHandler$1.run(ScriptHandler.java:70)
    	at java.lang.Thread.run(Thread.java:619)
    
    
    If someone could tell me what I did incorrectly and how I should have done it to avoid this error, I would greatly appreciate it.

    Thanks,

    Go L Den
     
  3. Unread #2 - Feb 16, 2009 at 12:15 AM
  4. Jimmy
    Joined:
    Jun 24, 2008
    Posts:
    2,421
    Referrals:
    10
    Sythe Gold:
    25

    Jimmy Ghost
    Retired Sectional Moderator $5 USD Donor

    RsBot Script Help

    Your loop looks a bit funky. Try something more like this?
    PHP:
    import java.awt.*;

    import com.speljohan.rsbot.bot.Bot;
    import com.speljohan.rsbot.event.listeners.PaintListener;
    import com.speljohan.rsbot.script.Script;
    import com.speljohan.rsbot.script.wrappers.*;

    public class 
    AutoBank extends Script {
        public 
    int BBooth 36786;

        public 
    double getVersion() {
        return 
    1.0;
        }

        public 
    String getScriptCategory() {
        return 
    "Auto Bank";
        }

        public 
    String getName() {
        return 
    "AutoBank";
        }

        public 
    String getAuthor() {
        return 
    "Go_L_Den";
        }

        public 
    boolean onStart(String[] args) {
        return 
    true;
        }

        public 
    void onFinish() {
        }

        public 
    int loop() {
        
    RSObject Booth findObject(BBooth);
        
    atObject(Booth"Use-Quickly");
        
    log("Found Bank Booth");
        return -
    1;
        }
    }
     
  5. Unread #3 - May 8, 2010 at 5:48 AM
  6. ewwerpm
    Joined:
    May 8, 2010
    Posts:
    0
    Referrals:
    0
    Sythe Gold:
    0

    ewwerpm Newcomer

    RsBot Script Help

    where is the package " com.speljohan", in my RSBot 1.16, there is no package about " com.speljohan". what shall i do?
     
< Generation-x 525 24/7 | Does getting reported = definate ban? >

Users viewing this thread
1 guest


 
 
Adblock breaks this site