My first ever script. I would like the camera issue to be fixed, but yea. This is version 0.8, will add support for more foods later on, and perhaps other teletabs, albeit pointless, since this just eats or teleports to a safe zone. May add spellbook support.
Code:
import java.util.Map;
import com.speljohan.rsbot.script.*;
public class DragonPvPCamper extends Script {
public int f1 = 7946;
public int f2 = 385;
public int teletab1 = 8013;
public int teletab2 = 8008;
public int randomInteger1 = random(1, 180);
public int randomInteger2 = random(1, 180);
public void checkEat() {
final int cHealth = skills
.getCurrentSkillLevel(Constants.STAT_HITPOINTS);
if (cHealth <= (50)) { // This is where you edit when you want to eat. E.g. Your HP - 16 or 20.
clickMouse(f1);
clickMouse(f2);
if (cHealth <= 25) //this is where you edit when you want to teleport. E.g. 33% of your hp is recommended. so 75 = 25 here.
clickMouse(teletab1);
clickMouse(teletab2);
}
}
private void clickMouse(final int teletab12) {
}
public String getName(){
return "Dragons PvP Camper";
}
public String getAuthor(){
return "Dragon487";
}
public String getScriptCategory(){
return "Player vs Player";
}
public double getVersion(){
return 0.8;
}
public String getScriptDescription() {
final String html = "This is Dragon's PvP script. It will eat below 50 hitpoints, when you are below 25, then it will teleport. Only teleports with a house or lumbridge teletab.";
return(html);
}
public boolean onStart(final Map<String, String> args) {
log ("Thanks for using my script.");
return true;
}
public void onFinish(){
log ("Oh, is it that way? Then you just lost the game.");
return;
}
public int loop() {
if(getMyPlayer().isMoving()){
checkEat();
setCameraRotation(randomInteger1);
setCameraRotation(randomInteger2);
return 300;
}
if (getMyPlayer().isIdle()){
setCameraRotation(randomInteger1);
setCameraRotation(randomInteger2);
checkEat();
return 300;
}
return food1;
}
}
Monkfish and sharks are only supported atm. You may use a lumby or house teleport.