Results 1 to 4 of 4

Thread: Action if msg in NPC channel x then goto x if other msg then just conitnue

  1. #1
    iBot User
    Join Date
    May 2012
    Posts
    79
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    4 Post(s)
    Reputation
    9
    Rep Power
    0

    Action if msg in NPC channel x then goto x if other msg then just conitnue

    Hello.
    I need action that if I write sth in NPC channel and im gonna have answer x then it goes to x wpt, if i got answer y then it just continue. I dont know if i msg it clear what i got in mind but I hope so u understand.

  2. #2
    Normal User mattos123's Avatar
    Join Date
    Sep 2012
    Location
    Brasil
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    12
    Rep Power
    5
    wait(3000) 
    local npcname = 'NPC NAME'
    local index = 0
    local msgs = getmessages("NPCs")
    local qtd = msgs.count-1
    for i=0,qtd do
    if msgs[qtd].sender == npcname and msgs[qtd].text:find('NPC MESSAGE !!!!') then
    gotolabel('LABEL HERE')
    else
    gotolabel('LABEL BEFORE NPC TALKING')
    end
    end
    Se ontem fosse anti-ontem, e hoje fosse ontem, hoje seria oque ?





    ~O amanhã


  3. #3
    iBot User
    Join Date
    May 2012
    Posts
    79
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    4 Post(s)
    Reputation
    9
    Rep Power
    0
    This is normal action or action to cavebot, cuz I dont understand it well

  4. #4
    Normal User
    Join Date
    Feb 2013
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    4
    Quote Originally Posted by mattos123 View Post
    wait(3000) 
    local npcname = 'NPC NAME'
    local index = 0
    local msgs = getmessages("NPCs")
    local qtd = msgs.count-1
    for i=0,qtd do
    if msgs[qtd].sender == npcname and msgs[qtd].text:find('NPC MESSAGE !!!!') then
    gotolabel('LABEL HERE')
    else
    gotolabel('LABEL BEFORE NPC TALKING')
    end
    end
    This action will only look at one single (the most recent) message that is returned by getnewmessages. Shouldn't it be if msgs[qtd-i]

Posting Permissions

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