Author Topic: multiple ChatArrival  (Read 2175 times)

0 Members and 1 Guest are viewing this topic.

Offline deseven

  • Junior Member
  • **
  • Posts: 20
  • Karma: +4/-2
multiple ChatArrival
« 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
Code: [Select]
function ChatArrival(user,data)
  if `something` then
    return Core.SendToUser(user,"<bot> You can't write that."),true
  end
end

script #2
Code: [Select]
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?

PtokaX forum

multiple ChatArrival
« on: 11 May, 2011, 12:00:51 »

Offline the-master

  • Triple Ace
  • **
  • Posts: 229
  • Karma: +10/-15
Re: multiple ChatArrival
« Reply #1 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.
keep on sharing :)
dchub://kickincountryhub.no-ip.org

Offline deseven

  • Junior Member
  • **
  • Posts: 20
  • Karma: +4/-2
Re: multiple ChatArrival
« Reply #2 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.

PtokaX forum

Re: multiple ChatArrival
« Reply #2 on: 12 May, 2011, 09:06:48 »