Okay so I tried to put all the elements into one array once again, but this doesn't work unfortunately.
Code: Select all
obj := { [12,59], [12,64], [12,68], [12,73], [12,77], [17,59], [17,64], [17,69], [17,78], [21,59], [21,64], [21,69], [21,74], [21,78], [26,59], [26,64], [26,69], [26,73], [26,78], [31,59], [31,64], [31,69], [31,73], [31,78], [36,59], [36,64], [36,69], [36,73], [36,78], [40,59], [40,64], [40,69], [40,73], [40,78], [45,59], [45,64], [45,69], [45,74], [45,78], [50,59], [50,64], [50,69], [50,74], [50,78], [55,59], [55,64], [55,69], [55,73], [55,78], [60,59], [60,63], [60,68], [60,73], [60,79], [65,59], [65,64], [65,69], [65,73], [65,78] }
Random, L, 1, % obj.Length()
mx := obj[L].1 * 10 + 1000
my := obj[L].2 * 10
MouseMove, %mx%, %my%
Sleep 240
Send ^{Click}
Sleep 50
So I guess I'll be working with 2 arrays. This is what I came up with using BoBos code.
Code: Select all
F12::
obj1 := [ {x:1118,y:590}, {x:1119,y:640}, {x:1116,y:680}, {x:1119,y:735}, {x:1116,y:774}, {x:1170,y:591}, {x:1166,y:637}, {x:1166,y:687}, {x:1166,y:735}, {x:1167,y:781}, {x:1218,y:593}, {x:1213,y:639}, {x:1212,y:688}, {x:1215,y:741}, {x:1216,y:780}, {x:1260,y:590}, {x:1262,y:637}, {x:1263,y:687}, {x:1261,y:733}, {x:1264,y:784}, {x:1311,y:591}, {x:1309,y:639}, {x:1311,y:690}, {x:1311,y:734}, {x:1313,y:783}, {x:1358,y:591}, {x:1360,y:638}, {x:1359,y:688}, {x:1359,y:735}, {x:1359,y:782} ]
obj2 := [ {x:1408,y:590}, {x:1405,y:638}, {x:1404,y:686}, {x:1406,y:733}, {x:1405,y:782}, {x:1454,y:588}, {x:1451,y:638}, {x:1453,y:687}, {x:1454,y:735}, {x:1455,y:782}, {x:1503,y:587}, {x:1502,y:637}, {x:1503,y:687}, {x:1500,y:737} {x:1501,y:783}, {x:1550,y:588}, {x:1552,y:638}, {x:1549,y:686}, {x:1552,y:734}, {x:1551,y:783}, {x:1596,y:587}, {x:1597,y:634}, {x:1598,y:684}, {x:1598,y:734}, {x:1600,y:787}, {x:1649,y:589}, {x:1645,y:640}, {x:1647,y:687}, {x:1645,y:734}, {x:1649,y:782} ]
obj := [obj1,obj2]
Random, oNo, 1,% obj.Length()
Random, iNo, 1,% obj[oNo].Length()
mx := obj[iNo].x
my := obj[iNo].y
MouseMove, %mx%, %my%
Sleep 200
Send ^{Click}
Sleep 50
obj.RemoveAt(iNo) ; Remove used element
Random, oNo, 1,% obj.Length()
Random, iNo, 1,% obj[oNo].Length()
mx := obj[iNo].x
my := obj[iNo].y
MouseMove, %mx%, %my%
Sleep 200
Send ^{Click}
Sleep 50
obj.RemoveAt(iNo) ; Remove used element
Random, oNo, 1,% obj.Length()
Random, iNo, 1,% obj[oNo].Length()
mx := obj[iNo].x
my := obj[iNo].y
MouseMove, %mx%, %my%
Sleep 200
Send ^{Click}
Sleep 50
obj.RemoveAt(iNo) ; Remove used element
Random, oNo, 1,% obj.Length()
Random, iNo, 1,% obj[oNo].Length()
mx := obj[iNo].x
my := obj[iNo].y
MouseMove, %mx%, %my%
Sleep 200
Send ^{Click}
Sleep 50
obj.RemoveAt(iNo) ; Remove used element
Random, oNo, 1,% obj.Length()
Random, iNo, 1,% obj[oNo].Length()
mx := obj[iNo].x
my := obj[iNo].y
MouseMove, %mx%, %my%
Sleep 200
Send ^{Click}
Sleep 50
if obj1.Length() + obj2.Length() = 55 ? : (obj1 := [ {x:1118,y:590}, {x:1119,y:640}, {x:1116,y:680}, {x:1119,y:735}, {x:1116,y:774}, {x:1170,y:591}, {x:1166,y:637}, {x:1166,y:687}, {x:1166,y:735}, {x:1167,y:781}, {x:1218,y:593}, {x:1213,y:639}, {x:1212,y:688}, {x:1215,y:741}, {x:1216,y:780}, {x:1260,y:590}, {x:1262,y:637}, {x:1263,y:687}, {x:1261,y:733}, {x:1264,y:784}, {x:1311,y:591}, {x:1309,y:639}, {x:1311,y:690}, {x:1311,y:734}, {x:1313,y:783}, {x:1358,y:591}, {x:1360,y:638}, {x:1359,y:688}, {x:1359,y:735}, {x:1359,y:782} ] & obj2 := [ {x:1408,y:590}, {x:1405,y:638}, {x:1404,y:686}, {x:1406,y:733}, {x:1405,y:782}, {x:1454,y:588}, {x:1451,y:638}, {x:1453,y:687}, {x:1454,y:735}, {x:1455,y:782}, {x:1503,y:587}, {x:1502,y:637}, {x:1503,y:687}, {x:1500,y:737} {x:1501,y:783}, {x:1550,y:588}, {x:1552,y:638}, {x:1549,y:686}, {x:1552,y:734}, {x:1551,y:783}, {x:1596,y:587}, {x:1597,y:634}, {x:1598,y:684}, {x:1598,y:734}, {x:1600,y:787}, {x:1649,y:589}, {x:1645,y:640}, {x:1647,y:687}, {x:1645,y:734}, {x:1649,y:782} ] )
MouseMove, 276, 224
Send {Space Down}
Sleep 200
Send {Space Up}
Sleep 50
Send {Esc}
MouseMove, 846, 280
Sleep 100
Send {Click}
return
My brain tells me tho that this impacts the "randomness" of the picking, because by rolling obj1 or obj2 I'm removing half of the pool... Not sure if that's true, just hard to imagine.
I have two more questions regarding this. First one is: Do I need to specify from which array the used object has to be removed? I kind of feel like by using obj.RemoveAt(iNo) it removes 2 objects with the same "key" (is that the right term?)
My second question is about the reset of the two arrays after picking 5 elements. Is using "&" the right way to do it?