mIRC Home    About    Download    Register    News    Help

Print Thread
hash table #108601 20/01/05 11:52 PM
Joined: Oct 2003
Posts: 306
J
jacksparrow2 Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Oct 2003
Posts: 306
alias kb {
if ($me !isop $active) && ($me !ishop $active) { return }
if (!$hget(Kicks)) { hmake Kicks 5 }
inc %inc
kick $active $1 $2- %inc
hadd -ms Kicks $1 Tiempo: $time Razon: $2-
/hsave -s kicks lista.kick
}

alias ver3 { /hload -s kicks 5 | //echo -s $hget(kicks,5 ) }

i have a problem with the alias ver3 , any help?


mess with the best
Re: hash table #108602 21/01/05 12:05 AM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
You have this all wrong...
Code:
alias ver3 {
  if ($isfile(lista.kick)) {
    hmake kicks 5
    hload -o kicks lista.kick
    if ($hget(kicks,5).item) { echo -s $hget(kicks,5).item / $hget(kicks,5).data }
  }
  else {
    hmake kicks 5
  }
}

Re: hash table #108603 21/01/05 12:12 AM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
You could also get rid of that else statement:

Code:
alias ver3 {
  hmake kicks 5
  if ($isfile(lista.kick)) {
    hload -o kicks lista.kick
    if ($hget(kicks,5).item) { echo -s $hget(kicks,5).item / $hget(kicks,5).data }
  }
}


New username: hixxy
Re: hash table #108604 21/01/05 12:36 AM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Yup, that's right. grin