| View previous topic :: View next topic |
| Author |
Message |
Nara Halfop
Joined: 23 Jul 2006 Posts: 40
|
Posted: Mon Jul 31, 2006 10:38 am Post subject: Prob with proc in a bind kick |
|
|
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 |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Thu Aug 03, 2006 2:11 am Post subject: |
|
|
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 |
|
 |
|
|
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
|
|