The Wiki for Tale 4 is in read-only mode and is available for archival and reference purposes only. Please visit the current Tale 11 Wiki in the meantime.

If you have any issues with this Wiki, please post in #wiki-editing on Discord or contact Brad in-game.

User:Quin/Macros/AS

From A Tale in the Desert
Jump to navigationJump to search

Quin's AppleScript Macros

It's not much and I'm still learning how to use AppleScript. If you find any ways to improve these, please let me know! As it is, they're rather archaic, but they work. All of these depend on a program called "Extra Suites" which makes things like clicking the mouse easier. It also has a feature for color detect (used for the slate macro).


General Purpose

This script will give you 2 seconds to hover the mouse over something (limestone, dig deeper command, chariot stop window, etc.) and then click it every 10 seconds. Just change the delay if you want it shorter or longer, depending on the situation. Stop it by going to Apple Script (Alt-Tab) and pressing stop script (Command-.)

This will interfere with typing while it's clicking, so it's somewhat a pain in that regards.

tell application "Extra Suites"
	
	delay 2 -- use this time to hover mouse over target.
	set POS1 to ES mouse location
	set theCount to 0
	
	repeat
		set POSX to ES mouse location
		ES move mouse POS1
		ES click mouse
		ES move mouse POSX
		delay 10 -- edit for time (in seconds)
	end repeat
end tell

Slate

CAUTION! It will steal your mouse and not give it back. Basically you should move to a space with slate present, start the macro and hover the mouse over the slate (so it can detect the color). Once that's done, the only way to get your mouse back is to kill the macro (Alt-Tab and press Esc or "Command-.").

On the bright side, it doesn't interfere with typing if you decide you need to stop to talk.

tell application "Extra Suites"
	
	delay 2 -- use this time to hover mouse over slate icon
	set POS1 to ES mouse location
	set RGB1 to ES pixel color
	set theCount to 0
	
	repeat
		set POSX to ES mouse location
		ES move mouse POS1
		set RGBX to ES pixel color
		if RGB1 = RGBX then ES click mouse
		ES move mouse POSX
		delay 0.1
	end repeat
end tell


Grass

A little more refined then the slate, but still not perfect. Setup is simple, hover the mouse over the grass icon, then hover the mouse over your avatar's head as (s)he stands up. This was a weak attempt to compensate for different windows sizes. You don't have to me zoomed in all the way, but should certainly make sure you can't see any buildings n/s of you.

This will interfere with typing while it's clicking, so it's somewhat a pain in that regards.

tell application "Extra Suites"
	
	delay 2
	set GPOS to ES mouse location -- hover over grass icon
	ES click mouse
	set theCount to 0
	
	delay 4
	set CLKPOS to ES mouse location -- hover over avi's head
	copy CLKPOS to CLK1
	set item 2 of CLK1 to 700
	copy CLKPOS to CLK2
	set item 2 of CLK2 to 100
	
	repeat until (theCount = 100) - alter if you have high/low Rhythmic Strength
		set POSX to ES mouse location
		ES move mouse CLK1 -- North
		ES click mouse
		ES move mouse POSX
		delay 3
		set POSX to ES mouse location
		ES move mouse GPOS
		ES click mouse
		ES move mouse CLK2 -- South
		ES click mouse
		ES move mouse POSX
		delay 3
		set POSX to ES mouse location
		ES move mouse GPOS
		ES click mouse
		ES move mouse POSX
		set theCount to theCount + 1
	end repeat
end tell


.... more to come.