A Wiki in the Desert
Log in

Difference between revisions of "User:Anka/Macros/GrassPicker"

From A Wiki in the Desert
(Created page with "//Grass Picker // //This macro will pick grass and keep you in the same relative area. //INSTRUCTIONS // I still use AC Tool for my macros (ac-tool/forums/index.php?/files/c...")
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 +
<pre>
 
//Grass Picker
 
//Grass Picker
 
//
 
//
Line 151: Line 152:
 
End
 
End
 
//Written with AC Tool 5.5 by Anka
 
//Written with AC Tool 5.5 by Anka
 +
</pre>

Latest revision as of 14:58, 25 September 2019

//Grass Picker
//
//This macro will pick grass and keep you in the same relative area.
//INSTRUCTIONS

//  I still use AC Tool for my macros (ac-tool/forums/index.php?/files/category/5-ac-tool/
//  Download and install version 5.4.0 first, then download AC Tool v5.5 and replace the executable in your 5.4 directory.
//
//  1)  Set your camera view to Cartographer (Tripple F8).
//  2)  Macro is designed to use in windowed ATITD screen maximised.
//  3)  If you plan to dry your grass on racks, stack drying rack windows in top left corner of screen.
//  4)  Place your mouse over the "Dry grass into straw" option of your racks.
//  5)  Alt tab to ACTool (Don't move the mouse)  Press F2
//  6)  Set Reps - (Wanted grass/Clay - Even number.
//  7)  Pick resolution.
//  8)  These are the "Interface Size" you should use for each resolution
//      1920x1080 small interface, 2160x1440 Large interface, 3840x1440 Huge interface.
//  9)  The clay option was for early game when I only had 2 canvas bags
//  10) Select Dry if you want to dry your grass (Only tested with drying racks guilded)
//  11) Set the number of drying racks you are using.

//  12) Click Ok or press Enter to Continue or Cancel to Stop the macro
//Anka
Constants
  Cycles = 0
  Reps = 0
  DumpX = 0  //Stash X Coord
  DumpY = 0   //Stash Y Coord
  StepLeft = 500
  StepRight = 425
  MouseX = 0
  MouseY = 0
  NewX = 0
  Pick = 1200      //Pick delay - Time waited while avatar picks grass
  MDelay = 570    //Mouse move delay, increase if having problems
  XMid = 0
  YMid = 0
  OffSet = 0
  GrassB = 0
  Pin = 0
End

SetConst DumpX = {mousex}
SetConst DumpY = {mousey}
Compute XMid = {Screenwidth} / 2


Form Grass
  FormCaption=Grass-Clay Picker
  ed1=EditBox:L:Wanted grass / Clay (Even #):140
  ed2=Combobox:Resolution:2160x1440:3840x2160,2160x1440,1920x1080
  ed3=checkbox:Clay? :S:False
  ed4=checkbox:Dry? :True
  ed5=EditBox:S:# of racks? : 10
end

if ShowForm Grass
  //Do this if OK clicked
  Compute Reps = Grass[ed1] / 2
  if Grass[ed3] = True
    Set StepLeft = 1500
    Set StepRight = 1300
  End
  Set Cycles = Grass[ed5]
else
  //Do this if Cancel is clicked
  Stopscript
end

Call Resolution
Compute YMid = ( {Screenheight} / 2) + $OffSet

KeyDown @{Tab} 200
Delay 2000
// Test

//


Loop $Cycles
  Loop $Reps
    Compute NewX = $XMid - $StepLeft
    Mousepos $NewX, $YMid
    Timestamp $YMid
    Call Grass
    
    Compute NewX = $XMid + $StepRight
    Mousepos $NewX, $YMid
    Timestamp $YMid
    Call Grass
    if Grass[ed3] = True
      MousePos 2173,2033
      Delay $MDelay
      LeftClick
      Delay $MDelay
      Mousepos 1917, 1123
      Delay $MDelay
      Rightclick
      Delay 2000
    End
  End
  
  if Grass[ed4] = True
    Mousepos $DumpX, $DumpY
    Delay $MDelay
    Rightclick
    Delay $MDelay
    Mousepos $XMid, $YMid
    Delay $MDelay
    Rightclick
    Delay $MDelay
    MousePos $Pin
    Delay $MDelay
    Rightclick
    Delay $MDelay
  End
End

Procedure Grass
  Delay $MDelay
  LeftClick
  Delay $Pick
  
  //Grass button
  MousePos $GrassB
  LeftClick
  Delay 1500
End

Procedure Coords
  Delay 5000
End

Procedure Resolution
  Case
  When Grass[ed2] = 3840x2160
    SetConst OffSet = 35
  When Grass[ed2] = 2160x1440
    SetConst OffSet = 17
    SetConst StepLeft = 305
    SetConst StepRight = 262
    SetConst GrassB = 750, 1340
    SetConst Pin = 2141, 39
  When Grass[ed2] = 1920x1080
    SetConst OffSet = 14
    SetConst StepLeft = 410
    SetConst StepRight = 362
    SetConst GrassB = 733, 985
    SetConst Pin = 1899, 41
  End
End
//Written with AC Tool 5.5 by Anka