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:Hilly/Macros"

From A Tale in the Desert
Jump to navigationJump to search
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Marcos]]
+
[[macros]]
 +
 
 +
[[User: hilly | Hilly Main page]]  
 
===Kilns===
 
===Kilns===
 +
 
<pre>
 
<pre>
  
Line 490: Line 493:
 
// Pin plant window in TOP LEFT!
 
// Pin plant window in TOP LEFT!
 
// see image for mouse start location.
 
// see image for mouse start location.
 +
// 1680x1050
  
 
constants
 
constants
Line 1,123: Line 1,127:
 
End
 
End
 
</pre>
 
</pre>
 +
 
===Grinder===
 
===Grinder===
 
<pre>
 
<pre>
Line 1,143: Line 1,148:
  
 
end
 
end
 +
</pre>
 +
===Charcoal Hearth===
 +
<pre>
 +
 +
//Charcoal Hearth
 +
// 1024x768
 +
// Setup:  This handles from 1 to 8 charcoal hearths at a time.  Pin the windows
 +
//        in 2 rows of 4 starting in top left corner.  But them up together but
 +
//        Don't overlap them at all.  I suggest at least 200
 +
//        wood per hearth and a normally hold about 150 water jugs.
 +
//        All hearths are slightly different but I suggest that you put your
 +
//        fastest burning hearths first in line.  The current settings are set
 +
//        for guilded hearths but its a bit more efficient atm with personal
 +
//        hearths.  You can tweak the settings below to alter Heat, Wood, Water
 +
//        and danger thresholds.  The macro doesn't watch Oxygen.  If your oxygen
 +
//        is getting too high, lower this by increasing WoodX in constants since
 +
//        adding wood lowers oxygen.
 +
//
 +
//  If you see anything odd, /chat me.
 +
//
 +
//  Known Issues:  You will see it add some wood during the snuff process.  It's
 +
//                not much wood but I'm looking into it.
 +
//
 +
//  ENJOY! :)  Come acro me in LE :) 780, 6956
 +
//  Anka
 +
//
 +
Constants
 +
  //User Definable variables
 +
  Hearths = 1      //Number of Hearths you are running. 1-8
 +
  HeatX = 168      //Threshold for Heat bar, increase or decrease as needed.
 +
  WoodX = 107      //Wood threshold, adds wood/round up to this point.
 +
  WaterX = 76      //Alowable water level, not much play here.. dont lower more than 2
 +
  DangerX = 164  //Threshold for Danger bar, increase or decrease as needed.
 +
  RGBBlue = 220    //Threshold for detecting the color blue.  Some video cards
 +
  //                  are having problems with this.  I will add a color test soon to
 +
  //                  help.  If you are having problems. Run just 1 hearth and try
 +
  //                  lowering this number by 10 at a time.  It's hard for me to see
 +
  //                  what is going on without using your pc :(
 +
  Guild = 0      // 1 for Guilded or public hearths, 0 for Personal hearths
 +
  //End User variables
 +
  AddX = 226
 +
  Add2X = 15
 +
  Add1Y = 65
 +
  Add2Y = 17
 +
  Add3Y = 250
 +
  RegX = 47
 +
  RegY = 74
 +
  BeginX = 111
 +
  BeginY = 245
 +
  NewX = 0
 +
  New2X = 0
 +
  New2Y = 0
 +
  NewY = 0
 +
  Heat = 0
 +
  Wood = 0
 +
  Water = 0
 +
  Danger = 0
 +
  Status = 0
 +
  HeatY = 156
 +
  OxyY = 168
 +
  WoodY = 180
 +
 
 +
  WaterY = 192
 +
 
 +
  DangerY = 204
 +
  StatusX = 167
 +
  StatusY = 216
 +
  WoodBX = 35
 +
  WoodBY = 250
 +
  WaterBX = 85
 +
  Num = 0
 +
  Jump = 5
 +
  JumpM = 0
 +
  Jumped = 0
 +
  Used = 0
 +
 
 +
  MDelay = 50
 +
  SDelay = 50
 +
  S1Delay = 50
 +
  Count = 0
 +
  CountM = 0
 +
  MouseX = 0
 +
  MouseY = 0
 +
 
 +
End
 +
 +
MousePos 100, 20  //Activates eGenesis window.. Don't run ACTool maximized.
 +
Delay $MDelay
 +
LeftClick
 +
Delay 2000
 +
 +
If $Guild = 1
 +
  Call Guild
 +
End
 +
 +
SetConst NewX = $BeginX
 +
SetConst NewY = $BeginY
 +
SetConst Count = 1
 +
Loop $Hearths
 +
  If $Count = $Jump
 +
    SetConst NewX = $BeginX
 +
    Compute NewY = $BeginY + $Add3Y
 +
  End
 +
  MousePos $NewX, $NewY
 +
  Delay $MDelay
 +
  Rightclick
 +
  Delay $MDelay
 +
  Compute NewX = $NewX + $AddX
 +
  Compute Count = $Count + 1
 +
End
 +
SetConst NewX = $BeginX  //Dont remember why this is here :)
 +
Call Main
 +
 +
Procedure Main
 +
  SetConst CountM = 1
 +
  SetConst Status = 0
 +
  Compute JumpM = $Jump - 1
 +
  Loop $Hearths
 +
    If $CountM = $Jump
 +
      // may have to use New Newx and newy variables in Main
 +
      SetConst NewX = $StatusX
 +
      Compute NewY = $StatusY + $Add3Y
 +
      SetConst New2X = $WaterBX
 +
      Compute New2Y = $WoodBY + $Add3Y
 +
    End
 +
   
 +
    While $Status = 0
 +
      Call CheckBars
 +
      If $Status = 1
 +
        Call Snuff
 +
        //code to advance to next hearth
 +
        Compute Used = $Used + 1
 +
        If $Used = $JumpM
 +
          Compute HeatX = $HeatX - (($Used - 1) * $AddX)
 +
          Compute HeatY = $HeatY + $Add3Y
 +
          Compute WoodX = $WoodX - (($Used - 1) * $AddX)
 +
          Compute WoodY = $WoodY + $Add3Y
 +
          Compute WaterX = $WaterX - (($Used - 1) * $AddX)
 +
          Compute WaterY = $WaterY + $Add3Y
 +
          Compute DangerX = $DangerX - (($Used - 1) * $AddX)
 +
          Compute DangerY = $DangerY + $Add3Y
 +
          Compute StatusX = $StatusX - (($Used - 1) * $AddX)
 +
          Compute StatusY = $StatusY + $Add3Y
 +
          //Compute WaterBX = $WaterBX - (($Used -1) * $AddX)
 +
          //Compute WoodBX = $WoodBX - (($Used - 1 ) * $AddX)
 +
          //Compute WoodBY = $WoodBY + $Add3Y
 +
          SetConst Jumped = 1
 +
          Continue
 +
        Else
 +
          Compute HeatX = $HeatX + $AddX
 +
          Compute WoodX = $WoodX + $AddX
 +
          Compute WaterX = $WaterX + $AddX
 +
          Compute DangerX = $DangerX + $AddX
 +
          Compute StatusX = $StatusX + $AddX
 +
          //Compute WaterBX = $WaterBX + $AddX
 +
          //Compute WoodBX = $WoodBX + $AddX
 +
        End
 +
        Continue
 +
      End
 +
      If $Heat = 0 and $Danger = 0 and $Wood = 0
 +
        Call Wood
 +
      Else
 +
        If $Heat = 1 or $Danger = 1
 +
          If $Water = 0
 +
            Call Water
 +
          End
 +
        End
 +
      End
 +
     
 +
      Delay 1000
 +
    End
 +
    Compute CountM = $CountM + 1
 +
    SetConst Status = 0
 +
  End
 +
End
 +
 +
Procedure CheckBars
 +
  MousePos $HeatX, $HeatY
 +
  Delay $SDelay
 +
  LoadRGB {MouseX}, {MouseY}
 +
  if {RGBBlue} > $RGBBlue
 +
    SetConst Heat = 1
 +
  Else
 +
    SetConst Heat = 0
 +
  End
 +
  MousePos $WoodX, $WoodY
 +
  Delay $S1Delay
 +
  LoadRGB {mousex}, {mousey}
 +
  if {RGBBlue} > $RGBBlue
 +
    SetConst Wood = 1
 +
  Else
 +
    SetConst Wood = 0
 +
  End
 +
  MousePos $WaterX, $WaterY
 +
  Delay $S1Delay
 +
  LoadRGB {mousex}, {mousey}
 +
  if {RGBBlue} > $RGBBlue
 +
    SetConst Water = 1
 +
  Else
 +
    SetConst Water = 0
 +
  End
 +
  MousePos $DangerX, $DangerY
 +
  Delay $S1Delay
 +
  LoadRGB {MouseX}, {MouseY}
 +
  if {RGBBlue} > $RGBBlue
 +
    SetConst Danger = 1
 +
  Else
 +
    SetConst Danger = 0
 +
  End
 +
  MousePos $StatusX, $StatusY
 +
  LoadRGB {MouseX}, {MouseY}
 +
  if {RGBRed} = 6 and {RGBGreen} = 254 and {RGBBlue} = 5
 +
    SetConst Status = 1
 +
  Else
 +
    SetConst Status = 0
 +
  End
 +
End
 +
 +
Procedure Water
 +
  SetConst NewX = $WaterBX
 +
  SetConst NewY = $WoodBY
 +
  Loop $Hearths
 +
    IF {loopno} = $Jump
 +
      SetConst NewX = $WaterBX
 +
      Compute NewY = $WoodBY + $Add3Y
 +
    End
 +
    If {loopno} > $Used
 +
      MousePos $NewX, $NewY
 +
      Delay $SDelay
 +
      Rightclick
 +
      Delay $SDelay
 +
    End
 +
    Compute NewX = $NewX + $AddX
 +
  End
 +
  SetConst NewX = $WaterBX
 +
End
 +
 +
Procedure Snuff
 +
  SetConst New2X = $WaterBX
 +
  SetConst New2Y = $WoodBY
 +
  Compute Num = $Used + 1
 +
  Loop $Hearths
 +
    IF {loopno} = $Jump
 +
      SetConst New2X = $WaterBX
 +
      Compute New2Y = $WoodBY + $Add3Y
 +
    End
 +
    If {loopno} = $Num
 +
      MousePos $New2X, $New2Y
 +
      Loop 8
 +
        Rightclick
 +
      End
 +
    End
 +
    Compute New2X = $New2X + $AddX
 +
  End
 +
End
 +
 +
Procedure Wood
 +
  SetConst NewX = $WoodBX
 +
  SetConst NewY = $WoodBY
 +
  Loop $Hearths
 +
    IF {loopno} = $Jump
 +
      SetConst NewX = $WoodBX
 +
      Compute NewY = $WoodBY + $Add3Y
 +
    End
 +
    If {loopno} > $Used
 +
      MousePos $NewX, $NewY
 +
      Delay $SDelay
 +
      Rightclick
 +
      Delay $SDelay
 +
    End
 +
    Compute NewX = $NewX + $AddX
 +
  End
 +
  SetConst NewX = $WoodBX
 +
End
 +
 +
 +
Procedure Guild
 +
  Compute BeginX = $BeginX - 7
 +
  Compute BeginY = $BeginY + 16
 +
  Compute RegY = $RegY + 16
 +
  Compute RegX = $RegX - 14
 +
  Compute AddX = $AddX - 15
 +
  Compute Add3Y = $Add3Y + 16
 +
  Compute Add1Y = $Add1Y - 16
 +
  Compute WoodBY = $WoodBY + 16
 +
  Compute HeatX = $HeatX - 4
 +
  Compute HeatY = $HeatY + 16
 +
  Compute WoodX = $WoodX - 1
 +
  Compute WoodY = $WoodY + 16
 +
  Compute WaterY = $WaterY + 16
 +
  Compute DangerX = $DangerX - 4
 +
  Compute DangerY = $DangerY + 16
 +
  Compute StatusX = $StatusX - 5
 +
  Compute StatusY = $StatusY + 16
 +
End
 +
//Written with ACTool 5.3.0 by Anka
 +
Bell Asterisk
 +
</pre>
 +
 +
===Thermometer===
 +
<pre>
 +
 +
//thermo
 +
//minimize chat, start thermo, set arrow in glory hole.
 +
 +
//put pipe in hole
 +
 +
loop 30
 +
 +
keys a
 +
delay 100
 +
 +
end
 +
 +
//move it back out
 +
 +
loop 7
 +
 +
keys s
 +
delay 200
 +
 +
end
 +
 +
//rotate it while it heats
 +
 +
loop 21
 +
 +
keys n
 +
delay 300
 +
 +
end
 +
 +
//rotate and blow
 +
 +
loop 4
 +
 +
keys b
 +
delay 50
 +
keys n
 +
delay 100
 +
 +
 +
end
 +
 +
keys q
 +
delay 50
 +
keys u
 +
delay 50
 
</pre>
 
</pre>

Latest revision as of 17:33, 9 December 2009

macros

Hilly Main page

Kilns


// Written by: Coyan/Mosaic Guild originally as a mining Macro
// Adjusted by Menhotep for woodplane work.
// Adjusted By Hilly for Kilns
// with minor adjustments
// This is what I suggest for setting up for this macro

Constructs
	MouseX=List // this is an array of mouse X coords for gem sample points
	MouseY=List // this is an array of mouse X coords for gem sample points
END

Constants
	totalpulls = 16 // How many times do you want it to run all kilns? (make sure you have wood and brick in inventory)
	loopcnt = 1 
	Mousecnt = 1
	MouseXN = 0
	MouseYN = 0
End

// First part that requires a detailed explanation
// this loop will pause for 3 seconds then grab the current mouse location
// its purpose is to identify the locations for the Kilns(or however
// many) when it grabs the spot(s), it will then echo a . to the chat window
// make sure you are in your main chat tab.  After it finds all the Kilns, you
// may need to minimize your chat window.  BE SURE TO BE IN MAIN TAB!

// Adjust this Loop numer to the number of kilns being used
Loop 20
	Delay 3000
	Listadd MouseX, {MouseX}
	Listadd MouseY, {MouseY}
	SayPaste ..
END

loop $totalpulls
	Compute loopcnt = 1
// Adjust this Loop numer to the number of kins being used
	loop 20
		mousepos MouseX[$loopcnt], MouseY[$loopcnt]
		Delay 150
		keys t
		Delay 150
		keys c // c=Clay brick, b=fire bricks, ext 
		Delay 150 
		keys w
		Delay 150 
		keys f
		Compute loopcnt = $loopcnt + 1
		Delay 100
	END
		
	Delay 150000 
	
end

Barley

(* Brute Force Barley Macro for ATITD 1280 1080 . This version by Silentdeth. T2 Original by Draeton.
To use pin the plant window to the upper RIGHT (not left), switch the view to double-f8 view and
zoom all the way in. *)
Constants
  // Insert constants here
  
  NumberOfLoops = 14 //This is the number of loops, and with luck is the only thing you will
  //have to change to suit your own needs.  I personally use 8 with +2str
  //(and dex from acro).
  
  SleepTime	= 200		//If you're having major problems with lag try moving this to a higher
  //number (these are in milliseconds).  This delay is used between most
  //commands
  
  MoveSleepTime = 1500 	//This is the delay used for when the character is actually moving.
  //Again this is in milliseconds, if lag is troubling you, try
  //Upping this number.
  
  LoopWaitTime = 11000	//This is used in the loop to check if it should feed or water the
  //barley more.  If you Change the times above up or down you may need
  //to do the inverse with this in order to not waste fertilizer or
  //worse, harvest the barley before it's done.
  
  
  XCoordsOfPlantBarley =1229 //973 	//If you don't want the barley planting box in the upper right,
  //can change this (and the Y value below this).
  YCoordsOfPlantBarley = 41 //47		//See above comment
  
  NumToDo = 18				//This is actually equipped to handle doing anywhere between 1 and 18
  //patches of barley at a time.  Use this to set the number. 18 is the current maximum, I may
  // increase if further in the furture but right now I cant carry enouph to make increaseing it
  //worth my time.
  
  // How far over and up and down to move
  MoveDeltaX=260
  MoveDeltaY=226
  
  //The center for calculating the movment  
  PlayerCenterX=625
  PlayerCenterY=524
  
  //How many patches of barley to plant per row
  PlantsPerRow = 5
  
  //If you want to have the macro save a bit of fert set ExtraTickOffset=1 and it will wait
  // 1 extra tick to fertalize or water.
  ExtraTickOffset = 1
  ExtraTickX=25
  
  //dont change these
  ResolutionX=1280//1024
  ResolutionY=1024//768
  varX = 0
  varY = 0
  Adding = 0
  LoopNum = 0
  NumberAdded = 0
  varColourY = 0
  varColourX = 0
  varAddX = 0
  
  varOriginalMouseX = 0
  varOriginalMouseY = 0
  
  MousePosX = 0
  MousePosY = 0
  varDelay = 0
  
  TempMouseX=0
  TempMouseY=0

//The Size of the barley window

  BarleyWindowX=212
  BarleyWindowY=221
  
  multiplyer = 0
  
	LeftRightSwitch = 0
	
End

call MakeBarley
//call GetPixelAtMouse


Procedure MakeBarley
  //SetActiveWindow eGenesis Client   //On my computer I commented this line because it messes my computer up.  Try that if you're having issues
  loop $NumberOfLoops //How many times to run through the loop.  I use 8 usually and have carry food going (+2 str, +3 or more dex will do for 8)
    //SetConst NumToDo = 8 //Possible to do less than 8 at a time.  <1 or >8 will break this
    //SetConst sleeptime = 200 //How much time to wait
    SetConst Adding = 1 //Tells it we're still adding, used in a later Function
    SetConst LoopNum = 0 //Which Loop Number we're at.  Used in the main loop
    
    
    loop $NumToDo //A statement like this that will be gone through for each number >1
      
      if {LoopNo} = 1
      else
      //pause
      Compute LeftRightSwitch = $NumberAdded MOD $PlantsPerRow 
        if $LeftRightSwitch = 0
          call MoveDown
        else
          Compute LeftRightSwitch = ($NumberAdded DIV $PlantsPerRow) MOD 2
          if $LeftRightSwitch = 0
            call MoveRight
          else
            call MoveLeft
          end //if LR switch
        end //if new row
      end// if first click
      call plant
      call drag $NumberAdded
      delay $sleeptime
      Compute MousePosX = $TempMouseX + 91 //411
      Compute MousePosY = $TempMouseY - 125//48
      call RightClick2
      //DragTo 105, 265
      //call LeftClick2
      Delay $sleeptime
      Inc NumberAdded
      Call TestColourWhich
    end //end loop 
    
    
    SetConst Adding = 0
    loop  6//This is the main loop
      SetConst LoopNum = {LoopNo} //Need this variable below so we don't keep feeding the early ones
      Delay $LoopWaitTime
      Call TestColourWhich //Go to the functions to test the colour, see if we need to add
      
    end //loop 16
    delay $sleeptime
    
    call Harvest
    compute multiplyer =  ($NumberAdded DIV $PlantsPerRow)
    loop $multiplyer
      call MoveUP
    end
    compute multiplyer =  ($NumberAdded DIV $PlantsPerRow) MOD 2
    if $multiplyer = 0
    compute multiplyer =  ($NumberAdded MOD $PlantsPerRow)
      loop $multiplyer
        call MoveLeft
      end // move left loop
    else
    	compute multiplyer = ($NumberAdded MOD $PlantsPerRow)
      loop $multiplyer
        call MoveRight
      end //move right loop
    end //if LR
    
    
  end //end number of loop
end //end procedure


procedure Harvest
  SetConst MousePosX =  {MouseX}
  SetConst MousePosY = {MouseY}

  
  MousePos 190, 109
  loop $NumberAdded //This is for harvesting
    
     
      Compute multiplyer= {LoopNo} - 1
        if 	{LoopNo} > 5
      Compute multiplyer= $multiplyer + 1
      //pause
    end //if 
    
      if 	{LoopNo} > 12
      Compute multiplyer= $multiplyer + 4
    end //if 
    
       if 	{LoopNo} > 15
      Compute multiplyer= $multiplyer + 1
    end //if 
    
   	Compute MousePosX = 110  + $BarleyWindowX * ($multiplyer MOD 6 ) 
    Compute MousePosY= 230 + $BarleyWindowY * ($multiplyer DIV 6 )
    
    
    
    call RightClick2
    Delay $sleeptime
    Compute MousePosX =  $MousePosX + 80
    Compute MousePosY =  $MousePosY - 120
    call RightClick2
    Delay $sleeptime
    SetConst NumberAdded = 0
    
  end //loop
end //procedure

Procedure TestColourWhich //This function figures out which coordinates to call.
  //No it is not terribly good code, but this was written first for AutoHotKey
  //your right, so im gonna make it pretty
  
 
  
  loop $NumberAdded //This is for the water
     
      Compute multiplyer= {LoopNo} - 1
        if 	{LoopNo} > 5
      Compute multiplyer= $multiplyer + 1
      //pause
    end //if 
    
      if 	{LoopNo} > 12
      Compute multiplyer= $multiplyer + 4
    end //if 
    
       if 	{LoopNo} > 15
      Compute multiplyer= $multiplyer + 1
    end //if 
    
   	Compute varColourX = 179 + $BarleyWindowX * ($multiplyer MOD 6 ) -  $ExtraTickX * $ExtraTickOffset
    Compute varColourY= 164 + $BarleyWindowY * ($multiplyer DIV 6 )
    
    
    
    Compute varAddX = $varColourX + 18 + $ExtraTickX * $ExtraTickOffset
    Call TestColour
    Compute varColourY = $varColourY + 20
    Call TestColour

   
    if $adding = 1 //This little section is to click a 2nd time when first planting the barley
      if {LoopNo} = $numberadded
        Call TestColour
        Compute varColourY = $varColourY - 20
        Call TestColour
      end//end if adding =1
    end // end if loopno=number added
  end// end loop
end//end proceedure




Procedure TestColour  //This actually tests the colours based on the position set in TestColourWhich
  LoadRGB $varColourX, $varColourY
  if {RGBBlue} > 220 //If it's really high in blue content
  else
    Call GetMousePos
    SetConst MousePosX = $varAddX
    SetConst MousePosY = $varColourY
    call RightClick2
    Call SetMousePos
    Delay 100
  end
  
end

procedure drag using numberPlanted
  SetConst multiplyer= $numberPlanted
  loop 1000
    Delay $sleeptime
    SetConst varDelay = 1
    Compute MousePosX =  INT(510/1024*$ResolutionX)
    Compute MousePosY = INT(425/768*$ResolutionY)
    call RightClick2
    Delay $sleeptime
    Delay $sleeptime
    call GetMousePos
    Compute TempMouseX=(INT(510/1024*$ResolutionX) + 100)
    Compute TempMouseY=(INT(425/768*$ResolutionY) - 95)
    MousePos $TempMouseX,$TempMouseY
    
   // NumberAdded
    //DragTo 105, 265
    Compute TempMouseX=103 + $BarleyWindowX*$numberPlanted
    Compute TempMouseY=44
    
    
    if 	$numberPlanted > 4
      Compute multiplyer= $numberPlanted + 1
    //  pause
    end //if 
    
      if 	$numberPlanted > 11
      Compute multiplyer= $multiplyer + 4
    end //if 
    
       if 	$numberPlanted > 14
      Compute multiplyer= $multiplyer + 1
    end //if 
    
   	Compute TempMouseX=103 + $BarleyWindowX * ($multiplyer MOD 6 )
    Compute TempMouseY=44 + $BarleyWindowY * ($multiplyer DIV 6 )
    
     
    DragTo $TempMouseX,$TempMouseY
    Compute TempMouseX={MouseX} + 2
    Compute TempMouseY={MouseY} + 122
    Call SetMousePos
    LoadRGB $TempMouseX,$TempMouseY
    if {RGBBlue} > 240
      break
    else
      Delay $sleeptime
      SetConst MousePosX =  743
      SetConst MousePosY = 611
      call RightClick2
    end //end if
  end //end loop
  
end// end proceedure



procedure plant
  SetConst MousePosX = $XCoordsOfPlantBarley
  SetConst MousePosY = $YCoordsOfPlantBarley
  call RightClick2
end

procedure MoveLeft
  //SetConst MousePosX = 245
  //SetConst MousePosY = 393
  Compute MousePosX= $PlayerCenterX - $MoveDeltaX
  Compute MousePosY= $PlayerCenterY
  MousePos $MousePosX,$MousePosY
  Call LeftClick2
  Delay $MoveSleepTime
end

procedure MoveDown
  //SetConst MousePosX =  500
  //SetConst MousePosY = 620
  Compute MousePosX= $PlayerCenterX
  Compute MousePosY= $PlayerCenterY + $MoveDeltaY
  MousePos $MousePosX,$MousePosY
  Call LeftClick2
  Delay $MoveSleepTime
end

procedure MoveUp
  //SetConst MousePosX =  500
  //SetConst MousePosY = 167
  Compute MousePosX= $PlayerCenterX
  Compute MousePosY= $PlayerCenterY - $MoveDeltaY
  MousePos $MousePosX,$MousePosY
  Call LeftClick2
  Delay $MoveSleepTime
end

procedure MoveRight
  //MousePos 880, 512
  //SetConst MousePosX =  760
  //SetConst MousePosY = 392
  Compute MousePosX= $PlayerCenterX + $MoveDeltaX
  Compute MousePosY= $PlayerCenterY
  MousePos $MousePosX,$MousePosY
  Call LeftClick2
  Delay $MoveSleepTime
end

Procedure LeftClick2
  call GetMousePos
  MousePos $MousePosX, $MousePosY
  if $varDelay = 1
    delay 200
  end
  LeftClick
  //delay 200
  SetConst varDelay = 0
  Call SetMousePos
End

Procedure RightClick2
  Call GetMousePos
  MousePos $MousePosX, $MousePosY
  if $varDelay = 1
    delay 200
  end
  RightClick
  SetConst varDelay = 0
  //delay 400
  Call SetMousePos
End

Procedure GetMousePos //find the original coords of the mouse
  SetConst varOriginalMouseX = {MouseX}
  SetConst varOriginalMouseY = {MouseY}
End
Procedure SetMousePos //set the mouse back where it came from
  MousePos $varOriginalMouseX, $varOriginalMouseY
End

Clay

// Clay 
loop 890

delay 600

MousePos 107, 96
leftclick

delay 100

MousePos 1762, 600
leftclick

delay 600

MousePos 107, 96
leftclick

delay 100

MousePos 68, 600
leftclick


end

Onion

// Onion Growing macro made by Oni - Updated 6/16/09
// Works only with Aqueduct window pinned up in TOP RIGHT!
// Pin plant window in TOP LEFT!
// see image for mouse start location.
// 1680x1050

constants
	Batch = 0
	StartX = 0
	StartY = 0
	NewX = 0
	NewY = 0
	Job = 0
	MDelay = 100
	SDelay = 200
End

SetConst StartX = {MouseX}
SetConst StartY = {MouseY}
TimeStamp $StartX, $StartY

Form Veggie, Settings
	ed1=Editbox:Batch:1
	ed2=ComboBox:Project:Onions
End

FormLoad Veggie, Veggie.frm

if ShowForm Veggie
	set Batch = Veggie[ed1]
	case
	When Veggie[ed2] = Onions
		set Job = Onions
	End
else
	Stop
End

FormSave Veggie, Veggie.frm

Loop $Batch
	Call $Job
End

Procedure Onions
	MousePos 40, 10
	leftclick
	delay 1000
	MousePos 86, 160 // close plant window
	delay 50
	rightclick
	delay 50
		/// Plant 8 onions ///
		// (1) //
	MousePos 52, 43 // plant click
	delay 300
	rightclick
	delay 1077
	MousePos 45, 84 // NW
	delay 300
	rightclick
	delay 300
	MousePos 31, 162 // click "build"
	delay 300
	rightclick
	Delay 75
		// (2) //
	MousePos 52, 43 // plant click
	Delay 75
	rightclick
	delay 1077
	MousePos 59, 78 // N //
	Delay 75
	rightclick
	delay 50
	MousePos 31, 162 // click "build"
	delay 50
	rightclick
	Delay 75
		// (3) //
	MousePos 52, 43 // plant click
	Delay 75
	rightclick
	delay 1077		
	MousePos 74, 84 // NE //
	Delay 75
	rightclick
	delay 50
	MousePos 31, 162 // click "build"
	delay 50
	rightclick
	Delay 75	
		// (4) //	
	MousePos 52, 43 // plant click
	Delay 75
	rightclick
	delay 1077			
	MousePos 82, 100 // E //
	Delay 75
	rightclick
	delay 50
	MousePos 31, 162 // click "build"
	delay 50
	rightclick
	Delay 75		
		// (5) //
	MousePos 52, 43 // plant click
	Delay 75
	rightclick
	delay 1077		
	MousePos 73, 115 // SE //
	Delay 75
	rightclick
	delay 50
	MousePos 31, 162 // click "build"
	delay 50
	rightclick
	Delay 75		
		// (6) //
	MousePos 52, 43 // plant click
	Delay 75
	rightclick
	delay 1077			
	MousePos 59, 123 // S //
	Delay 75
	rightclick
	delay 50
	MousePos 31, 162 // click "build"
	delay 50
	rightclick
	Delay 75		
		// (7) //
	MousePos 52, 43 // plant click
	Delay 75
	rightclick
	delay 1077			
	MousePos 44, 114 // SW //
	Delay 75
	rightclick
	delay 50
	MousePos 31, 162 // click "build"
	delay 50
	rightclick
	Delay 75		
		// (8) //
	MousePos 52, 43 // plant click
	Delay 75
	rightclick
	delay 1077			
	MousePos 35, 101 // W //
	Delay 75
	rightclick
	delay 50
	MousePos 31, 162 // click "build"
	delay 50
	rightclick
	Delay 75	
	///// END PLANT ////

		
	// PIN 1 //
	Compute NewX = $StartX + 3
	Compute NewY = $StartY - 7
	mousepos $NewX, $NewY
Delay 75
rightclick
Delay 75
	Compute NewX = $NewX + 78
	Compute NewY = $NewY - 24
	mousepos $NewX, $NewY
	Delay 75
	dragto 76, 92

MousePos 174, 92 // pin 1
Delay 75
rightclick
Delay 75	

// PIN 2 //
	Compute NewX = $StartX + 41
	Compute NewY = $StartY - 28
	mousepos $NewX, $NewY
Delay 75
rightclick
Delay 75
	Compute NewX = $NewX + 78
	Compute NewY = $NewY - 24
	mousepos $NewX, $NewY
	Delay 75
	dragto 76, 177

MousePos 172, 178
Delay 75
rightclick
Delay 75		

// PIN 3 //
	Compute NewX = $StartX + 74
	Compute NewY = $StartY - 27
	mousepos $NewX, $NewY
Delay 75
rightclick
Delay 75
	Compute NewX = $NewX + 78
	Compute NewY = $NewY - 24
	mousepos $NewX, $NewY
	Delay 75
	dragto 76, 261

MousePos 173, 261
Delay 75
rightclick
Delay 75		
	
	// PIN 4 //
	Compute NewX = $StartX + 112
	Compute NewY = $StartY + 48
	mousepos $NewX, $NewY
Delay 75
rightclick
Delay 75
	Compute NewX = $NewX + 78
	Compute NewY = $NewY - 24
	mousepos $NewX, $NewY
	Delay 75
	dragto 76, 345

MousePos 172, 347
Delay 75
rightclick
Delay 75		
	
	// PIN 5 //
	Compute NewX = $StartX + 118
	Compute NewY = $StartY + 83
	mousepos $NewX, $NewY
Delay 75
rightclick
Delay 75
	Compute NewX = $NewX + 78
	Compute NewY = $NewY - 24
	mousepos $NewX, $NewY
	Delay 75
	dragto 76, 429

MousePos 173, 430
Delay 75
rightclick
Delay 75		
	
	// PIN 6 //
	Compute NewX = $StartX + 63
	Compute NewY = $StartY + 93
	mousepos $NewX, $NewY
Delay 75
rightclick
Delay 75
	Compute NewX = $NewX + 78
	Compute NewY = $NewY - 24
	mousepos $NewX, $NewY
	Delay 75
	dragto 76, 513

MousePos 172, 514
Delay 75
rightclick
Delay 75		
	
	// PIN 7 //
	Compute NewX = $StartX - 27
	Compute NewY = $StartY + 84
	mousepos $NewX, $NewY
Delay 75
rightclick
Delay 75
	Compute NewX = $NewX + 78
	Compute NewY = $NewY - 24
	mousepos $NewX, $NewY
	Delay 75
	dragto 76, 599

MousePos 173, 598
Delay 75
rightclick
Delay 75		
	
	// PIN 8 //
	Compute NewX = $StartX - 12
	Compute NewY = $StartY + 40 
	mousepos $NewX, $NewY
Delay 75
rightclick
Delay 75
	Compute NewX = $NewX + 78
	Compute NewY = $NewY - 24
	mousepos $NewX, $NewY
	Delay 75
	dragto 76, 683

MousePos 173, 682
Delay 75
rightclick
Delay 75
	
keys {F4}
	/////WATER////////
	/////Set1/////
MousePos 55, 123
Delay 75
rightclick
Delay 75
MousePos 55, 210
Delay 75
rightclick
Delay 75
MousePos 55, 291
Delay 75
rightclick
Delay 75
MousePos 55, 376
Delay 75
rightclick
Delay 75
MousePos 55, 461
Delay 75
rightclick
Delay 75
MousePos 55, 546
Delay 75
rightclick
Delay 75
MousePos 55, 631
Delay 75
rightclick
Delay 75
MousePos 55, 717
Delay 75
rightclick
Delay 75
		////////Fill Jugs///////
MousePos 1418, 60
delay 50
leftclick
delay 50	
MousePos 1415, 123
delay 50
leftclick
delay 50	
	//// LOOP 1
keys {F4}
	Compute NewX = $StartX + 110
	Compute NewY = $StartY - 16
	delay 10
	mousepos $NewX, $NewY
	LoadRGB $newX, $NewY
		while {RGBgreen} < 130
		delay 10
		LoadRGB $newX, $NewY
		delay 10
		keys {F4}
		delay 10
		End
		delay 3500
		keys {F4}
MousePos 55, 123
Delay 75
rightclick
Delay 75
MousePos 55, 210
Delay 75
rightclick
Delay 75
MousePos 55, 291
Delay 75
rightclick
Delay 75
MousePos 55, 376
Delay 75
rightclick
Delay 75
MousePos 55, 461
Delay 75
rightclick
Delay 75
MousePos 55, 546
Delay 75
rightclick
Delay 75
MousePos 55, 631
Delay 75
rightclick
Delay 75
MousePos 55, 717
Delay 75
rightclick
Delay 75	
	////////Fill Jugs///////
MousePos 1418, 60
delay 50
leftclick
delay 50	
MousePos 1415, 123
delay 50
leftclick
delay 50	
	/////Set2/////
keys {F4}
	Compute NewX = $StartX + 121
	Compute NewY = $StartY - 25
	delay 10
	mousepos $NewX, $NewY
	LoadRGB $newX, $NewY
		while {RGBgreen} < 130
		delay 10
		LoadRGB $newX, $NewY
		delay 10
		keys {F4}
		delay 10
		End
		delay 3500
		keys {F4}
MousePos 55, 123
Delay 75
rightclick
Delay 75
MousePos 55, 210
Delay 75
rightclick
Delay 75
MousePos 55, 291
Delay 75
rightclick
Delay 75
MousePos 55, 376
Delay 75
rightclick
Delay 75
MousePos 55, 461
Delay 75
rightclick
Delay 75
MousePos 55, 546
Delay 75
rightclick
Delay 75
MousePos 55, 631
Delay 75
rightclick
Delay 75
MousePos 55, 717
Delay 75
rightclick
Delay 75	
		////////Fill Jugs///////
MousePos 1418, 60
delay 50
leftclick
delay 50	
MousePos 1415, 123
delay 50
leftclick
delay 50
	/////Set3/////
keys {F4}
	Compute NewX = $StartX + 127
	Compute NewY = $StartY - 30
	delay 10
	mousepos $NewX, $NewY
	LoadRGB $newX, $NewY
		while {RGBgreen} < 130
		delay 10
		LoadRGB $newX, $NewY
		delay 10
		keys {F4}
		delay 10
		End
		delay 3500
		keys {F4}
MousePos 55, 123
Delay 75
rightclick
Delay 75
MousePos 55, 210
Delay 75
rightclick
Delay 75
MousePos 55, 291
Delay 75
rightclick
Delay 75
MousePos 55, 376
Delay 75
rightclick
Delay 75
MousePos 55, 461
Delay 75
rightclick
Delay 75
MousePos 55, 546
Delay 75
rightclick
Delay 75
MousePos 55, 631
Delay 75
rightclick
Delay 75
MousePos 55, 717
Delay 75
rightclick
Delay 75	
		////////Fill Jugs///////
MousePos 1418, 60
delay 50
leftclick
delay 50	
MousePos 1415, 123
delay 50
leftclick
delay 50	
	/////Set4/////
keys {F4}
	Compute NewX = $StartX + 137
	Compute NewY = $StartY - 37
	delay 10
	mousepos $NewX, $NewY
	LoadRGB $newX, $NewY
		while {RGBgreen} < 130
		delay 10
		LoadRGB $newX, $NewY
		Delay 75
		keys {F4}
		delay 10
		End
		delay 3500
		keys {F4}
MousePos 55, 123
Delay 75
rightclick
Delay 75
MousePos 55, 210
Delay 75
rightclick
Delay 75
MousePos 55, 291
Delay 75
rightclick
Delay 75
MousePos 55, 376
Delay 75
rightclick
Delay 75
MousePos 55, 461
Delay 75
rightclick
Delay 75
MousePos 55, 546
Delay 75
rightclick
Delay 75
MousePos 55, 631
Delay 75
rightclick
Delay 75
MousePos 55, 717
Delay 75
rightclick
Delay 750
	////// Harvest////////
MousePos 55, 123
Delay 75
rightclick
Delay 75
MousePos 55, 210
Delay 75
rightclick
Delay 75
MousePos 55, 291
Delay 75
rightclick
Delay 75
MousePos 55, 376
Delay 75
rightclick
Delay 75
MousePos 55, 461
Delay 75
rightclick
Delay 75
MousePos 55, 546
Delay 75
rightclick
Delay 75
MousePos 55, 631
Delay 75
rightclick
Delay 75
MousePos 55, 717
Delay 75
rightclick
Delay 75
	////////close pin///////
MousePos 173, 93
	Delay 75
	rightclick
	Delay 75
MousePos 173, 177
	Delay 75
	rightclick
	Delay 75
MousePos 171, 262
	Delay 75
	rightclick
	Delay 75
MousePos 173, 346
	Delay 75
	rightclick
	Delay 75
MousePos 173, 431
	Delay 75
	rightclick
	Delay 75
MousePos 173, 514
	Delay 75
	rightclick
	Delay 75
MousePos 172, 600
	Delay 75
	rightclick
	Delay 75
MousePos 174, 685
	Delay 75
	rightclick
	Delay 75

delay 6001
		
End	

Grinder

delay 18000

loop 10000 


MousePos 1762, 120 // Change these locations to the pinned windows
leftclick

delay 18000


MousePos 68, 120
leftclick

delay 18000


end

Charcoal Hearth


//Charcoal Hearth
// 1024x768
// Setup:  This handles from 1 to 8 charcoal hearths at a time.  Pin the windows
//         in 2 rows of 4 starting in top left corner.  But them up together but
//         Don't overlap them at all.  I suggest at least 200
//         wood per hearth and a normally hold about 150 water jugs.
//         All hearths are slightly different but I suggest that you put your
//         fastest burning hearths first in line.  The current settings are set
//         for guilded hearths but its a bit more efficient atm with personal
//         hearths.  You can tweak the settings below to alter Heat, Wood, Water
//         and danger thresholds.  The macro doesn't watch Oxygen.  If your oxygen
//         is getting too high, lower this by increasing WoodX in constants since
//         adding wood lowers oxygen.
//
//  If you see anything odd, /chat me.
//
//  Known Issues:  You will see it add some wood during the snuff process.  It's
//                 not much wood but I'm looking into it.
//
//  ENJOY! :)  Come acro me in LE :) 780, 6956
//  Anka
//
Constants
  //User Definable variables
  Hearths = 1       //Number of Hearths you are running. 1-8
  HeatX = 168       //Threshold for Heat bar, increase or decrease as needed.
  WoodX = 107      //Wood threshold, adds wood/round up to this point.
  WaterX = 76      //Alowable water level, not much play here.. dont lower more than 2
  DangerX = 164   //Threshold for Danger bar, increase or decrease as needed.
  RGBBlue = 220    //Threshold for detecting the color blue.  Some video cards
  //                   are having problems with this.  I will add a color test soon to
  //                   help.  If you are having problems. Run just 1 hearth and try
  //                   lowering this number by 10 at a time.  It's hard for me to see
  //                   what is going on without using your pc :(
  Guild = 0       // 1 for Guilded or public hearths, 0 for Personal hearths
  //End User variables
  AddX = 226
  Add2X = 15
  Add1Y = 65
  Add2Y = 17
  Add3Y = 250
  RegX = 47
  RegY = 74
  BeginX = 111
  BeginY = 245
  NewX = 0
  New2X = 0
  New2Y = 0
  NewY = 0
  Heat = 0
  Wood = 0
  Water = 0
  Danger = 0
  Status = 0
  HeatY = 156
  OxyY = 168
  WoodY = 180
  
  WaterY = 192
  
  DangerY = 204
  StatusX = 167
  StatusY = 216
  WoodBX = 35
  WoodBY = 250
  WaterBX = 85
  Num = 0
  Jump = 5
  JumpM = 0
  Jumped = 0
  Used = 0
  
  MDelay = 50
  SDelay = 50
  S1Delay = 50
  Count = 0
  CountM = 0
  MouseX = 0
  MouseY = 0
  
End

MousePos 100, 20  //Activates eGenesis window.. Don't run ACTool maximized.
Delay $MDelay
LeftClick
Delay 2000

If $Guild = 1
  Call Guild
End

SetConst NewX = $BeginX
SetConst NewY = $BeginY
SetConst Count = 1
Loop $Hearths
  If $Count = $Jump
    SetConst NewX = $BeginX
    Compute NewY = $BeginY + $Add3Y
  End
  MousePos $NewX, $NewY
  Delay $MDelay
  Rightclick
  Delay $MDelay
  Compute NewX = $NewX + $AddX
  Compute Count = $Count + 1
End
SetConst NewX = $BeginX  //Dont remember why this is here :)
Call Main

Procedure Main
  SetConst CountM = 1
  SetConst Status = 0
  Compute JumpM = $Jump - 1
  Loop $Hearths
    If $CountM = $Jump
      // may have to use New Newx and newy variables in Main
      SetConst NewX = $StatusX
      Compute NewY = $StatusY + $Add3Y
      SetConst New2X = $WaterBX
      Compute New2Y = $WoodBY + $Add3Y
    End
    
    While $Status = 0
      Call CheckBars
      If $Status = 1
        Call Snuff
        //code to advance to next hearth
        Compute Used = $Used + 1
        If $Used = $JumpM
          Compute HeatX = $HeatX - (($Used - 1) * $AddX)
          Compute HeatY = $HeatY + $Add3Y
          Compute WoodX = $WoodX - (($Used - 1) * $AddX)
          Compute WoodY = $WoodY + $Add3Y
          Compute WaterX = $WaterX - (($Used - 1) * $AddX)
          Compute WaterY = $WaterY + $Add3Y
          Compute DangerX = $DangerX - (($Used - 1) * $AddX)
          Compute DangerY = $DangerY + $Add3Y
          Compute StatusX = $StatusX - (($Used - 1) * $AddX)
          Compute StatusY = $StatusY + $Add3Y
          //Compute WaterBX = $WaterBX - (($Used -1) * $AddX)
          //Compute WoodBX = $WoodBX - (($Used - 1 ) * $AddX)
          //Compute WoodBY = $WoodBY + $Add3Y
          SetConst Jumped = 1
          Continue
        Else
          Compute HeatX = $HeatX + $AddX
          Compute WoodX = $WoodX + $AddX
          Compute WaterX = $WaterX + $AddX
          Compute DangerX = $DangerX + $AddX
          Compute StatusX = $StatusX + $AddX
          //Compute WaterBX = $WaterBX + $AddX
          //Compute WoodBX = $WoodBX + $AddX
        End
        Continue
      End
      If $Heat = 0 and $Danger = 0 and $Wood = 0
        Call Wood
      Else
        If $Heat = 1 or $Danger = 1
          If $Water = 0
            Call Water
          End
        End
      End
      
      Delay 1000
    End
    Compute CountM = $CountM + 1
    SetConst Status = 0
  End
End

Procedure CheckBars
  MousePos $HeatX, $HeatY
  Delay $SDelay
  LoadRGB {MouseX}, {MouseY}
  if {RGBBlue} > $RGBBlue
    SetConst Heat = 1
  Else
    SetConst Heat = 0
  End
  MousePos $WoodX, $WoodY
  Delay $S1Delay
  LoadRGB {mousex}, {mousey}
  if {RGBBlue} > $RGBBlue
    SetConst Wood = 1
  Else
    SetConst Wood = 0
  End
  MousePos $WaterX, $WaterY
  Delay $S1Delay
  LoadRGB {mousex}, {mousey}
  if {RGBBlue} > $RGBBlue
    SetConst Water = 1
  Else
    SetConst Water = 0
  End
  MousePos $DangerX, $DangerY
  Delay $S1Delay
  LoadRGB {MouseX}, {MouseY}
  if {RGBBlue} > $RGBBlue
    SetConst Danger = 1
  Else
    SetConst Danger = 0
  End
  MousePos $StatusX, $StatusY
  LoadRGB {MouseX}, {MouseY}
  if {RGBRed} = 6 and {RGBGreen} = 254 and {RGBBlue} = 5
    SetConst Status = 1
  Else
    SetConst Status = 0
  End
End

Procedure Water
  SetConst NewX = $WaterBX
  SetConst NewY = $WoodBY
  Loop $Hearths
    IF {loopno} = $Jump
      SetConst NewX = $WaterBX
      Compute NewY = $WoodBY + $Add3Y
    End
    If {loopno} > $Used
      MousePos $NewX, $NewY
      Delay $SDelay
      Rightclick
      Delay $SDelay
    End
    Compute NewX = $NewX + $AddX
  End
  SetConst NewX = $WaterBX
End

Procedure Snuff
  SetConst New2X = $WaterBX
  SetConst New2Y = $WoodBY
  Compute Num = $Used + 1
  Loop $Hearths
    IF {loopno} = $Jump
      SetConst New2X = $WaterBX
      Compute New2Y = $WoodBY + $Add3Y
    End
    If {loopno} = $Num
      MousePos $New2X, $New2Y
      Loop 8
        Rightclick
      End
    End
    Compute New2X = $New2X + $AddX
  End
End

Procedure Wood
  SetConst NewX = $WoodBX
  SetConst NewY = $WoodBY
  Loop $Hearths
    IF {loopno} = $Jump
      SetConst NewX = $WoodBX
      Compute NewY = $WoodBY + $Add3Y
    End
    If {loopno} > $Used
      MousePos $NewX, $NewY
      Delay $SDelay
      Rightclick
      Delay $SDelay
    End
    Compute NewX = $NewX + $AddX
  End
  SetConst NewX = $WoodBX
End


Procedure Guild
  Compute BeginX = $BeginX - 7
  Compute BeginY = $BeginY + 16
  Compute RegY = $RegY + 16
  Compute RegX = $RegX - 14
  Compute AddX = $AddX - 15
  Compute Add3Y = $Add3Y + 16
  Compute Add1Y = $Add1Y - 16
  Compute WoodBY = $WoodBY + 16
  Compute HeatX = $HeatX - 4
  Compute HeatY = $HeatY + 16
  Compute WoodX = $WoodX - 1
  Compute WoodY = $WoodY + 16
  Compute WaterY = $WaterY + 16
  Compute DangerX = $DangerX - 4
  Compute DangerY = $DangerY + 16
  Compute StatusX = $StatusX - 5
  Compute StatusY = $StatusY + 16
End
//Written with ACTool 5.3.0 by Anka
Bell Asterisk

Thermometer


//thermo 
//minimize chat, start thermo, set arrow in glory hole. 

//put pipe in hole 

loop 30 

keys a 
delay 100 

end 

//move it back out 

loop 7 

keys s 
delay 200 

end 

//rotate it while it heats 

loop 21 

keys n 
delay 300 

end 

//rotate and blow 

loop 4 

keys b 
delay 50
keys n 
delay 100 


end 

keys q 
delay 50 
keys u 
delay 50