Auto clicker with random intervals help?

Joined
Mar 16, 2011
Messages
16
Reaction score
0
Points
1
I am looking for an auto clicker with random intervals between clicks.

I have a perfect example; but it's for windows, I have been able to open it on my mac, but when trying to use it, it'll only work when i'm on that particular window, not when i change to the safari or other programs.

Here is a screenshot of the windows one;

clickeri.jpg


This allows you to generate 100 random intervals between clicks (the range is how many mini seconds the delays go from and to)

Something like this is PERFECT, I am fairly new to macs, and tried automator, but have had no such luck on how to get random delays between clicks.

Being a nooby with macs, I am not sure if i am doing something wrong when trying to get this to work on other applications?
I was able to get this running on my macbook pro with WineBottler.

If anyone knows of any other applications which can get the result i'm after I would be forever grateful! Or if someone also knows how i'll be able to do this on "Applescript Editor", and quote what i need to type/talk through it, that would be fantastic.





I'm running a macbook pro on Mac OS X - 10.6.6 (2.66 GHz Intel Core i7).


Thanks for any help... Nathan Brady.

P.S; I'm new to this forum so i am not entirely sure if I have posted this is the correct place.. sorry if that is the issue.

Screen shot 2011-03-16 at 13.08.35.png
 

chscag

Well-known member
Staff member
Admin
Joined
Jan 23, 2008
Messages
65,248
Reaction score
1,833
Points
113
Location
Keller, Texas
Your Mac's Specs
2017 27" iMac, 10.5" iPad Pro, iPhone 8, iPhone 11, iPhone 12 Mini, Numerous iPods, Monterey
Moved to correct forum.

And I suggest being patient as it was only two hours between your posts. These forums are peer to peer and not manned by paid support personnel.
 
OP
N
Joined
Mar 16, 2011
Messages
16
Reaction score
0
Points
1
Okay, thank you for moving my forum to the correct place. And i'll wait to see if anyone replies :)... Thanks for the help with the use of this forum site.
 
Joined
May 14, 2009
Messages
2,052
Reaction score
136
Points
63
Location
Near Whitehorse, Yukon
Your Mac's Specs
2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9
Paste this into the Applescript editor. You can save it as a script which will make it open in the Applescript Editor when double clicked, from where you can start/stop it and change the code.
Or you can save it as a application, it will then run automatically when you open it and then close when it is finished. You cannot edit the code anymore when it is a application.

Code:
##This will not work with java applets! For some strange reason Applescript doesn't like Java.

##How many times to run this script, each time making a new random delay
repeat 100 times
	
	##Make a random number between 2 values, and store it in the randomDelay variable (In seconds)
	set randomDelay to random number from 1 to 30
	
	##Tell System Events to pay attention
	tell application "System Events"
		
		##Now run the delay function with the randomDelay variable we set earlier
		delay randomDelay
		
		##Tell Safari to pay attention
		tell process "Safari"
			
			##The place where we want to click, use command+shift+4 to find the correct coordinates. Top coor is first, bottom is last.
			click at {841, 155}
		end tell
	end tell
end repeat
 
OP
N
Joined
Mar 16, 2011
Messages
16
Reaction score
0
Points
1
Hey, Thanks for your response. I wanted to use this in java script to be honest, anyway that I can make that possible?

Also If it's possible to use the auto click script you have made, but for java applications, Is there any chance you can set the applescript to click on my curser/mouse location? rather then coordinates? Not that i'm finding it hard to find them, just would be better for my use, as the location i would like to click moves from time to time.



I have this code which allows me to use a repeated auto text/type, which works in java applications. I found this surfing the web though.


Here is the Auto Type code (full).
Code:
tell application "System Events"
	set texttosay to "Sample Text"
	display dialog "Text to say:" default answer "white:wave:"
	set texttosay to the text returned of the result
	repeat
		activate application "Safari"
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		keystroke texttosay
		delay 4
		keystroke return
		display dialog the "Do you want to stop the AutoTyper?" buttons {"Continue", "Quit"} default button 1
		if the button returned of the result is "Quit" then
			exit repeat
		end if
	end repeat
end tell


Quick idea which has come to mind, I believe theres a way on macs to set a regular keyboard key to "left click command". If i mix the auto type code with this (say I tell auto type to keep clicking "~" while that key is set to "left click command") Then it may be able to have the same outcome?

With that said, I'm not sure if i'd still be able to have random delays if this process works..? :/


Thanks again for everything so far :)
 
OP
N
Joined
Mar 16, 2011
Messages
16
Reaction score
0
Points
1
Tested...

I have tried setting sticky keys, but didn't seem to work, On my macbook pro when I set them the "left click command" is "i"... I tested using the following command to see if it'll work but sadly it failed, just kept typing i's haha... even though the sticky keys were on. To be honest, i expected this, was just high hoping.

Code:
repeat 100 times
	set randomDelay to random number from 3 to 10
	tell application "System Events"
		delay randomDelay
		tell process "Safari"
			keystroke "III"
		end tell
	end tell
end repeat
FAIL! :p
 
Joined
May 14, 2009
Messages
2,052
Reaction score
136
Points
63
Location
Near Whitehorse, Yukon
Your Mac's Specs
2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9
Hey, Thanks for your response. I wanted to use this in java script to be honest, anyway that I can make that possible?
I'm not sure what you mean here, do you want to run the applescript from a javascript code you wrote or is this the same question as the next one?

Also If it's possible to use the auto click script you have made, but for java applications.
You can try it yourself, just replace Safari in the code with the name of the java app. For example, tell process "Safari" to tell process "Minecraft"
However I'm very sure that it will spit out an error when you try to run it, and I cannot for the life of me figure out why it does this.

EDIT: I have just found out why this is, java does not use the normal Mac OS GUI, it looks the same but it is code wise different and separate from what the system uses. Then when Applescript tries to click it, it doesn't 'see' anything to click on and stalls.
No workaround to this I'm afraid:(

Is there any chance you can set the applescript to click on my curser/mouse location? rather then coordinates? Not that i'm finding it hard to find them, just would be better for my use, as the location i would like to click moves from time to time.
Sadly not, there are plenty of complaints about this but so far Apple hasn't done anything to change it.
All they would have to add is a click mouse at current location event but so far they haven't and it doesn't seem like they will.


I have this code which allows me to use a repeated auto text/type, which works in java applications.
Thats right, typing text isn't a problem but for some strange reason clicking is. :Grimmace:
 
OP
N
Joined
Mar 16, 2011
Messages
16
Reaction score
0
Points
1
Sorry, I wanted the apple scripts command to run on a java application. :/ Don't think thats going to be possible though by the sounds of it.

Ahh well I don't need it too bad... Thanks for all the time and help though :), Helped me understand a lot more then I did originally.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top