Post by paladiex on Aug 30, 2017 16:00:51 GMT
So, below I have a picture. My bot needs to click the runes in order from left to right and down. Once it clicks the rune it will sell it or keep it, if it keeps it then I want it to proceed to the next box; however if it sells it then it needs to click the same box it did prior in order to not skip.
I've got a function, but it feels very inefficient. I've got 24 lines in the function (1 for each of these locations) I feel like I could setup a loop that does something with the numbers in the variables.
Like clickSpot = "rune"..(something).."Row"..(something)
Anyone got any ideas how I can set a loop up for the variables here?
Edit 1: This is what I have for it so far
rune1Row1 = Location (920, 615)
rune2Row1 = Location (1045, 615)
rune3Row1 = Location (1175, 615)
rune4Row1 = Location (1300, 615)
rune5Row1 = Location (1425, 615)
rune6Row1 = Location (1550, 615)
rune1Row2 = Location (920, 740)
rune2Row2 = Location (1045, 740)
rune3Row2 = Location (1175, 740)
rune4Row2 = Location (1300, 740)
rune5Row2 = Location (1425, 740)
rune6Row2 = Location (1550, 740)
rune1Row3 = Location (920, 865)
rune2Row3 = Location (1045, 865)
rune3Row3 = Location (1175, 865)
rune4Row3 = Location (1300, 865)
rune5Row3 = Location (1425, 865)
rune6Row3 = Location (1550, 865)
rune1Row4 = Location (920, 995)
rune2Row4 = Location (1045, 995)
rune3Row4 = Location (1175, 995)
rune4Row4 = Location (1300, 995)
rune5Row4 = Location (1425, 995)
rune6Row4 = Location (1550, 995)
I've got a function, but it feels very inefficient. I've got 24 lines in the function (1 for each of these locations) I feel like I could setup a loop that does something with the numbers in the variables.
Like clickSpot = "rune"..(something).."Row"..(something)
Anyone got any ideas how I can set a loop up for the variables here?
Edit 1: This is what I have for it so far
function runeSpotter ()
if runeSoldHid == 1 then
runeX = runeX - 1
runeSoldHid = 0
end
if runeX > 5 then runeX = 1 and runeY == runeY+1
end
if runeY > 4 then runeY = 1
end
runeSpot = "rune" .. runeX .. "Row".. runeY
runeX = runeX+1
end