mIRC Homepage

Bot in multiple chans - how to control all chans

Posted By: Rhino

Bot in multiple chans - how to control all chans - 31/05/05 03:29 AM

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
Posted By: alhammer

Re: Bot in multiple chans - how to control all cha - 31/05/05 04:43 AM

To Identify:
Code:
if ($read(channels.txt,s,$chan)) { action }
To Add
Code:
on master:text:!setchan *:#: if ($2 ischan) { write channels.txt $2- }
Posted By: Rhino

Re: Bot in multiple chans - how to control all cha - 01/06/05 03:23 AM

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
Posted By: RusselB

Re: Bot in multiple chans - how to control all chans - 01/06/05 04:36 AM

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.
Posted By: xDaeMoN

Re: Bot in multiple chans - how to control all cha - 01/06/05 08:16 PM

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.
Posted By: Rhino

Re: Bot in multiple chans - how to control all cha - 03/06/05 03:42 AM

Many thanks to all who replied, bot is now working in multiple chans

grin


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