egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to msg more chans?

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Danko
Voice


Joined: 09 Mar 2006
Posts: 18

PostPosted: Wed Jun 21, 2006 4:56 am    Post subject: How to msg more chans? Reply with quote

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
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Wed Jun 21, 2006 5:00 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Danko
Voice


Joined: 09 Mar 2006
Posts: 18

PostPosted: Wed Jun 21, 2006 5:22 am    Post subject: Reply with quote

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
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Wed Jun 21, 2006 10:55 am    Post subject: Reply with quote

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
View user's profile Send private message
Danko
Voice


Joined: 09 Mar 2006
Posts: 18

PostPosted: Wed Jun 21, 2006 11:17 am    Post subject: Reply with quote

Thank you. Very Happy

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..? Confused
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Jun 21, 2006 7:09 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
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


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber