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.

auto msg script

Old posts that have not been replied to for several years.
Locked
m
minted
Halfop
Posts: 64
Joined: Wed Jul 20, 2005 9:58 am

auto msg script

Post by minted »

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 :]
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Code: Select all

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

 tag when posting logs, code
m
minted
Halfop
Posts: 64
Joined: Wed Jul 20, 2005 9:58 am

Post by minted »

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.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Code: Select all

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

 tag when posting logs, code
Locked