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 

[HELP] if {![isop $powerfull $chan]} { ???????

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


Joined: 14 Nov 2005
Posts: 6

PostPosted: Mon Nov 14, 2005 5:35 am    Post subject: [HELP] if {![isop $powerfull $chan]} { ??????? Reply with quote

hi all!
annyone can tell me why i cant put this if to work ? ... i tryed a few examples and no one works Neutral

Code:
proc pub:voice {nick uhost hand chan text} {
 global Otrigger
 set newvc [lindex $text 0]
 if {$newvc==""} { putserv "MODE $chan +v $nick" }
 if {[botisop $chan]=="0"} { putserv "NOTICE $nick :ERROR! i dont have ${Otrigger}voice to do it" ; return 0 }
 putserv "MODE $chan +v $newvc"
}


why when bot isnt oppen he doesnt output the error notice??
if is oped he complete the operation and gives the voice...
but if isnt opped he doenst output the notice to user.. and doesnt report any error to partyline to... O.o
i tryied several ways like:

Code:
set powerfull [string tolower [lindex $botnick 0]]
set newdp [string tolower [lindex $text 0]]
if {![isop $powerfull $chan]} {


and

Code:

if {![botisop $chan]} ... bla bla bla


none of this examples work. . all night to try to do this work . .
eggdrops is v1.6.17+SSL

:\
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Nov 14, 2005 6:47 am    Post subject: Reply with quote

It seems like your bot doesn't recognize that it's deoped, are you sure you have the right net-type setting?

Try this code:
Code:
bind pub - ${Otrigger}voice pub:voice

proc pub:voice {nick uhost hand chan arg} {
 set newvc [lindex [split $arg] 0]
 if {[botisop $chan]} {
  if {$newvc==""} {
   putserv "MODE $chan +v $nick"
  } elseif {[onchan $newvc $chan]} {
   putserv "MODE $chan +v $newvc"
  } {
   puthelp "NOTICE $nick :$newvc is not on $chan."
  }
 } {
  puthelp "NOTICE $nick :ERROR! I'm not oped on $chan."
 }
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
ruizit0
Voice


Joined: 14 Nov 2005
Posts: 6

PostPosted: Tue Nov 15, 2005 1:24 am    Post subject: Reply with quote

yap Smile it works perfectly . . but now i have one problem . .
sorry my "n00b'ness" but that piece of code a little bit complicated that im accustomed..

now i want to add some "if's" but i tryed and the only worked was the
if {$newvc == $botnick} {
the other ones i cant make it work with your type of code Sad

Code:

if {$newvc == ""} {
if {[isvoice $newvc $chan]} {
putserv "NOTICE $nick :you have already voice"
}


Code:

if {[isvoice $newvc $chan]} {
putserv "NOTICE $nick :look to chan... $newvc is already voiced!"
}


Code:

if {$newvc == $botnick} {
puthelp "NOTICE $nick :dont touch me!"


can you help me on that please ? Sad
thanks Smile
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Nov 15, 2005 5:32 am    Post subject: Reply with quote

Code:
bind pub - ${Otrigger}voice pub:voice

proc pub:voice {nick uhost hand chan arg} {
 set newvc [lindex [split $arg] 0]
 if {[botisop $chan]} {
  if {$newvc==""} {
   if {![isvoice $nick $chan]} {
    putserv "MODE $chan +v $nick"
   } {
    puthelp "NOTICE $nick :you're already voiced on $chan."
   }
  } elseif {[onchan $newvc $chan]} {
   if {[isbotnick $newvc]} {
    puthelp "NOTICE $nick :don't touch me!"
   } elseif {![isvoice $newvc $chan]} {
    putserv "MODE $chan +v $newvc"
   } {
    puthelp "NOTICE $nick :$newvc is already voiced on $chan."
   }
  } {
   puthelp "NOTICE $nick :$newvc is not on $chan."
  }
 } {
  puthelp "NOTICE $nick :ERROR! I'm not oped on $chan."
 }
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
ruizit0
Voice


Joined: 14 Nov 2005
Posts: 6

PostPosted: Wed Nov 16, 2005 2:10 am    Post subject: Reply with quote

thanks Sir_FZ its working perfectly . .
but now i have another problem (n00b stuff) :\

im trying to set some flags to binds like:

Code:

#flag setup
set normal_flag "m"

#bind setup
set bind_op "!op"

bind $normal_flag ${bind_op} pub:op

proc pub:op {....} {


when i use this set's (flags and binds) the if {[botisop $chan]} { stops working :\

i tryed some diferent code situations and i cant figure why and how to solve it :\

then i thinked on something like this:
Code:

 if ![matchattr $hand $normal_flag $chan] {
puthelp "NOTICE $nick :you dont have permission"


but doesnt worked to...
i tryed diferente ways to put that if but with no sucess :\ i even dont figure how and the order of the code .. the order how it calls the processes .. so is a little dificult to me to make it right before to gain practice to this new order :\

my last proc code is this

Code:

#flag setup
set normal_flags "o"

#bind setup
set bind_voice "!voice"


#script
bind pub - ${bind_voice} pub:voice

proc pub:voice {nick uhost hand chan arg} {
global normal_flags
 set newvc [lindex [split $arg] 0]
 if {[botisop $chan]} {
if {$newvc==""} {
   if {![isvoice $nick $chan]} {
 if ![matchattr $hand $normal_flags $chan] {
putserv "NOTICE $nick :not allowed to use command"
}
putserv "MODE $chan +v $nick"
   } {
    puthelp "NOTICE $nick :you're already voiced on $chan."
   }
  } elseif {[onchan $newvc $chan]} {
   if {[isbotnick $newvc]} {
    puthelp "NOTICE $nick :don't touch me!"
   } elseif {![isvoice $newvc $chan]} {
    putserv "MODE $chan +v $newvc"
   } {
    puthelp "NOTICE $nick :$newvc is already voiced on $chan."
   }
  } {
   puthelp "NOTICE $nick :$newvc is not on $chan."
  }
 } {
  puthelp "NOTICE $nick :not voiced on $chan"
 }
}


i moved that new if up and down in the code and i cant make it work lol :\
sorry for taking your time.. but can you give me a light ?
thanks
(sorry my english)
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Nov 16, 2005 1:38 pm    Post subject: Reply with quote

If the user doesn't have the +m flag, then ofcourse the whole proc will not be called and not just [botisop].
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
ruizit0
Voice


Joined: 14 Nov 2005
Posts: 6

PostPosted: Wed Nov 16, 2005 6:06 pm    Post subject: Reply with quote

but the user is me... i have all flags .. . and the bot doesnt respond to nothing .. .
but if a normal user tryes the bot responds to te flag check if...
when is me.. with all the flags. . he doesnt do nothing
wierd
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Nov 17, 2005 6:41 pm    Post subject: Reply with quote

Code:
matchattr $hand o $chan

will check if $hand has global +o only and not $chan specific +o. So instead use o|o. Also a little tip would be to add
Code:
if {![matchattr $hand o|o $chan]} {
 # not allowed notice
 return 0
}

before the main ifs start, i.e. after the global line or something like that.
_________________
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