mIRC Home    About    Download    Register    News    Help

Print Thread
#4308 01/01/03 06:21 AM
Joined: Dec 2002
Posts: 51
D
Dingo Offline OP
Babel fish
OP Offline
Babel fish
D
Joined: Dec 2002
Posts: 51
could somebody please help me with returning the total numbe rof lines from mu userlist, and adding each line into a hash table? i've been trying for a few hours with no success smirk

Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Code:

alias show.userlist {
  var %file = $readini($mircini,rfiles,n0), %i = 1
  
  ;  Decide if our users file is in INI format
  if (($read(%file,s,[users])) && ($read(%file,s,n0=))) {
    while ($readini(%file,users,$+(n,$calc(%i - 1)))) {
      .hadd -m userlist $gettok($gettok($ifmatch,2,58),1,32) $gettok($ifmatch,1,58) $gettok($ifmatch,2-,32)
      inc %i
    }
  }
  
  ;  Or if it's in TXT format
  elseif (*.txt iswm %file) {
    while ($read(%file,%i)) {
      inc %i
      .hadd -m userlist $gettok($gettok($ifmatch,2,58),1,32) $gettok($ifmatch,1,58) $gettok($ifmatch,2-,32)
    }
  }
  %i = 1
  echo -eati2 * Hash Table entries for Userlist
  while ($hget(userlist,%i).item) {
    var %item = $ifmatch
    var %levels = $gettok($hget(userlist,$ifmatch),1,32)
    var %note = $gettok($hget(userlist,$ifmatch),2-,32)
    echo 3 -ati2 $ifmatch $+($chr(3),05,%levels) $+($chr(3),06,%note)
    inc %i
  }
  hfree userlist
}


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Joined: Dec 2002
Posts: 51
D
Dingo Offline OP
Babel fish
OP Offline
Babel fish
D
Joined: Dec 2002
Posts: 51
thanks much Hammer - i really appreciate your help with that .

i'm trying to learn scripting, so i won't just copy / past it and forget about it - i'll check it out and figure out how it works so i can learn better smile

thanks again laugh


Link Copied to Clipboard