Post by jamesp on Oct 16, 2020 22:09:14 GMT
Hi, I'm new to programming and recently got this error on the snapAndPlay
Version: 2.8.9
find 3
Runtime error: /sdcard/AnkuLua/snapAndPlay/snapAndPlay.lua:1167:attempt to concatenate field 'id' (a nil value)
And here's my potato code (any idea what I'm doing wrong?):
----- start mining the rocks here and remember compass north view up -----
a = 1
repeat
wait1 = math.random(111, 999) * 0.001 + 3
wait2 = math.random(111, 999) * 0.001 + 3
wait3 = math.random(111, 999) * 0.001 + 3
------ 1 -----
touchList[index] = {target = "3.png", region = Region(567, 397, 160, 160), id = "3", action = 'click'}
waitList[index] = wait1
index = index + 1
------ 2 -----
touchList[index] = {target = "1.png", region = Region(559, 209, 160, 160), id = "1", action = 'click'}
waitList[index] = wait2
index = index + 1
------ 3 -----
touchList[index] = {target = "2.png", region = Region(459, 304, 160, 160), id = "2", action = 'click'}
waitList[index] = wait3
index = index + 1
a = a + 1
until(a>9)
------ 1 -----
touchList[index] = {"click", Location(972, 326)}
index = index + 2
------ 2 -----
touchList[index] = {"click", Location(972, 380)}
index = index + 2
------ 3 -----
touchList[index] = {"click", Location(974, 436)}
index = index + 2
------ 4 -----
touchList[index] = {"click", Location(975, 482)}
index = index + 2
------ 5 -----
touchList[index] = {"click", Location(973, 537)}
index = index + 2
------ 6 -----
touchList[index] = {"click", Location(973, 585)}
index = index + 2
------ 7 -----
touchList[index] = {"click", Location(973, 637)}
index = index + 2
------ 8 -----
touchList[index] = {"click", Location(1031, 641)}
index = index + 2
------ 9 -----
touchList[index] = {"click", Location(1032, 585)}
index = index + 2
------ 10 -----
touchList[index] = {"click", Location(1033, 536)}
index = index + 2
------ 11 -----
touchList[index] = {"click", Location(1030, 485)}
index = index + 2
------ 12 -----
touchList[index] = {"click", Location(1032, 434)}
index = index + 2
------ 13 -----
touchList[index] = {"click", Location(1031, 381)}
index = index + 2
------ 14 -----
touchList[index] = {"click", Location(1031, 330)}
index = index + 2
------ 15 -----
touchList[index] = {"click", Location(1098, 327)}
index = index + 2
------ 16 -----
touchList[index] = {"click", Location(1098, 381)}
index = index + 2
------ 17 -----
touchList[index] = {"click", Location(1098, 436)}
index = index + 2
------ 18 -----
touchList[index] = {"click", Location(1098, 488)}
index = index + 2
------ 19 -----
touchList[index] = {"click", Location(1098, 539)}
index = index + 2
------ 20 -----
touchList[index] = {"click", Location(1098, 588)}
index = index + 2
------ 21 -----
touchList[index] = {"click", Location(1098, 641)}
index = index + 2
------ 22 -----
touchList[index] = {"click", Location(1155, 641)}
index = index + 2
------ 23 -----
touchList[index] = {"click", Location(1155, 590)}
index = index + 2
------ 24 -----
touchList[index] = {"click", Location(1155, 536)}
index = index + 2
------ 25 -----
touchList[index] = {"click", Location(1155, 484)}
index = index + 2
------ 26 -----
touchList[index] = {"click", Location(1155, 434)}
index = index + 2
------ 27 -----
touchList[index] = {"click", Location(1155, 381)}
index = index + 2
Version: 2.8.9
find 3
Runtime error: /sdcard/AnkuLua/snapAndPlay/snapAndPlay.lua:1167:attempt to concatenate field 'id' (a nil value)
And here's my potato code (any idea what I'm doing wrong?):
----- start mining the rocks here and remember compass north view up -----
a = 1
repeat
wait1 = math.random(111, 999) * 0.001 + 3
wait2 = math.random(111, 999) * 0.001 + 3
wait3 = math.random(111, 999) * 0.001 + 3
------ 1 -----
touchList[index] = {target = "3.png", region = Region(567, 397, 160, 160), id = "3", action = 'click'}
waitList[index] = wait1
index = index + 1
------ 2 -----
touchList[index] = {target = "1.png", region = Region(559, 209, 160, 160), id = "1", action = 'click'}
waitList[index] = wait2
index = index + 1
------ 3 -----
touchList[index] = {target = "2.png", region = Region(459, 304, 160, 160), id = "2", action = 'click'}
waitList[index] = wait3
index = index + 1
a = a + 1
until(a>9)
------ 1 -----
touchList[index] = {"click", Location(972, 326)}
index = index + 2
------ 2 -----
touchList[index] = {"click", Location(972, 380)}
index = index + 2
------ 3 -----
touchList[index] = {"click", Location(974, 436)}
index = index + 2
------ 4 -----
touchList[index] = {"click", Location(975, 482)}
index = index + 2
------ 5 -----
touchList[index] = {"click", Location(973, 537)}
index = index + 2
------ 6 -----
touchList[index] = {"click", Location(973, 585)}
index = index + 2
------ 7 -----
touchList[index] = {"click", Location(973, 637)}
index = index + 2
------ 8 -----
touchList[index] = {"click", Location(1031, 641)}
index = index + 2
------ 9 -----
touchList[index] = {"click", Location(1032, 585)}
index = index + 2
------ 10 -----
touchList[index] = {"click", Location(1033, 536)}
index = index + 2
------ 11 -----
touchList[index] = {"click", Location(1030, 485)}
index = index + 2
------ 12 -----
touchList[index] = {"click", Location(1032, 434)}
index = index + 2
------ 13 -----
touchList[index] = {"click", Location(1031, 381)}
index = index + 2
------ 14 -----
touchList[index] = {"click", Location(1031, 330)}
index = index + 2
------ 15 -----
touchList[index] = {"click", Location(1098, 327)}
index = index + 2
------ 16 -----
touchList[index] = {"click", Location(1098, 381)}
index = index + 2
------ 17 -----
touchList[index] = {"click", Location(1098, 436)}
index = index + 2
------ 18 -----
touchList[index] = {"click", Location(1098, 488)}
index = index + 2
------ 19 -----
touchList[index] = {"click", Location(1098, 539)}
index = index + 2
------ 20 -----
touchList[index] = {"click", Location(1098, 588)}
index = index + 2
------ 21 -----
touchList[index] = {"click", Location(1098, 641)}
index = index + 2
------ 22 -----
touchList[index] = {"click", Location(1155, 641)}
index = index + 2
------ 23 -----
touchList[index] = {"click", Location(1155, 590)}
index = index + 2
------ 24 -----
touchList[index] = {"click", Location(1155, 536)}
index = index + 2
------ 25 -----
touchList[index] = {"click", Location(1155, 484)}
index = index + 2
------ 26 -----
touchList[index] = {"click", Location(1155, 434)}
index = index + 2
------ 27 -----
touchList[index] = {"click", Location(1155, 381)}
index = index + 2