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.

request (tcl script) please :)

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
A
Atomic
Voice
Posts: 25
Joined: Thu Jun 24, 2004 9:19 pm

request (tcl script) please :)

Post by Atomic »

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 :)
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Sure it's possible. Just make a bind and a proc and use

puthelp "PRIVMSG $target :\001SOUND filename\001"

Code: Select all

# 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.)
A
Atomic
Voice
Posts: 25
Joined: Thu Jun 24, 2004 9:19 pm

wow

Post by Atomic »

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?
Post Reply