mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2006
Posts: 14
N
negeren Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: Sep 2006
Posts: 14
on *:text:%Bid:%c-cha:{
if (%Bid > 0) && (%Bid < 21) {
set %Win $nick
set %Bid 0
.timer 1 0 /msg %c-cha 0,1 stop | .timer 1 2 /msg %c-cha 8,1 Stop | .timer 1 3 /msg %c-cha 7,1 STop | .timer 1 4 /msg %c-cha 4,1 STOp | .timer 1 5 /msg %c-cha 1,4 S-T-O-P 1,1.....10 we have a 4WINNER | /query $me $nick just won
}
}

the on text event will not respond to the variable I have tried:
on *:text:*%Bid*:%c-cha:{}
but it will not accept the variable and respond to the variabe anywhere in the channle text.

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Try:

on *:TEXT:$(%Bid):%c-cha:{


-genius_at_work

Joined: Sep 2006
Posts: 14
N
negeren Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: Sep 2006
Posts: 14
ok the:
on *,text,$(%bid),c-cha {
didn't work it is still not reponding if someone types:
it must be 3
or
3 is it
or
yes 3 it is

3 = %bid

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
TEXT events don't assume that you want to match words anywhere in a string of words.

on *:TEXT:$(%bid):%c-cha:{ will match exactly and only the contents of %bid. In your case, if someone says:

3

It will match. If they include any other words, it will no longer match.

To match other words, you need to add * wildcard characters around it. Example:

on *:TEXT:$($+(*,%bid,*)):%c-cha:{

This code has its problems as well. If someone says '3' or '33' it will match. The actual match is: 3 surrounded by ANY characters. More precise matches can be made by using regex.

-genius_at_work

Joined: Sep 2006
Posts: 14
N
negeren Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: Sep 2006
Posts: 14
wow that works
ahh I see thank you so can you tell me how I can refine it so I can filter out the kinda matches.
like
if variable = 3
and someone types :::::'/ 13 \':::::
it will not trigger
like capturing the trigger one space before and after
then setting it to a variable
so it would be %res = 13_
_ = space
so I can set it in a if then statment so it would be
if (%res == %Bid) {

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
try this:

on $*:TEXT:$($+(/\b,%bid,\b/)):%c-cha:{

-genius_at_work

Joined: Sep 2006
Posts: 14
N
negeren Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: Sep 2006
Posts: 14
omg that is perfect
Thank You sooo much


Link Copied to Clipboard