After experimenting with it a bit I see its potential, but unfortunately it also has some flaws that make it teach people to write bad Lua code.
It limits the execution of each callin function to a certain number (usually 5000) of lines of code. You can check how much lines you have left using builtin getNumberOfLines() function. The problem is that counting of executed lines of code is implemented in the most braindead way possible and is very abusable.
Some examples:
(it is long) [spoiler]
This counts as 2 lines of code:
But at the same time this counts as only one:
Or using nice Lua syntax:
From here it only gets worse. These also count as 1 line of code:
[quote]a
{ b
1, c
2, d
{ e
3, f
4}, g = 6 }[/quote]
quote: if (a == 1) then b 2 else b 3 end |
You see where this is going...
The only bottleneck seem to be function calls (which count as 2 lines + whatever is in function body) and loops which count as at least as much as number of iterations they do.
(in the following code I am using triangle brackets instead of square ones to avoid breaking the forum formatting)
So a loop like this:
[quote]for i
1, 5 do a<i>
2 * i end[/quote]Counts as 5 lines of code, which is the minimum.
But you must be careful with these, because:
[quote]for i = 1, 5 do
a<i> = 2 * i
end[/quote]already counts as 10 lines.
While the noob way:
quote: a<1> 2; a<2> 4; a<3> 6; a<4> 8; a<5> = 10 |
counts as only one!
[/spoiler]
All of this leads the code of top-performing bots to look like this:
Which doesn't really help code readibility and reusability...