Sign in to follow this  
Followers 0
Omga4000

Random Choice of Scripts

3 posts in this topic

#1 ·  Posted (edited)

Hey all :graduated:

I've created a script that presses on certain places in the screen (MouseClick).

Now I want to insert him a few more lines of MouseClick and let him

randomly choose one of them.

I've looked at Random function but it's only for numbers..

Is it possible

Thank you ;)

EDIT:

I thought maybe an example will help you understand better..

Choice num 1

MouseMove(971,169)
MouseDown(left)
MouseMove(707,170)
MouseUp(left)

Choice num 2

MouseClick(left,1172,1004,1)
Sleep (2000)
MouseClick(left,365,466,1)

Choice num 3

Send($date & {TAB}Title{TAB}Last{TAB}Middle{TAB}First{TAB}Suffix{TAB}2000{TAB}1{TAB}1{TAB}{SPACE})
MouseClick(left,1067,443,1)

Now randomly choose between choice number 1, choice number 2 and choice number 3.

This is just an example of clicks. NOT my real script.

So there's no point of using it in you answer :)

Edited by Omga4000

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

You can use "If... ElseIf", "Select Case" or "Switch Case"

Example of switch:

$Random = Random(1, 3, 1)
;Switch
Switch $Random
;Choice num 1
Case 1
  MouseMove(971, 169)
  ;Choice num 2:
Case 2
  ; Your code...
  ;Choice num 3:
Case 3
  ; Your code...
EndSwitch
Edited by Ramzes

Sorry for my bad English but nobody is perfect. [font=arial, helvetica, sans-serif]Ramzes[/font]

Share this post


Link to post
Share on other sites

Thank you! :graduated:

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