PtokaX forum

Lua 5.3/5.2/5.1 Scripts (for PtokaX 0.4.0.0 and newer) => Help with scripts => Topic started by: deseven on 11 May, 2011, 12:00:51

Title: multiple ChatArrival
Post by: deseven on 11 May, 2011, 12:00:51
Hello.

How can i block user message completely when using multiple ChatArrival in different scripts?

For example:

script #1

function ChatArrival(user,data)
  if `something` then
    return Core.SendToUser(user,"<bot> You can't write that."),true
  end
end


script #2

function ChatArrival(user,data)
  if `something else` then
    return Core.SendToAll("<"..user.sNick.."> blah-blah-blah"),true
  end
end


First script will block the message, but the second one will send the message anyway. How can i avoid that?
Title: Re: multiple ChatArrival
Post by: the-master on 12 May, 2011, 06:05:51
If the first script blocks the message, the second script wont have any chatarrival and wont be triggered to reply.
Title: Re: multiple ChatArrival
Post by: deseven on 12 May, 2011, 09:06:48
Thank you for giving me a clue :)
That was just about the order of the scripts - first script must be on top of any others in the Scripts.xml

Closed.