If statements do work! lol (:
Your code looks well structured - nicely done! The reason it is failing is purely syntactical - you've got a rogue ';' on line 7.
It may be a bit confusing, but long story short if you delete it, the code should work. The if statement is interpreted as a one-line (curly bracket-less) block and the empty expression is the conditional code. The curly brackets then form their own block which is always executed. Your code would look like this if properly formatted:
case TELEPORT:
Area geArea = new Area(3165, 3480, 3161, 3476); //area of all possible squares in GE that you can get teleported to.
Position current2 = myPlayer().getPosition();
log("STARTING");
if (!geArea.contains(myPlayer()))
;
{
getEquipment().interact(EquipmentSlot.RING, "Grand exchange");
log("teleporting");
new ConditionalSleep(5000) {
@Override
public boolean condition() {
return !myPlayer().getPosition().equals(current2);
}
}.sleep();
}
sleep(random(500, 600));
break;
Hopefully that makes sense. Careful where you put the ';'s!
Apa