all tables are defined in tables.lua
I am so incredibly puzzled, by this. I'm close to figuring out what the issue is.
function queue ()
cnote ('wtf')
for _, v in ipairs (curelist) do
if aff [v.name] then
cnote (_ .. v.name .. ' ' .. v.heal)
if v.heal then
v.heal ()
return
end
end
end
end
function searchaffs ()
Note ('queue')
for _, v in ipairs (curelist) do
Note (v.name)
if aff [v.name] then
if v.heal then
Note (v.heal)
v.heal ()
return
end
end
end
end
Those look the same to me, and are right beside eachother in my script file.
queue () produces this:
Run-time error
World: Laeric on Lusternia (Ur'Guard)
Immediate execution
[string "Script file"]:233: attempt to concatenate field 'heal' (a function value)
stack traceback:
[string "Script file"]:233: in function 'queue'
[string "Command line"]:1: in main chunk
searchaffs () produces this:
queue
shiver
function: 04AC9E58
drink fire
You take a drink from an amethyst vial.
A feeling of comfortable warmth spreads over you.
curelist & aff:
aff=
{
illusion=false,
prone=false,
sleep=false,
waking=false,
-- Focus affs
paralysis=false,
leglock=false,
throatlock=false,
-- Drink affs (cold)
shiver=true,
frozen=false,
}
curelist = {
{name='shiver', heal=drink.fire,},
{name='afflict2', heal=drink.frost,},
}
Am I missing something? Yes it looks weird because I was fiddling with different things to test it out, but with those settings.. searchaffs () works correctly and queue () does not, are they different somehow?
EDIT: Oh boy, I'm an idiot, I didn't fully read the error message before posting... removed the .. v.heal and ..
it worked, but then I moved the tables back from my script file (the one that mushclient compiles..) to tables.lua and it doesn't work anymore. No errors, gah need to experiment more.. Any ideas thus far? this as output:
queue
frozen
shiver
|