mIRC Home    About    Download    Register    News    Help

Print Thread
Bot in multiple chans - how to control all chans #121689
31/05/05 03:29 AM
31/05/05 03:29 AM
Joined: Oct 2004
Posts: 11
Australia , Adelaide
R
Rhino Offline OP
Pikka bird
Rhino  Offline OP
Pikka bird
R

Joined: Oct 2004
Posts: 11
Australia , Adelaide
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

Re: Bot in multiple chans - how to control all cha #121690
31/05/05 04:43 AM
31/05/05 04:43 AM
Joined: Feb 2005
Posts: 194
Georgia, USA
A
alhammer Offline
Vogon poet
alhammer  Offline
Vogon poet
A

Joined: Feb 2005
Posts: 194
Georgia, USA
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.
Re: Bot in multiple chans - how to control all cha #121691
01/06/05 03:23 AM
01/06/05 03:23 AM
Joined: Oct 2004
Posts: 11
Australia , Adelaide
R
Rhino Offline OP
Pikka bird
Rhino  Offline OP
Pikka bird
R

Joined: Oct 2004
Posts: 11
Australia , Adelaide
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

Re: Bot in multiple chans - how to control all chans #121692
01/06/05 04:36 AM
01/06/05 04:36 AM
Joined: Aug 2004
Posts: 7,252
Ontario, Canada
R
RusselB Offline
Hoopy frood
RusselB  Offline
Hoopy frood
R

Joined: Aug 2004
Posts: 7,252
Ontario, Canada
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.

Re: Bot in multiple chans - how to control all cha #121693
01/06/05 08:16 PM
01/06/05 08:16 PM
Joined: Mar 2005
Posts: 420
X
xDaeMoN Offline
Fjord artisan
xDaeMoN  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!
Re: Bot in multiple chans - how to control all cha #121694
03/06/05 03:42 AM
03/06/05 03:42 AM
Joined: Oct 2004
Posts: 11
Australia , Adelaide
R
Rhino Offline OP
Pikka bird
Rhino  Offline OP
Pikka bird
R

Joined: Oct 2004
Posts: 11
Australia , Adelaide
Many thanks to all who replied, bot is now working in multiple chans

grin


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