Hi everybody? ;D
I'm trying to run this script in my new hub. but i'm getting the error [13:58] Syntax ...\0.3.5.0.lua5.1.1.dbg\scripts\Shuckie Engl-lua 5.lua:1929: attempt to call a table value. is that because it has to be converted to lua 5.1? And if so can anybody convert this for . Thx? ;)
For fixed it change in line 1929 this:
for key, value in trigs do
with:
for key, value in pairs(trigs) do
And work
Hi Marilyn
Thanks allot ;D It's working fine now. nomore errors ;)
Welcome ;)
You will find more error's in table.getn's calls because in lua 5.1 it was renamed to table.maxn + the're missing locals.
This tricker-bot is not the best, search for another maybe clever bot.
Quote from: Markitos on 17 July, 2006, 18:00:31
You will find more error's in table.getn's calls because in lua 5.1 it was renamed to table.maxn + the're missing locals.
This tricker-bot is not the best, search for another maybe clever bot.
I have fixed only bug reported by TopCat, I don't have see all code ;)
Quote from: 6Marilyn6Manson6 on 17 July, 2006, 18:04:42
Quote from: Markitos on 17 July, 2006, 18:00:31
You will find more error's in table.getn's calls because in lua 5.1 it was renamed to table.maxn + the're missing locals.
This tricker-bot is not the best, search for another maybe clever bot.
I have fixed only bug reported by TopCat, I don't have see all code ;)
I didn't blame you =)
Quote from: Markitos on 17 July, 2006, 18:14:23
Quote from: 6Marilyn6Manson6 on 17 July, 2006, 18:04:42
Quote from: Markitos on 17 July, 2006, 18:00:31
You will find more error's in table.getn's calls because in lua 5.1 it was renamed to table.maxn + the're missing locals.
This tricker-bot is not the best, search for another maybe clever bot.
I have fixed only bug reported by TopCat, I don't have see all code ;)
I didn't blame you =)
OK :D
Quote from: Markitos on 17 July, 2006, 18:00:31
You will find more error's in table.getn's calls because in lua 5.1 it was renamed to table.maxn + the're missing locals.
This tricker-bot is not the best, search for another maybe clever bot.
Put in the front:
table.getn=table.getn or function(tbl) return #tbl end
Quote from: bastya_elvtars on 17 July, 2006, 18:54:30
Quote from: Markitos on 17 July, 2006, 18:00:31
You will find more error's in table.getn's calls because in lua 5.1 it was renamed to table.maxn + the're missing locals.
This tricker-bot is not the best, search for another maybe clever bot.
Put in the front:
table.getn=table.getn or function(tbl) return #tbl end
Interesting function! Or maybe table.getn = table.getn or table.maxn
maxn should be avoided whenever possible, it traverses the table (similar to a for loop).
Quote from: bastya_elvtars on 17 July, 2006, 20:13:30
maxn should be avoided whenever possible, it traverses the table (similar to a for loop).
Humm thanks for the hint.
Hi everybody,
Ive only changed what Marilyn told me to change and it works great in my hub. Ive had no more errors. :P
So i don't know about the other errors but if i get any other ones i will replay them here ;D
Quote from: TopCat on 17 July, 2006, 21:45:07
Hi everybody,
Ive only changed what Marilyn told me to change and it works great in my hub. Ive had no more errors. :P
So i don't know about the other errors but if i get any other ones i will replay them here? ;D
LOL :D
Quote from: bastya_elvtars on 17 July, 2006, 18:54:30
table.getn=table.getn or function(tbl) return #tbl end
After some reading...
function len_event (op)
if type(op) == "string" then
return strlen(op) -- primitive string length
elseif type(op) == "table" then
return #op -- primitive table length
Quote from: Mutor on 18 July, 2006, 20:43:53
Yes that works well, I for one dont mind traversing the table ;D
table.maxn will serve well for most applications
#tablename will serve as well
btw your example code is LUA 4 and the function, incomplete...
Length = function(item)
if item then
if type(item) == "string" then
return string.len(item)
elseif type(item) == "table" then
return #item
end
end
end
Your right, i though so but wasn't sure. I never programmed in LUA 4 and found that func. in here http://www.lua.org/manual/5.1/manual.html#2.8
I noticed too that it was incomplete but what i wanted to know/show was the lenght operator #.
Cheers