mIRC Homepage
Posted By: JonEdney Messege Transfer Script - 10/01/06 01:03 AM
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
Posted By: RusselB Re: Messege Transfer Script - 10/01/06 01:19 AM
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
Posted By: JonEdney Re: Messege Transfer Script - 10/01/06 01:26 AM
That doesn't do anything frown
Posted By: RusselB Re: Messege Transfer Script - 10/01/06 04:13 AM
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.
Posted By: NeUtRoN_StaR Re: Messege Transfer Script - 10/01/06 05:11 AM
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
Posted By: RusselB Re: Messege Transfer Script - 10/01/06 07:48 AM
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.
Posted By: NeUtRoN_StaR Re: Messege Transfer Script - 10/01/06 10:33 AM
interesting.
Posted By: DaveC Re: Messege Transfer Script - 10/01/06 12:00 PM
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
Posted By: RusselB Re: Messege Transfer Script - 10/01/06 11:37 PM
I'm presuming that /amsg is the command they want, since that's the command they gave in the original post.
© mIRC Discussion Forums