| View previous topic :: View next topic |
| Author |
Message |
Nor7on Op

Joined: 03 Mar 2007 Posts: 185 Location: Spain - Barcelona
|
Posted: Tue Aug 19, 2008 9:56 am Post subject: need and else. |
|
|
| Code: | setudef flag lockunban
proc blacklist:userdel {nickname hostname handle text} {
global unbanc botnick blacklist BLNicks lockblack bchanwork
if {[lsearch -exact [channel info $bchanwork] "+lockblack"]} {
puthelp "privmsg $nickname :sorry can't use this command."
puthelp "privmsg $nickname :pls contact with a OP."
} else {
rest of script... |
is little code is, if my chan have flag +lockunban put the puthelps, else the rest of my code.
can helpme? |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Aug 19, 2008 10:55 am Post subject: |
|
|
First off, you never defined the lockblack channel setting, so I'm assuming you actually intended to use the lockunban.
Secondly, there's a much better way of checking whether the setting is set or not, using channel get.
Finally, your post really does not say much as to what your script should do, should the channel setting not be set. The vast list of global variables also makes no sense..
I'm posting the fix regarding channel setting, but you really need to specify what it is you are asking for...
| Code: | setudef flag lockunban
proc blacklist:userdel {nickname hostname handle text} {
global unbanc botnick blacklist BLNicks lockblack bchanwork
if {[channel get $bchanwork lockunban]} {
puthelp "privmsg $nickname :sorry can't use this command."
puthelp "privmsg $nickname :pls contact with a OP."
} else {
#Rest goes here
}
}
|
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Nor7on Op

Joined: 03 Mar 2007 Posts: 185 Location: Spain - Barcelona
|
Posted: Tue Aug 19, 2008 5:05 pm Post subject: |
|
|
| Code: | setudef flag lockunban
proc blacklist:userdel {nickname hostname handle text} {
global unbanc botnick blacklist BLNicks lockblack bchanwork
if {[channel get $bchanwork lockunban]} {
puthelp "privmsg $nickname :sorry can't use this command."
puthelp "privmsg $nickname :pls contact with a OP."
} else {
set cmd [lindex [split $text] 0]
set hostmask [string tolower $nickname!$hostname]
foreach blnick $BLNicks {
if {[string match -nocase [set ban [lindex [split $blnick] 0]] $nickname!$hostname]} {
bla bla bla put ban, kick, etc.
}
}
}
} |
but it don't work, when have +lockunban send the puthelp, and the same when have -lockunban. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Aug 19, 2008 8:25 pm Post subject: |
|
|
Well, then the error really is not with your script, but with how you try to alter the lockunban flag for the specific channel. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|