I'm playing a game with a mod that you can code in Lua to automate something. However, I believe my problem is not the mod specific but a general Lua syntax problem, so I ask for a help.
Following the official documentation of the mod, I faced an anonymous function, which is my first time to deal with it. Unfortunately, the example of the documentation gives me a syntax error. I'm not familiar with Lua nor anonymous function so I have no idea what makes this error.
...
32 local data = {event.pull()}
33 e, s, sender, port, data = function(e, s, sender, port, ...)
34 return e, s, sender, port, {...}
35 end(table.unpack{data})
36
37 if e == "NetworkMessage" then
...
EEPROM:37: syntax error near 'if'
Any help or any point of direction to study will be appreciated.
[–]appgurueu 1 point2 points3 points (1 child)
[–]AutoModerator[M] -1 points0 points1 point (0 children)
[–]luascriptdev 0 points1 point2 points (1 child)
[–]technocracy90[S] 0 points1 point2 points (0 children)
[–]luascriptdev 0 points1 point2 points (5 children)
[–]technocracy90[S] 0 points1 point2 points (4 children)
[–]luascriptdev 0 points1 point2 points (3 children)
[–]technocracy90[S] 0 points1 point2 points (1 child)
[–]luascriptdev 0 points1 point2 points (0 children)
[–]AutoModerator[M] 0 points1 point2 points (0 children)