mIRC Homepage
Posted By: milosh list level users - 22/01/04 01:26 AM
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!
Posted By: KingTomato Re: list level users - 22/01/04 01:33 AM
/help $ulist

$ulist(*!*@*, 5, 0) - Total number of users at level 5
$ulist(*!*@*, 5, 1) - First user name with level 5
Posted By: milosh Re: list level users - 22/01/04 01:42 AM
Thanx a lot, KingTomato, that's what i needed... just didn't know where to search for it. :tongue:
Posted By: milosh Re: list level users - 23/01/04 12:21 AM
Sorry, that doesn't work. frown 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!
Posted By: Iori Re: list level users - 23/01/04 06:02 AM
Use * to match any address.
  • $ulist(*,%level,0)

Posted By: Zyzzyx26 Re: list level users - 15/03/04 12:48 AM
This is wierd...i tried to post this once, it appeared that it had been posted...but i dont see it smirk 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
Code:
/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?
Posted By: Iori Re: list level users - 15/03/04 02:27 AM
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.
Code:
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 -
}
Posted By: Zyzzyx26 Re: list level users - 15/03/04 08:54 PM
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 smile

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
Posted By: Iori Re: list level users - 15/03/04 09:42 PM
Code:
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
}
Posted By: Zyzzyx26 Re: list level users - 16/03/04 12:13 AM
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?
Code:
/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! laugh
Posted By: Iori Re: list level users - 16/03/04 12:20 AM
Here ya go.. smile
Code:
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
}

Posted By: Zyzzyx26 Re: list level users - 16/03/04 12:35 AM
It works fantastic!! Thanks a lot! laugh

If it isnt much trouble, would you mind explaining me the use of the %x variable, please? smile

Thanks again for the huge help!!! laugh
Posted By: Iori Re: list level users - 16/03/04 12:59 AM
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. laugh.
Posted By: Zyzzyx26 Re: list level users - 16/03/04 01:13 AM
Oic... wink

Thanks again! laugh
© mIRC Discussion Forums