Jump to content

Checking if I'm dead


hekx

Recommended Posts

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
Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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