| View previous topic :: View next topic |
| Author |
Message |
johnnys Voice
Joined: 30 Jun 2005 Posts: 11
|
Posted: Thu Jun 30, 2005 9:10 am Post subject: Voice Kick! |
|
|
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: | # 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 ..." |
|
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Jun 30, 2005 11:53 am Post subject: |
|
|
You can add the following line to the script:
| Code: | | set voicechans "#channel" |
and add this line in every proc:
| Code: | | if {[lsearch -exact $::voicechans $chan] == -1} { return 0 } |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
johnnys Voice
Joined: 30 Jun 2005 Posts: 11
|
Posted: Thu Jun 30, 2005 2:32 pm Post subject: |
|
|
??? dont kow, every proc? like this?
| Code: | # 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 ..." |
|
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Jun 30, 2005 4:50 pm Post subject: |
|
|
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. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
johnnys Voice
Joined: 30 Jun 2005 Posts: 11
|
Posted: Fri Jul 01, 2005 8:06 am Post subject: |
|
|
have read you my first post? "I dont know TCL" I dont know proc,enter - can anyone do that for me?
(  |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Jul 01, 2005 11:09 am Post subject: |
|
|
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: | | proc bla {....} { if {[lsearch ....]} {...} |
you can use
| Code: | proc bla {....} {
if {[lsearch ...]} {...} |
And you forgot to add the line in the voiceban proc. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|