| View previous topic :: View next topic |
| Author |
Message |
Atomic Voice
Joined: 24 Jun 2004 Posts: 25
|
Posted: Wed Oct 04, 2006 10:36 am Post subject: request (tcl script) please :) |
|
|
ok i am requesting this tcl script as its proving to difficult for me..
its kinda lame i know... but.. i guess it could be funny..
i have a funbot in my channel called R2-D2 he does various things..
what i want him to do is send a fake sound event to the channel
like when you do /sound filename.wav.mp3 in mirc.. if the person
has this sound file they hear it..
so the trigger would be !sound filename.wav or .mp3 then the bot
would send this fake signal to the channel.. i think its a ctcp channel sound filename..
after a person does a !sound.. they are ignored for 30 seconds to stop spamming of sounds..
i have collected a few sound files for R2-D2 his silly noises ect..
i want the bot to also trigger a random sound from a list i can modify
and output this to the channel as a /sound event.... at random intervals
i have tried doing this script myself doing it a few different ways...
but i cant seem to get this working.. is this even possible on eggdrops?
ty for anyone that will help me with this tcl  |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Wed Oct 04, 2006 12:56 pm Post subject: |
|
|
Sure it's possible. Just make a bind and a proc and use
puthelp "PRIVMSG $target :\001SOUND filename\001"
| Code: |
# available sounds:
set mysounds "filename1.wav filename2.mp3 filename3 etc"
# channels we want to annoy with noise:
set mychannels "#mychannel1 #chan2 #etc"
# how many minutes to set the noise timer
set noisetime 5
bind pub - !noise noiseproc
proc noiseproc {nick uhost hand chan text} {
global mysounds mychannels
if {[lsearch -exact $mychannels $chan] == -1} {return}
set text [string trim $text];set text [split $text]
if {[lsearch -exact $mysounds $text] != -1} {
puthelp "PRIVMSG $chan :\001SOUND $text\001"
} else {
puthelp "PRIVMSG $chan :I don't have that sound.."
}
}
proc randomnoisetimer {} {
global mysounds mychannels noisetime
set randsounds [lindex $mysounds [rand [llength $mysounds]]]
foreach channel $mychannels {
puthelp "PRIVMSG $channel :\001SOUND $randsounds\001"
}
if {![string match "*randomnoisetimer*" [timers]]} {timer $noisetime randomnoisetimer}
}
# start the randomnoisetimer when the script is rehashed/reloaded
if {![string match "*randomnoisetimer*" [timers]]} {timer $noisetime randomnoisetimer}
###############################################################################################
|
I didn't do the anti-flood control, someone else might be able to contribute a decent/simple method of flood control for this (the ones I have for reference are probably too complicated for such a simple script.) |
|
| Back to top |
|
 |
Atomic Voice
Joined: 24 Jun 2004 Posts: 25
|
Posted: Wed Oct 04, 2006 3:32 pm Post subject: wow |
|
|
hey rosc2112,
Thank you very much for your help..
it indeed does work perfectly..
i would have never got it working..
its way beyond my tcl abilities
just need some flood protection in it now..
again thank you very much for your time spent doing it
.....
so can anyone add some flood protection to it? |
|
| Back to top |
|
 |
|