This is a hybrid between $readini(), $read(), and $play(); whereas you can use the same file structure as an INI file without having to define items with variables. It was something that I was working on to use for something I'm working on myself, allowing for easier use.
[nicks]
evilMonkey
Foobar
Hawkee
;// $_read(file, section, item/N)
;// $_read(file.txt, nicks, Hawkee) -> 3
;// $_read(file.txt, nicks, 0) -> 3
;// $_read(file.txt, nicks, 1) -> evilMonkey
alias _read {
if ($isid) {
var %i = 1
var %n = $lines($1)
while (%i <= %n) {
if ($read($1, n, %i) == $+([,$2,])) {
var %l = 1
while (1) {
inc %i
var %a = $read($1, n, %i)
if ($3 == %a) return %l
if ($3 == 0) && (%i == %n) return %l
if ($3 == 0) && ($regex(%a, /^\[.+\]$/)) return $calc(%l - 1)
if ($3 == %l) && (!$regex(%a, /^\[.+\]$/)) return %a
elseif (!$regex(%a, /\[.+\]/)) {
inc %l
continue
}
else return
}
}
inc %i
}
}
}
Thanks. :)