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 

Voice Kick!

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
johnnys
Voice


Joined: 30 Jun 2005
Posts: 11

PostPosted: Thu Jun 30, 2005 9:10 am    Post subject: Voice Kick! Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Jun 30, 2005 11:53 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
johnnys
Voice


Joined: 30 Jun 2005
Posts: 11

PostPosted: Thu Jun 30, 2005 2:32 pm    Post subject: Reply with quote

??? 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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Jun 30, 2005 4:50 pm    Post subject: Reply with quote

Well, you can add an enter after { it's not a problem Wink 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
View user's profile Send private message Visit poster's website
johnnys
Voice


Joined: 30 Jun 2005
Posts: 11

PostPosted: Fri Jul 01, 2005 8:06 am    Post subject: Reply with quote

have read you my first post? "I dont know TCL" I dont know proc,enter - can anyone do that for me?

( Sad Sad Sad Sad Sad Sad Sad Sad Sad Sad
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri Jul 01, 2005 11:09 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases 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