Results 1 to 8 of 8

Thread: Alert on local chat, help me please.

  1. #1
    Normal User cowboy's Avatar
    Join Date
    May 2013
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    1 Post(s)
    Reputation
    10
    Rep Power
    4

    Alert on local chat, help me please.

    Hello,
    I need a script that will alert me if i will get new message on local chat. I written this alredy:
    PHP Code:
    if getnewmessages("Local Chat").count 0 then
                   playsound
    ("alert.wav")
    end 
    And it works fine, warring me every message, but i want it to ignore my spells and messages. Can anyone help me?

    @edit
    ohh and i know i can ignore myself in tibia ignore panel, but i dont want to, i want the script to ignore me.

  2. #2
    Normal User xavizus's Avatar
    Join Date
    Jun 2013
    Location
    Japan
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    18
    Rep Power
    4
    Quote Originally Posted by cowboy View Post
    Hello,
    I need a script that will alert me if i will get new message on local chat. I written this alredy:
    PHP Code:
    if getnewmessages("Local Chat").count 0 then
                   playsound
    ("alert.wav")
    end 
    And it works fine, warring me every message, but i want it to ignore my spells and messages. Can anyone help me?

    @edit
    ohh and i know i can ignore myself in tibia ignore panel, but i dont want to, i want the script to ignore me.
    It should be something like this:

    PHP Code:
    local msgs getmessages("Local Chat")
    local qtd msgs.count-1
    if(getnewmessages("Local Chat").count >0then
    for i0qtd do
        if(
    not msgs[qtd].sender == "Your name"then
            playsound
    ("alert.wav")
        
    end
        
    break
    end
    end 
    Last edited by xavizus; 06-17-2013 at 01:46 PM.

  3. #3
    Normal User cowboy's Avatar
    Join Date
    May 2013
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    1 Post(s)
    Reputation
    10
    Rep Power
    4
    yeah, dosent work for me too. maybe someone will know how to fix the script, i hope so

  4. #4
    iBot User Raph_'s Avatar
    Join Date
    Feb 2013
    Posts
    391
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    59
    Rep Power
    4
    Code:
    local msgs = getnewmessages("Local Chat")
    local msgsCount = msgs.count - 1
    
    for i = 0, msgsCount do
        if msgs[msgsCount - i] and msgs[msgsCount - i].sender ~= name then
            playsound("alert.wav")
            wait(500, 900)
        end
    end

  5. #5
    Normal User cowboy's Avatar
    Join Date
    May 2013
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    1 Post(s)
    Reputation
    10
    Rep Power
    4
    this one works perfectly!
    is there anyway to add some messages that would be excluded from triggering alarm? i mean a list so i could write all spells like "exura" etc etc so i would be only alerted if someone will talk to me.
    and one more question, when script is paused and then turned on again, it says "message" so many times that someone messaged me when script was paused, any idea to fix this?

    if you dont get it its like:

    botting in the botplace
    low supplies -> disabling script
    going to city, buying stuff, depositing, going back to exp
    on the botplace again ->enabling script and now bot turns the alert like 3454234 times : D

    now you surely understand : D
    @edit
    i just figured out that clearing the chat on startup of the script would work, simple as that, is there any function to do it?
    Last edited by cowboy; 06-17-2013 at 04:58 PM.

  6. #6
    iBot User Raph_'s Avatar
    Join Date
    Feb 2013
    Posts
    391
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    59
    Rep Power
    4
    Check this:
    Code:
    local words = {"exura", "utani hur"}
    local msgs = getnewmessages("Local Chat")
    local msgsCount = msgs.count - 1
    
    for i = 0, msgsCount do
    	if msgs[msgsCount - i] and msgs[msgsCount - i].sender ~= name then
    		for x = 1, #words do
    			if msgs[msgsCount - i]:find(words[x]) then
    				return
    			else
    				playsound("alarm.wav")
    				wait(300, 600)
    			end
    		end
    	end
    end

  7. #7
    Normal User cowboy's Avatar
    Join Date
    May 2013
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    1 Post(s)
    Reputation
    10
    Rep Power
    4
    after updating to tibia 10.02 and ibot 2.1.3 self ignore part of this script stopped working, no idea why :/

    @edit
    not only self ignore part works wrong, whole script is crazy now... what happened?
    Last edited by cowboy; 06-23-2013 at 01:07 PM.

  8. #8
    Normal User
    Join Date
    Dec 2013
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    3
    Would be great if somebody have a solution for this.
    I would appreciate it greatly.

Posting Permissions

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