mIRC Home    About    Download    Register    News    Help

Print Thread
#161356 06/10/06 11:36 AM
Joined: Mar 2003
Posts: 27
Z
zorin Offline OP
Ameglian cow
OP Offline
Ameglian cow
Z
Joined: Mar 2003
Posts: 27
If i have a on text string like
On *:TEXT:hi:#channel:/msg $nick hi

But if that user uses color, it wont be recognized
I was thinking something like

On *:TEXT:$strip(hi):#channel:/msg $nick hi

But i guess im far off

Joined: Sep 2003
Posts: 58
S
Babel fish
Offline
Babel fish
S
Joined: Sep 2003
Posts: 58
Maybe this will do the trick..

ON *:TEXT:*:#: {
$text = $strip($1-,burc)
if (hi isin $text) { msg $nick hi }
}

At least this will ignore any text on the beginning and the end of hi..
But it will also run on words like "high"

I've been out of the scripting business for a while now, but maybe this will word..

You could've found it to if you used the search option wink

Grtzzz


***************************
To chat, or not to chat.
That's the question
Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
Code:
 On *:TEXT:*:#Channel: {
 if ( $strip($1-) == hi ) msg $nick hi
} 


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
Maybe you mean %text instead of $text.


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Quote:
If i have a on text string like
On *:TEXT:hi:#channel:/msg $nick hi

But if that user uses color, it wont be recognized
I was thinking something like

On *:TEXT:$strip(hi):#channel:/msg $nick hi

But i guess im far off


I don't see a reason why you should be using the strip command since you can check if hi isin $1 since its most unlikely to be high or a word with hi in it opposed to being hi itself you dont need strip but if of course you dont feel safe about it then iswm could be another eval

On *:TEXT:*:#:if hi isin $1 msg # Hi $nick

OR

On *:TEXT:*:#:if hi iswm $strip($1) msg # Hi $nick


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Code:
on *:text:*:#channel:if $strip($1-) == hi { msg $nick hi }


Or a regex match
Code:
on $*:text:/^hi$/Si:#channel:msg $nick hi

The Si is Strip and case-insensitive.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Even if it's unlikely, why not use $strip? Just wondering why you would choose not to. smile

And, why iswm in your $strip version instead of if $strip($1-) == hi ?

zorin, just so you know... the reason you can't use $strip in the on text line that you mentioned is because it would just be matching when it is hi (stripped of codes). It's not stripping the incoming text, but just the text in the on text line, if that makes sense. smile


Invision Support
#Invision on irc.irchighway.net
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
just for a gag he could do it with.

On *:TEXT:$($iif(hi isin $strip($1-),*)):#channel:/msg $nick hi

(untested)

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Hm... didn't think about doing something like that in the on text line. I think that would be confusing to debug in a large script, though. laugh


Invision Support
#Invision on irc.irchighway.net
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Ill tell the truth, its also exptremly resource hoggy, since the match text section is done before the channel match is done, so it would do a strip on $1- and then a iswm on that and evalaute the $iif to its result, then employ it against the original $1 (be it $null or *) and if it matched then check if the channel matched. Which OOOOPS it didnt! LOL!


Link Copied to Clipboard