Need help with fixing my script!

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

Need help with fixing my script!
  1. Unread #1 - Jan 11, 2009 at 3:11 AM
  2. dark spaj
    Joined:
    Nov 16, 2008
    Posts:
    342
    Referrals:
    2
    Sythe Gold:
    0

    dark spaj Forum Addict

    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!!
     
  3. Unread #2 - Jan 11, 2009 at 8:04 AM
  4. rivgen
    Joined:
    Jul 22, 2008
    Posts:
    536
    Referrals:
    0
    Sythe Gold:
    0

    rivgen Forum Addict

    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); 
    	 }
    	 
    }
     
  5. Unread #3 - Jan 16, 2009 at 7:29 AM
  6. dark spaj
    Joined:
    Nov 16, 2008
    Posts:
    342
    Referrals:
    2
    Sythe Gold:
    0

    dark spaj Forum Addict

    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 =)
     
  7. Unread #4 - Jan 17, 2009 at 3:32 PM
  8. war833
    Joined:
    Dec 11, 2008
    Posts:
    82
    Referrals:
    0
    Sythe Gold:
    0

    war833 Member

    Need help with fixing my script!

    What script? I see no script.
     
  9. Unread #5 - Jan 21, 2009 at 12:44 AM
  10. dark spaj
    Joined:
    Nov 16, 2008
    Posts:
    342
    Referrals:
    2
    Sythe Gold:
    0

    dark spaj Forum Addict

    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!
     
  11. Unread #6 - Jan 23, 2009 at 7:55 PM
  12. war833
    Joined:
    Dec 11, 2008
    Posts:
    82
    Referrals:
    0
    Sythe Gold:
    0

    war833 Member

    Need help with fixing my script!

    Still no script.
     
  13. Unread #7 - Jan 28, 2009 at 3:42 PM
  14. dark spaj
    Joined:
    Nov 16, 2008
    Posts:
    342
    Referrals:
    2
    Sythe Gold:
    0

    dark spaj Forum Addict

    Need help with fixing my script!

    I said its in the first ever post in this fucin thread man!
     
  15. Unread #8 - Jan 29, 2009 at 5:10 AM
  16. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    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.
     
  17. Unread #9 - Feb 2, 2009 at 9:41 PM
  18. xxelitexx
    Joined:
    Feb 2, 2009
    Posts:
    21
    Referrals:
    0
    Sythe Gold:
    0

    xxelitexx Newcomer

    Need help with fixing my script!

    where are the imports that are referred to in the code?
     
  19. Unread #10 - Feb 17, 2009 at 12:37 AM
  20. dark spaj
    Joined:
    Nov 16, 2008
    Posts:
    342
    Referrals:
    2
    Sythe Gold:
    0

    dark spaj Forum Addict

    Need help with fixing my script!

    i dont see any imports...
     
  21. Unread #11 - Feb 17, 2009 at 3:36 AM
  22. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    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.*;
     
  23. Unread #12 - Feb 18, 2009 at 2:56 AM
  24. dark spaj
    Joined:
    Nov 16, 2008
    Posts:
    342
    Referrals:
    2
    Sythe Gold:
    0

    dark spaj Forum Addict

    Need help with fixing my script!

    I think the better thing to say is

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

Users viewing this thread
1 guest


 
 
Adblock breaks this site