| View previous topic :: View next topic |
| Author |
Message |
ruizit0 Voice
Joined: 14 Nov 2005 Posts: 6
|
Posted: Mon Nov 14, 2005 5:35 am Post subject: [HELP] if {![isop $powerfull $chan]} { ??????? |
|
|
hi all!
annyone can tell me why i cant put this if to work ? ... i tryed a few examples and no one works
| 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 |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Nov 14, 2005 6:47 am Post subject: |
|
|
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 |
|
 |
ruizit0 Voice
Joined: 14 Nov 2005 Posts: 6
|
Posted: Tue Nov 15, 2005 1:24 am Post subject: |
|
|
yap 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
| 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 ?
thanks  |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Nov 15, 2005 5:32 am Post subject: |
|
|
| 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 |
|
 |
ruizit0 Voice
Joined: 14 Nov 2005 Posts: 6
|
Posted: Wed Nov 16, 2005 2:10 am Post subject: |
|
|
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 |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Wed Nov 16, 2005 1:38 pm Post subject: |
|
|
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 |
|
 |
ruizit0 Voice
Joined: 14 Nov 2005 Posts: 6
|
Posted: Wed Nov 16, 2005 6:06 pm Post subject: |
|
|
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 |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Nov 17, 2005 6:41 pm Post subject: |
|
|
| 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 |
|
 |
|