PtokaX forum

Archive => Archived 5.0 boards => Help with scripts => Topic started by: ConejoDelMal on 07 April, 2005, 09:00:45

Title: need help converting...
Post by: ConejoDelMal on 07 April, 2005, 09:00:45
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..
Title:
Post by: Dessamator on 07 April, 2005, 10:25:49
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 !
Title:
Post by: jiten on 07 April, 2005, 11:41:29
I guess that Dessamator is correct  ;)
Anyway, if it doesn't work could u post the script here?
Title:
Post by: ConejoDelMal on 07 April, 2005, 16:50:01
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
Title:
Post by: Herodes on 07 April, 2005, 17:13:27
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 ..
Title:
Post by: ConejoDelMal on 07 April, 2005, 17:27:33
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
Title:
Post by: Herodes on 08 April, 2005, 00:32:50
[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 ..
Title:
Post by: ConejoDelMal on 08 April, 2005, 00:50:30
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...
Title:
Post by: Herodes on 08 April, 2005, 01:02:45
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 ..
Title:
Post by: ConejoDelMal on 08 April, 2005, 01:07:18
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