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 

request (tcl script) please :)

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Atomic
Voice


Joined: 24 Jun 2004
Posts: 25

PostPosted: Wed Oct 04, 2006 10:36 am    Post subject: request (tcl script) please :) Reply with quote

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 Smile
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Wed Oct 04, 2006 12:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
Atomic
Voice


Joined: 24 Jun 2004
Posts: 25

PostPosted: Wed Oct 04, 2006 3:32 pm    Post subject: wow Reply with quote

hey rosc2112,

Thank you very much for your help..
it indeed does work perfectly.. Smile

i would have never got it working..
its way beyond my tcl abilities Smile

just need some flood protection in it now..
again thank you very much for your time spent doing it Smile

.....

so can anyone add some flood protection to it?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests 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