mIRC Home    About    Download    Register    News    Help

Print Thread
#117098 12/04/05 10:12 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
Hello.

I have a problem with the red part of this script:

Code:
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
#117099 12/04/05 10:25 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
try the following in place of the section that's not working
Code:
elseif ($ulevel < $level($address($2,1))) && ($ulevel == 10) {
.notice $nick $2 is an op, you can't deop him
}  

#117100 12/04/05 10:32 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
Nice it worked smile Can you tell me what the different parts of ($ulevel < $level($address($2,1))) means? Then i would be happey smile


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#117101 12/04/05 10:37 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
No nevermind think i got it myself smile

$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
#117102 12/04/05 10:50 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
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.

#117103 12/04/05 10:54 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
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

Code:
  elseif ($ulevel == 10) &amp;&amp; ($level($address($2,2)) == 11) {
    notice $nick $2 is an op, you can't deop him.
  }



laugh


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#117104 12/04/05 11:20 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
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.
Code:
 on @10:TEXT:!deop &amp;:#:{
  if ($2 == $me) &amp;&amp; ($ulevel == 10) {    notice $nick I don't think so   }
  elseif ($nick !isop $chan) {    notice $nick $2 isn't an op.  }
  elseif ($ulevel == 10) &amp;&amp; ($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.

#117105 13/04/05 11:24 AM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
Yes i know that smile But i still need it to tell anyway if it's not opped or if users are lower level then 10 or 11 smile

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
#117106 13/04/05 09:32 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
on *:text:!whois &amp; *:#:{
var %a = 1
while %a &lt;= $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.

Link Copied to Clipboard