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 

auto msg script

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
minted
Halfop


Joined: 20 Jul 2005
Posts: 64

PostPosted: Fri Sep 16, 2005 6:19 pm    Post subject: auto msg script Reply with quote

i need a lil tcl that will send preset messages to certain channels every 20 mins or so. e.g
bot sends msg1 to #chan1,#chan2,#chan3
20 mins later...
bot sends msg2 to #chan1,#chan2,#chan3
20 mins later...etc

theres similar scripts in the tcl archive, but they would all send msg1 msg2 msg3 at the same time.

i hope my explanation isnt too confusing, and tnx in advance :]
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Fri Sep 16, 2005 11:06 pm    Post subject: Reply with quote

Code:

set idx -1
set chans {#chan1 #chan2 #chan3}
set msgs {"spam 1" "spam 2" "spam 3"}
bind time - * foo
proc foo {m args} {
   if {$m!="08" && $m!="09" && $m%20==0} {
      foreach c $::chans {
         puthelp "privmsg $c :[lindex $::msgs [incr ::idx]]"
      }
   }
}

this should be optimized to support ircds with multiple PRIVMSG targets but I can't be bothered with that
_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
minted
Halfop


Joined: 20 Jul 2005
Posts: 64

PostPosted: Sat Sep 17, 2005 1:24 am    Post subject: Reply with quote

tnx demond, its almost what i want.
im not too good at explaining.
with that code, it sends msg1 to chan1, msg2 to chan2, etc
i want, msg1 to all chosen chans, msg 2 to all chosen chans, etc
about 20 mins between each msg.
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sat Sep 17, 2005 1:52 am    Post subject: Reply with quote

Code:

set idx 0
set msgs {"spam 1" "spam 2" "spam 3"}
set chans(0) {#chan1 #chan2} ;# chans for msg1
set chans(1) {#chan3 #chan4} ;# chans for msg2
set chans(2) {#chan5 #chan6} ;# chans for msg3
bind time - * foo
proc foo {m args} {
   if {$m!="08" && $m!="09" && $m%20==0} {
      foreach c $::chans($::idx) {
         puthelp "privmsg $c :[lindex $::msgs $::idx]"
      }
      if {[incr ::idx] == [llength $::msgs]} {set ::idx 0}
   }
}

_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive 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