Sign in to follow this  
Followers 0
pdark1987

trying some simple clicks not work? (noob)

10 posts in this topic

 
MouseClick("left" 624, 375, 1,10) ;op app
sleep(2000)
MouseClick("left" [,680, 1113 [, click = 1 [speed = 10]]]) ;switch windows app
MouseClickDrag("left", 601, 960, 280, 960) ;close op app
MouseClick("left" [,576, 962 [, click = 1 [speed = 10]]]) ; root explorer
MouseClick("left" [,346, 196 [, click = 1 [speed = 10]]]) ; document main
 
 
when i run script get error:
line 2 
mouseclick("left"624,375,1,10)
mouselick"^ERROR
 
error:error in expression
 
im new to this try do a kinda like a marco, but will try to add more functions once i get some of the bassics down.. btw thats the sstart of the script not sure i need to start it some other way..

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

You forgot the comma between "left" and 624.

Also in the rest of your code, the square brackets (meaning "[" and "]") in the helpfile indicate optional arguments. So a text like "Function _myFunction(arg1 [, arg2])" means that arg1 is necessary, and arg2 is optional.

So in the case of MouseClick, the helpfile states:

MouseClick ( "button" [, x, y [, clicks = 1 [, speed = 10]]] )

This means that you can do:

MouseClick("left")

or

MouseClick("left", 10, 20) (note: x and y are on the same "level of optional" so to speak, you can choose to either not supply both or supply both)

or

MouseClick("left", 10, 20, 2) ("clicks = 1" as an argument means that if you do not specify it, it defaults to 1, in this case we do set it to 2)

or

MouseClick("left", 10, 20, 2, 5) (again, "speed = 10" means "default to 10 if not given as argument".)

Hope this makes it somewhat more clear.

Edited by SadBunny

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

pdark1987, what kind of document are you trying to manipulate? I can almost guarantee there is an easier way than using Mouseclicks, which will only lead to headache :)

1 person likes this

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

FileMove could probably achive what you are aiming for, generally MouseClick is kind of a last resort thing.

Share this post


Link to post
Share on other sites

thanks guys.got the the clicks to work. next question if i save a image has an bitmap image and want to click it at the x,y location when image loads? because sometime it take a bit longer to load cuz of the connections.. 

and also how can i start and stop a script cuz of sometimes when it misses and i want to stop it?

thanks for everything

Share this post


Link to post
Share on other sites

i meant click that x,y location when the image shows

Share this post


Link to post
Share on other sites

J1 is asking the same question that has been asked since post #3. What application are you trying to automate?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

im trying to play around with droid4x emulator on pc..

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