mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2022
Posts: 15
M
Pikka bird
OP Offline
Pikka bird
M
Joined: Dec 2022
Posts: 15
I have a simple script:
Code
on *:TEXT:sample:#: {
  echo -a Hi.
}

Quite simple.
If I'm in a channel and type the trigger word: “sample” in this case, the even is not fired.
If another person in the channel types the word the event is fired.

Is this a configuration setting that I forgot to flip or is it a known bug?

Joined: Jul 2006
Posts: 4,180
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,180
That's by design, the on text event triggers as a result of receiving a privmsg from the server, when you send a message to a channel, you don't get (receive) a privmsg from the server, you're only sending one.
That's for channel: If you test this with private message, because in this case you receive a privmsg from the server, on text will trigger for your own text.

You can use the on input event to react to your own message, typical structure will look like this:

Code
on *:text:the_trigger:#:{ do_trigger $nick $chan }
on *:input:#:if ($1- == the_trigger) { do_trigger $me $chan }
alias do_trigger { echo -ag $1 triggered the code on $2 }


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2022
Posts: 15
M
Pikka bird
OP Offline
Pikka bird
M
Joined: Dec 2022
Posts: 15
The moment I clicked send in the post, I remembered. 😛


Link Copied to Clipboard