Jump to content

jelleplomp

Members
  • Posts

    16
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by jelleplomp

  1. getting this error =\

    [ERROR][Bot #1][03/26 04:18:15 PM]: Error in script executor!
    java.lang.NullPointerException
    	at Searching.walkToArea(Methods.java:98)
    	at JP_COW_KILLER.onLoop(JP_COW_KILLER.java:37)
    	at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(vk:97)
    	at java.lang.Thread.run(Unknown Source)
    
    

    line : 

    getLocalWalker().walk(cowFieldEast.getRandomPosition(0));
    
  2. Or use localWalker.walk(area.getRandomPosition))? There's no sense in using paths for every scenario when you can have the walking event auto-generate one using DCPF. 

     

    so your telling me i can use a method that generates a path to an area? XD

    ffs lol thanks

     

    what int do i need to use?

  3. hello,

     

    I'am currently trying to create a more enhanced cow killer,

    I've divided the cow field into 3 different area's:

    East,

    South,

    West

     

    so say if im in "East", and there is no attackable cow the bot runs to "South" I've created this method:

    	public void walkToArea(String area, Player p) throws InterruptedException {
    		/* 2 other areas to EAST*/
    		methods.safeWalkTo(PathSouthToEast);
    		if(area == "East" && whatAreaPlayer(p) == "South") {
    			methods.safeWalkTo(PathSouthToEast);
    		}
    		if(area == "East" && whatAreaPlayer(p) == "West") {
    			methods.safeWalkTo(PathWestToEast);
    		}
    		/*end EAST*/
    		
    		/* 2 other areas to West*/
    		if(area == "West" && whatAreaPlayer(p) == "South") {
    			methods.safeWalkTo(PathSouthToWest);
    		}
    		if(area == "West" && whatAreaPlayer(p) == "East") {
    			methods.safeWalkTo(PathEastToWest);
    		}
    		
    		/* 2 other areas to West*/
    		if(area == "South" && whatAreaPlayer(p) == "West") {
    			methods.safeWalkTo(PathWestToSouth);
    		}
    		if(area == "South" && whatAreaPlayer(p) == "East") {
    			methods.safeWalkTo(PathWestToSouth);
    		}
    	}
    

    whatAreaPlayer:

    	public String whatAreaPlayer(Player p) {
    		if (cowFieldSouth.contains(p))
    			return "South";
    		if (cowFieldEast.contains(p))
    			return "East";
    		if (cowFieldWest.contains(p))
    			return "West";
    		return "cant find";
    	}
    

    safeWalkTo (thanks to Renegeade)

    	public void safeWalkTo(Position[] p) throws InterruptedException {
    		this.getLocalWalker().walkPath(p);
    		Position lastPos = p[p.length - 1];
    		while (true) {
    			double lastDistance = distanceSquared(this.myPosition(), lastPos);
    			if (lastDistance < 4.5d) {
    				break;
    			}
    			Methods.sleep(3000);
    			if (Math.abs(distanceSquared(this.myPosition(), lastPos)
    					- lastDistance) < 1.1d) {
    				ArrayList<Position> shortenedPath = new ArrayList<Position>();
    				boolean startAdding = false;
    				for (Position pos : p) {
    					if (distanceSquared(this.myPosition(), pos) < 100d) {
    						startAdding = true;
    					}
    					if (startAdding) {
    						shortenedPath.add(pos);
    					}
    				}
    				this.getLocalWalker().walkPath(shortenedPath);
    			}
    		}
    	}
    
    	private double distanceSquared(Position p1, Position p2) {
    		return Math.pow(p1.getX() - p2.getX(), 2d)
    				+ Math.pow(p1.getY() - p2.getY(), 2d);
    	}
    

    but now it just wont move...

     

    thanks in advance,

    Jelleplomp

  4. Hi everybody,

     

    I need some help, I'm trying to make a monkfighter that will auto heal itself on the monk itself,

    now i already have this bit of code: 

    private void heal() throws InterruptedException {
    	  NPC Monk = (NPC)this.npcs.closest(new String[] { "Monk" });
    		if(Monk != null && !myPlayer().isUnderAttack() && !Monk.isUnderAttack()) {
    			Monk.interact(new String[] { "Talk-to" });
    			this.status = "healing at Monk";
    		    getInterfaces().get(231).getChild(2).interact(new String[] { "continue" });
    		    getInterfaces().get(219).getChild(1).interact(new String[] { "can" });
    		    sleep(random(200,300));
    		    getInterfaces().get(217).getChild(2).interact(new String[] { "continue" });
    		    sleep(random(200,300));
    		    getInterfaces().get(231).getChild(2).interact(new String[] { "continue" });
    		    sleep(random(1000, 1500));
    		}
    	}
    

    but in the loop when its opening the interfaces and starting to interact at "can", the onloop method refers back to this method so it will all start over again, meaning it will never go further than this line:

    getInterfaces().get(231).getChild(2).interact(new String[] { "continue" });
     

    so how do i do this?

    thanks in advance,

     

    Jelleplomp

  5. I'am currently creating a script to fill empty jugs with water,


    i already got this but when i try to load it in OSbot it crashes.


    script :


    **** i fixed the above but now im getting this error :


    [ERROR][Bot #1][03/20 05:45:15 PM]: Error in script executor!
    java.lang.NullPointerException
    at jugfiller.JugFiller.onLoop(JugFiller.java:63)
    at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(il:249)
    at java.lang.Thread.run(Unknown Source)

     


    line 63 : 


    switch(getState()) 

     


     


    http://pastebin.com/9kiDJLvK


     


    thanks in advance,


    Jelleplomp


     

×
×
  • Create New...