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.
Support & discussion of released scripts, and announcements of new releases.
johnnys
Voice
Posts: 11 Joined: Thu Jun 30, 2005 8:54 am
Post
by johnnys » Thu Jun 30, 2005 9:10 am
Hey
First, i dont know TCL - so pls dont flame me..i just need little help. I found voice control v1.0 in the Database, it works fine for me, but i got one proplem. I would like to activate the script only in one channel...not at all. maybe somebody can help me, thx
Code: Select all
# voice control v1.0 (14 April 2001) By irco <irco@mail.com> EFnet #Q8Help
# the voice control can make voice groub to control your channel
# the can do to kick ban unban mode on/off and change to topic
# Notes: I wrote this on eggdrop 1.3.x, don't complain if you load it up
# on your prehistoric 1.1.5 and it blows up the computer.
bind mode - *+v* voicenotice
bind pub - !kick voicekick
bind pub - !ban voiceban
bind pub - !unban voiceunban
bind pub - !mode voicemode
bind pub - !topic voicetopic
# set the Voice notice msg
set voicemsg "welcome to the control #lamerchan you can use !ban, !kick, !unban, !topic, !mode on/off"
# Don't edit anything below unless you know what you're doing
set ver "v1.0"
proc voicenotice {nick uhost hand chan mode victim} {
global voicemsg
putserv "notice $victim :$voicemsg"
return 0
}
proc voicekick {nick uhost hand chan arg} {
global botnick
if {[isvoice $nick $chan]} {
set who [lindex $arg 0]
set why [lrange $arg 1 end]
if {$who == ""} {
putserv "notice $nick :Usage: !kick <nick> <reason>"
return 0
}
if {![validuser [nick2hand $who $chan]]} {
if {![onchan $who $chan]} {
putserv "notice $nick :$who is not on the channel"
return 0
}
putserv "kick $chan $who :$why kick by $nick"
}
}
}
proc voiceban {nick uhost hand chan arg} {
global botnick
if {[isvoice $nick $chan]} {
set who [lindex $arg 0]
set why [lrange $arg 1 end]
if {$who == ""} {
putserv "notice $nick :Usage: !ban <nick> <reason>"
return 0
}
if {![validuser [nick2hand $who $chan]]} {
if {![onchan $who $chan]} {
putserv "notice $nick :$who is not on the channel"
return 0
}
if {![onchan $who $chan]} {
putserv "notice $nick :$who is not on the channel"
return 0
}
set host "*!*@[lindex [split [getchanhost $who $chan] "@"] end]"
putserv "MODE $chan -o+b $who $host"
putserv "KICK $chan $who :$why Ban By $nick"
return
}
}
}
proc voiceunban {nick uhost handle chan text} {
global botnick
if {$text == ""} {
putserv "notice $nick :Usage: !unban host"
return 0
}
if {([isvoice $nick $chan]) && ([isop $botnick $chan])} {
putserv "MODE $chan -b [lindex $text 0] :[lrange $text 1 end]"
return 0
}
}
proc voicemode {nick uhost handle chan text} {
global botnick
if {([isvoice $nick $chan]) && ([isop $botnick $chan])} {
if {$text == ""} {
putserv "notice $nick :Usage: !mode On/Off"
return 0
}
if {[lindex $text 0] == "on"} {
putserv "MODE $chan +mi"
} elseif {[lindex $text 0] == "off"} {
putserv "MODE $chan -mi"
}
}
}
proc voicetopic {nick uhost handle chan text} {
global botnick
if {[isvoice $nick $chan]} {
if {[isop $botnick $chan] == "1"} {
if {$text == ""} {
putserv "notice $nick :Usage: !topic <reason>"
return 0
}
putserv "TOPIC $chan :$text topic By $nick"
}
}
}
putlog "Voice control $ver By irco loaded ..."
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Thu Jun 30, 2005 11:53 am
You can add the following line to the script:
and add this line in every proc:
Code: Select all
if {[lsearch -exact $::voicechans $chan] == -1} { return 0 }
johnnys
Voice
Posts: 11 Joined: Thu Jun 30, 2005 8:54 am
Post
by johnnys » Thu Jun 30, 2005 2:32 pm
??? dont kow, every proc? like this?
Code: Select all
# voice control v1.0 (14 April 2001) By irco <irco@mail.com> EFnet #Q8Help
# the voice control can make voice groub to control your channel
# the can do to kick ban unban mode on/off and change to topic
# Notes: I wrote this on eggdrop 1.3.x, don't complain if you load it up
# on your prehistoric 1.1.5 and it blows up the computer.
bind mode - *+v* voicenotice
bind pub - !kick voicekick
bind pub - !ban voiceban
bind pub - !unban voiceunban
bind pub - !mode voicemode
bind pub - !topic voicetopic
set voicechans "#channel"
# set the Voice notice msg
set voicemsg "welcome to the control #lamerchan you can use !ban, !kick, !unban, !topic, !mode on/off"
# Don't edit anything below unless you know what you're doing
set ver "v1.0"
proc voicenotice {nick uhost hand chan mode victim} { if {[lsearch -exact $::voicechans $chan] == -1} { return 0 }
global voicemsg
putserv "notice $victim :$voicemsg"
return 0
}
proc voicekick {nick uhost hand chan arg} { if {[lsearch -exact $::voicechans $chan] == -1} { return 0 }
global botnick
if {[isvoice $nick $chan]} {
set who [lindex $arg 0]
set why [lrange $arg 1 end]
if {$who == ""} {
putserv "notice $nick :Usage: !kick <nick> <reason>"
return 0
}
if {![validuser [nick2hand $who $chan]]} {
if {![onchan $who $chan]} {
putserv "notice $nick :$who is not on the channel"
return 0
}
putserv "kick $chan $who :$why kick by $nick"
}
}
}
proc voiceban {nick uhost hand chan arg} {
global botnick
if {[isvoice $nick $chan]} {
set who [lindex $arg 0]
set why [lrange $arg 1 end]
if {$who == ""} {
putserv "notice $nick :Usage: !ban <nick> <reason>"
return 0
}
if {![validuser [nick2hand $who $chan]]} {
if {![onchan $who $chan]} {
putserv "notice $nick :$who is not on the channel"
return 0
}
if {![onchan $who $chan]} {
putserv "notice $nick :$who is not on the channel"
return 0
}
set host "*!*@[lindex [split [getchanhost $who $chan] "@"] end]"
putserv "MODE $chan -o+b $who $host"
putserv "KICK $chan $who :$why Ban By $nick"
return
}
}
}
proc voiceunban {nick uhost handle chan text} { if {[lsearch -exact $::voicechans $chan] == -1} { return 0 }
global botnick
if {$text == ""} {
putserv "notice $nick :Usage: !unban host"
return 0
}
if {([isvoice $nick $chan]) && ([isop $botnick $chan])} {
putserv "MODE $chan -b [lindex $text 0] :[lrange $text 1 end]"
return 0
}
}
proc voicemode {nick uhost handle chan text} { if {[lsearch -exact $::voicechans $chan] == -1} { return 0 }
global botnick
if {([isvoice $nick $chan]) && ([isop $botnick $chan])} {
if {$text == ""} {
putserv "notice $nick :Usage: !mode On/Off"
return 0
}
if {[lindex $text 0] == "on"} {
putserv "MODE $chan +mi"
} elseif {[lindex $text 0] == "off"} {
putserv "MODE $chan -mi"
}
}
}
proc voicetopic {nick uhost handle chan text} { if {[lsearch -exact $::voicechans $chan] == -1} { return 0 }
global botnick
if {[isvoice $nick $chan]} {
if {[isop $botnick $chan] == "1"} {
if {$text == ""} {
putserv "notice $nick :Usage: !topic <reason>"
return 0
}
putserv "TOPIC $chan :$text topic By $nick"
}
}
}
putlog "Voice control $ver By irco loaded ..."
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Thu Jun 30, 2005 4:50 pm
Well, you can add an enter after { it's not a problem
and you missed a proc. Other than this, all I can tell you is give it a try.
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Fri Jul 01, 2005 11:09 am
I told you, what you've done was correct but it won't harm the script if you add an enter after the {. Instead of
Code: Select all
proc bla {....} { if {[lsearch ....]} {...}
you can use
Code: Select all
proc bla {....} {
if {[lsearch ...]} {...}
And you forgot to add the line in the voiceban proc.