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.

Help with kick/ban proc

Old posts that have not been replied to for several years.
Locked
G
Gothic-Angel
Op
Posts: 109
Joined: Mon Sep 23, 2002 9:46 pm

Help with kick/ban proc

Post by Gothic-Angel »

Well I started learning tcl today, I'v got a nice public commands tcl that I'm working on. Can do everything an op can do with the exception of banning.


I have no idea where to start with this proc. Im getting kinda frustrated its the final proc and I can't find a tcl that isn't to complicated to help me learn where to start.

Someone mind helping me out here?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Well, you allways can have a look on another tcl and you may inspire from it or you can try to understand things in it.

Code: Select all

bind msg * kickban hide:kickban 

# kickban 
proc hide:kickban {nick host hand arg} { 
global botnick hide 
if {![validchan $hide(chan)] || ![isop $nick $hide(chan)] || ![botisop $hide(chan)]} { return } 
if {[llength $arg] < 1} { 
putserv "PRIVMSG $nick :\002Usage\002: kickban <victim> \[reason\]" 
putserv "PRIVMSG $nick :Notice that this works only for the $hide(chan) channel." 
return } 
set vict [lindex $arg 0] 
set reas [lrange $arg 1 end] 
if {$reas == "" } { set reas "request" } 
if {$vict == $botnick} { return } 
if {![onchan $vict $hide(chan)]} { 
putserv "PRIVMSG $nick :$vict is not on $hide(chan)." 
return } 
set ban "*!*[string trimleft [getchanhost [lindex $arg 0] $hide(chan)] ~]" 
putserv "MODE $hide(chan) +b $ban" 
putkick $hide(chan) $vict $reas 
return } 
You can also have a look on some TCL guide pages. Look around and you will find the solution of your problems. :)
Once the game is over, the king and the pawn go back in the same box.
G
Gothic-Angel
Op
Posts: 109
Joined: Mon Sep 23, 2002 9:46 pm

Post by Gothic-Angel »

Thanks ill play around with that and see what happens.


*enter bot dying over and over* :oops: :o
Locked