This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

How to msg more chans?

Help for those learning Tcl or writing their own scripts.
Post Reply
D
Danko
Voice
Posts: 18
Joined: Thu Mar 09, 2006 1:07 pm

How to msg more chans?

Post by Danko »

Let's say I have a small proc, and I want to msg the same to more than only one chan;

Code: Select all

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?
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

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...
D
Danko
Voice
Posts: 18
Joined: Thu Mar 09, 2006 1:07 pm

Post by Danko »

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: Select all

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)
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Code: Select all

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"
}
D
Danko
Voice
Posts: 18
Joined: Thu Mar 09, 2006 1:07 pm

Post by Danko »

Thank you. :D

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..? :?
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

bind dcc n hello hellodcc

proc hellodcc {hand idx arg} {
 # call your proc from here
}
Post Reply