Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: .Isreachable Action - How to prevent spamming "Hi"

  1. #1
    iBot User
    Join Date
    May 2012
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    2 Post(s)
    Reputation
    10
    Rep Power
    5

    .Isreachable Action - How to prevent spamming "Hi"

    Hello, I need little help with one action...
    What i wanted to do is check to prevent saying hi unless npc is on screen and reachable.
    What is important npc need to be reachable, because he can be trapped behind doors ( on screen) but too far away from doors to talk with him.

    I tried to use

    Code:
    local SKURWIEL = {"Sigurd"}
    
    if SKURWIEL.isreachable == true
    then
    
        gotolabel('no')
    
      
    else 
        gotolabel('no1')
            
    end
    yet this does not seem to work

    It would be awesome action, preventing from spamming "hi" when npc is in another place at the moment



    _____________________SOLVED__________________________



    reachcreature('Sigurd')
    if maround(3, "Sigurd") > 0 then
    gotolabel("npc_visible4")
    else
    gotolabel("check_1")
    end
    ^ with this bot won't spam hi if npc isn't in reach even if npc is walking away ;D
    Last edited by Last11; 05-28-2014 at 01:45 PM.

  2. #2
    Moderator Furieri's Avatar
    Join Date
    Jun 2012
    Location
    Vitoria - ES / Brasil
    Posts
    792
    Mentioned
    62 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    199 Post(s)
    Reputation
    158
    Rep Power
    7
    Try it:
    Code:
    local NpcToReach = "Sigurd"
    
    if NpcToReach.isreachable() then
        reachcreature(NpcToReach)
        wait(600)
        gotolabel('Talk')  
    else 
        gotolabel('GoNPC')
    end

  3. #3
    iBot User
    Join Date
    May 2012
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    2 Post(s)
    Reputation
    10
    Rep Power
    5
    Quote Originally Posted by isaacbf View Post
    Try it:
    Code:
    local NpcToReach = "Sigurd"
    
    if NpcToReach.isreachable() then
        reachcreature(NpcToReach)
        wait(600)
        gotolabel('Talk')  
    else 
        gotolabel('GoNPC')
    end

    Nope, it does not work, lua error for trying to assign "null" to isreachable


    I can do rest like reachcreature after, but i can't make script get true or false respond for condition. To do one thing or another if it's not on screen, or not reachable.
    Last edited by Last11; 05-28-2014 at 12:43 PM.

  4. #4
    Moderator Furieri's Avatar
    Join Date
    Jun 2012
    Location
    Vitoria - ES / Brasil
    Posts
    792
    Mentioned
    62 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    199 Post(s)
    Reputation
    158
    Rep Power
    7
    Put NpcToReach.isreachable() == true

  5. #5
    Moderator Furieri's Avatar
    Join Date
    Jun 2012
    Location
    Vitoria - ES / Brasil
    Posts
    792
    Mentioned
    62 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    199 Post(s)
    Reputation
    158
    Rep Power
    7
    Worked?

  6. #6
    iBot User
    Join Date
    May 2012
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    2 Post(s)
    Reputation
    10
    Rep Power
    5
    I'm Getting still same error, that nill value can't be used for .isreachable action

    I found this thing in other topic from Support&Request

    It was written by blackw

    if target.isreachable == false
    then
    stopattack()
    end
    I just can't make it to work for npc name and my conditions
    Last edited by Last11; 05-28-2014 at 12:51 PM.

  7. #7
    iBot User
    Join Date
    May 2012
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    2 Post(s)
    Reputation
    10
    Rep Power
    5
    This is semi working

    local NpcToReach = "Sigurd"

    if maround("sigurd") > 0 then
    reachcreature(NpcToReach)
    wait(600)
    gotolabel('no')
    else
    gotolabel('no1')
    end
    I wanted for script to work like this, but npc must be reachable also
    Last edited by Last11; 05-28-2014 at 01:17 PM.

  8. #8
    Moderator Furieri's Avatar
    Join Date
    Jun 2012
    Location
    Vitoria - ES / Brasil
    Posts
    792
    Mentioned
    62 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    199 Post(s)
    Reputation
    158
    Rep Power
    7
    local NpcToReach = "Sigurd"

    reachcreature(NpcToReach)

    if getcreature(NpcToReach).isreachable() == true then
    wait(600)
    gotolabel('Talk')
    else
    gotolabel('GoNPC')
    end

  9. #9
    iBot User
    Join Date
    May 2012
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    2 Post(s)
    Reputation
    10
    Rep Power
    5
    Quote Originally Posted by isaacbf View Post
    local NpcToReach = "Sigurd"

    reachcreature(NpcToReach)

    if getcreature(NpcToReach).isreachable() == true then
    wait(600)
    gotolabel('Talk')
    else
    gotolabel('GoNPC')
    end
    It doesn't work, because it may seem like it works, but it doesn't do anything it just go to next label after this action it doesn't choose true or false

    there is error in lua, i fear that it may be more difficult than it seems
    Last edited by Last11; 05-28-2014 at 01:26 PM.

  10. #10
    Moderator Furieri's Avatar
    Join Date
    Jun 2012
    Location
    Vitoria - ES / Brasil
    Posts
    792
    Mentioned
    62 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    199 Post(s)
    Reputation
    158
    Rep Power
    7
    Im not at home to make tests =x but i do by other way buy last try

    ocal NpcToReach = "Sigurd"

    reachcreature(NpcToReach)

    if getcreature(NpcToReach).isreachable == true then
    wait(600)
    gotolabel('Talk')
    else
    gotolabel('GoNPC')
    end




    if it didn't work, what you do in this NPC?

Posting Permissions

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