New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Apps and Games Discussion of applications and games available for Mac OS X.

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


Post Reply New Thread Subscribe

 
Thread Tools
Ninja Konor

 
Member Since: Jan 27, 2011
Posts: 2
Ninja Konor is on a distinguished road

Ninja Konor is offline
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
QUOTE Thanks
Ninja Konor

 
Member Since: Jan 27, 2011
Posts: 2
Ninja Konor is on a distinguished road

Ninja Konor is offline
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
QUOTE Thanks
McYukon

 
McYukon's Avatar
 
Member Since: May 14, 2009
Location: Near Whitehorse, Yukon
Posts: 2,053
McYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to behold
Mac Specs: 2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9

McYukon is offline
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.

Use the reputation system if a post helps you!
Mac Forums IRC Channel - Help build it by hanging out with us
The next sentence is true. The previous sentence is false.
QUOTE Thanks

Post Reply New Thread Subscribe


« Left 4 Dead 2 crash error... | Bootable backup partition size »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Applescript to load a game + no cd crack fernando87 OS X - Apps and Games 6 04-06-2009 11:17 PM
Best Mac Racing Sim to Date theanimaster OS X - Apps and Games 3 07-17-2008 08:09 PM

All times are GMT -4. The time now is 04:06 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?