alias close {
if (%style == close) {
%display $close(table)
}
;;make the variables
var %x = 1, %table = $1
;;start the while loop of %x being lower or equal to 23.
while (%x <= 23) {
;;Tokenize the skill thats number %X
tokenize 32 $hget(%table,$setskill(%x))
;;checks to see if the level is less than 99
if ($2 < 99) {
;;check to see if %close is NOT a variable
if (!%close) {
;; If it ISNT, then set the skill thats number %X to %close, and the exp-to-next to %closexp
var %close = $setskill(%x)
var %closexp = $4
}
;; if there IS a %close
else {
;; Checks to see if the exp-to-next for the skill thats number %X is less than %closexp and higher than 0
if ($4 < %closexp && $4 > 0) {
var %close = $setskill(%x)
var %closexp = $4
}
}
}
inc %x
}
return %close
}