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 

Prob with proc in a bind kick

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Nara
Halfop


Joined: 23 Jul 2006
Posts: 40

PostPosted: Mon Jul 31, 2006 10:38 am    Post subject: Prob with proc in a bind kick Reply with quote

Alright, I'm aware this code is very messy. Sorry. This script just won't work, I'm probably using the wrong things, please help me out. This is meant to ban anyone without a flag P using bans. Also, it has a clause for ChanServ bans They are issued with a reason like this: "(Nara) You're an idiot."

Code:
bind kick - * kickuser

proc kickuser {nick host hand chan target reason} {
if {![string equal $nick "ChanServ"]} {
if {![matchattr $hand P] && ![string equal [finduser [lindex [split $host @] 1]] "*"]} {
newchanban "$chan" "*!*@[lindex [split $host @] 1]" "KickUser" "Kicking users on #chan is not permitted. Perm ban, PM Nara for removal" "0"
putserv "PRIVMSG Chanserv :#chan deluser $nick"
}
if {[string equal [finduser [lindex [split $host @] 1]] "*"]} {
newchanban "$chan" "*!*@[lindex [split $host @] 1]" "KickUser" "Kicking users on #chan is not permitted. Perm ban, PM Nara for removal" "0"
putserv "PRIVMSG Chanserv :#chan deluser $nick"
}
}
if {[string equal $nick "ChanServ"]} {
regexp {/((.*?/)} $reason match $reason2
}
if {[$reason2 onchan "#2g"]} {
if {![string equal [finduser [lindex [split $host @] 1]] "*"]} {
if {![matchattr [finduser [lindex [split $host @] 1]] P]} {
newchanban "$chan" "*!*@[lindex [split $host @] 1]" "KickUser" "Kicking users on #chan is not permitted. Perm ban, PM Nara for removal" "0"
putserv "PRIVMSG Chanserv :#chan deluser $nick"
}
}
}
if {![$reason2 onchan "#chan"]} {
newchanban "$chan" "*!*@$reason2.*.gamesurge" "KickUser" "Kicking users on #2g is not permitted. Perm ban, PM Nara for removal" "0"
putserv "PRIVMSG Chanserv :#2g deluser "/*$reason2"
}
}


Also, can you please tell me if this is done right:
Code:
bind notc - * noticekick

proc noticekick {nick uhost handle text dest} {
if {[validchan $dest]} {
set dest [string tolower $dest]
if {[string equal $dest "#chan"] && ![matchattr $handle P]} {
newchanban "$dest" "*!*@[lindex [split $uhost @] 1]" "NoticeBan" "Noticing $dest is not permitted." "0"
putserv "PRIVMSG Chanserv :#chan deluser $nick"
}
}
}


Thank you,
Nara
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Thu Aug 03, 2006 2:11 am    Post subject: Reply with quote

First, apply indenting to make this script readable.
Secondly, give us the errors you encounter, you cannot expect us to to help you without knowing what exactly you did wrong.
Also, use elseif instead of a million if's.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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