mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2010
Posts: 5
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Aug 2010
Posts: 5
Hi, hi, I have a very nubish scripting question. I want to do something similar to this: I want someone to be able to do !trigger nickhere and have the event trigger on the person listed. I’ve tried doing it myself with on text, but seem to be failing hard. was wondering if I could get some help smile

Code:
on *:text:!trigger:#Channel: {
  bs act $chan actionhere $2
}


and variations using aliases is what I've been trying and no luck (as you probably know already)

Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Your problem is that your matchtext section contains no wildcard. Therefore your on TEXT event is only triggering on !trigger without anything else after it.

Code:
on *:TEXT:!trigger *:#chan: bs act $chan actionhere $2 

If you want to improve the code a little, you could use:
Code:
on *:TEXT:!trigger *:#chan: if ($2 ison $chan) bs act $chan actionhere $2

The if-statement makes sure parameter $2 is a nick on the given channel.

Joined: Aug 2010
Posts: 5
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Aug 2010
Posts: 5
many thanks, working perfectly! laugh

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
It'd be better you use the $strip, because if someone uses control codes, and your mIRC doesn't have the incoming text stripped, your code won't get triggered:
Code:
on *:TEXT:*:#chan:{
  if (!%c) {
    set -u5 %c 1
    if ($strip($1) == !trigger) && ($2 ison $chan) {
      bs act $chan actionhere $2
    }
  }
}
A little trigger flood control is suggested in case of spam or flood abuse.


Link Copied to Clipboard