mIRC Homepage
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
To Identify:
Code:
if ($read(channels.txt,s,$chan)) { action }
To Add
Code:
on master:text:!setchan *:#: if ($2 ischan) { write channels.txt $2- }
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
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.
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.
Many thanks to all who replied, bot is now working in multiple chans

grin


Thanks again ......... wink
© mIRC Discussion Forums