Sign in to follow this  
Followers 0
mauranius

Problem with multiple labels

4 posts in this topic

Dear Autoit forum people :). I have been working on a quite difficult script on autoit2. And it doesn't do what it should do! You see I want Autoit to random choose a program out of 3 clicking sequences which I have worked out, I assigned labels to each of the sequences, but it keeps opening the first label no matter what I have tried. I also tried making it a sublabel etc.

Anyone has an idea how I can solve this problem? I already tried Goto and Gosub and neither of them seems to be working on the labels. Maybe there is a command that shows where a label starts/stops?

Scripting is below, thanks in advance (p.s. the script i made to resemble a real person clicking)

Inputbox, A, haha, please enter number of repeats

Sleep, 4500

Repeat, %A%

Inputbox, program, program, 1-3

IfEqual, %program%, 1, Gosub, program1

program1:

Random, X, 695, 705

Random, Z, 1000, 1100

Random, C, 460, 470

Random, D, 494, 503

Random, E, 531, 539

Random, F, 566, 574

Random, G, 600, 610

Random, H, 638, 642

Random, I, 672, 678

LeftClick, %X%, %C%

Sleep, %Z%

LeftClick, %x%, %D%

Sleep, %Z%

LeftClick, %X%, %E%

Sleep, %Z%

LeftClick, %x%, %F%

Sleep, %Z%

LeftClick, %X%, %G%

Sleep, %Z%

LeftClick, %x%, %H%

Sleep, %Z%

LeftClick, %X%, %I%

Sleep, %Z%

Random, X, 735, 745

Random, Z, 1000, 1100

Random, C, 460, 470

Random, D, 494, 503

Random, E, 531, 539

Random, F, 566, 574

Random, G, 600, 610

Random, H, 638, 642

Random, I, 672, 678

Sleep, %Z%+50

LeftClick, %X%, %C%

Sleep, %Z%

LeftClick, %x%, %D%

Sleep, %Z%

LeftClick, %X%, %E%

Sleep, %Z%

LeftClick, %x%, %F%

Sleep, %Z%

LeftClick, %X%, %G%

Sleep, %Z%

LeftClick, %x%, %H%

Sleep, %Z%

LeftClick, %X%, %I%

Sleep, %Z%

Random, X, 780, 790

Random, Z, 1000, 1100

Random, C, 460, 470

Random, D, 494, 503

Random, E, 531, 539

Random, F, 566, 574

Random, G, 600, 610

Random, H, 638, 642

Random, I, 672, 678

Sleep, %Z%+50

LeftClick, %X%, %C%

Sleep, %Z%

LeftClick, %x%, %D%

Sleep, %Z%

LeftClick, %X%, %E%

Sleep, %Z%

LeftClick, %x%, %F%

Sleep, %Z%

LeftClick, %X%, %G%

Sleep, %Z%

LeftClick, %x%, %H%

Sleep, %Z%

LeftClick, %X%, %I%

Sleep, %Z%

Random, X, 820, 830

Random, Z, 1000, 1100

Random, M, 8000, 8500

Random, C, 460, 470

Random, D, 494, 503

Random, E, 531, 539

Random, F, 566, 574

Random, G, 600, 610

Random, H, 638, 642

Random, I, 672, 678

Sleep, %Z%+70

LeftClick, %X%, %C%

Sleep, %Z%

LeftClick, %x%, %D%

Sleep, %Z%

LeftClick, %X%, %E%

Sleep, %Z%

LeftClick, %x%, %F%

Sleep, %Z%

LeftClick, %X%, %G%

Sleep, %Z%

LeftClick, %x%, %H%

Sleep, %Z%

LeftClick, %X%, %I%

Sleep, %M%

Return

IfEqual, %program%, 2, Gosub, program2

program2:

Random, X, 695, 705

Random, Z, 1000, 1100

Random, C, 460, 470

Random, D, 494, 503

Random, E, 531, 539

Random, F, 566, 574

Random, G, 600, 610

Random, H, 638, 642

Random, I, 672, 678

LeftClick, %X%, %C%

Sleep, %Z%

LeftClick, %x%, %D%

Sleep, %Z%

LeftClick, %X%, %E%

Sleep, %Z%

LeftClick, %x%, %F%

Sleep, %Z%

LeftClick, %X%, %G%

Sleep, %Z%

LeftClick, %x%, %H%

Sleep, %Z%

LeftClick, %X%, %I%

Sleep, %Z%

Random, X, 735, 745

Random, Z, 1000, 1100

Random, C, 460, 470

Random, D, 494, 503

Random, E, 531, 539

Random, F, 566, 574

Random, G, 600, 610

Random, H, 638, 642

Random, I, 672, 678

Sleep, %Z%+50

LeftClick, %X%, %I%

Sleep, %Z%

LeftClick, %x%, %H%

Sleep, %Z%

LeftClick, %X%, %G%

Sleep, %Z%

LeftClick, %x%, %F%

Sleep, %Z%

LeftClick, %X%, %E%

Sleep, %Z%

LeftClick, %x%, %D%

Sleep, %Z%

LeftClick, %X%, %C%

Sleep, %Z%

Random, X, 780, 790

Random, Z, 1000, 1100

Random, C, 460, 470

Random, D, 494, 503

Random, E, 531, 539

Random, F, 566, 574

Random, G, 600, 610

Random, H, 638, 642

Random, I, 672, 678

Sleep, %Z%+50

LeftClick, %X%, %C%

Sleep, %Z%

LeftClick, %x%, %D%

Sleep, %Z%

LeftClick, %X%, %E%

Sleep, %Z%

LeftClick, %x%, %F%

Sleep, %Z%

LeftClick, %X%, %G%

Sleep, %Z%

LeftClick, %x%, %H%

Sleep, %Z%

LeftClick, %X%, %I%

Sleep, %Z%

Random, X, 820, 830

Random, Z, 1000, 1100

Random, M, 8000, 8500

Random, C, 460, 470

Random, D, 494, 503

Random, E, 531, 539

Random, F, 566, 574

Random, G, 600, 610

Random, H, 638, 642

Random, I, 672, 678

Sleep, %Z%+70

LeftClick, %X%, %I%

Sleep, %Z%

LeftClick, %x%, %H%

Sleep, %Z%

LeftClick, %X%, %G%

Sleep, %Z%

LeftClick, %x%, %F%

Sleep, %Z%

LeftClick, %X%, %E%

Sleep, %Z%

LeftClick, %x%, %D%

Sleep, %Z%

LeftClick, %X%, %C%

Sleep, %M%

Return

IfEqual, %program%, 3, Gosub, program3

program3:

Random, X, 820, 830

Random, Z, 1000, 1100

Random, C, 460, 470

Random, D, 494, 503

Random, E, 531, 539

Random, F, 566, 574

Random, G, 600, 610

Random, H, 638, 642

Random, I, 672, 678

Sleep, %Z%+70

LeftClick, %X%, %C%

Sleep, %Z%

LeftClick, %x%, %D%

Sleep, %Z%

LeftClick, %X%, %E%

Sleep, %Z%

LeftClick, %x%, %F%

Sleep, %Z%

LeftClick, %X%, %G%

Sleep, %Z%

LeftClick, %x%, %H%

Sleep, %Z%

LeftClick, %X%, %I%

Sleep, %Z%

Random, X, 780, 790

Random, Z, 1000, 1100

Random, C, 460, 470

Random, D, 494, 503

Random, E, 531, 539

Random, F, 566, 574

Random, G, 600, 610

Random, H, 638, 642

Random, I, 672, 678

Sleep, %Z%+50

LeftClick, %X%, %C%

Sleep, %Z%

LeftClick, %x%, %D%

Sleep, %Z%

LeftClick, %X%, %E%

Sleep, %Z%

LeftClick, %x%, %F%

Sleep, %Z%

LeftClick, %X%, %G%

Sleep, %Z%

LeftClick, %x%, %H%

Sleep, %Z%

LeftClick, %X%, %I%

Sleep, %Z%

Random, X, 735, 745

Random, Z, 1000, 1100

Random, C, 460, 470

Random, D, 494, 503

Random, E, 531, 539

Random, F, 566, 574

Random, G, 600, 610

Random, H, 638, 642

Random, I, 672, 678

Sleep, %Z%+50

LeftClick, %X%, %C%

Sleep, %Z%

LeftClick, %x%, %D%

Sleep, %Z%

LeftClick, %X%, %E%

Sleep, %Z%

LeftClick, %x%, %F%

Sleep, %Z%

LeftClick, %X%, %G%

Sleep, %Z%

LeftClick, %x%, %H%

Sleep, %Z%

LeftClick, %X%, %I%

Sleep, %Z%

Random, X, 695, 705

Random, Z, 1000, 1100

Random, M, 8000, 8500

Random, C, 460, 470

Random, D, 494, 503

Random, E, 531, 539

Random, F, 566, 574

Random, G, 600, 610

Random, H, 638, 642

Random, I, 672, 678

LeftClick, %X%, %C%

Sleep, %Z%

LeftClick, %x%, %D%

Sleep, %Z%

LeftClick, %X%, %E%

Sleep, %Z%

LeftClick, %x%, %F%

Sleep, %Z%

LeftClick, %X%, %G%

Sleep, %Z%

LeftClick, %x%, %H%

Sleep, %Z%

LeftClick, %X%, %I%

Sleep, %M%

Return

EndRepeat

Share this post


Link to post
Share on other sites



May I suggest to download AutoItv3, the latest one? Also you can pretty easily use the simple $iRandom = Random(1, 3, 1)

for simple 1 through 3 options, it's not so random as yours but it's still random.

Share this post


Link to post
Share on other sites

May I suggest to download AutoItv3, the latest one? Also you can pretty easily use the simple $iRandom = Random(1, 3, 1)

for simple 1 through 3 options, it's not so random as yours but it's still random.

Hehe you may yes, but I just started finding out the opportunities of this one :), so first I hope someone will know why my script won't use labels, then if no one knows i might have to switch to autoitv3

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0