Qubit Posted November 9, 2014 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
Constant Posted November 9, 2014 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); }
Swizzbeat Posted November 9, 2014 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
Alek Posted November 9, 2014 Posted November 9, 2014 You know you can get a random position in an area using the current API?
Apaec Posted November 9, 2014 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 }
Qubit Posted November 9, 2014 Author 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
Joseph Posted November 9, 2014 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
Qubit Posted November 9, 2014 Author 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