Hello!
I have been testing functions in AutoTouch, which runs Lua. When I was testing the “findColor” function, something went wrong and I don’t know why. Script:
—————————————————————
function getColorAxis(color)
local axis;
repeat
axis = findColor(color, 0, nil)
until(#axis > 0)
return axis
end
function printTab(t)
for i = 1, #t do
local s = tostring(t)
toast(s)
end
end
ax = getColorAxis(30455)
printTab(ax)
usleep(1000000)
——————————————————————
The only error I can think of is the tostring function ,which might have a version problem. But since it didn’t throw out an error, I think that this might not be the case
When I run the script, it starts off doing nothing (since I have the color on home screen), but when I exit to home screen, instead of printing both vectors, it prints out a table, then freezes. The only way(I think) to fix this is to force power-off my device and rejailbreaking. So if someone can tell me what’s wrong with my code, that will really help.
Thanks!