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:Caigan/Flax Grow Macro

From A Tale in the Desert
< User:Caigan
Revision as of 02:20, 30 January 2009 by Caigan (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
//Caigan's 4x4 Flaxer Macro
//v1.1
//
//This macro only works on a 1680 x 1050 resolution with the game maximized. I'm not savvy enough
//to code it for multiple resolutions.
//
//Okay, more like I'm lazy.
//
//You MUST have your chat minimized for this to work.
//
//Pin your Plant tab in the upper left. Make sure you have enough water in your inventory.
//Make sure the ground is flat around you. Hills can really mess with this.
//
//Use F5, zoom your camera all the way out, and align your screen to face north (F4 for compass).
//Then use Alt + L to lock your camera.
//
//Currently the macro works with 4x4. If you can tweak the numbers for more, more power to you.
//
//This is very ugly  because I rarely ever code. I'm more of an artistic person. 

CONSTANTS //Change these to set your macro
  
  FRows = 2 //Number of double rows you want. If you want 2 rows, put 1. 
  FPer = 3 //Number between 1 and 3. This will be the number of beds per row, up to 4
  ORow = 0 //Set to 1 if you want an additional row (Making it an odd number of rows). NOT CODED IN.
  Cycles = 3 //How many cycles of weeding + harvesting there are
  XCenter = 839 //X Coord of spot right between characters feet
  YCenter = 536 //Y Coord of spot right between characters feet
  HPixel = 57 //Number of pixels between the centers of each bed Horizontally
  VPixel = 50 //Number of pixels between the centers of each bed Vertically
  BDelay1 = 40000 // How long it takes till the first weeding
  BDelay2 = 23000 // How long it takes till the second weeding
  
  //Don't Change These
  Calc1 = X
  MoveBack = X
  RowNum = X
  BedRow = X
  FTime = X
  WTime = X
  XCenterNew = X
  YCenterNew = X
  XCenterConst = X
  YCenterConst = X
  
End

Compute RowNum = $FRows * 2
Compute BedRow = $FPer + 1

Procedure FlaxTimer //Determine the amount of time it took to plant all the beds
	Compute Calc1 = $RowNum + $ORow
	Compute Calc1 = $Calc1 * $BedRow
	Compute Calc1 = $Calc1 * 575
	Compute Calc1 = $BDelay1 - $Calc1
  Set FTIME = $Calc1
End

Procedure WaitTimer //Determine the amount of time after first watering
	Compute Calc1 = $RowNum + $ORow
	Compute Calc1 = $Calc1 * $BedRow
	Compute Calc1 = $Calc1 * 700
	//Say WTime before Calculation is $Calc1
	Compute Calc1 = $BDelay2 - $Calc1
	//Say WTime before settime is $Calc1
  Set WTIME = $Calc1
  //Say WTime is $WTime
End

Loop $FRows
  
  //Horizontal Right
  Loop $FPer
    MousePos 70, 45
    RightClick
    Delay 125
    KeyDown {Right} 100
    Delay 125
    KeyDown {Right} 100
    Delay 125
  End
  
  //Vertical Drop
  MousePos 70, 45
  RightClick
  Delay 125
  KeyDown {Down} 100
  Delay 125
  KeyDown {Down} 100
  Delay 125
  
  //Horizontal Left
  Loop $FPer
    MousePos 70, 45
    RightClick
    Delay 125
    KeyDown {Left} 100
    Delay 125
    KeyDown {Left} 100
    Delay 125
  End
  
  //Vertical Drop
  MousePos 70, 45
  RightClick
  Delay 125
  KeyDown {Down} 100
  Delay 125
  KeyDown {Down} 100
  Delay 125
  
End

    KeyDown {Up} 100 
    Delay 125
    KeyDown {Up} 100
    Delay 125
  Compute MoveBack = $BedRow / 2
  FormatNumber MoveBack = $MoveBack, 0


Call FlaxTimer

Delay $FTime

If $ORow = 0
  //Set the cursor position for the first bed. 
  
  //Calculate X Position
  COMPUTE XCenterNew = $XCenter
  Set XCenterConst = $XCenterNew
  //Calculate Y Position
  COMPUTE Calc1 = $RowNum - 1
  Compute Calc1 = $Calc1 * $VPixel
  FormatNumber Calc1 = $Calc1, ####
  COMPUTE YCenterNew = $YCenter - $Calc1
  Set YCenterConst = $YCenterNew
  
  //Water, Weed, Harvest Phases
  Loop $Cycles
    Loop $FRows
      Loop $BedRow
        MousePos $XCenterNew, $YCenterNew
        Delay 100
        RightClick
        Delay 250
        COMPUTE XCENTERNEW = $XCENTERNEW + $HPixel
        MousePos $XCenterNew, $YCenterNew
        Delay 100
        RightClick
        Delay 250        
      End
      COMPUTE XCENTERNEW = $XCENTERNEW - $HPixel
      COMPUTE YCENTERNEW = $YCENTERNEW + $VPixel
      Loop $BedRow
        MousePos $XCenterNew, $YCenterNew
        Delay 100
        RightClick
        Delay 250
        COMPUTE XCENTERNEW = $XCENTERNEW + $HPixel
        MousePos $XCenterNew, $YCenterNew
        Delay 100
				RightClick
				Delay 250
        COMPUTE Calc1 = $HPixel * 2
        COMPUTE XCENTERNEW = $XCENTERNEW - $Calc1
      End
      COMPUTE XCENTERNEW = $XCENTERNEW + $HPixel
      COMPUTE YCENTERNEW = $YCENTERNEW + $VPixel
    End
		MousePos 78, 509
		RightClick    
    Set XCENTERNEW = $XCENTERCONST
    Set YCENTERNEW = $YCENTERCONST
    Call WaitTimer
    Delay $WTime
  End
Else
End

//Return to Home Point
  COMPUTE Calc1 = $RowNum - 1
  Loop $Calc1
    KeyDown {Up} 100 
    Delay 125
    KeyDown {Up} 100
    Delay 125
  End
    Delay 1000