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.
Old posts that have not been replied to for several years.
kevie
Voice
Posts: 12 Joined: Tue Jun 10, 2003 3:45 am
Post
by kevie » Tue Jun 10, 2003 3:49 am
Hi, i would like to know how could i get a simple tcl script which enables the eggdrop to voice the user when he say certain line in the channel?
mortician
Voice
Posts: 37 Joined: Sun Sep 22, 2002 6:35 pm
Location: Tsjakamaka
Contact:
Post
by mortician » Tue Jun 10, 2003 3:58 am
Use a pubm bind
Code: Select all
set line "line to say"
bind pubm - "*$line*" voiceUser
proc voiceUser {nick uhost hand channel rest} {
putserv "MODE $channel +v :$nick"
}
It is a mistake to think you can solve any major problems just with potatoes.
kevie
Voice
Posts: 12 Joined: Tue Jun 10, 2003 3:45 am
Post
by kevie » Tue Jun 10, 2003 4:15 am
How do i add a reply to the user who was voiced?
Something like this? :
#puthelp "PRIVMSG $nick :you have been voiced in $chan"
mortician
Voice
Posts: 37 Joined: Sun Sep 22, 2002 6:35 pm
Location: Tsjakamaka
Contact:
Post
by mortician » Tue Jun 10, 2003 4:34 am
yup (if you remove that # off course
)
Oh, and the channel parameter in my proc is $channel and not $chan ...
It is a mistake to think you can solve any major problems just with potatoes.
kevie
Voice
Posts: 12 Joined: Tue Jun 10, 2003 3:45 am
Post
by kevie » Tue Jun 10, 2003 5:01 am
Thanks so much. Just wonder how could i add a timer to it? like if the voiced user did not say the "something" within 30mins, it will devoice them.
ReaLz
Op
Posts: 121 Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece
Post
by ReaLz » Tue Jun 10, 2003 5:47 am
heh..... check this:
Code: Select all
## Settings
set line "line to say"
set phrase "phrase to say not to be devoiced"
set channel "#channel"
## Binds
bind pubm - "*$line*" voiceUser
bind time - "00 * * * *" time_proc
bind time - "30 * * * *" time_proc
bind pubm - "*$phrase" saveUser
## Code
proc voiceUser {nick uhost hand channel rest} {
putserv "MODE $channel +v :$nick"
puthelp "NOTICE $nick :You've just been voiced, remember to say $phrase in 30 minutes to avoid getting devoiced"
return
}
proc time_proc {min hour day month year} {check_word}
proc check_word {} {
if {![botisop $::channel]} {
putlog "I'm not oped in $::channel."
}
foreach user [chanlist $::channel] {
if {[isvoice $user $::channel]} {
set hand [nick2hand $user]
if {[matchattr $hand S]} {
return
}
pushmode $::channel -v $user
}
}
}
proc saveUser {nick chan hand idx args} {
if {[validuser $hand]} {
chattr $hand +S
return
}
adduser $nick
chattr $nick +S
}
«A fantastic spaghetti is a spaghetti that does not exist»
kevie
Voice
Posts: 12 Joined: Tue Jun 10, 2003 3:45 am
Post
by kevie » Tue Jun 10, 2003 7:18 am
ReaLz, I have no prob with those lines concerning the voicing of users saying the line, but the bot wun devoice them when they didnt repeat that line for more than 30 minutes.
ReaLz
Op
Posts: 121 Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece
Post
by ReaLz » Tue Jun 10, 2003 7:57 am
uhm yes you're right...
change the time_proc with this:
proc time_proc {min hour day month year} {check_word}
proc check_word {} {
if {![botisop $::channel]} {
putlog "I'm not oped in $::channel."
}
foreach user [chanlist $::channel] {
if {[isvoice $user $::channel]} {
set hand [nick2hand $user]
if {[matchattr $hand S]} {
chattr $hand -S
return
}
pushmode $::channel -v $user
}
}
}
«A fantastic spaghetti is a spaghetti that does not exist»
ReaLz
Op
Posts: 121 Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece
Post
by ReaLz » Tue Jun 10, 2003 7:58 am
uhm yes you're right...
change the time_proc with this:
Code: Select all
proc time_proc {min hour day month year} {check_word}
proc check_word {} {
if {![botisop $::channel]} {
putlog "I'm not oped in $::channel."
}
foreach user [chanlist $::channel] {
if {[isvoice $user $::channel]} {
set hand [nick2hand $user]
if {[matchattr $hand S]} {
chattr $hand -S
return
}
pushmode $::channel -v $user
}
}
}
«A fantastic spaghetti is a spaghetti that does not exist»
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Tue Jun 10, 2003 8:00 am
Please avoid repeating/posting the same topic.
Once the game is over, the king and the pawn go back in the same box.
ReaLz
Op
Posts: 121 Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece
Post
by ReaLz » Tue Jun 10, 2003 8:01 am
oops.. I clicked the Back button
«A fantastic spaghetti is a spaghetti that does not exist»
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Tue Jun 10, 2003 9:08 am
btw, after the:
putlog "I'm not oped in $::channel."
you should add a return cos as far as I can see it continues the proc after the putlog.
Once the game is over, the king and the pawn go back in the same box.
kevie
Voice
Posts: 12 Joined: Tue Jun 10, 2003 3:45 am
Post
by kevie » Tue Jun 10, 2003 9:13 am
It works now! Bravo. Anyway, can i put a puthelp "NOTICE $nick :you've been devoiced..." on it after the bot devoiced the user?
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Tue Jun 10, 2003 9:19 am
Give it a try. I'm shure it won't bite you.
Once the game is over, the king and the pawn go back in the same box.
kevie
Voice
Posts: 12 Joined: Tue Jun 10, 2003 3:45 am
Post
by kevie » Tue Jun 10, 2003 10:09 am
seems like i ended up with more errors,
Tcl error [time_proc]: can't read "nick": no such variable
Can anyone help me out with that?