Results 1 to 8 of 8

Thread: [ACTION] If PK gotolabel "X"

  1. #1
    iBot User
    Join Date
    Mar 2015
    Posts
    39
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    27 Post(s)
    Reputation
    10
    Rep Power
    2

    [ACTION] If PK gotolabel "X"

    Afternoon, gentlemen!

    So, as the title says, I need an action to go to this label "X" if a PK appears on my screen. But also, I need this check position z to go to this label.

    if posz == x and pk on screen then go to label X.


    I know there is something like that on forum, but only the action on scripts, not the actions itselves, so I would have to download every script to look for it. hahaha I know it's a easy one, if anyone can help me with this one, I'd be greatful.

    Thanks mates.

  2. #2
    Moderator Drakke's Avatar
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,898
    Mentioned
    216 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    390 Post(s)
    Reputation
    366
    Rep Power
    10
    Quote Originally Posted by afonsodp View Post
    Afternoon, gentlemen!

    So, as the title says, I need an action to go to this label "X" if a PK appears on my screen. But also, I need this check position z to go to this label.

    if posz == x and pk on screen then go to label X.


    I know there is something like that on forum, but only the action on scripts, not the actions itselves, so I would have to download every script to look for it. hahaha I know it's a easy one, if anyone can help me with this one, I'd be greatful.

    Thanks mates.
    Will check if any player on screen have white- red- black- orange- or yellow skull and if youre on whatever Z position you put it will go to whatever label you put in there.

    local CheckPlayers = getcreatures('p')

    for i=1,#CheckPlayers do
    if posz == 5 and (CheckPlayers[i].skull >= 3 or CheckPlayers[i].skull == 1) then
    gotolabel('x')
    end
    end

  3. #3
    iBot User
    Join Date
    Mar 2015
    Posts
    39
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    27 Post(s)
    Reputation
    10
    Rep Power
    2
    Quote Originally Posted by Drakke View Post
    Will check if any player on screen have white- red- black- orange- or yellow skull and if youre on whatever Z position you put it will go to whatever label you put in there.

    local CheckPlayers = getcreatures('p')

    for i=1,#CheckPlayers do
    if posz == 5 and (CheckPlayers[i].skull >= 3 or CheckPlayers[i].skull == 1) then
    gotolabel('x')
    end
    end
    Thanks man, I have to wait for a pk now to see if it works, but I guess it's all cool...
    Can you tell me if I didn't change anything wrongly? Look what I did:

    local CheckPlayers = getcreatures('p')

    for i=1,#CheckPlayers do
    if posz == 13 and (CheckPlayers[i].skull >= 3 or CheckPlayers[i].skull == 1) then
    gotolabel('sobe')
    end
    end

    for i=1,#CheckPlayers do
    if posz == 12 and (CheckPlayers[i].skull >= 3 or CheckPlayers[i].skull == 1) then
    gotolabel('refill')
    end
    end

  4. #4
    Moderator Drakke's Avatar
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,898
    Mentioned
    216 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    390 Post(s)
    Reputation
    366
    Rep Power
    10
    Quote Originally Posted by afonsodp View Post
    Thanks man, I have to wait for a pk now to see if it works, but I guess it's all cool...
    Can you tell me if I didn't change anything wrongly? Look what I did:

    local CheckPlayers = getcreatures('p')

    for i=1,#CheckPlayers do
    if posz == 13 and (CheckPlayers[i].skull >= 3 or CheckPlayers[i].skull == 1) then
    gotolabel('sobe')
    end
    end

    for i=1,#CheckPlayers do
    if posz == 12 and (CheckPlayers[i].skull >= 3 or CheckPlayers[i].skull == 1) then
    gotolabel('refill')
    end
    end
    Do >= 12 instead, so you dont need it two codes, now it will check if youre on 12, 13, 14, 15, 16 etc etc
    And to test it, just make two waypoints, dont start cavebot at all, it will always be set to the first waypoint right and get a noobchar or a friend to attack you or whatever and have it change to waypoint2 if there is someone with skull around you. Easy way to see if it works, I tried it but couldnt find anyone with skull so just changed it to party and seemed to work so.


    local CheckPlayers = getcreatures('p')

    for i=1,#CheckPlayers do
    if posz >= 12 and (CheckPlayers[i].skull >= 3 or CheckPlayers[i].skull == 1) then
    gotolabel('sobe')
    end
    end


    Edit:

    Ill add the skull types it will check for aswell and just tell me what types you want it to check and Ill change it or if thats ok

    0: Creature does not have skull. --Will not check because duuh
    1: Creature have yellow skull. --Will check
    2: Creature have green skull. --Will not check because its in a party
    3: Creature have white skull. --Will check
    4: Creature have a red skull. --Will check
    5: Creature have black skull. --Will check
    6: Creature have orange skull. --Will check
    Last edited by Drakke; 05-03-2015 at 10:59 PM.

  5. #5
    iBot User
    Join Date
    Mar 2015
    Posts
    39
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    27 Post(s)
    Reputation
    10
    Rep Power
    2
    Quote Originally Posted by Drakke View Post
    Do >= 12 instead, so you dont need it two codes, now it will check if youre on 12, 13, 14, 15, 16 etc etc
    And to test it, just make two waypoints, dont start cavebot at all, it will always be set to the first waypoint right and get a noobchar or a friend to attack you or whatever and have it change to waypoint2 if there is someone with skull around you. Easy way to see if it works, I tried it but couldnt find anyone with skull so just changed it to party and seemed to work so.


    local CheckPlayers = getcreatures('p')

    for i=1,#CheckPlayers do
    if posz >= 12 and (CheckPlayers[i].skull >= 3 or CheckPlayers[i].skull == 1) then
    gotolabel('sobe')
    end
    end


    Edit:

    Ill add the skull types it will check for aswell and just tell me what types you want it to check and Ill change it or if thats ok

    0: Creature does not have skull. --Will not check because duuh
    1: Creature have yellow skull. --Will check
    2: Creature have green skull. --Will not check because its in a party
    3: Creature have white skull. --Will check
    4: Creature have a red skull. --Will check
    5: Creature have black skull. --Will check
    6: Creature have orange skull. --Will check
    Got it, thanks a lot man!
    And about the posz, I don't think I can make >= 12, because on floor 13, the label to go up is not the same label on floor 12, right?
    Anyway, this is perfect, thank you!

    I can't rep you, says I have to spread some rep around, hahah, thanks again!

  6. #6
    Moderator Drakke's Avatar
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,898
    Mentioned
    216 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    390 Post(s)
    Reputation
    366
    Rep Power
    10
    Quote Originally Posted by afonsodp View Post
    Got it, thanks a lot man!
    And about the posz, I don't think I can make >= 12, because on floor 13, the label to go up is not the same label on floor 12, right?
    Anyway, this is perfect, thank you!

    I can't rep you, says I have to spread some rep around, hahah, thanks again!
    This should work better for you then
    First it checks if skulled player around you and then checks if youre on 12 or 13 and goes to correct label

    local CheckPlayers = getcreatures('p')

    for i=1,#CheckPlayers do
    if CheckPlayers[i].skull >= 3 or CheckPlayers[i].skull == 1 then
    if posz == 12 then
    gotolabel('refill')
    elseif posz == 13 then
    gotolabel('sobe')
    end
    end
    end

  7. #7
    iBot User
    Join Date
    Mar 2015
    Posts
    39
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    27 Post(s)
    Reputation
    10
    Rep Power
    2
    Quote Originally Posted by Drakke View Post
    This should work better for you then
    First it checks if skulled player around you and then checks if youre on 12 or 13 and goes to correct label

    local CheckPlayers = getcreatures('p')

    for i=1,#CheckPlayers do
    if CheckPlayers[i].skull >= 3 or CheckPlayers[i].skull == 1 then
    if posz == 12 then
    gotolabel('refill')
    elseif posz == 13 then
    gotolabel('sobe')
    end
    end
    end
    Tested today, works perfectly! Thank you, @Drakke!

  8. #8
    Moderator Drakke's Avatar
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,898
    Mentioned
    216 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    390 Post(s)
    Reputation
    366
    Rep Power
    10
    Quote Originally Posted by afonsodp View Post
    Tested today, works perfectly! Thank you, @Drakke!
    Perfect!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •