I've got a script that i'm trying to convert to lua 5, but when i debug it it gives me an error...
"392: expected near `in' "
here's the line of the script:
info.in = GetTime()
hope its enough info...script is huge..
try this :
info["in"] = GetTime()
but well, i dont think it will work,it depends on the script, and what it really wants, anyways give it a try !
I guess that Dessamator is correct ;)
Anyway, if it doesn't work could u post the script here?
Well...debugger doesnt complains about those lines anymore....but i got other errors.. like:
" unexpected symbol near `.' "
local math.log = "Base-Dados/UserInfo/"..string.lower(usr)..".info"
So...till all this is fixed..no idea if the other functions are working...
Not sure i can post the whole script here...but i'm working on it
QuoteOriginally posted by [AT]conejodelmal
Well...debugger doesnt complains about those lines anymore....but i got other errors.. like:
" unexpected symbol near `.' "
local math.log = "Base-Dados/UserInfo/"..string.lower(usr)..".info"
So...till all this is fixed..no idea if the other functions are working...
Not sure i can post the whole script here...but i'm working on it
the problem with this local variable declaration is that it is trying to declare an index (log) of a global table (math) as a local variable. I encountered this lately in many scripts and in a weird way they all relate to math.log.. ;)
this is in my opinion because the script was run throught a Lua425 (or similar) converter which encountered a string 'log' and assumed that it must be converted to 'math.log'.. so switching it back should do the trick ..I hope ..
Thx a lot Herodes! It was as you said... switched back and no more error.... at least not that one :P
Now i got an " expected near `in' " in the line:
sTmp = sTmp.."\r\n"..SHOWINFOFUNCMSG8.."\t"..info.in
[AT]conejodelmal : are you trying to convert BrainMaster ? cause if you are,.. I think there are going to be more than 'a couple of stops' until it is done ..
yeah, i was trying.... but just to learn from it, to understand better the changes between lua 4 and 5. I guess that anyway a lot of functions would need to be changed because of the new ptokax...
QuoteOriginally posted by [AT]conejodelmal
yeah, i was trying.... but just to learn from it, to understand better the changes between lua 4 and 5. I guess that anyway a lot of functions would need to be changed because of the new ptokax...
all I can tell you is that nErBoS is a good teacher through his scripts. He writes clean, and has a good way to do things. Although you should be looking at small scripts and play with those a lot before starting on smth as big as BrainMaster ..
QuoteOriginally posted by Herodes all I can tell you is that nErBoS is a good teacher through his scripts. He writes clean, and has a good way to do things. Although you should be looking at small scripts and play with those a lot before starting on smth as big as BrainMaster ..
yeah, maybe i should do that... but i got enthusiastic about something like that... leeding to nowhere probably :P