| View previous topic :: View next topic |
| Author |
Message |
Danko Voice
Joined: 09 Mar 2006 Posts: 18
|
Posted: Wed Jun 21, 2006 4:56 am Post subject: How to msg more chans? |
|
|
Let's say I have a small proc, and I want to msg the same to more than only one chan;
| Code: | bind pub !hello hellotest
set mychans "#chan1 #chan2" (??!)
proc delpre {nick host hand channel arg} {
global mychans
set input [lindex [split $arg] 1]
putquick "PRIVMSG $mychans :Abcedf $input"
}
|
When I'm using this my bot only msg to #chan1 with text #chan2.. A solution would ofcourse be to add yet another putquick privmsg line, but I'd like to avoid that.. Any tips? |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Wed Jun 21, 2006 5:00 am Post subject: |
|
|
use "," instead of " " to seperate channels. please note that the maximum channels to send to at once is determined by "maxtargets" (can be seen while connection in raw log). Also addional spam detection might be installed for multitarget messages (like immediatly terminate connection on advertising URLs, channel names, in color or whatever). _________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
| Back to top |
|
 |
Danko Voice
Joined: 09 Mar 2006 Posts: 18
|
Posted: Wed Jun 21, 2006 5:22 am Post subject: |
|
|
Ahh, i see now why it didnt work with "," as chan seperator also, but thats prolly because I was testing on a server with maxtargets=1.
However, seems like MAXTARGETS=4 is pretty usual among servers.
Lets say i for example want to msg to 12 chans, could i just do something like;
| Code: |
set mychans(1) "#chan1,#chan2,#chan3,#chan4"
set mychans(2) "#chan5,#chan6,#chan7,#chan8"
set mychans(2) "#chan9,#chan10,#chan11,#chan12"
...
putquick "PRIVMSG $mychans(1) :Abcedf $input"
putquick "PRIVMSG $mychans(2) :Abcedf $input"
putquick "PRIVMSG $mychans(3) :Abcedf $input"
|
Would that be the easiest solution, or would it be any better way to do it?
(dont think about flood etc, i'm just thinking in general) |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Wed Jun 21, 2006 10:55 am Post subject: |
|
|
| Code: | set mychans(1) "#chan1,#chan2,#chan3,#chan4"
set mychans(2) "#chan5,#chan6,#chan7,#chan8"
set mychans(3) "#chan9,#chan10,#chan11,#chan12"
for {set i 1} {$i < [array size mychans]} {incr i} {
putquick "PRIVMSG $mychans($i) :bla bla"
}
|
|
|
| Back to top |
|
 |
Danko Voice
Joined: 09 Mar 2006 Posts: 18
|
Posted: Wed Jun 21, 2006 11:17 am Post subject: |
|
|
Thank you.
One last Q; If I also want to be able to use the command from partyline (.hello ..), what do I have to add? coz "proc myproc {n h h c a}" wont work from partyline, right..?  |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Wed Jun 21, 2006 7:09 pm Post subject: |
|
|
| Code: | bind dcc n hello hellodcc
proc hellodcc {hand idx arg} {
# call your proc from here
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|