|
Joined: Dec 2002
Posts: 51
Babel fish
|
OP
Babel fish
Joined: Dec 2002
Posts: 51 |
in my userlist, i have a line that shows the following: 10:*!*Ausnut@AusNut.users.undernet.org ;AusNut Dingo` 100 user level; address; X username; normal nick; X Access Level X is the CService bot on the Undernet I want to get the X Access Level from the end of the line to display in my opcheck script. I just dont know how to get the access level. if someone could give me a few ideas that would be great
ALIAS opcheck {
;checks for @
%coun = 1
%C.NICKS = $nick($chan,0)
echo 2 -a 14,15==> OPS:
while ( %coun <= %C.NICKS ) {
if ( $level($address($nick($chan,%coun),1)) == %OL ) {
set %nick $nick($chan,%coun)
if ( $nick($chan,%coun) isop $chan ) {
echo 2 -a 14,15==>12 @ $+ $nick($chan,%coun) $&
$str($chr(160),$calc(9 - $len(%nick))) 14<=>12 $&
$address($nick($chan,%coun),1)
}
else echo 2 -a 14,15==>12 $nick($chan,%coun) $&
$str($chr(160),$calc(10 - $len(%nick))) 14<=>12 $&
$address($nick($chan,%coun),1)
cline 12 $chan $nick($chan,%coun)
}
inc %coun 1
}
}
that show's the following on the screen 14,15==>12 @Dingo` 14<=>12 *!*AusNut@AusNut.users.undernet.org 14,15==>12 @Oddjob^ 14<=>12 *!*nettopp33@217.10.142.183 14,15==>12 @X 14<=>12 *!*cservice@undernet.org 14,15==>12 mafafk 14<=>12 *!*mafkees@mafkees.users.undernet.org [EDIT: added $& and [[/b]/code] -Hammer]
Last edited by Hammer; 07/01/03 09:38 AM.
|
|
|
|
Joined: Jan 2003
Posts: 5
Nutrimatic drinks dispenser
|
Nutrimatic drinks dispenser
Joined: Jan 2003
Posts: 5 |
If I am not mistaken $ulist(*,*,1).info will return the information you want for the first user in your user list. Pay attention to the .info parameter. I think that the user list entries have space for additional information and there is the number you are looking for.. A second thought... If in this additional space for info is also the X name you can easy find the last number with a $gettok($ulist(*,*,1).info,2,32) cause as I see it there is a space (?) that seperates the number..
Last edited by rimini; 07/01/03 05:42 AM.
|
|
|
|
Joined: Dec 2002
Posts: 51
Babel fish
|
OP
Babel fish
Joined: Dec 2002
Posts: 51 |
gee i was fiddling around with .info before, but it wasn't working. i know why now - i was using the $IAL instead of $ulist thanks for pointing the .info out again
|
|
|
|
Joined: Dec 2002
Posts: 51
Babel fish
|
OP
Babel fish
Joined: Dec 2002
Posts: 51 |
heh and just to prove i've learnt alot from the messageboard, i'll put up the code i used to get that access level
$right($ulist(*,*,N).info,3)
i'm glad you guys are here to help
|
|
|
|
Joined: Dec 2002
Posts: 51
Babel fish
|
OP
Babel fish
Joined: Dec 2002
Posts: 51 |
and to add that into my /opcheck script, this is the code which i used while i'm on here though - is there a way of putting those 2 long lines onto a few shorter lines?
unset %C.NICKS
unset %coun
%coun = 1
%C.NICKS = $nick($chan,0)
echo 2 -a 14,15==> Voices:
while ( %coun <= %C.NICKS ) {
if ( $level($address($nick($chan,%coun),1)) == %VL ) {
set %nick $nick($chan,%coun)
if ( $nick($chan,%coun) isop $chan ) {
echo 6 -a 14,15==>6 + $+ $nick($chan,%coun) $&
$str($chr(160),$calc(10 - $len(%nick))) [color:red] 14<=>12 $&
$right($ulist(%address).info,3) [/color] 14<=>6 $&
$address($nick($chan,%coun),1)
}
else echo 6 -a 14,15==>6 $nick($chan,%coun) $&
$str($chr(160),$calc(10 - $len(%nick))) [color:red] 14<=>12 $&
$right($ulist(%address).info,3) [/color] 14<=>6 $&
$address($nick($chan,%coun),1)
cline 6 $chan $nick($chan,%coun)
}
inc %coun 1
}
[EDIT: added $& and [[/b]code] -Hammer
Last edited by Hammer; 07/01/03 09:36 AM.
|
|
|
|
Joined: Jan 2003
Posts: 5
Nutrimatic drinks dispenser
|
Nutrimatic drinks dispenser
Joined: Jan 2003
Posts: 5 |
You can use the $& identifier.
<example>
echo 6 -a 14,15==>6 $& + $+ $nick($chan,%coun) $& $str($chr(160),$calc(10 - $len(%nick))) $& 14<=>12 $right($ulist(%address).info,3) $& 14<=>6 $address($nick($chan,%coun),1)
<end of example>
For more: /help $&
Take care
|
|
|
|
Joined: Dec 2002
Posts: 699
Fjord artisan
|
Fjord artisan
Joined: Dec 2002
Posts: 699 |
You should use /var instead of /set for things like this var %i = 1
echo 2 -a 14,15==> OPS:
while ($nick(#,%i)) {
var %nick = $ifmatch,%address = $address(%nick,1)
if ($level(%address) == %OL) {
.......
.......
}
elseif ($level(%address) == %VL) {
.......
.......
}
inc %i
}
...
|
|
|
|
|