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 

need and else.

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


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Tue Aug 19, 2008 9:56 am    Post subject: need and else. Reply with quote

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
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Tue Aug 19, 2008 10:55 am    Post subject: Reply with quote

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
View user's profile Send private message
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Tue Aug 19, 2008 5:05 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Tue Aug 19, 2008 8:25 pm    Post subject: Reply with quote

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
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