Qubit Posted November 9, 2014 Share Posted November 9, 2014 (edited) i can't seem to get these to work, would be nice if someone were to explain why they dont work. Ex: ///////////////////////////////////Im getting error on Area ---- Area is undefined if(Area(1,2,3,4).contains.myPosition(){ //code } //////////////////////////////////// Im getting errors on .getRunEnergy() ---says change method receiver cast if(myPlayer().getRunenergy() > random(25,50){ myPlayer().setRunning(true); } //////////////////////////////////// Im getting error on walk ----- method walk i undefined Position BANK = new Position(random(3092,3097), random(3240, 3246), 0); walk(BANK); Edited November 9, 2014 by javant Link to comment Share on other sites More sharing options...
Constant Posted November 9, 2014 Share Posted November 9, 2014 I'm no expert on the API but it should probably be new Area(1, 2, 3, 4).contains(myPlayer) if(myPlayer.getRunEnergy() > random(25, 50)){ myPlayer.setRunning(true); } Link to comment Share on other sites More sharing options...
Swizzbeat Posted November 9, 2014 Share Posted November 9, 2014 (edited) Unless your using notepad all the Java IDE's have relatively useful intellisense. I suggest actually reading the compile time errors you receive. Edited November 9, 2014 by Swizzbeat Link to comment Share on other sites More sharing options...
Alek Posted November 9, 2014 Share Posted November 9, 2014 You know you can get a random position in an area using the current API? Link to comment Share on other sites More sharing options...
Apaec Posted November 9, 2014 Share Posted November 9, 2014 localWalker.walk(BANK.getRandomPosition(0)); walks you to a random position in an area Area x = new Area(1,2,3,4); if (x.contains(myPlayer())) { //cod } if (settings.getRunEnergy() > random(20,25)) { //code } Link to comment Share on other sites More sharing options...
Qubit Posted November 9, 2014 Author Share Posted November 9, 2014 localWalker.walk(BANK.getRandomPosition(0)); walks you to a random position in an area Area x = new Area(1,2,3,4); if (x.contains(myPlayer())) { //cod } if (settings.getRunEnergy() > random(20,25)) { //code } I still get an error on Area(1,2,3,4); saying cannot define constructor Link to comment Share on other sites More sharing options...
Joseph Posted November 9, 2014 Share Posted November 9, 2014 I still get an error on Area(1,2,3,4); saying cannot define constructor then you have the wrong import, remove it. and try adding the other import. It should be something with rs07 1 Link to comment Share on other sites More sharing options...
Qubit Posted November 9, 2014 Author Share Posted November 9, 2014 (edited) then you have the wrong import, remove it. and try adding the other import. It should be something with rs07 that was the problem.. thanks!! Edited November 9, 2014 by javant 1 Link to comment Share on other sites More sharing options...