The Wiki for Tale 6 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:Anka/Macros/PaintMixer

From ATITD6
Jump to navigationJump to search
//Paint Mixer   -   by Anka
//
//This macro will mix paint for you.  It was designed to used a single paint batch Pigment Laboratory
//before upgrades became available but it's fast enough that you might not want to upgrade it
//anyway.
//
//  I have 2 paints of mine set up already.  You will have to edit these 2 colors to match your
//  paint recipies.  To add more paints, follow these instructions...
//
// 1. Add your paint color to the menu on line 76 separated by commas.  Replace any spaces in the
//    name with a _
// 2. Scroll down to the other Procedures and add a Procedure for your paint.  It should match what
//    what you put in the menu.  It's easy to copy and paste a procedure and rename then edit.
// 3. Set up your recipe - look over the other procedures to get an idea of what is happening.
//    The basic setup for adding a single click of an ingredient is...
//       MousePos $IngX, $CarrotY
//       Call RClick
//    These 2 lines will add 1 carrot.  If you need more than 1 of an ingredient, use this...
//        MousePos $IngX, $CarrotY
//        Call RClick
//        Set INum = 2
//        Loop $INum
//          Rightclick
//        End
//        Delay $MDelay
//  The first 2 lines will also add 1 carrot but you set the following line "Set INum = 2" to 
//  the remaining clicks.  In this case you want a total of 3 so set INum to 1 less.
//
//  Once you set up all of your paints, it should work from tale to tale.
//  Enjoy Anka

Constants
  Batch = 0
  Color = 0
  X1 = 10
  Y1 = 45
  IngX = 0
  TakeX = 0
  TakeY = 0
  CabbageY = 0
  CarrotY = 0
  ClayY = 0
  DeadTongueY = 0
  ToadY = 0
  EarthY = 0
  RedY = 0
  LeadY = 0
  SilverY = 0
  IronY = 0
  CopperY = 0
  SulfurY = 0
  PotashY = 0
  LimeY = 0
  SaltpeterY = 0
  INum = 0
  MDelay = 100
End

Object Take
  0=0,0|0=1,0|0=2,0|0=3,0|0=4,0|0=5,0|0=6,0|
  0=3,1|0=3,2|0=3,3|0=3,4|0=3,5|0=3,6|0=3,7|
  0=3,8|
End Object

Object Ing
  0=0,0|0=1,0|0=2,0|0=1,1|
  0=1,2|0=4,2|0=6,2|0=7,2|
  0=1,3|0=4,3|0=8,3|0=1,4|
  0=4,4|0=8,4|0=1,5|0=4,5|
  0=8,5|0=1,6|0=4,6|0=8,6|
  0=0,7|0=1,7|0=2,7|0=4,7|0=8,7|
End Object

Form Paint, Settings
  ed1=Editbox:Batch:1
  ed2=Combobox:Color:Green_Yellow, Pale_Violet_Red
end

FormLoad Paint, Paint.frm

if ShowForm Paint
  Set Batch = Paint[ed1]
  Set Color = Paint[ed2]
else
  stop
End

FormSave Paint, Paint.frm

keydown @{Tab} 100
Delay 2000

Call Startup

Loop $Batch
  Call $Color
  MousePos $TakeX, $TakeY
  Call RClick
End

Procedure Startup
  //Search for starting spot
  While $Y1 <  120
    IsObject Take at $X1, $Y1
      //Set take button
      Compute TakeX = $X1 + 5
      Compute TakeY = $Y1 + 3
      Break
    Else
      Compute Y1 = $Y1 + 1
    End
  End
  
  While $Y1 <  280
    IsObject Ing at $X1, $Y1
      //Set any variables here
      Compute IngX = $X1 + 7
      Compute CabbageY = $Y1 + 24
      Compute CarrotY = $CabbageY + 18
      Compute ClayY = $CarrotY + 18
      Compute DeadTongueY = $ClayY + 18
      Compute ToadY = $DeadTongueY + 18
      Compute EarthY = $ToadY + 18
      Compute RedY = $EarthY + 18
      Compute LeadY = $RedY + 18
      Compute SilverY = $LeadY + 18
      Compute IronY = $SilverY + 18
      Compute CopperY = $IronY + 18
      Compute SulfurY = $CopperY + 18
      Compute PotashY = $SulfurY + 18
      Compute LimeY = $PotashY + 18
      Compute SaltpeterY = $LimeY + 18
      Break
    Else
      Compute Y1 = $Y1 + 1
    End
  End
End

Procedure Green_Yellow  //Recipe 1 Carrot, 1 Sulfur, 1 Potash, 1 Saltpeter, 9 Clay
  MousePos $IngX, $CarrotY  //Ingredient 1
  Call RClick
  MousePos $IngX, $SulfurY  //Ingredient 2
  Call RClick
  MousePos $IngX, $PotashY
  Call RClick
  MousePos $IngX, $SaltpeterY
  Call RClick
  MousePos $IngX, $ClayY  //Drops 1 in then loop does the other 8
  Call RClick
  Set INum = 8  
  Loop $INum
  	Rightclick
  End
  Delay $MDelay
End

Procedure Pale_Violet_Red  //Recipe 7 Cabbage, 3 Carrot, 1 Potash
	MousePos $IngX, $CabbageY
	Call RClick
	Set Inum = 6
	Loop $INum
		Rightclick
	End
	Delay $MDelay
	MousePos $IngX, $CarrotY
	Call RClick
	Set INum = 2
	Loop $INum
		Rightclick
	End
	Delay $MDelay
	MousePos $IngX, $PotashY
	Call RClick
End

Procedure RClick
  Delay $MDelay
  Rightclick
  Delay $MDelay
End