|
Joined: Dec 2003
Posts: 261
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2003
Posts: 261 |
Good morning/afternoon/evening/night. My question is: Is there a way to list all the users with the same level on my userlist? example, i need a list that looks like this:
Level 5 users: nick1, nick2, *!blabla@*exa.mp.le Level 10 users: nick1, nick3, nick4 Level 15 users: nick2, nick5, nick6
Also, is there a way to list all the variables that are set and their values?
thanx!
velicha dusha moja Gospoda
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 3,012 |
/help $ulist
$ulist(*!*@*, 5, 0) - Total number of users at level 5 $ulist(*!*@*, 5, 1) - First user name with level 5
-KingTomato
|
|
|
|
Joined: Dec 2003
Posts: 261
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2003
Posts: 261 |
Thanx a lot, KingTomato, that's what i needed... just didn't know where to search for it. :tongue:
velicha dusha moja Gospoda
|
|
|
|
Joined: Dec 2003
Posts: 261
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2003
Posts: 261 |
Sorry, that doesn't work.  When I do $ulist(*!*@*, %level, 0), I get 0 for every value of %level. And I have this in my userlist: 5:*!*bg@191.250.80.* 5:*!*bg@*.bg.ptt.yu I could not solve this problem. thanx!
velicha dusha moja Gospoda
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
Use * to match any address.
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
This is wierd...i tried to post this once, it appeared that it had been posted...but i dont see it  I'll try again.. That tip works great! I used it to do sth very much like to the /ulist command, but better looking :P /listusers {
set %level $$1
set %uz 1
echo -ag -
echo -ag *** Beginning of List: User level %level
while (%uz <= $ulist(*,0)) && ($ulist(*,%level,%uz).info != $null) {
echo -ag User number %uz is $ulist(*,%level,%uz).info ( $ulist(*,%level,%uz) )
inc %uz
}
echo -ag *** End of List: Users level %level
echo -ag -
}
Here i search and list the address and the name(info part) of the users with the level i choose. Is ther anyway to search and list the users by the INFO part in the userlist?
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
Not sure if you want to list ALL users of that level, or only if they have info set. This lists all N level users if they have userlist info. listusers {
var %level = $$1, %uz = 1
; ^^ use /var to make local variables [color:green]/help local variables[/color]
echo -ag -
echo -ag *** Beginning of List: User level %level
; find all users of that level
while $ulist(*,%level,%uz) {
var %a = $ifmatch
; check for .info and display if it is there.
if $ulist(%a,%level,1).info { echo -ag * %uz $+ : $ifmatch ( $+ %a $+ ) }
inc %uz
}
echo -ag *** End of List: Users level %level
echo -ag -
}
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
Everyone in my userlist has the INFO set... I put their nicks on the info part so i can be sure who is who there  I'm looking for something that looks only in the INFO part and that returns those who match the search.. For example, if i have John set as lvl 10 is would be 10:*!*userid@*.host John Now, i want to see if John is already in my list.. so i'll have to look into the Info part for "John", and then i want the script to show me his level and address... Is that possible and relatively simple? :P
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
listuser {
var %i = 1
while $ulist(*,%i).info {
if $$1 == $ifmatch {
echo -eag * Level $level($ulist(*,%i)) $ifmatch ( $+ $ulist(*,%i) $+ )
return
}
inc %i
}
echo -eag * $1 was not found in the userlist
}
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
That's a very cool code, but on some cases i have more than one address for each user, and it wont look for the rest if it finds the 1st matching one.. Why wont this work? /listuser {
var %i = 1
while $ulist(*,%i).info {
if ($$1 == $ifmatch) {
echo -eag * Level $level($ulist(*,%i)) $ifmatch ( $+ $ulist(*,%i) $+ )
}
elseif ($$1 != $ifmatch) {
echo -eag * User $ifmatch was NOT found | halt
}
inc %i
}
} Thanks for the help!
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
Here ya go..  listuser {
var %i = 1,%x
linesep -a
while $ulist(*,%i).info {
if $1 == $ifmatch {
echo -ag * Level $level($ulist(*,%i)) $ifmatch ( $+ $ulist(*,%i) $+ )
inc %x
}
inc %i
}
if !%x { echo -ag * $1 was not found in the userlist }
linesep -a
}
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
It works fantastic!! Thanks a lot!  If it isnt much trouble, would you mind explaining me the use of the %x variable, please?  Thanks again for the huge help!!!
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
Sure, it is only to check that at least one match was found. If there was no matches, %x would be empty and !%x ( !%x = NOT%x) would be $true, so you would want the "no matches" line echoed.  .
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
Oic...  Thanks again!
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
|