error converting to LUA5
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

error converting to LUA5

Started by Alexandros, 26 February, 2005, 06:40:07

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Alexandros

how do you convert this line:
return foreachi(table, function(id, item) if item.sName == %name then return id end end)
of this script http://www.plop.nl/ptokaxbots/OpiumVolage/freeslotbot1.lua to lua5...it seems have a error in %name.

thanks

Optimus

Thats no longer possible... some 1 correct me if i'm wrong

Tw?sT?d-d?v

hi , i got prob with converting script .... i get the error..

scripts\trivia.lua:694: attempt to call global `openfile' (a nil value)

help plz

Optimus

patience is needed m8, things are not going that fast. though some 1 could help ya :D

Tw?sT?d-d?v

LOL ... ok m8   thx

plop

foreach shouldn't ever be used as it's slower then a normal table loop.
the upvallue's used (%name) are removed from lua 5, you need 2 rewrite it fully.
a function inside the function works if you return the locals from the nested function.

lua 5 only handles files by using file handles.
so again here you gotta rewrite the part.
fFile = io.open(filename)
or the new cool way 2 proces every line in a file.
for line in io.lines(filename) do

these things all should be manualy converted as the code differs a bit 2 much on lua 5 (the resulting code is about half the size).

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

??????Hawk??????

QuoteOriginally posted by Alexandros
how do you convert this line:
return foreachi(table, function(id, item) if item.sName == %name then return id end end)
of this script http://www.plop.nl/ptokaxbots/OpiumVolage/freeslotbot1.lua to lua5...it seems have a error in %name.

thanks


Try just removing the   %  see  what happens  ..  

worked ok for me in my script   :))  :))  :))


??????Hawk??????

Tw?sT?d-d?v

hmm ..... still need help .... can some1 help me to convert triv game plz ... it's to big to post here .... ill need to send it some1 if they are able to help

Alexandros


??????Hawk??????

QuoteOriginally posted by (uk)jay
hmm ..... still need help .... can some1 help me to convert triv game plz ... it's to big to post here .... ill need to send it some1 if they are able to help

im sure the creater of your triv bot is doing overtime now  converting it  ...

for now you could use XN with  security disabled for games only  ..

triv , anagrams , war games , HangMan


??????Hawk??????

bastya_elvtars

#10
Quoteplop wrote:

or the new cool way 2 proces every line in a file.
for line in io.lines(filename) do

This rocked my world, really nice 1.  :D

-- // edit

my 1024th post, at last a round number!
Everything could have been anything else and it would have just as much meaning.

Herodes

QuoteOriginally posted by bastya_elvtars
my 1024th post, at last a round number!
Hehehe,... you geek ..  :D

SMF spam blocked by CleanTalk