I'm looking for some AppleScript help for my game :)

Joined
Jan 27, 2011
Messages
2
Reaction score
0
Points
1
Hello.
I am new to these forums so excuse me for any problems.

I am trying to learn AppleScript a little bit, so I figured I'd start by working on something that would help me with my gaming. I am running this game on Safari/Firefox if it matters.

I kind of want something that will click randomly between 1.00000 and 3.00000 seconds (including the decimals).

I will update you as I figure parts out.

Thanks
This should help me learn a bit about AppleScript =)

My Current Code:
Code:
tell application "Safari" to activate

repeat 2000 times
	set a to random number from 1.0 to 3.0
	delay a
	tell application "System Events"
		tell process "Safari"
			click at {1000, 300}
		end tell
	end tell
end repeat
 
OP
N
Joined
Jan 27, 2011
Messages
2
Reaction score
0
Points
1
I was saying that it didn't click in a normal webpage... but it does.

It says this however when trying to click on my Java Based game:

tell current application
random number from 1.0 to 3.0
--> 1.316124503011
end tell
tell application "System Events"
click process "Safari" at {1000, 200}
--> missing value
end tell
 
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
From what I figured out from past Applescripting it will not click on Java apps, in browser or standalone.
Your code is correct and it will click in a normal webpage as you said, but as soon as it hits a java application something changes and it buggers up.
I tried both Applescript and Automator and both have the same problem, and I haven't found a solution for it yet.
 

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