Signup Now
Results 1 to 6 of 6
  1. #1
    Free User Noobot's Avatar
    Join Date
    Jan 2015
    Location
    Sweden
    Posts
    33
    Reputation
    16
    Rep Power
    0

    Exclamation $pattacker.id doesnt seem to work properly

    I did a "flee spawn if being PKed" script some days ago, and when someone comes and PK you it works great. But the problem is that sometimes the bot think it is being PKed even tho it isnt.. I have tried diffrent types of it and tried it alot of times, and also used "take screenshot if being pk" script to see what is happening and from what I can see it randomly happens sometimes when a player is outside the screen just about to enter the screen..

    To solve this I tried to only look for players inside 5sqm and even 4 sqm but it still bugs out sometimes :/ it doesnt happen every time someone comes inside the screen, its just sometimes. duno if this is only me but I dont think so, seems to be the $pattacker function that there is someting wrong with since I can't hear "PK alarm" (which is activated) at the same time as the bot is switching on the PK script.

    this is the script I started with:

    --Flee spawn, equip time ring and log out in pz if being PKed.
    auto(200)

    if $pattacker.id ~= 0 then
    CODE
    end


    and the latest one:

    --Flee spawn, equip time ring and log out in pz if being PKed.
    auto(200)

    if paround(4) > 0 then
    if $pattacker.id > 0 then
    CODE
    end
    end


    I have tried both $pattacker ~= 0 and $pattacker > 0

    @Lucas Terra @SuNe

  2. #2
    Moderator mistgun's Avatar
    Join Date
    Dec 2013
    Location
    Lodz, Poland
    Posts
    1,821
    Reputation
    220
    Rep Power
    26
    Quote Originally Posted by Noobot View Post
    I did a "flee spawn if being PKed" script some days ago, and when someone comes and PK you it works great. But the problem is that sometimes the bot think it is being PKed even tho it isnt.. I have tried diffrent types of it and tried it alot of times, and also used "take screenshot if being pk" script to see what is happening and from what I can see it randomly happens sometimes when a player is outside the screen just about to enter the screen..

    To solve this I tried to only look for players inside 5sqm and even 4 sqm but it still bugs out sometimes :/ it doesnt happen every time someone comes inside the screen, its just sometimes. duno if this is only me but I dont think so, seems to be the $pattacker function that there is someting wrong with since I can't hear "PK alarm" (which is activated) at the same time as the bot is switching on the PK script.

    this is the script I started with:

    --Flee spawn, equip time ring and log out in pz if being PKed.
    auto(200)

    if $pattacker.id ~= 0 then
    CODE
    end


    and the latest one:

    --Flee spawn, equip time ring and log out in pz if being PKed.
    auto(200)

    if paround(4) > 0 then
    if $pattacker.id > 0 then
    CODE
    end
    end


    I have tried both $pattacker ~= 0 and $pattacker > 0

    @Lucas Terra @SuNe

    better when u check a creature's dist with
    $pattacker.dist

  3. #3
    Free User Noobot's Avatar
    Join Date
    Jan 2015
    Location
    Sweden
    Posts
    33
    Reputation
    16
    Rep Power
    0
    Quote Originally Posted by mistgun View Post
    better when u check a creature's dist with
    $pattacker.dist
    okay I will try that thanks

  4. #4
    Free User Noobot's Avatar
    Join Date
    Jan 2015
    Location
    Sweden
    Posts
    33
    Reputation
    16
    Rep Power
    0
    oh that was just for the distance right..

    the problem isnt the distance since it worked great to check only for players inside 4 sqm, but it still thinks the player is attacking me. but as I have seen on my screenshot they dont atk me. I take 1 screenshot every 200ms when someone is attacking me and I can see clearly that they are just walking past me, so what is it that is wrong? someting on my side or the bot? does the $pattacker function work as it should for others?

    they players have had diffrent outfits, diffrent sexes, with mount and without and also with and without guild. so it seems to be totally random. I cant see any similarities

  5. #5
    Helper StaR's Avatar
    Join Date
    Dec 2013
    Location
    Manchester
    Posts
    713
    Reputation
    50
    Rep Power
    22
    Quote Originally Posted by Noobot View Post
    oh that was just for the distance right..

    the problem isnt the distance since it worked great to check only for players inside 4 sqm, but it still thinks the player is attacking me. but as I have seen on my screenshot they dont atk me. I take 1 screenshot every 200ms when someone is attacking me and I can see clearly that they are just walking past me, so what is it that is wrong? someting on my side or the bot? does the $pattacker function work as it should for others?

    they players have had diffrent outfits, diffrent sexes, with mount and without and also with and without guild. so it seems to be totally random. I cant see any similarities
    I think @mistgun meant use check the distance of the player who attacked you to see if anyone has attacked you.

    e.g
    auto(1000)

    if $pattacker.dist > 0 then
    printerror('I am being attacked')
    end



  6. #6
    Free User Noobot's Avatar
    Join Date
    Jan 2015
    Location
    Sweden
    Posts
    33
    Reputation
    16
    Rep Power
    0
    oh okay, yea maybe the dist isnt "bugged" like the .id function.

    anyway I looked trough the windbot documentation again and I came up with a new one that seems to work properly:


    --Flee spawn, equip time ring and log out in pz if being PKed.
    auto(200)

    if paround(5) > 0 and $pattacker.id > 0 and $pattacker.skull > 0 then
    CODE
    end


    its probably just enough with "$pattacker.skull" but im going the safe road for now

    Thanks for the help

 

 

Posting Permissions

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