Results 1 to 4 of 4

Thread: if "x" message from "y" player on local chat then gotolabel("z")

  1. #1
    Focus Group kamil123's Avatar
    Join Date
    Apr 2012
    Location
    Poland
    Posts
    342
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    18 Post(s)
    Reputation
    106
    Rep Power
    6

    if "x" message from "y" player on local chat then gotolabel("z")

    hello i need hotkey as listed in title.
    PHP Code:
    if
    getnewmessages("local chat").text:find("x") and
    .
    sender "y" and

    then
    gotolabel
    ("z")
    end 
    Last edited by kamil123; 09-14-2013 at 09:38 AM.

  2. #2
    Focus Group Gryllz's Avatar
    Join Date
    Jun 2012
    Location
    Dubai
    Posts
    3,482
    Mentioned
    89 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    236 Post(s)
    Reputation
    342
    Rep Power
    10
    PHP Code:
    local MESSAGES getnewmessages("Y"
    local MESSAGES_COUNT MESSAGES.count 1    

    for INDEX 0MESSAGES_COUNT do    
    if (
    MESSAGES[MESSAGES_COUNT INDEX].text:find("X")) then    
        gotolabel
    ("Z")   
    end    
    end 
    I have just tested it, it works but only if you have opened a chat with character "Y".

  3. #3
    Focus Group kamil123's Avatar
    Join Date
    Apr 2012
    Location
    Poland
    Posts
    342
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    18 Post(s)
    Reputation
    106
    Rep Power
    6
    it works, thanks ;d

    althought it would be nice if it also worked if private channel with player "Y" isn't opened :P

    You must spread some Reputation around before giving it to Gryllz again.

  4. #4
    iBot User
    Join Date
    May 2012
    Location
    Spain
    Posts
    213
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    15 Post(s)
    Reputation
    32
    Rep Power
    5
    it should work, I did not test but if isnt then just reply me..

    local NAMES = {"Name of the character"}
    local PRIVATEMESS = 'here the message'
    local LABEL = 'y'

    for MESSAGE in Message.GetAll("Local Chat")
    do
    for x = 1, #NAMES
    do
    if MESSAGE:SenderName():find(NAMES[x])
    then
    focusclient()
    System.Wait(100, 300)
    if (MESSAGES[MESSAGES_COUNT - INDEX].text:find(PRIVATEMESS))
    then
    gotolabel(LABEL)
    end
    System.Wait(1000, 2000)
    end
    end
    end


    Regards, NWA
    Last edited by NWA; 09-14-2013 at 11:28 AM.
    Regards, NWA

Posting Permissions

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