|
|
Joined: May 2004
Posts: 132
Vogon poet
|
OP
Vogon poet
Joined: May 2004
Posts: 132 |
Hello. I have a problem with the red part of this script:
on *:TEXT:!deop*:#:{
if ($ulevel != 10) && ($ulevel != 11) {
notice $nick You are not high enough level, please contact admin for further information.
}
elseif ($me isop $chan) && ($2- == $me) && ($ulevel == 10) {
notice $nick I don't think so
}
elseif ($nick !isop $chan) {
notice $nick $2 isn't an op.
}
elseif ($me !isop $chan) {
notice $nick I'm not an op on this channel.
}
[color:red]elseif ($ulevel == 10) && ($2- == $level(11)) {
notice $nick $2 is an op, you can't deop him.
}[/color]
else {
mode $chan -o $nick
}
}
I need the my bot to tell an ulevel 10 the notice message if he trys to use the bot to deop an ulevel 11. Can anyone help?
if ($me != geek) { $life is $false } else { $life is $true } NoPleX
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
try the following in place of the section that's not working elseif ($ulevel < $level($address($2,1))) && ($ulevel == 10) {
.notice $nick $2 is an op, you can't deop him
}
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
OP
Vogon poet
Joined: May 2004
Posts: 132 |
Nice it worked Can you tell me what the different parts of ($ulevel < $level($address($2,1))) means? Then i would be happey
if ($me != geek) { $life is $false } else { $life is $true } NoPleX
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
OP
Vogon poet
Joined: May 2004
Posts: 132 |
No nevermind think i got it myself $level($address($2,2))) Trigger The level of the $2 (the $nick) adress and the ,2 part shows it like *!*@host and $ulevel < means that if $ulevel is less then $nick... Am i right?
if ($me != geek) { $life is $false } else { $life is $true } NoPleX
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Basically, yes. The $level identifier works with the address of the nick. Since the nick is in $2 and you need to identify the address in the same format as it is stored in the userlist (reference $mask). So it's $level($address(nick,mask)) to compare to $ulevel, which is the level of the user initiating the process.
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
OP
Vogon poet
Joined: May 2004
Posts: 132 |
Jep... That what i ment :P But i'm a jerk at explaining... hehe... I just made some changes in the script now... Cauce i just wanted it to work on ulevel 11... And it works fine now thanks... Now i looks like this
elseif ($ulevel == 10) && ($level($address($2,2)) == 11) {
notice $nick $2 is an op, you can't deop him.
}
if ($me != geek) { $life is $false } else { $life is $true } NoPleX
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Here's a suggestion that cuts down on your code, yet, with the exception of the messages to the people that don't have access, should work the same. on @10:TEXT:!deop &:#:{
if ($2 == $me) && ($ulevel == 10) { notice $nick I don't think so }
elseif ($nick !isop $chan) { notice $nick $2 isn't an op. }
elseif ($ulevel == 10) && ($level($address($2,2)) == 11) { notice $nick $2 is an op, you can't deop him. }
else { mode $chan -o $nick }
}
The @ in the ON TEXT event means that the person running the code must be an op. The 10 in the ON TEXT means that only those with level 10 or higher can activate the code. Just a suggestion.
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
OP
Vogon poet
Joined: May 2004
Posts: 132 |
Yes i know that But i still need it to tell anyway if it's not opped or if users are lower level then 10 or 11 But i have a new question... I i type !whois11 and then i type 5 nicks eg. !whois11 Joey Pezuz Franz Wuzz Ceruz Now... Let's say Wuzz is level 11 and the others have no level. How do i make the bot search the users afte which one is level 11 and then tell the channel?
if ($me != geek) { $life is $false } else { $life is $true } NoPleX
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
on *:text:!whois & *:#:{
var %a = 1
while %a <= $numtok($3-,32) {
if $level($address($gettok($3-,%a,32),2)) != $2 {
describe # $gettok($3-,%a,32) does not have level $2
}
inc %a
}
}
Usage: !whois <level> <nick(s)> Hope I understood you correctly...it was a little confusing.
Last edited by RusselB; 13/04/05 09:33 PM.
|
|
|
|
|
|