Jump to content

Checking if I'm dead


Recommended Posts

Posted (edited)

this is not really good but it works and its noob friendly

what youre doin here is youre checking if youre in the specific area so where you gonna be when your dead and then youre gonna walk back to the goblins

so (the areas is not good you should do it yourself thats one x and y coardinate tile  from bottom left to top right when your looking north)

final Area LUMBRIDGE_AREA = new Area (2982,3233,2990,3242);

final Area GOBLIN_AREA = new Area (x,y,x,y);

if (LUMBRIDGE_AREA .contains(myPosition()){

getWalking().webWalk(GOBLIN_AREA);

}

 

Edited by mousbros
Posted
2 hours ago, mousbros said:

this is not really good but it works and its noob friendly

what youre doin here is youre checking if youre in the specific area so where you gonna be when your dead and then youre gonna walk back to the goblins

so (the areas is not good you should do it yourself thats one x and y coardinate tile  from bottom left to top right when your looking north)

final Area LUMBRIDGE_AREA = new Area (2982,3233,2990,3242);

final Area GOBLIN_AREA = new Area (x,y,x,y);

if (LUMBRIDGE_AREA .contains(myPosition()){

getWalking().webWalk(GOBLIN_AREA);

}

 

I'll try this, thankyou so much, it doesn't have to be pretty, just has to work

 

Posted (edited)
10 hours ago, hekx said:

hey all.

I'm writing a combat script for me to just afk fight the wizards outside Draynor village. The only problem is if I die. I need a way of detecting if I am dead so I can then walk myself from spawn to where the wizards are and fight them again?

No need to check if your dead. Just check to see if the wizards are nearby, if not walk to the wizard area.

 

Area wizardArea = new Area(0, 0, 0, 0); // Set this to the area of the wizards.
String wizardName = "PlaceNameHere";
NPC wizard = getNpcs().closest(npc -> npc.getName().equalsIgnoreCase(wizardName) && npc.isAttackable());

// If the wizard is null and you are not in the area walk to the area.
// Else If you are in the area and there is no available wizard and you are currently on a p2p world than hop to a p2p world.
// Else If you are in the area and there is no available wizard and you are currently on a f2p world than hop to a f2p world.
if (wizard == null && !wizardArea.contains(myPlayer()))
    getWalking().webWalk(wizardArea);
else if (wizardArea.contains(myPlayer()))
    if (getWorlds().isMembersWorld())
        getWorlds().hopToP2PWorld();
    else
        getWorlds().hopToF2PWorld();
Edited by BravoTaco
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...