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 

bot check for owner before remove

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


Joined: 21 Apr 2005
Posts: 19

PostPosted: Sun Sep 14, 2008 11:04 pm    Post subject: bot check for owner before remove Reply with quote

What i am trying to do is before the bots removes the chan fro list is to make sure the person trying to remove it is the channel owner of the chan. I have been able to set it up so far to block certain chans and have tried to get it to match flags and have got it to delete the chan but when i try to use the else command to where if they dont meet the flags to send an error message i get an error of


invalid command name "else" while executing "else { puthelp "NOTICE $nick :cant do that " ; return 0 }" (procedure "pub_lol_remove" line 16) invoked from within "pub_lol_remove $_pub1 $_pub2 $_pub3 $_pub4 $_pub5"

Code:

proc pub_lol_remove {nick host hand chan arg} {
   set arg [charfilter $arg]
   set noremove "#chan1 #chan2"
   global lol botnick
   if {![check $hand $nick $host]} {
      if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
            puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
      return 0
   }
   set ch [lindex $arg 0]
   if {$ch != ""} {set ch [chanaddapt $ch]}
   if {$ch == ""} {set ch $chan}
   if {![validchan $ch]} {   puthelp "NOTICE $nick :I'm not on $ch " ;   return 0 }
     if {[lsearch -exact $noremove [string tolower $ch]] != -1} {   puthelp "NOTICE $nick :Can't do that " ;   return 0 }
   channel remove $ch
   puthelp "NOTICE $nick :$ch has been removed."
}


im pretty sure that i have the line right of
if {[matchattr $hand |X $ch]}
{channel remove $ch return 0}
but not sure of how to get it to send the msg if they dont meet the correct flags
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Sep 15, 2008 2:52 pm    Post subject: Reply with quote

There's no else-statement in the code you pasted.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
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