mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2004
Posts: 11
R
Rhino Offline OP
Pikka bird
OP Offline
Pikka bird
R
Joined: Oct 2004
Posts: 11
I have a bot script, I want it to control more than 1 chan, atm, I can only set 1 chan as "controlchannel"

how can I modify this script, to accomodate multiple chans, when bot is in these chans

on master:text:!setchan*:$chan: if ($2 ischan) { set %controlchan $2 }

any help would be greatly appreciated

Thanks in advance confused

Joined: Feb 2005
Posts: 194
A
Vogon poet
Offline
Vogon poet
A
Joined: Feb 2005
Posts: 194
To Identify:
Code:
if ($read(channels.txt,s,$chan)) { action }
To Add
Code:
on master:text:!setchan *:#: if ($2 ischan) { write channels.txt $2- }

Last edited by alhammer; 31/05/05 04:45 AM.
Joined: Oct 2004
Posts: 11
R
Rhino Offline OP
Pikka bird
OP Offline
Pikka bird
R
Joined: Oct 2004
Posts: 11
I cant seem to get it to work, confused

I modded the script line, but it seems to only work in 1 chan,

any other suggestions would be greatly appreciated

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
on master:text:!setchan*:#:{ if $2 ischan { set %controlchan $addtok(%controlchan,$2,32) } }  


That'll keep a record of all of the control channels in the one variable, with each channel separated with a space character. Note mIRC has a limitation of about 900 characters for a single variable, so I don't suggest you get rooms/channels with very long names.

I also changed the $chan in the ON TEXT event to # per mIRC help for the ON TEXT event.

Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
You could also do this

Code:
 on master:text:!setchan*:%controlchan: { if $2 ischan { set %controlchan $addtok(%controlchan,$2,44) } } 


So the trigger/command would only work on the control channels.


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
Joined: Oct 2004
Posts: 11
R
Rhino Offline OP
Pikka bird
OP Offline
Pikka bird
R
Joined: Oct 2004
Posts: 11
Many thanks to all who replied, bot is now working in multiple chans

grin


Thanks again ......... wink


Link Copied to Clipboard