Adblock breaks this site

Need help with fixing my script!

Discussion in 'Programming General' started by dark spaj, Jan 11, 2009.

  1. dark spaj

    dark spaj Forum Addict

    Joined:
    Nov 16, 2008
    Posts:
    342
    Referrals:
    2
    Sythe Gold:
    0
    Need help with fixing my script!

    Hey this is just an edit so i can like save making a new thread about the same script...

    These are the errors i get when i run the script...(these happen when rs is going to the 'click here to play screen")
    [11:24:31][ Error Stream] java.lang.NullPointerException
    [11:24:31][ Error Stream] at com.speljohan.rsbot.script.Methods.atObject(Methods.java:2018)
    [11:24:31][ Error Stream] at DSedgewillows.loop(DSedgewillows.java:70)
    [11:24:31][ Error Stream] at com.speljohan.rsbot.script.Script.run(Script.java:102)
    [11:24:31][ Error Stream] at com.speljohan.rsbot.script.ScriptHandler$1.run(ScriptHandler.java:70)
    [11:24:31][ Error Stream] at java.lang.Thread.run(Unknown Source)

    dont know if it means any thing.

    and also, atleast the script does something bu it still doesnt chop willows, it seems interested in items on the ground, it right clicks them then cancels...and sometimes it chops normal trees so i dont know whats wrong...

    so heres the script:

    Code:
    import com.speljohan.rsbot.script.*;
    import com.speljohan.rsbot.script.wrappers.*;
    
    
    
    public class DSedgewillows extends Script{    
    
    
        public String getName() {  
            return "Dark Spaj's Edgeville Willows";    
        }
    
        public double getVersion() {    
            return 0.1;    
        }
    
        public String getAuthor() {
            return "Dark Spaj";  
        }
    
        public String getScriptCategory() {
            return "Woodcutting";
        }
    
        public boolean onStart(String[] args) {  
            return true;    
        }
    
        public String getScriptDescription() {
            String html = "";
            html += "<html>\n";
            html += "<body>\n";
            html += "<h2>" + getName() + " v" + getVersion() + "</h2><br>\n";
            html += "Author: " + getAuthor() + "<br><br>\n";
            html += "Setup: <br>";
            html += "<li>Start in Edgeville bank.</li>";
            html += "<li>Have an axe.</li>";
            html += "</body>\n";
            html += "</html>\n";
            return html;
        }
    
    
        private int State = 0;  
        private int[] Trees = { 1308, 5551, 5552, 5553 };
        private int[] Bankbooths = { 5912, 5913 };
        private int Logs = 1519;
        private int Runs = 0;
        private int Willows;
    
        private final RSTile[] treetobank = {
            new RSTile(3115, 3498),
            new RSTile(3106, 3496), new RSTile(3094, 3494)
        };
        
        private final RSTile[] banktotree = {
            new RSTile(3094, 3494),
            new RSTile(3106, 3496), new RSTile(3115, 3498)
        };
    
    
        public int loop() {
            try{
            switch (State) {
             case 0:
                if (getInventoryCount() == 28) {
                        State++;
                    } else {
                        RSObject Willow = findObject(Trees);
                        atObject(Willow, "Chop down");  
                    }
                return random(1000, 2000);
             case 1:
                if(getInventoryCount(Logs) == 0){
                    State++;
                    Runs++;
                } else{
                walkPathMM(randomizePath(treetobank, 2, 2), 20);
                //treetobank.walkToEnd();
                    RSObject Bankbooth = findObject(Bankbooths);
                    atObject(Bankbooth, "Use-quickly");
                    atInventoryItem(Logs, "Deposit-All");
                walkPathMM(randomizePath(banktotree, 2, 2), 20);
                }
                return random(1000, 2000);
             case 2: //Runs output
                System.out.println("Runs: " + Runs);
                State = 0;
                return random(1000, 2000);
            }
            } catch(Exception e){
             e.printStackTrace();
            }
            return random(1000, 2000);
        }
        
    }
     
    
    
    




    If you can do this THANKS SO MUCH!!
     
  2. rivgen

    rivgen Forum Addict

    Joined:
    Jul 22, 2008
    Posts:
    536
    Referrals:
    0
    Sythe Gold:
    0
    Need help with fixing my script!

    Code:
    import com.speljohan.rsbot.script.*;
    import com.speljohan.rsbot.script.wrappers.*;
    
    
    
    public class DSedgewillows extends Script{	
    
    
    	 public String getName() {  
    		return "Dark Spaj's Edgeville Willows";	
    	 }
    
    	 public double getVersion() {	
    		return 0.1;	  
    	 }
    
    	 public String getAuthor() { 
    		return "Dark Spaj";  
    	 }
    
    	 public boolean onStart(String[] args) {  
    		return true;	
    	 }
    
    
    	private int State = 0;  
    	private int[] Trees = { 1308, 5551, 5552, 5553 };
    	private int[] Bankbooths = { 5912, 5913 };
    	private int Logs = 1519; 
    	private int Runs = 0; 
    	private int Willows;
    
    	private final RSTile[] treetobank = { 
    		new RSTile(3115, 3498),
    		new RSTile(3106, 3496), new RSTile(3094, 3494)
    	};
    	
    	private final RSTile[] banktotree = { 
    		new RSTile(3094, 3494),
    		new RSTile(3106, 3496), new RSTile(3115, 3498)
    	};
    
    
    	public int loop() {
    		try{ 
    		switch (State) {
    		  case 0: 
    			if (getInventoryCount() == 28) { 
    					State++;
    				} else { 
    					RSObject Willow = findObject(Willows); 
    					atObject(Willow, "Chop down");  
    				}
    			return random(1000, 2000); 
    		  case 1: 
    			if(getInventoryCount(Logs) == 0){ 
    				State++; 
    				Runs++; 
    			} else{ 
    			walkPathMM(randomizePath(treetobank, 2, 2), 20);
    			//treetobank.walkToEnd();
    			 	RSObject Bankbooth = findObject(Bankbooths); 
    				atObject(Bankbooth, "Use-quickly");
    				atInventoryItem(Logs, "Deposit-All");
    			walkPathMM(randomizePath(banktotree, 2, 2), 20);
    			}
    			return random(1000, 2000); 
    		  case 2: //Runs output
    			System.out.println("Runs: " + Runs); 
    			State = 0; 
    			return random(1000, 2000); 
    		 }
    		} catch(Exception e){ 
    		  e.printStackTrace();
    		}
    		return random(1000, 2000); 
    	 }
    	 
    }
     
  3. dark spaj

    dark spaj Forum Addict

    Joined:
    Nov 16, 2008
    Posts:
    342
    Referrals:
    2
    Sythe Gold:
    0
    Need help with fixing my script!

    ^^ignore that post above^^

    Ok ive edited this thread to fit the new edit of the thread...this script is pretty much rivgens script but edited slightly so ignore that post above plz that isnt the best script as it didnt do it well so plz IGNORE IT!!!! rivgen did do a good job..dont deny it but just that isnt an update of teh current !!!!

    so could someone still fix plz =)
     
  4. war833

    war833 Member

    Joined:
    Dec 11, 2008
    Posts:
    82
    Referrals:
    0
    Sythe Gold:
    0
    Need help with fixing my script!

    What script? I see no script.
     
  5. dark spaj

    dark spaj Forum Addict

    Joined:
    Nov 16, 2008
    Posts:
    342
    Referrals:
    2
    Sythe Gold:
    0
    Need help with fixing my script!

    Are you blind or something or are you trying to get post count?

    its in teh first post stoopid ?

    DUUHHH!
     
  6. war833

    war833 Member

    Joined:
    Dec 11, 2008
    Posts:
    82
    Referrals:
    0
    Sythe Gold:
    0
    Need help with fixing my script!

    Still no script.
     
  7. dark spaj

    dark spaj Forum Addict

    Joined:
    Nov 16, 2008
    Posts:
    342
    Referrals:
    2
    Sythe Gold:
    0
    Need help with fixing my script!

    I said its in the first ever post in this fucin thread man!
     
  8. Swan

    Swan When They Cry...
    Retired Global Moderator

    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner
    Need help with fixing my script!

    Calm down or you sir will be infracted.

    There is no script - it uses RSbot libraries, but that is actually a legitimate Java PROGRAM source file, nowhere near a script.

    Now enough spam or I will indeed lock this.
     
  9. xxelitexx

    xxelitexx Newcomer

    Joined:
    Feb 2, 2009
    Posts:
    21
    Referrals:
    0
    Sythe Gold:
    0
    Need help with fixing my script!

    where are the imports that are referred to in the code?
     
  10. dark spaj

    dark spaj Forum Addict

    Joined:
    Nov 16, 2008
    Posts:
    342
    Referrals:
    2
    Sythe Gold:
    0
    Need help with fixing my script!

    i dont see any imports...
     
  11. Swan

    Swan When They Cry...
    Retired Global Moderator

    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner
    Need help with fixing my script!

    [​IMG]

    I really think I should quote you here:

    Code:
    import com.speljohan.rsbot.script.*;
    import com.speljohan.rsbot.script.wrappers.*;
     
  12. dark spaj

    dark spaj Forum Addict

    Joined:
    Nov 16, 2008
    Posts:
    342
    Referrals:
    2
    Sythe Gold:
    0
    Need help with fixing my script!

    I think the better thing to say is

    I
    [​IMG]
     
< My cryptography function. | java error 1330 >


 
 
Adblock breaks this site