- Joined
- Jul 24, 2014
- Messages
- 633
- Thread Author
- #1
Well I finally gave developing a shot and I'm determined to release something functional!
First of all, I tried making a Seren Stone miner based on @SlashnHax 's tutorial power miner.
I haven't changed much of the code but this is what I got so far:
Now I got some text that is either appearing red, or has been underlined in red:
Can't resolve symbol 'skrall'. Do I need to add a folder with my username or something?
',' or ';' expected. The part '()->P is underlined in red. I doublechecked my code and also the code of SNH and I couldn't find anything missing.
Cannot resolve symbol 'State'. I have no idea what I'm doing wrong here to be honest lol.
Feedback is very much appreciated! Once I get this working I'll try to finetune the delays some more and maybe I'll add a paint too!
First of all, I tried making a Seren Stone miner based on @SlashnHax 's tutorial power miner.
I haven't changed much of the code but this is what I got so far:
JavaScript:
package com.runemate.skrall.bots.seren
import com.runemate.game.api.hybrid.region.Players;
import com.runemate.game.api.hybrid.entities.GameObject;
import com.runemate.game.api.hybrid.region.GameObjects;
import com.runemate.game.api.script.Execution;
import com.runemate.game.api.script.framework.LoopingScript;
import com.runemate.game.api.hybrid.local.Camera;
/**
* Seren Stone miner by skrall
* based on Slashnhax's Powerminer
*/
public class AFKSerenStones extends LoopingScript {
private enum State {
MINE, WAIT
}
@Override
public void onLoop() {
switch(getCurrentState()){
case MINE:
GameObject rocks = GameObjects.newQuery().names("Seren stone").results().nearest();
if(rocks != null && rocks.getDefinition() != null) {
if(!rocks.isVisible()) {
Camera.turnTo(rocks);
}
if(rocks.interact("Mine", rocks.getDefinition().getName())) {
Execution.delayUntil(()->Players.getLocal().getAnimationId() != -1, 500, 5000);
}
}
break;
case WAIT:
break;
}
}
}
@Override
public void onStop(){
}
private State getCurrentState(){
if(Players.getLocal().getAnimationId() == -1 || rocks == null || !rocks.isValid()) {
return State.MINE;
} else {
return State.WAIT;
}
}
}
Now I got some text that is either appearing red, or has been underlined in red:
JavaScript:
package com.runemate.skrall.bots.seren
Code:
Execution.delayUntil(()->Players.getLocal().getAnimationId() != -1, 500, 5000);
JavaScript:
private State getCurrentState(){
Feedback is very much appreciated! Once I get this working I'll try to finetune the delays some more and maybe I'll add a paint too!