mIRC Home    About    Download    Register    News    Help

Print Thread
#139051 10/01/06 01:03 AM
Joined: Jan 2006
Posts: 2
J
Bowl of petunias
OP Offline
Bowl of petunias
J
Joined: Jan 2006
Posts: 2
I'm attempting to create a bot that will do a few things. I'm stuck on one thing.

When I type something like ?announce blah blah blah i want another client that i am configuring to relay it. The problem Im' having is that I can not find the correct variable to identify what was typed, this is what I have...

on *:TEXT:?announce DONT KNOW WHAT SHOULD BE HERE TO REPRESENT THE TEXT:#channel:/amsg DONT KNOW WHAT SHOULD BE HERE TO REPRESENT THE TEXT

Thanks in advance

#139052 10/01/06 01:19 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
What you're looking for are the $2- identifier(s)

Code:
 on *:text:?announce &*:*:{ .amsg $2- } 


A person types ?announce announcement here
The bot sends the message
Quote:
announcement here
to all channels that it is in for that network. Note that this is only for a single network

#139053 10/01/06 01:26 AM
Joined: Jan 2006
Posts: 2
J
Bowl of petunias
OP Offline
Bowl of petunias
J
Joined: Jan 2006
Posts: 2
That doesn't do anything frown

#139054 10/01/06 04:13 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I wasn't able to test the code the first time, but this time I was. The problem is the usage of the ? in the command line

Code:
on *:text:!announce &*:*:{ .amsg $2- }  


That will work, but you have to use the ! rather than the ?

I think the reason for this is because the ? acts as a single character wildcard in the match text events.

#139055 10/01/06 05:11 AM
Joined: Mar 2005
Posts: 212
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
is there a way around that
lets say someone was really intent on using ?
could using $chr() go around that or is there no

just curious
also ? indicating a wild single character in macth text i would imagine would have made it work in more situations than desired rather than none but i guess id be wrong

Last edited by NeUtRoN_StaR; 10/01/06 05:13 AM.
#139056 10/01/06 07:48 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I wasn't able to find a work around for it, and I also thought that it would work as you suggested, with the first character being irrelevant, but testing proved otherwise.

#139057 10/01/06 10:33 AM
Joined: Mar 2005
Posts: 212
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
interesting.

#139058 10/01/06 12:00 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
on *:TEXT:$($+($chr(63),announce *)):*:{ .amsg $2- }

That should work for "?announce <one or more characters>", however i dont know if /AMSG is the desired command of course frown

#139059 10/01/06 11:37 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I'm presuming that /amsg is the command they want, since that's the command they gave in the original post.


Link Copied to Clipboard