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

From A Tale in the Desert
Jump to navigationJump to search

I primarily use AutoHotKey on my PC. If you're a Mac OSX user, go here for my Apple Script macros.


AutoHotKey Scripts

Charcoal

Description & Usage

To use this, you have to understand how to make charcoal! Visit my charcoal creation guide to get a few pointers! Certainly only try with *one* until you're sure it's working. Occasionally I've had this glitch and move a window, so watch out!

This is an edited version of a macro Tesuji of T3 wrote. I rewrote it in T3 for operating my 10 charcoal ovens, but it actually can support 12 ovens. You must be in full-screen (not window) mode for this macro to work properly. It has settings to make the mouse move super-fast, so I typically don't have this macro always running in the background.

  • Setup Controls:
    • Ctrl+Shift+Z: Add a window and position it. Hover the mouse over the window and press this key. Do not move a window after it has been placed.
    • Ctrl+Shift+X: Clear all window settings. You must set them up again by using Ctrl+Shift-Z on each window.
    • Ctrl+Shift+R: Begin recalibrating relative button positions.
  • Buttons
    • Ctrl+Shift+Q: Press Begin on all windows.
    • Ctrl+Shift+W: Add wood to all windows.
    • Ctrl+Shift+E: Add water to all windows.
    • Ctrl+Shift+A: Close all vents.
    • Ctrl+Shift+S: Set all vents to partially open.
    • Ctrl+Shift+D: Open all vents.

Note: Make sure to have enough supplies handy (10 jugs & 300 wood/oven).

Macro

#SingleInstance force

SendMode Play
SetMouseDelay, 10, Play

; Number of columns before going to next row
ColumnCount := 4

; Relative positions of each location.
; Set here permanently or recalibrate every time.
SizeX := 222
SizeY := 239
BeginX := 105
BeginY := 215
WoodX := 34
WoodY := 222
WaterX := 76
WaterY := 222
CloseX := 128
CloseY := 222
MiddleX := 155
MiddleY := 222
OpenX := 179
OpenY := 222

WindowCount := 0
IsCalibrating := false

BaseX(Index)
{
  global ColumnCount
  global SizeX
  return (Floor(Mod(Index, ColumnCount))) * SizeX
}

BaseY(Index)
{
  global ColumnCount
  global SizeY
  return (Floor(Index / ColumnCount)) * SizeY
}

ClickAll(RelX, RelY)
{
  global WindowCount
  Loop %WindowCount%
  {
    x := BaseX(A_Index - 1) + RelX
    y := BaseY(A_Index - 1) + RelY
    ControlClick, X%x% Y%y%, ahk_class eGenesis Client,,,, NA
;    Click %x%, %y%
  }
}

+^z::
if IsCalibrating
{
  return
}
; else
  x := 0
  y := 0
  MouseGetPos, x, y
  MouseClickDrag, Left, %x%, %y%, 1, 1
  MouseClickDrag, Left, 1, 1, % BaseX(WindowCount) , % BaseY(WindowCount)
  WindowCount := WindowCount + 1
return

+^x::
WindowCount := 0
MsgBox, 0, , % "Clearing Window Positions"
return

+^r::
if IsCalibrating
{
  IsCalibrating := false
  MsgBox, 0, , % "Ending Recalibration Mode"
  return
}
; else
  IsCalibrating := true
  MsgBox, 0, , % "Beginning Recalibration Mode. Press Control-h for help."
return

+^h::
if IsCalibrating
{
  MsgBox, 0, % "Calibration Mode", % "Calibrate each button hotkey. First, move a Charcoal Oven window to the upper-left corner of the screen. Then move the mouse over each kind of button and press the associated hotkey. Current status:`n"
  . "Begin (q): (" . BeginX . ", " . BeginY . ")`n"
  . "Wood (w): (" . WoodX . ", " . WoodY . ")`n"
  . "Water(e): (" . WaterX . ", " . WaterY . ")`n"
  . "Close(a): (" . CloseX . ", " . CloseY . ")`n"
  . "Middle(s): (" . MiddleX . ", " . MiddleY . ")`n"
  . "Open (d): (" . OpenX . ", " . OpenY . ")`n`n"
  . "To finish calibrating, press Control-R`n"
  . "Change the appropriate variables in the script to make calibration permanent."
  return
}
; else
  MsgBox, 0, % "Run Mode", % WindowCount . " windows active.`n"
  . "Keys:`n"
  . "Control+Shift-z: Add a window and position it. Hover the mouse over the window and press this key. Do not move a window after it has been placed.`n"
  . "Control+Shift-x: Clear all window settings. You must set them up again by using control-a on each window.`n"
  . "Control+Shift-r: Begin recalibrating relative button positions`n"
  . "Control+Shift-q: Press Begin on all windows`n"
  . "Control+Shift-w: Add wood to all windows`n"
  . "Control+Shift-e: Add water to all windows`n"
  . "Control+Shift-a: Close all vents`n"
  . "Control+Shift-s: Set all vents to partially open`n"
  . "Control+Shift-d: Open all vents"
return

+^q::
if IsCalibrating
{
  MouseGetPos, BeginX, BeginY
  return
}
; else
  ClickAll(BeginX, BeginY)
return

+^w::
if IsCalibrating
{
  MouseGetPos, WoodX, WoodY
  return
}
; else
  ClickAll(WoodX, WoodY)
return

+^e::
if IsCalibrating
{
  MouseGetPos, WaterX, WaterY
  return
}
; else
  ClickAll(WaterX, WaterY)
return

+^a::
if IsCalibrating
{
  MouseGetPos, CloseX, CloseY
  return
}
; else
  ClickAll(CloseX, CloseY)
return

+^s::
if IsCalibrating
{
  MouseGetPos, MiddleX, MiddleY
  return
}
; else
  ClickAll(MiddleX, MiddleY)
return

+^d::
if IsCalibrating
{
  MouseGetPos, OpenX, OpenY
  return
}
; else
  ClickAll(OpenX, OpenY)
return


Carpentry Blades

Description & Usage

NOTE: 1024x768 Resolution Necessary for this and likely other macros to work properly!

This script is meant to automate the manufacturing of carpentry blades! It works decently well for my purposes - feel free to modify it, or use it as a model for other blacksmith efforts.

  • Controls
    • Ctrl+Shift+G - "Get" Plots hammer hits for command below. If you move or something didn't work, restart here.
    • Ctrl+Shift+H - "Hammer" Creates a single blade (test). Will not automatically load/unload.
    • Ctrl+Shift+= - Creates multiple blades (based on # entered) and wait for you to press "y" before continuing.
  • Setup
    • Get overhead view (F8 twice) and zoom in completely.
    • Have your chat minimized.
    • Be sure to turn on "Chat appears above player's head" in "Chat-related Options"
    • Position the "Project Select" window for your metal ?????.
    • Open the 'Project Select' window for your desired metal and pin it. Load Carp Blade.
    • Position mouse directly over upper-left point of carpentry blade, then press Ctrl+Shift+G.
    • Press Ctrl+Shift+H to make a test blade. Unload (or scrap, if necessary).
    • If this worked, press Ctrl+Shift+=. Fill in # of carp blades (make sure you have the materials).
    • After each blade, press 'Y' within 10 seconds to continue. Use this to verify quality before it unloads.

Macro


;This script is meant to automate the manufacturing of carpentry blades!

;  Get overhead view (F8 twice) and zoom in completely.
;  Position mouse directly over upper-left point of carpentry blade,
;  then press Ctrl+Shift+G.  This script will plot your hammer hits.

^+G::
MouseGetPos, xpos, ypos

  x9 = %xpos%
  x9 += 9
 x20 = %xpos%
 x20 += 20
 x26 = %xpos%
 x26 += 26
 x33 = %xpos%
 x33 += 33
 x39 = %xpos%
 x39 += 39
 x51 = %xpos%
 x51 += 51
 x58 = %xpos%
 x58 += 58
 x71 = %xpos%
 x71 += 71
 x84 = %xpos%
 x84 += 84
 x90 = %xpos%
 x90 += 90
 x97 = %xpos%
 x97 += 97
x110 = %xpos%
x110 += 110
x123 = %xpos%
x123 += 123
x129 = %xpos%
x129 += 129
x141 = %xpos%
x141 += 141
x148 = %xpos%
x148 += 148
x154 = %xpos%
x154 += 154
x161 = %xpos%
x161 += 161
x172 = %xpos%
x172 += 172

  y2 = %ypos%
  y2 += 2
 y12 = %ypos%
 y12 += 12
 y38 = %ypos%
 y38 += 38
 y54 = %ypos%
 y54 += 54
 y64 = %ypos%
 y64 += 64
 y77 = %ypos%
 y77 += 77
 y92 = %ypos%
 y92 += 92
y114 = %ypos%
y114 += 114

return


;  This command will use the stored numbers to make a carpentry blade.
;  If you moved at all, you'll need to use the command above first to
;  allign everything.  
;  Be sure to have your chat window closed before you start!
;  When ready, press Ctrl+Shift+H.

^+H::
MouseMove %x90%, %y64%
Send s9
  Click %x9%, %y114%
  Click %x172%, %y114%
  Click %x33%, %y114%
  Click %x148%, %y114%
  Click %x58%, %y114%
  Click %x123%, %y114%
  Click %x84%, %y114%
  Click %x97%, %y114%
Send c9
  Click %x20%, %y114%
  Click %x161%, %y114%
  Click %x71%, %y114%
  Click %x110%, %y114%
Send c4
  Click %x90%, %y64%
  Click %x58%,  %y64%
  Click %x123%, %y64%
Send b9
  Click %x26%,  %y54%
  Click %x154%, %y54%
  Click %x26%,  %y2%
  Click %x154%, %y2%
  Click %x33%,  %y12%
  Click %x148%, %y12%
  Click %x39%,  %y2%
  Click %x141%, %y2%

MouseMove %x90%, %y64%
Send c5
  Click %x51%, %y77%
  Click %x129%, %y77%
Send b3
  Click %x58%, %y92%
  Click %x123%, %y92%
  Click %x33%, %y92%
  Click %x148%, %y92%
  Click %x20%, %y92%
  Click %x161%, %y92%
  Click %x9%, %y92%
  Click %x172%, %y92%
Send s3
  Click %x51%, %y54%
  Click %x129%, %y54%
  Click %x71%, %y38%
  Click %x110%, %y38%

Send q
return


^+=::
InputBox, Input, Carp Blade Count, How many blades will you make?,, 220, 120

Loop %Input% 
{
Click 800, 80
  Sleep 100
Click 800, 80
  Sleep 500

MouseMove %x90%, %y64%
Send s9
  Click %x9%, %y114%
  Click %x172%, %y114%
  Click %x33%, %y114%
  Click %x148%, %y114%
  Click %x58%, %y114%
  Click %x123%, %y114%
  Click %x84%, %y114%
  Click %x97%, %y114%
Send c9
  Click %x20%, %y114%
  Click %x161%, %y114%
  Click %x71%, %y114%
  Click %x110%, %y114%
Send c4
  Click %x90%, %y64%
  Click %x58%,  %y64%
  Click %x123%, %y64%
Send b9
  Click %x26%,  %y54%
  Click %x154%, %y54%
  Click %x26%,  %y2%
  Click %x154%, %y2%
  Click %x33%,  %y12%
  Click %x148%, %y12%
  Click %x39%,  %y2%
  Click %x141%, %y2%

MouseMove %x90%, %y64%
Send c5
  Click %x51%, %y77%
  Click %x129%, %y77%
Send b3
  Click %x58%, %y92%
  Click %x123%, %y92%
  Click %x33%, %y92%
  Click %x148%, %y92%
  Click %x20%, %y92%
  Click %x161%, %y92%
  Click %x9%, %y92%
  Click %x172%, %y92%
Send s3
  Click %x51%, %y54%
  Click %x129%, %y54%
  Click %x71%, %y38%
  Click %x110%, %y38%
Send q

Click 900, 195
Keywait, y, D T10
  if ErrorLevel
    return
Click 475, 435
}

Glassworking x4

Description & Usage

This is meant to 'mimic' your clicks on multiple Glazier's Benches. It couldn't have 'solid' buttons since things move around, so it is based on the location of the mouse. You need to understand basic Glazier Bench operation to use this script properly.

Command: Ctrl+Shift+Left Click

  • Setup
    • Decide how many benches you'll be using and edit the script based on this (currently set at 2, the other 2 are 'noted out' with ;)
    • Align the first window along the left side of screen.
    • Position subsequent windows (all pinned) at the right edge of the 'h' in "Empty ALL the glass from the bench" (see picture below).
    • Press Ctrl+Shift+Left Click on the desired commands. If you need to reset the windows (i.e. when a project is complete) simply click the top of the windows (so you don't accidentally click something else).

Visual Aid

(Invisible Picture LOL)

Macro

;This is my Glassworks Macro it is a very basic "mimic click" macro to help operate multiple Glazier's benches (use with CTRL+SHIFT+LEFT CLICK).  Align second and subsequent windows at the edge of "h" in "Empty ALL the glass from the bench" such that the whole phrase is visible.  !NOTE!  Has the ability to be used for 4 benches, but have to manually remove the ";" for those commands.

MimicMouse:
^+LButton::
SetDefaultMouseSpeed, 0
MouseGetPos, XSpot1, YSpot1
  XSpot2 = %XSpot1%
  XSpot2 += 220
  XSpot3 = %XSpot1%
  XSpot3 += 440
  XSpot4 = %XSpot1%
  XSpot4 += 660
Click %XSpot1%, %YSpot1%
Click %XSpot2%, %YSpot1%
Click %XSpot3%, %YSpot1%
Click %XSpot4%, %YSpot1%
MouseMove %XSpot1%, %YSpot1%
return

Speed Thermometer

Description & Usage

This is a quick and dirty script from T3 that made thermometers. Due to lag or strange timing, it has about a 1/40 chance to fail - so you have been warned! It typically averages 4-6k quality.

Command: Ctrl+Shif+T

  • Setup
    • Have chat minimized, make sure keyboard commands work.
    • Load the thermometer project.
    • Hover mouse over Glory Hole (ensure it says there!)
    • Press Ctrl+Shif+T. Rinse and repeat as necessary.

Macro

Thermometer:
^+T::
Send naaaaanaaaaanaaaaanaaaaanaaaaanaaaaanaaaaanaaaaan
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
;6
Send nssssss
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
;7
Send ns
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
;8
Send ns
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
;9
Send ns
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
Send n
Send n
Sleep 30
;9
Send n
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
Send n
Send n
Sleep 30
;8
Send na
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
Send n
Send n
Sleep 30
;7
Send na
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
Send n
Send n
Sleep 30
;6
Send na
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
Send n
Send n
Sleep 30
;6
Send n
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
Send n
Send n
Sleep 30
;7
Send n
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
Send n
Send n
Sleep 30
;8
Send n
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
Send bbbbq

Send n
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
Send qn
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
Send qn
Sleep 30
Send n
Sleep 30
Send n
Sleep 30
Send qnu
return