Trouble with Basics, pick 3 Elements out of 5
Posted: 25 Nov 2020, 04:20
Hi there guys, so I'm a noob when it comes to coding and I'm having troubles making my script work.
What I want to do is pick n elements out of m without picking the same element twice. Each element has a specific unique position and when an element is picked, the mouse should move to the position.
However, my script isn't doing anything. Here is what I came up with
but that didn't work either. What am I doing wrong?
ok so I learned that I have to use stringsplit for this to work, however, my script still isn't doing anything
best regards
What I want to do is pick n elements out of m without picking the same element twice. Each element has a specific unique position and when an element is picked, the mouse should move to the position.
However, my script isn't doing anything. Here is what I came up with
Code: Select all
random, l, 1, 5
obj := {1: "x = 1110, y = 588", 2: "x = 1110, y = 669", 3: "x = 1110, y = 750", 4: "x = 1110, y = 830", 5: "x = 1110, y = 910"} ; do I even need to specify x & y here or would 1: "1110, 588" also work? I probably also need to create a connection between the random number picked and the objecties?
MouseMove, x%x%, y%y% obj["l"] ; do I even need to specify x & y here or would "MouseMove, % obj["l]" also work? (like I did below)
if((m := rand(1, 5)) != l)
MouseMove, % obj["m"]
if((n := rand(1, 5)) != l | m)
MouseMove, % obj["m"]
; then finish and pick another 3 elements
; I also tried
random, var_1, 1, 5
l := %var_1%
ok so I learned that I have to use stringsplit for this to work, however, my script still isn't doing anything
Code: Select all
random, l, 1, 5
obj := {1: "1110,588", 2: "1110,669", 3: "1110,750", 4: "1110,830", 5: "1110,910"}
var_1 := obj["%l%"]
stringsplit coordinatesxy, var_1, `,
MouseMove %coordinatesxy1%, %coordinatesxy2%
best regards