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.

Difference between revisions of "User:AngelRio/Flax"

From A Tale in the Desert
Jump to navigationJump to search
 
(16 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
Growing flax is simple.  It is one of the most basic building blocks of many construction projects.  Farming it in quantities, however, present a risk to the wrist and carpal tunnel due to its repetitive nature.  We plan to remedy that by using both left and right hands, and minimizing the stress on the mouse-holding hand.
 
Growing flax is simple.  It is one of the most basic building blocks of many construction projects.  Farming it in quantities, however, present a risk to the wrist and carpal tunnel due to its repetitive nature.  We plan to remedy that by using both left and right hands, and minimizing the stress on the mouse-holding hand.
  
This was written to remedy RSI, and not for growing flax while you are AFKOther than this restriction, please feel free to modify the code, and submit changes back.  Thank you.
+
In essence, this replaces the function of the hotkeys for growing flax as they are effectively useless.  The in-game hotkeys for growing flax make your avatar move making flax growing a very slow process.
 +
 
 +
This was written to reduce risk of RSI.  With that in mind, please feel free to modify the code, and submit changes back.  Thank you.
  
 
=Instructions=
 
=Instructions=
 
# Load the AHK file.
 
# Load the AHK file.
 
# Position the flax menu below the TimeLoc window as shown below.
 
# Position the flax menu below the TimeLoc window as shown below.
##[[Image:Flax Menu Position.JPG | Flax menu positioned below the TimeLoc window]]
+
#*[[Image:Flax Menu Position.JPG | Flax menu positioned below the TimeLoc window]]
 
# Go to overhead cartographic view (press F8 twice).
 
# Go to overhead cartographic view (press F8 twice).
 
## Zoom in the closest level.
 
## Zoom in the closest level.
Line 13: Line 15:
 
## Press Alt-L to freeze the zoom level.
 
## Press Alt-L to freeze the zoom level.
 
# Start planting flax.  Press the Insert key.
 
# Start planting flax.  Press the Insert key.
## Do not move the mouse at any time.
+
#* Do not move the mouse at any time.
 
# Wait for the weeds to grow.
 
# Wait for the weeds to grow.
# Mouse over a flax bed and press the Delete key.
+
# Mouse over a flax bed and press the Delete or PageDown key.
## Repeat for each flax bed.
+
#* Repeat for each flax bed.
## Do not move the mouse when until the bed has been watered, weeded or harvested.
+
#* Do not move the mouse when until the bed has been watered, weeded or harvested.
## Alternatively, you can use Delete key when watering, weeding or harvesting from the left to the right, and the PageDown key when going from the right to the left.
+
#* Use the PageDown key when watering, weeding or harvesting from left to right, the Delete key when doing it from right to left.
 +
#* Use the Tab key for harvesting seeds.  It's similar to the PageDown and Delete keys but returns the mouse pointer to its original position.
  
 
==Notes==
 
==Notes==
 
* Tested using 1024 x 768 resolution.  If you have a different resolution, you may have to edit some of the values.
 
* Tested using 1024 x 768 resolution.  If you have a different resolution, you may have to edit some of the values.
 +
* I work in a very "laggy" environment (network and computer specs), and you may be able to tweak the delays to more optimal settings for your own system.
  
=Showing your Appreciation=
+
==Bonus==
Donations of in-game items are certainly welcome, especially limestones. ^_^"
+
For those tired of using their index fingers for clicking, you can now use the back tick (`) key as a left click. Cheers!
  
 
=About AutoHotKey=
 
=About AutoHotKey=
Line 31: Line 35:
 
=Code for AutoHotKey=
 
=Code for AutoHotKey=
 
<pre>
 
<pre>
;Plant a row of flax
+
;==============================================================================
 +
; Plant a row of flax
 +
;==============================================================================
 
PlantFlax()
 
PlantFlax()
 
{
 
{
   Loop 10
+
   Loop 5
 
   {
 
   {
     ;Wait for the proper position
+
     ; Wait for the proper position
     Sleep, 450
+
     Sleep, 400
  
     ;Put a flax seed on the ground
+
     ; Put a flax seed on the ground
 
     Click, 503, 55
 
     Click, 503, 55
   }
+
 
 +
    ; Wait for the proper position
 +
    Sleep, 410
 +
 
 +
    ; Put a flax seed on the ground
 +
    Click, 503, 55
 +
}
 +
}
 +
 
 +
;==============================================================================
 +
; Water, Weed or Harvest a bed of flax
 +
;==============================================================================
 +
WaterWeedHarvest(MouseX, MouseY)
 +
{
 +
  ; Click on the Flax bed
 +
   Click %MouseX% %MouseY%
 +
 
 +
  ; Approximate the location of the menu to click
 +
  NewMouseX := MouseX + 50
 +
 
 +
  ; Wait for the menu to show up
 +
  ; Change this to a better implementation that is lag-resistant
 +
  Sleep, 70
 +
 
 +
  ; Click on the menu item to Water/Weed/Harvest
 +
  Click %NewMouseX% %MouseY%
 +
 
 +
  ; Finished one bed
 +
  Return
 
}
 
}
  
;==============================================
+
 
;Watering/Weeding/Harvesting from Left to Right
+
;==============================================================================
 +
; Watering/Weeding/Harvesting from Left to Right
 +
;==============================================================================
 
PgDn::
 
PgDn::
MouseGetPos, MouseX, MouseY
 
NewMouseX := MouseX + 40
 
NewMouseY := MouseY
 
  
; Click on the Flax bed
+
  ; Get location of the mouse pointer
Click %MouseX% %MouseY%
+
  MouseGetPos, MouseX, MouseY
  
;Wait for the menu to show up
+
  WaterWeedHarvest(MouseX, MouseY)
;;Change this to a lag-resistant implementation
+
 
Sleep, 500
+
  NewMouseX := MouseX + 40
 +
  MouseMove, %NewMouseX%, %MouseY%
  
;Click on the menu item to Water/Weed/Harvest
+
  ; Finished one bed
Click %NewMouseX% %NewMouseY%
+
  Return
  
;Finished one bed
 
Return
 
  
;==============================================
+
;==============================================================================
;Watering/Weeding/Harvesting from Right to Left
+
; Watering/Weeding/Harvesting from Right to Left
 +
;==============================================================================
 
Delete::
 
Delete::
MouseGetPos, MouseX, MouseY
 
NewMouseX := MouseX + 20
 
NewMouseY := MouseY
 
  
; Click on the Flax bed
+
  ; Get location of the mouse pointer
Click %MouseX% %MouseY%
+
  MouseGetPos, MouseX, MouseY
 +
 
 +
  WaterWeedHarvest(MouseX, MouseY)
 +
 
 +
  ; Move the mouse near the next flax bed
 +
  NewMouseX := MouseX - 40
 +
  MouseMove, %NewMouseX%, %MouseY%
 +
 
 +
  ; Finished one bed
 +
  Return
 +
 
 +
;==============================================================================
 +
; Planting two rows with 10 flax beds in each row
 +
;==============================================================================
 +
Insert::
  
;Wait for the menu to show up
+
  ; Move to the right...
;;Change this to a lag-resistant implementation
+
  Click, 1024, 384
Sleep, 500
 
  
;Click on the menu item to Water/Weed/Harvest
+
  PlantFlax()
Click %NewMouseX% %NewMouseY%
 
  
NewMouseX := NewMouseX -60
+
  ; Move down, a bit to the right...
 +
  Click, 585, 477
 +
  Sleep, 1385
  
MouseMove, %NewMouseX%, %NewMouseY%
+
  ; Move to the left...
 +
  Click, 0, 384
  
;Finished one bed
+
  PlantFlax()
Return
 
  
;============================================
+
  ; Move to the center ready for weeding
;Planting flax beds
+
  Click, 692, 356
Insert::
 
;Move to the right...
 
Click, 1024, 384
 
  
PlantFlax()
+
  ; End of Flax Planting
 +
  Return
  
;Move down a bit...
+
;==============================================================================
Click, 585, 477
+
; Mouse click on ` key
Sleep, 1000
+
;==============================================================================
 +
`::
 +
  Click
 +
  Return
  
;Move to the left...
+
Tab::
Click, 0, 384
+
  ; Get location of the mouse pointer
 +
  MouseGetPos, MouseX, MouseY
 +
  NewMouseY := MouseY
 +
 
 +
  WaterWeedHarvest(MouseX, NewMouseY)
  
PlantFlax()
+
  ; Move the mouse near the next flax bed
 +
  MouseMove, %MouseX%, %MouseY%
  
;Move to the center ready for weeding
+
  ; Finished one bed
Click, 700, 356
+
  Return
  
;End of Flax Planting
+
;==============================================================================
Return
+
; Expand abbreviations
 +
;==============================================================================
 
</pre>
 
</pre>

Latest revision as of 23:38, 4 March 2009

Rationale

Growing flax is simple. It is one of the most basic building blocks of many construction projects. Farming it in quantities, however, present a risk to the wrist and carpal tunnel due to its repetitive nature. We plan to remedy that by using both left and right hands, and minimizing the stress on the mouse-holding hand.

In essence, this replaces the function of the hotkeys for growing flax as they are effectively useless. The in-game hotkeys for growing flax make your avatar move making flax growing a very slow process.

This was written to reduce risk of RSI. With that in mind, please feel free to modify the code, and submit changes back. Thank you.

Instructions

  1. Load the AHK file.
  2. Position the flax menu below the TimeLoc window as shown below.
    • Flax menu positioned below the TimeLoc window
  3. Go to overhead cartographic view (press F8 twice).
    1. Zoom in the closest level.
    2. Zoom out in 10 increments.
    3. Press Alt-L to freeze the zoom level.
  4. Start planting flax. Press the Insert key.
    • Do not move the mouse at any time.
  5. Wait for the weeds to grow.
  6. Mouse over a flax bed and press the Delete or PageDown key.
    • Repeat for each flax bed.
    • Do not move the mouse when until the bed has been watered, weeded or harvested.
    • Use the PageDown key when watering, weeding or harvesting from left to right, the Delete key when doing it from right to left.
    • Use the Tab key for harvesting seeds. It's similar to the PageDown and Delete keys but returns the mouse pointer to its original position.

Notes

  • Tested using 1024 x 768 resolution. If you have a different resolution, you may have to edit some of the values.
  • I work in a very "laggy" environment (network and computer specs), and you may be able to tweak the delays to more optimal settings for your own system.

Bonus

For those tired of using their index fingers for clicking, you can now use the back tick (`) key as a left click. Cheers!

About AutoHotKey

I prefer using AutoHotKey since you can map certain keyboard sequences or mouse control into a "hotkey" such as Ctrl-Alt-Something, unlike with AC Tool where you need to be fast on the Alt-Tab draw. In this simple flax-growing script, we use the Insert, Delete and PageDown buttons which are not used in the game.

Code for AutoHotKey

;==============================================================================
; Plant a row of flax
;==============================================================================
PlantFlax()
{
  Loop 5
  {
    ; Wait for the proper position
    Sleep, 400

    ; Put a flax seed on the ground
    Click, 503, 55

    ; Wait for the proper position
    Sleep, 410

    ; Put a flax seed on the ground
    Click, 503, 55
	}
}

;==============================================================================
; Water, Weed or Harvest a bed of flax
;==============================================================================
WaterWeedHarvest(MouseX, MouseY)
{
  ; Click on the Flax bed
  Click %MouseX% %MouseY%

  ; Approximate the location of the menu to click
  NewMouseX := MouseX + 50

  ; Wait for the menu to show up
  ; Change this to a better implementation that is lag-resistant
  Sleep, 70

  ; Click on the menu item to Water/Weed/Harvest
  Click %NewMouseX% %MouseY%

  ; Finished one bed
  Return
}


;==============================================================================
; Watering/Weeding/Harvesting from Left to Right
;==============================================================================
PgDn::

  ; Get location of the mouse pointer
  MouseGetPos, MouseX, MouseY

  WaterWeedHarvest(MouseX, MouseY)
  
  NewMouseX := MouseX + 40
  MouseMove, %NewMouseX%, %MouseY%

  ; Finished one bed
  Return


;==============================================================================
; Watering/Weeding/Harvesting from Right to Left
;==============================================================================
Delete::

  ; Get location of the mouse pointer
  MouseGetPos, MouseX, MouseY

  WaterWeedHarvest(MouseX, MouseY)

  ; Move the mouse near the next flax bed
  NewMouseX := MouseX - 40
  MouseMove, %NewMouseX%, %MouseY%

  ; Finished one bed
  Return

;==============================================================================
; Planting two rows with 10 flax beds in each row
;==============================================================================
Insert::

  ; Move to the right...
  Click, 1024, 384

  PlantFlax()

  ; Move down, a bit to the right...
  Click, 585, 477
  Sleep, 1385

  ; Move to the left...
  Click, 0, 384

  PlantFlax()

  ; Move to the center ready for weeding
  Click, 692, 356

  ; End of Flax Planting
  Return

;==============================================================================
; Mouse click on ` key
;==============================================================================
`::
  Click
  Return

Tab::
  ; Get location of the mouse pointer
  MouseGetPos, MouseX, MouseY
  NewMouseY := MouseY
  
  WaterWeedHarvest(MouseX, NewMouseY)

  ; Move the mouse near the next flax bed
  MouseMove, %MouseX%, %MouseY%

  ; Finished one bed
  Return

;==============================================================================
; Expand abbreviations
;==============================================================================