| View previous topic :: View next topic |
| Author |
Message |
minted Halfop
Joined: 20 Jul 2005 Posts: 64
|
Posted: Fri Sep 16, 2005 6:19 pm Post subject: auto msg script |
|
|
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 |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Fri Sep 16, 2005 11:06 pm Post subject: |
|
|
| 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 |
|
 |
minted Halfop
Joined: 20 Jul 2005 Posts: 64
|
Posted: Sat Sep 17, 2005 1:24 am Post subject: |
|
|
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 |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sat Sep 17, 2005 1:52 am Post subject: |
|
|
| 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 |
|
 |
|
|
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
|
|