mIRC Home    About    Download    Register    News    Help

Print Thread
#26730 28/05/03 10:38 PM
Joined: May 2003
Posts: 9
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: May 2003
Posts: 9
Hi

with an on-text trigger ? is a wildcard -- is there any way to make mirc read it as a plain text chr.

I have tried:

on *:TEXT:$(? $+ blah):#:{

on *:TEXT:$($chr(63) $+ blah):#:{

and having set %test to ?blah:
on *:TEXT:%test:#:{

but none work, help would b gratefully recieved -- thank you

#26731 28/05/03 10:40 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
on *:TEXT:*:#:{
if (* isin $1-) {
blah
}
elseif (? isin $1-) {
blah
}
elseif (& isin $1-) {
blah
}
}
i didnt answer it correctly but that is what i use to use wildcards as normal text smile

Last edited by pheonix; 28/05/03 10:41 PM.

new username: tidy_trax
#26732 28/05/03 11:01 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
on 1:TEXT:*::#: {
if (?* iswm $1-) {
/set -u0 %command $remove($1, ?)
if (%command == op) { /mode $chan +ooo $2- }
else if (%command == deop) { /mode $chan -ooo $2- }
; etc
}
}


-KingTomato
#26733 28/05/03 11:01 PM
Joined: May 2003
Posts: 9
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: May 2003
Posts: 9
yes, thats what I'm using atm, i was just wondering if there was a way to do it in the trigger.

#26734 29/05/03 03:03 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
That doesn't help at all. His problem is that "?" is treated a wildcard char in the <matchtext> part of the on TEXT event. Well, "?" is treated as the same special char in a "iswm" comparison, so "if (?* iswm <something>) actually means "if <something> consists of one or more characters".

There are many ways to get around this. Personally I'd use something like:
Code:
on *:text:??*:#:{
  if $regex($1,/^\?+(.+)/) {
    var %command = $regml(1)
    if %command == this { do this }
    elseif %command == that { do that }
    .....
  }
}


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com

Link Copied to Clipboard