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.

Difference between revisions of "User:Bardoth/info"

From ATITD6
Jump to navigationJump to search
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<pre>
+
==[[Caress of Wind]]==
-- flax_auto.lua v1.2 -- by Jimbly, tweaked by Cegaiel and
+
{{Template:BuildingInfo|image=CaressofWind.png|size=n/a|where=[[where::Small Construction Site]]|description=Used during the Test of the Covered Cartouche.}}
--  KasumiGhia, revised by Tallow, revised by Tripps, revised by Bardoth
+
* 30 [[Boards]]
--
+
* 3 [[Sail]]
-- Plant and harvest seeds then plant and harvest flax, repeat
+
* 3 [[Papyrus Paper]]
-- Draws water when needed, optionally rots flax, optionally
+
* 4 [[Steel Wire]]
-- stores products
+
* 1 [[Bearings]]
--
+
* 22 [[Oil]]
-- Works Reliably: 2x2, 3x3, 4x4, 5x5
 
-- May Work (depends on your computer): 6x6, 7x7
 
--
 
  
assert(loadfile("luaScripts/ui_utils.inc"))();
+
== Upgrading ==
assert(loadfile("luaScripts/common.inc"))();
+
Once built, '''the Caress of Wind''' may be expanded. The costs from level 1 are:
assert(loadfile("luaScripts/settings.inc"))();
 
assert(loadfile("luaScripts/constants.inc"))();
 
assert(loadfile("luaScripts/screen_reader_common.inc"))();
 
  
askText = singleLine([[
+
{|  border="1" style= align="center" width="80%"
  flax_auto v1.0 (by Jimbly, tweaked by Cegaiel and KasumiGhia,
+
!Size !! Bearings !! Boards!! Oil!! Papyrus Paper !! Sail !! Steel Wire
  revised by Tallow, revised by Tripps) --
+
|-
  Make sure the plant flax window is pinned and on the RIGHT side of
+
| align="center"|'''10 '''||align="center"| 1 || align="center"|14 ||align="center"| 10 || align="center"|2 || align="center"|2 ||align="center"| 2
  the screen. Your VeggieTales window should also be on the RIGHT side
+
|-
  of the screen. You may need to F12 at low resolutions or hide your
+
| align="center"|'''20''' || align="center"|1 || align="center"|28 || align="center"|20 || align="center"|4 || align="center"|3 || align="center"|4
  chat window (if it starts planting and fails to move, it probably
+
|-
  clicked on your chat window). Will plant grid NE of current
+
| align="center"|'''30''' || align="center"|2 || align="center"|57 || align="center"|41 || align="center"|7 || align="center"|6 || align="center"|8
  location.  Will turn on 'Plant all crops where you stand' and 'Right
+
|-
  click pins/unpins a menu'. Will turn off 'Enable Hotkeys on flax'.
+
| align="center"|'''40''' || align="center"|3 || align="center"|86 || align="center"|62 || align="center"|10 || align="center"|9 || align="center"|12
]]);
+
|-
 +
| align="center"|'''50''' || align="center"|5 || align="center"|144 || align="center"|104 || align="center"|17 || align="center"|15|| align="center"|20
 +
|-
 +
| align="center"|'''60''' || align="center"|7 || align="center"|202 || align="center"|146 || align="center"|24 || align="center"|21 || align="center"|28
 +
|-
 +
| align="center"|'''100''' || align="center"|31 || align="center"|898 || align="center"|652 || align="center"|105 || align="center"|93 || align="center"|124
 +
|-
 +
| align="center"|'''200''' || align="center"|1023 || align="center"|29666 || align="center"|21543 || align="center"|3438 || align="center"|3069 || align="center"|4092
 +
|}
 +
<br>
  
-- Global parameters set by prompt box.
+
==[[Charm of Flight]]==
num_loops = 5;
+
{{Template:BuildingInfo|image=CharmOfFlight.jpg|size=n/a|where=[[where::Small Construction Site]]|description=Used during the Test of the Covered Cartouche.}}
run_loops = 1;
+
* 2 [[Copper Strap]]
grid_w = 5;
+
* 3 [[Rope]]
grid_h = 5;
+
* 20 [[Boards]]
grid_direction = 1;
+
* 19 [[Clay]]
grid_directions = { "Northeast", "Northwest", "Southeast", "Southwest" };
+
* 1 [[Cut Gems | Eyelet cut Amethyst]]
grid_deltas =  
+
* 1 [[Cut Gems | Lens cut Garnet]]
{
 
  { {1, 0, -1, 0}, {0, -1, 0, 1} },
 
  { {-1, 0, 1, 0}, {0, -1, 0, 1} },
 
  { {1, 0, -1, 0}, {0, 1, 0, -1} },
 
  { {-1, 0, 1, 0}, {0, 1, 0, -1} }
 
};
 
 
 
min_seeds = 0;
 
is_plant = true;
 
seeds_per_pass = 4;
 
seeds_per_harvest = 1;
 
rot_flax = false;
 
water_needed = false;
 
water_location = {};
 
water_location[0] = 0;
 
water_location[1] = 0;
 
store_flax = false;
 
storage_location = {};
 
storage_location[0] = 0;
 
storage_location[1] = 0;
 
  
-- How many seeds are left
+
== Upgrading ==
seeds_in_pocket = 26;
+
Once built, '''the Charm of Flight''' may be expanded. The costs from level 1 are:
  
imgFlax1 = "Flax:";
+
{|  border="1" style= align="center" width="80%"  
imgHarvest = "HarvestThisFlax.png";
+
!Size!! Boards !! Clay !! Copper Strap !! Eyelet Cut Amethyst !! Lens Cut Garnet !! Rope
imgWeedAndWater = "WeedAndWater.png";
+
|-
imgWeed = "WeedThisFlaxBed.png";
+
| 10 || 9 || 8 || 1 || 1 || 1 || 2
imgSeeds = "HarvestSeeds.png";
+
|-
imgUseable = "UseableBy.png";
+
| 20 || 18 || 17 || 2 || 1 || 1 || 3
imgThisIs = "ThisIs.png";
+
|-
imgUtility = "Utility.png";
+
| 30 || 37 || 35 || 4 || 2 || 2 || 6
imgRipOut = "RipOut.png";
+
|-
imgUnpin = "UnPin.png";
+
| 40 || 56 || 53 || 6 || 3 || 3 || 9
imgTheSeeds = "TheSeeds.png";
+
|-
imgOK = "ok.png";
+
| 50 || 94 || 89 || 10 || 4 || 6 || 15
imgTearDownThis = "TearDownThis.png";
+
|-
imgTearDown = "TearDown.png";
+
| 60 || 132 || 125 || 14 || 6 || 8 || 21
imgPlantWhereChecked = "PlantAllCropsWhereYouStandChecked.png";
+
|-
imgPlantWhereUnchecked = "PlantAllCropsWhereYouStandUnchecked.png";
+
| 70 || 208 || 197 || 22 || 10 || 12 || 33
imgHotkeysOnFlax = "EnableHotkeysOnFlax.png";
+
|-
imgOptionsX = "OptionsX.png";
+
| 80 || 284 || 269 || 30 || 13 || 17 || 45
imgRightClickPins = "RightClickPins.png";
+
|-
imgSmallX = "smallX.png";
+
| 90 || 436 || 413 || 46 || 21 || 25 || 69
 +
|-
 +
| 100 || 588 || 557 || 62 || 28 || 34 || 93
 +
|-
 +
| 200 || 19436 || 18413 || 2046 || 921 || 1125 || 3069
 +
|}
  
-- Tweakable delay values
+
<br>
refresh_time = 300; -- Time to wait for windows to update
 
walk_time = 300;
 
  
-- Don't touch. These are set according to Jimbly's black magic.
+
==[[Distract of Sky]]==
walk_px_y = 340;
+
{{Template:BuildingInfo|image=DistractofSky.jpg‎ |size=n/a|where=[[where::Small Construction Site]]|description=Used during the Test of the Covered Cartouche.}}
walk_px_x = 380;
+
* 7 [[Leather]]
 +
* 2 [[Copper Wire]]
 +
* 1 [[Raeli Tiles | Blueish Raeli Tiles]]
 +
* 2 [[Paint | Violetish Paint]]
 +
* 0 [[White Sand]]
 +
* 3 [[Bearings]]
 +
* 0 [[Quicksilver]]
  
xyCenter = {};
+
== Upgrading ==
xyFlaxMenu = {};
+
Once built, '''the Distract of Sky''' may be expanded. The costs from level 1 are:
  
-- The flax bed window
+
{|  border="1"
window_w = 174;
+
!Size!! Bearings !! Copper Wire !! Leather !! Violetish Paint !! Quicksilver !! Blueish Raeli Tiles !! White Sand
window_h = 100;
+
|-
 +
| 20 || 3 || 3 || 8 || 2 || &nbsp; || 1 || &nbsp;
 +
|-
 +
| 40 || 9 || 8 || 23 || 6 || &nbsp; || 4 || 1
 +
|-
 +
| 60 || 22 || 19 || 53 || 15 || &nbsp; || 9 || 3
 +
|-
 +
| 80 || 47 || 41 || 114 || 32 || 1 || 19 || 6
 +
|-
 +
| 100 || 97 || 85 || 236 || 66 || 3 || 40 || 12
 +
|-
 +
| 120 || 197 || 172 || 479 || 134 || 6 || 81 || 24
 +
|-
 +
| 140 || 397 || 346 || 965 || 270 || 12 || 163 || 48
 +
|-
 +
| 160 || 797 || 694 || 1937 || 542 || 24 || 327 || 96
 +
|}
  
harvest_seeds_time = 300;
+
==[[Fall of Balance]]==
 +
{{Template:BuildingInfo|image=Fall_Of_Balance.jpg‎|size=n/a|where=[[where::Small Construction Site]]|description=Used during the Test of the Covered Cartouche.}}
 +
* 1 [[Sheet Glass]]
 +
* 7 [[Papyrus Paper]]
 +
* 1 [[Bearings]]
 +
* 26 [[Concrete]]
 +
* 38 [[Boards]]
 +
* 18 [[Beeswax]]
  
FLAX = 0;
 
ONIONS = 1;
 
plantType = FLAX;
 
  
--warehouse_color = -1769769985;
+
== Upgrading ==
--chest_color = 2036219647;
+
Once built, the '''Fall of Balance''' may be expanded. The costs from level 1 are:
--tent_color = 1399546879;
 
  
-------------------------------------------------------------------------------
+
{|  border="1"
-- initGlobals()
+
!Size!! Bearings !! Beeswax !! Boards !! Concrete !! Papyrus Paper !! Sheet Glass !! Gearbox
--
+
|-
-- Set up black magic values used for trying to walk a standard grid.
+
| 10 || 1 || 8 || 16 || 12 || 4 || 0 || 0
-------------------------------------------------------------------------------
+
|-
 +
| 20 || 1 || 16 || 34 || 24 || 8  || 0 || 0
 +
|-
 +
| 30 || 2 || 33 || 70 || 49 || 15 || 1 || 1
 +
|-
 +
| 40 || 3 || 50 || 106 || 74 || 23  || 1 || 1
 +
|-
 +
| 50 || 5 || 84 || 178 || 124 || 38 || 2 || 2
 +
|-
 +
| 60 || 7 || 118 || 250 || 174 || 53 || 4 || 2
 +
|-
 +
| 70 || 11 || 186 || 394 || 274 || 82 || 6 || 3
 +
|-
 +
| 80 || 15 || 254 || 538 || 374 || 112 || 8 || 3
 +
|-
 +
| 90 || 23 || 390 || 826 || 574 || 172 || 13 || 3
 +
|-
 +
| 100 || 31 || 526 || 1114 || 774 || 231 || 18 || 4
 +
|-
 +
| 200 || 1023 || 17390  || 38626 || 25574 || 7612 || 593
 +
|}
  
function initGlobals()
+
==[[Float of Ghost]]==
  -- Macro written with 1720 pixel wide window
+
{{Template:BuildingInfo|image=FloatOfGhost.jpg‎ |size=n/a|where=[[where::Small Construction Site]]|description=Used during the Test of the Covered Cartouche.}}
  
  srReadScreen();
+
* 0 [[Cut Gems |Dalessi cut Turquoise]]
  xyWindowSize = srGetWindowSize();
+
* 0 [[Cut Gems |Amanti cut Garnet]]
 +
* 11 [[Water in Jugs]]
 +
* 1 [[Sheet Glass]]
 +
* 3 [[Cut Stone]]
 +
* 2 [[Small Diamond]]
 +
* 14 [[Ink]]
  
  local pixel_scale = xyWindowSize[0] / 1720;
 
  lsPrintln("pixel_scale " .. pixel_scale);
 
  
  walk_px_y = math.floor(walk_px_y * pixel_scale);
+
== Upgrading ==
  walk_px_x = math.floor(walk_px_x * pixel_scale);
+
Once built, the Float Of Ghost may be expanded. The costs from level 1 are:
  
  local walk_x_drift = 14;
+
{|  border="1"
  local walk_y_drift = 18;
+
!Size!! Amanti Cut Garnet !! Cut Stone !! Dalessi Cut<br> Turquoise !! Ink !! Sheet Glass !! Small Diamond !! Water in Jugs
  if (lsScreenX < 1280) then
+
|-
    -- Have to click way off center in order to not move at high resolutions
+
| 20 || 1 || 3 || 0 || 12 || 2 || 2 || 9
    walk_x_drift = math.floor(walk_x_drift * pixel_scale);
+
|-
    walk_y_drift = math.floor(walk_y_drift * pixel_scale);
+
| 40 || 2 || 9 || 0|| 38 || 5 || 6 || 29
  else
+
|-
    -- Very little drift at these resolutions, clicking dead center barely moves
+
| 60 || 4 || 22 || 1 || 91 || 12 || 15 || 69
    walk_x_drift = 1;
+
|-
    walk_y_drift = 1;
+
| 80 || 8 || 48 || 3 || 197 || 25 || 33 || 150
  end
+
|-
 +
| 100 || 17 || 99 || 7 || 409 || 51 || 69 || 311
 +
|-
 +
| 120 || 34 || 201 || 14 || 832 || 103 || 140 || 633
 +
|-
 +
| 140 || 68 || 405 || 28 || 1678 || 207 || 282 || 1277
 +
|-
 +
| 160 || 136 || 813 || 56 || 3370 || 415 || 566 || 2565
 +
|}
  
  xyCenter[0] = xyWindowSize[0] / 2 - walk_x_drift;
+
==[[Glaze Of Light]]==
  xyCenter[1] = xyWindowSize[1] / 2 + walk_y_drift;
 
  if plantType == FLAX then
 
    xyFlaxMenu[0] = xyCenter[0] - 43*pixel_scale;
 
    xyFlaxMenu[1] = xyCenter[1] + 0;
 
  else
 
    xyFlaxMenu[0] = xyCenter[0] - 20;
 
    xyFlaxMenu[1] = xyCenter[1] - 10;
 
  end
 
end
 
  
-------------------------------------------------------------------------------
+
{{Template:BuildingInfo|image=Glaze_Of_Light.jpg‎  ‎|size=n/a|where=[[where::Small Construction Site]]|description=Used during the Test of the Covered Cartouche.}}
-- checkForEnd()
 
--
 
-- Similar to checkBreak, but also looks for a clean exit.
 
-------------------------------------------------------------------------------
 
  
local ending = false;
+
* 0 Bearings
 +
* 0 Fine Glass Rods
 +
* 1 Medium Ruby
 +
* 0 Quicksilver
 +
* 1 Small Barrel
 +
* 33 Water in Jugs
  
function checkForEnd()
+
== Upgrading ==
  if ((lsAltHeld() and lsControlHeld()) and not ending) then
+
Once built, the Glaze Of Light may be expanded. The costs from level 1 are:
    ending = true;
 
    setStatus("");
 
    cleanup();
 
    error "broke out with Alt+Ctrl";
 
  end
 
  if (lsShiftHeld() and lsControlHeld()) then
 
    if lsMessageBox("Break", "Are you sure you want to exit?", MB_YES + MB_NO) == MB_YES then
 
      error "broke out with Shift+Ctrl";
 
    end
 
  end
 
  if lsAltHeld() and lsShiftHeld() then
 
    -- Pause
 
    while lsAltHeld() or lsShiftHeld() do
 
      statusScreen("Please release Alt+Shift", 0x808080ff, false);
 
    end
 
    local done = false;
 
    while not done do
 
      local unpaused = lsButtonText(lsScreenX - 110, lsScreenY - 60,
 
                    z, 100, 0xFFFFFFff, "Unpause");
 
      statusScreen("Hold Alt+Shift to resume", 0xFFFFFFff, false);
 
      done = (unpaused or (lsAltHeld() and lsShiftHeld()));
 
    end
 
    while lsAltHeld() or lsShiftHeld() do
 
      statusScreen("Please release Alt+Shift", 0x808080ff, false);
 
    end
 
  end
 
end
 
  
-------------------------------------------------------------------------------
+
{|  border="1"
-- checkWindowSize()
+
!Size!! Bearings !! Fine Glass Rods !! Medium Ruby !! Quicksilver!! Small Barrel !!  Water in Jugs
--
+
|-
-- Set width and height of flax window based on whether they are guilded.
+
| 20 || 0 || 0|| 1 || 0 || 2 || 32
-------------------------------------------------------------------------------
+
|-
 +
| 40 || 1 || 1 || 1|| 0 || 4 || 98
 +
|-
 +
| 60 || 2 || 3 || 9 || 1 || 13 || 229
 +
|-
 +
| 80 || 5 || 7 || 20 || 2|| 27 || 492
 +
|-
 +
| 100 || 10|| 15 || 42 || 4 || 56 || 1017
 +
|-
 +
| 125 || 25 || 37 || 104 || 10 || 132 || 2417
 +
|-
 +
| 150 || 60 || 90 || 244 || 24 || 303 || 5567
 +
|}
  
window_check_done_once = false;
+
==[[Hatch of Steel]]==
function checkWindowSize(x, y)
+
{{Template:BuildingInfo|image=HatchofSteel.PNG‎ |size=n/a|where=[[where::Small Construction Site]]|description=Used during the Test of the Covered Cartouche.}}
  if not window_check_done_once then
 
    srReadScreen();
 
    window_check_done_once = true;
 
    local pos = srFindImageInRange(imgUseable, x-5, y-50, 150, 100)
 
    if pos then
 
      window_w = 166;
 
      window_h = 116;
 
    end
 
  end
 
end
 
  
-------------------------------------------------------------------------------
+
* 20 [[Copper Wire]]
-- promptFlaxNumbers()
+
* 11 [[Slate]]
--
+
* 1 [[Iron Bar]]
-- Gather user-settable parameters before beginning
+
* 1 [[Copper Sheeting]]
-------------------------------------------------------------------------------
+
* 15 [[Oil]]
 +
* 2 [[Cut Stone]]
  
function promptFlaxNumbers()
+
== Upgrading ==
  scale = 1.1;
+
Once built, the Hatch of Steel may be expanded. The costs from level 1 are:
   
 
  local z = 0;
 
  local is_done = nil;
 
  local value = nil;
 
  -- Edit box and text display
 
  while not is_done do
 
    -- Make sure we don't lock up with no easy way to escape!
 
    checkBreak();
 
  
    local y = 5;
+
{|  border="1"
 +
!Size!! Copper Sheeting !! Copper Wire !! Cut Stone!! Iron Bars !! Oil !! Slate
 +
|-
 +
| 10 || 1 || 9 || 1 || 1 || 6|| 4
 +
|-
 +
| 20 || 1 || 18 || 2 || 1 || 13 || 9
 +
|-
 +
| 30 || 2 || 37 || 4 || 2 || 27 || 19
 +
|-
 +
| 40 || 3 || 56 || 6 || 3 || 41 || 29
 +
|-
 +
| 50 || 5 || 94 || 10 || 5 || 69 || 49
 +
|-
 +
| 60 || 7 || 132 || 14 || 7 || 97 || 69
 +
|-
 +
| 70 || 11 || 208 || 22 || 11 || 153 || 109
 +
|-
 +
| 80 || 15 || 284 || 30 || 15 || 209 || 149
 +
|-
 +
| 90 || 23 || 463 || 46 || 23 || 321 || 229
 +
|-
 +
| 100 || 31 || 588 || 62 || 31 || 433 || 309
 +
|-
 +
| 200 || 1023 || 19436 || 2046 || 1023 || 14321 || 10229
 +
|}
  
    lsSetCamera(0,0,lsScreenX*scale,lsScreenY*scale);
+
==[[Pierce of Heaven]]==
 +
{{Template:BuildingInfo|image=PierceOfHeaven.jpg‎ |size=n/a|where=[[where::Small Construction Site]]|description=Used during the Test of the Covered Cartouche.}}
  
    lsPrint(5, y, z, scale, scale, 0xFFFFFFff, "Passes:");
+
* 0 [[Medium Gears]]
    num_loops = readSetting("num_loops",num_loops);
+
* 0 [[Small Gears]]
    is_done, num_loops = lsEditBox("passes", 110, y, z, 50, 30, scale, scale,
+
* 0 [[Bearings]]
                                  0x000000ff, num_loops);
+
* 0 [[Iron Strap]]
    is_done, run_loops = lsEditBox("passes2", 170, y, z, 50, 30, scale, scale,
+
* 0 [[Cut Stone]]
                                  0x000000ff, run_loops);
+
* 0 [[Mandibular Glue]]
    if not tonumber(num_loops) then
+
* 14 [[Treated Boards |Pliable Blonde Boards]]
      is_done = nil;
+
* 20 [[Treated Boards |Black Rigid Boards]]
      lsPrint(10, y+18, z+10, 0.7, 0.7, 0xFF2020ff, "MUST BE A NUMBER");
+
<br><br><br>
      num_loops = 1;
+
==[[Point of Mind]]==
    end
+
{{Template:BuildingInfo|image=PointOfMind.png‎ |size=n/a|where=[[where::Small Construction Site]]|description=Used during the Test of the Covered Cartouche.}}
    writeSetting("num_loops",num_loops);
 
    y = y + 32;
 
  
    lsPrint(5, y, z, scale, scale, 0xFFFFFFff, "Grid size:");
+
* 2 [[Boards]]
    grid_w = readSetting("grid_w",grid_w);
+
* 33 [[Honey]]
    is_done, grid_w = lsEditBox("grid", 110, y, z, 50, 30, scale, scale,
+
* 0 [[Sheet Glass]]
                                0x000000ff, grid_w);
+
* 1 [[Small Ruby]]
    if not tonumber(grid_w) then
+
* 0 [[Cuttable Gems | Cut Garnet Lens]]
      is_done = nil;
 
      lsPrint(10, y+18, z+10, 0.7, 0.7, 0xFF2020ff, "MUST BE A NUMBER");
 
      grid_w = 1;
 
      grid_h = 1;
 
    end
 
    grid_w = tonumber(grid_w);
 
    grid_h = grid_w;
 
    writeSetting("grid_w",grid_w);
 
    y = y + 32;
 
 
    lsPrint(5, y, z, scale, scale, 0xFFFFFFff, "Plant to the:");
 
grid_direction = readSetting("grid_direction",grid_direction);
 
grid_direction = lsDropdown("grid_direction", 145, y, 0, 145, grid_direction, grid_directions);
 
writeSetting("grid_direction",grid_direction);
 
    y = y + 32;
 
  
    lsPrint(5, y, z, scale, scale, 0xFFFFFFff, "Seed harvests per bed:");
+
== Upgrading ==
    seeds_per_pass = readSetting("seeds_per_pass",seeds_per_pass);
+
Once built, the Point of Mind may be expanded. The costs from level 1 are:
    is_done, seeds_per_pass = lsEditBox("seedsper", 250, y, z, 50, 30,
 
                                          scale, scale, 0x000000ff, seeds_per_pass);
 
    seeds_per_pass = tonumber(seeds_per_pass);
 
    if not seeds_per_pass then
 
      is_done = nil;
 
      lsPrint(10, y+18, z+10, 0.7, 0.7, 0xFF2020ff, "MUST BE A NUMBER");
 
      seeds_per_pass = 1;
 
    end
 
    writeSetting("seeds_per_pass",seeds_per_pass);
 
    y = y + 32;
 
  
    lsPrint(5, y, z, scale, scale, 0xFFFFFFff, "Seeds per harvest:");
+
{|  border="1"
    seeds_per_harvest = readSetting("seeds_per_harvest",seeds_per_harvest);
+
!Size!! Boards !! Gear Box !! Honey !! Sheet Glass !! Small Ruby !! Cut Garnet Lens
     is_done, seeds_per_harvest = lsEditBox("seedsperharvest", 250, y, z, 50, 30,
+
|-
                                          scale, scale, 0x000000ff, seeds_per_harvest);
+
| 10 ||  0        ||    0          ||  10      ||      0                ||  1                ||    0
     seeds_per_harvest = tonumber(seeds_per_harvest);
+
|-
    if not seeds_per_harvest then
+
| 20 ||  1      ||     1          ||  32      ||      0                ||  2                ||    0
       is_done = nil;
+
|-
       lsPrint(10, y+18, z+10, 0.7, 0.7, 0xFF2020ff, "MUST BE A NUMBER");
+
| 30 ||  2      ||     1          ||  54      ||      1                ||  3                ||    0
      seeds_per_harvest = 1;
+
|-
     end
+
| 40 ||  5       ||    2          ||  98       ||      1                ||  4                ||    0  
     writeSetting("seeds_per_harvest",seeds_per_harvest);
+
|-
     y = y + 32;
+
| 50 ||  7       ||    2          ||  142    ||      2                ||  6                ||    1
 +
|-
 +
| 60 ||  12    ||    3          ||  230    ||    3                ||  9                ||    1
 +
|-
 +
| 70 ||  17    ||    3          ||  317    ||    5                ||  14              ||  2
 +
|-
 +
| 80 ||  27     ||    4          ||  492    ||    7                ||  21              ||  2
 +
|-
 +
| 90 ||  36    ||    4          ||  667     ||    11              ||  30              ||  3
 +
|-
 +
| 100 ||  55  ||     5          ||  1017    ||    15              ||  43              ||  4
 +
|}
  
    rot_flax = readSetting("rot_flax",rot_flax);
+
==[[Puncture of Dark]]==
    rot_flax = lsCheckBox(10, y, z+10, 0xFFFFFFff, "Rot Flax", rot_flax);
+
{{Template:BuildingInfo|image=Puncture_Of_Dark.JPG‎  |size=n/a|where=[[where::Small Construction Site]]|description=Used during the Test of the Covered Cartouche.}}
    writeSetting("rot_flax",rot_flax);
 
    y = y + 32;
 
  
    water_needed = readSetting("water_needed",water_needed);
+
* 0 [[Large Diamond]]
    water_needed = lsCheckBox(10, y, z+10, 0xFFFFFFff, "Flax requires water", water_needed);
+
* 0 [[Bearings]]
    writeSetting("water_needed",water_needed);
+
* 0 [[Steel Sheeting]]
    y = y + 32;
+
* 0 [[Gold]]
   
+
* 6 [[Oil]]
    if rot_flax or water_needed then
+
* 11 [[Leather]]
      lsPrint(5, y, z, scale, scale, 0xFFFFFFff, "Water coords:");
+
* 3 [[Slate]]
      water_location[0] = readSetting("water_locationX",water_location[0]);
 
      is_done, water_location[0] = lsEditBox("water_locationX", 165, y, z, 55, 30,
 
                                            scale, scale, 0x000000ff, water_location[0]);
 
      water_location[0] = tonumber(water_location[0]);
 
      if not water_location[0] then
 
        is_done = nil;
 
        lsPrint(10, y+18, z+10, 0.7, 0.7, 0xFF2020ff, "MUST BE A NUMBER");
 
        water_location[0] = 1;
 
      end
 
      writeSetting("water_locationX",water_location[0]);
 
     
 
      water_location[1] = readSetting("water_locationY",water_location[1]);
 
      is_done, water_location[1] = lsEditBox("water_locationY", 222, y, z, 55, 30,
 
                                            scale, scale, 0x000000ff, water_location[1]);
 
      water_location[1] = tonumber(water_location[1]);
 
      if not water_location[1] then
 
        is_done = nil;
 
        lsPrint(10, y+18, z+10, 0.7, 0.7, 0xFF2020ff, "MUST BE A NUMBER");
 
        water_location[1] = 1;
 
      end
 
      writeSetting("water_locationY",water_location[1]);
 
      y = y + 32;
 
    end
 
  
    store_flax = readSetting("store_flax",store_flax);
+
== Upgrading ==
    store_flax = lsCheckBox(10, y, z+10, 0xFFFFFFff, "Store Flax", store_flax);
+
Once built, the Puncture of Dark may be expanded. The costs from level 1 are:
    writeSetting("store_flax",store_flax);
 
    y = y + 32;
 
   
 
    if store_flax then
 
      lsPrint(5, y, z, scale, scale, 0xFFFFFFff, "Storage coords:");
 
      storage_location[0] = readSetting("storage_locationX",storage_location[0]);
 
      is_done, storage_location[0] = lsEditBox("storage_locationX", 185, y, z, 55, 30,
 
                                            scale, scale, 0x000000ff, storage_location[0]);
 
      storage_location[0] = tonumber(storage_location[0]);
 
      if not storage_location[0] then
 
        is_done = nil;
 
        lsPrint(10, y+18, z+10, 0.7, 0.7, 0xFF2020ff, "MUST BE A NUMBER");
 
        storage_location[0] = 1;
 
      end
 
      writeSetting("storage_locationX",storage_location[0]);
 
   
 
      storage_location[1] = readSetting("storage_locationY",storage_location[1]);
 
      is_done, storage_location[1] = lsEditBox("storage_locationY", 242, y, z, 55, 30,
 
                                            scale, scale, 0x000000ff, storage_location[1]);
 
      storage_location[1] = tonumber(storage_location[1]);
 
      if not storage_location[1] then
 
        is_done = nil;
 
        lsPrint(10, y+18, z+10, 0.7, 0.7, 0xFF2020ff, "MUST BE A NUMBER");
 
        storage_location[1] = 1;
 
      end
 
      writeSetting("storage_locationY",storage_location[1]);
 
      y = y + 32 + 5;
 
    end
 
  
    if lsButtonText(10, (lsScreenY - 30) * scale, z, 100, 0xFFFFFFff, "OK") then
+
{|  border="1"
      is_done = 1;
+
!Size 10 !! Large Diamond !! Bearings !! Steel Sheeting !! Gold !! Oil !! Leather !! Slate
    end
+
|-
 +
| 10 || 0 || 0 || 0 || 0 || 4 || 4 || 2
 +
|-
 +
| 20 || 0 || 0 || 0 || 0 || 4 || 7 || 4
 +
|-
 +
| 30 || 0 || 1 || 1 || 0 || 14 || 20 || 8
 +
|-
 +
| 40 || 0 || 1 || 1 || 0 || 21 || 30 || 12
 +
|-
 +
| 50 || 0 || 2 || 2 || 1 || 35 || 51 || 20
 +
|-
 +
| 60 || 0 || 3 || 3 || 1 || 49 || 72 || 27
 +
|-
 +
| 100 || 2 || 13 || 12 || 6 || 216 || 322 || 117
 +
|-
 +
| 200 || 64 || 416 || 384 || 192 || 7098 || 10645 || 3837
 +
|}
  
    if lsButtonText((lsScreenX - 100) * scale, (lsScreenY - 30) * scale, z, 100, 0xFFFFFFff,
+
==[[Pursuit of Soul]]==
                    "End script") then
+
{{Template:BuildingInfo|image=Pursuit_Of_Soul$PursuitOfSoul1.jpg |size=n/a|where=[[where::Small Construction Site]]|description=Used during the Test of the Covered Cartouche.}}
      error "Clicked End Script button";
 
    end
 
  
    if is_done and (not num_loops or not grid_w) then
 
      error 'Canceled';
 
    end
 
       
 
    lsDoFrame();
 
    lsSleep(tick_delay);
 
  end
 
  
  min_seeds = grid_w*grid_h+1;
+
* 0 [[Quicksilver]]
end
+
* 7 [[Sulfurous Water]]
 +
* 3 [[Oil]]
 +
* 1 [[Glass Pipe]]
 +
* 0 [[Small Sapphire]]
 +
* 1 [[Small Topaz]]
 +
* 2 [[Small Ruby]]
  
------------------------------------------------------------------------------
+
== Upgrading ==
-- promptSeeds()
+
Once built, the Pursuit of Soul may be expanded. The costs from level 1 are:
-------------------------------------------------------------------------------
 
  
function promptSeeds()
+
{|  border="1"
  scale = 1.1;
+
!Size !! Quicksilver !! Sulfurous Water !! Oil !! Glass Pipe !! Small Sapphire !! Small Topaz !! Small Ruby
   
+
|-
  local z = 0;
+
| 10 || 0 || 4 || 2 || 1 || 1 || 1 || 2
  local is_done = nil;
+
|-
  local value = nil;
+
| 20 || 0 || 7 || 4 || 1 || 1 || 2 || 3
  -- Edit box and text display
+
|-
  while not is_done do
+
| 30 || 0 || 14 || 8 || 3 || 2 || 4 || 6
    -- Make sure we don't lock up with no easy way to escape!
+
|-
    checkBreak();
+
| 40 || 0 || 21 || 12 || 4 || 3 || 5 || 8
 +
|-
 +
| 50 || 1 || 36 || 20 || 7 || 5 || 9 || 13
 +
|-
 +
| 60 || 1 || 50 || 28 || 9 || 6 || 12 || 18
 +
|-
 +
| 100 || 7 || 223 || 122 || 39 || 24 || 54 || 78
 +
|-
 +
| 200 || 224 || 7353 || 3997 || 1279 || 768 || 1759 || 2558
 +
|}
  
    local y = 5;
+
==[[Reflect of Orbit]]==
 +
{{Template:BuildingInfo|image=Reflection_of_Orbit.jpg‎  |size=n/a|where=[[where::Small Construction Site]]|description=Used during the Test of the Covered Cartouche.}}
 +
* 0 [[Gold]]
 +
* 0 [[Cut Gems | Eyelet cut Amethyst]]
 +
* 0 [[Mud Granite]]
 +
* 2 [[Bearings]]
 +
* 4 [[Steel Sheeting]]
 +
* 6 [[Raeli Tiles | Reddish Raeli Tiles]]
 +
* 13 [[Oil]]
  
    lsSetCamera(0,0,lsScreenX*scale,lsScreenY*scale);
+
== Upgrading ==
 +
Once built, the {{PAGENAME}} may be expanded. The costs from level 1 are:
  
    lsPrint(5, y, z, scale, scale, 0xFFFFFFff, "How many seeds are you");
+
{|  border="1"
    y = y + 32;
+
!Size!! Bearings !! Eyelet Cut Ameythyst !! Gold !! Mud Granite !! Oil !! Reddish Raeli Tiles !! Steel Sheeting
    lsPrint(5, y, z, scale, scale, 0xFFFFFFff, "starting with (minimum " .. min_seeds .. ")?");
+
|-
    y = y + 32;
+
| 10 || 2 || 1 || 1 || &nbsp; || 5 || 4 || 2
    seeds_in_pocket = readSetting("seeds_in_pocket",seeds_in_pocket);
+
|-
    is_done, seeds_in_pocket = lsEditBox("seeds_in_pocket", 110, y, z, 50, 30, scale, scale,
+
| 20 || 3 || 1 || 1 || &nbsp; || 11 || 7 || 4
                                  0x000000ff, seeds_in_pocket);
+
|-
    seeds_in_pocket = tonumber(seeds_in_pocket);
+
| 30 || 6 || 2 || 2 || &nbsp; || 23 || 14 || 9
    if not seeds_in_pocket then
+
|-
      is_done = nil;
+
| 40 || 9 || 3 || 2 || &nbsp; || 35 || 21 || 13
      lsPrint(10, y+18, z+10, 0.7, 0.7, 0xFF2020ff, "MUST BE A NUMBER");
+
|-
      seeds_in_pocket = min_seeds;
+
| 50 || 15 || 5 || 3 || 1 || 60 || 35 || 22
    elseif seeds_in_pocket < min_seeds then
+
|-
      is_done = nil;
+
| 60 || 20 || 6 || 4 || 1 || 84 || 49 || 31
      lsPrint(10, y+18, z+10, 0.7, 0.7, 0xFF2020ff, "MUST BE AT LEAST " .. min_seeds);
+
|-
      seeds_in_pocket = min_seeds;
+
| 70 || 32 || 9 || 7 || 2 || 133 || 77 || 49
    end
+
|-
    writeSetting("seeds_in_pocket",seeds_in_pocket);
+
| 80 || 43 || 12 || 9 || 2 || 181 || 105 || 66
    y = y + 32;
+
|-
+
| 90 || 66 || 18 || 14 || 3 || 278 || 161|| 101
y = y + 32;
+
|-
lsPrintWrapped(5, y, z, lsScreenX - 10, scale, scale, 0xD0D0D0ff,
+
| 100 || 88 || 24 || 18 || 4|| 375 || 217 || 136
  "This macro will grow seeds as needed.  Any extra seeds beyond the " ..
+
|-
  min_seeds .. " minimum will be used before growing more seeds.");
+
| 200 || 2878 || 768 || 567 || 128 || 12403 || 7130 || 4467
y = y + 128;
+
|}
  
    if lsButtonText(10, (lsScreenY - 30) * scale, z, 100, 0xFFFFFFff, "OK") then
+
==[[Return of Promise]]==
      is_done = 1;
+
{{Template:BuildingInfo|image=ReturnofPromise.png‎  |size=n/a|where=[[where::Small Construction Site]]|description=Used during the Test of the Covered Cartouche.}}
    end
+
* 2 [[Cut Stone]]
 +
* 1 [[Raeli Tiles | Black Raeli Tiles]]
 +
* 0 [[Raeli Tiles | White Raeli Tiles]]
 +
* 3 [[Raeli Tiles | Blueish Raeli Tiles]]
 +
* 0 [[Raeli Tiles | Reddish Raeli Tiles]]
 +
* 2 [[Raeli Tiles | Yellowish Raeli Tiles]]
 +
* 0 [[Small Gears]]
 +
* 1 [[Bearings]]
  
    if lsButtonText((lsScreenX - 100) * scale, (lsScreenY - 30) * scale, z, 100, 0xFFFFFFff,
+
== Upgrading ==
                    "End script") then
+
Once built, the Return of Promise may be expanded. The costs from level 1 are:
      error "Clicked End Script button";
 
    end
 
  
    lsDoFrame();
+
{|  border="1"
    lsSleep(tick_delay);
+
!Size!! Bearings !! Cut Stone !! Blueish Tiles!! Reddish !! Yellowish !! Black !! White !! Small Gears
  end
+
|-
end
+
| 10 || 1 || 2 || 2 || 1 || 1|| 1|| 0|| 0
 +
|-
 +
| 20 || 1 || 3 || 3 || 1 || 2|| 1|| 0|| 0
 +
|-
 +
| 30 || 2 || 6 || 7 || 2 || 4|| 3|| 0 || 1
 +
|-
 +
| 40 || 3 || 8 || 10 || 2 || 6 || 4|| 0|| 1
 +
|-
 +
| 50 || 5 || 13 || 17 || 4 || 11 || 7|| 1|| 2
 +
|-
 +
| 60 || 7 || 18 || 24 || 5 || 15 || 9 || 1 || 3
 +
|-
 +
| 100 || 31 || 78 || 107 || 20 || 68 || 39|| 7 || 12
 +
|-
 +
| 200 || 1023 || 2558 || 3517 || 640 || 2238 || 1729 ||224 ||384
 +
|}
  
------------------------------------------------------------------------------
+
==[[Revolve of Time]]==
-- getPlantWindowPos()
+
{{Template:BuildingInfo|image=Revolve_of_time.JPG‎ |size=n/a|where=[[where::Small Construction Site]]|description=Used during the Test of the Covered Cartouche.}}
-------------------------------------------------------------------------------
 
  
lastPlantPos = null;
+
* 0 [[Bearings]]
seedImage = imgFlax1;
+
* 1 [[Concrete]]
 +
* 3 [[Cut Stone]]
 +
* 0 [[Fine Glass Pipe]]
 +
* 0 [[Gold]]
 +
* 0 [[Mandibular Glue]]
 +
* 0 [[Raeli Tiles |Greenish Raeli Tiles]]
 +
* 33 [[Red Sand]]
  
function getPlantWindowPos()
+
== Upgrading ==
  srReadScreen();
+
Once built, the {{PAGENAME}} may be expanded. The costs from level 1 are:
  local plantPos = findText(seedImage);
 
  if plantPos then
 
    plantPos[0] = plantPos[0] + 10;
 
  else
 
    plantPos = lastPlantPos;
 
    if plantPos then
 
      safeClick(plantPos[0], plantPos[1]);
 
      lsSleep(refresh_time);
 
    end
 
  end
 
  if not plantPos then
 
    error 'Could not find plant window';
 
  end
 
  lastPlantPos = plantPos;
 
  return plantPos;
 
end
 
  
-------------------------------------------------------------------------------
+
{|  border="1"
-- getToggle()
+
!Size!!Bearings !! Concrete !! Cut Stone !! Fine Glass Pipe !! Gold !! Mandibular Glue !!Greenish Raeli Tiles !! Red Sand
--
+
|-
-- Returns 0 or 2 alternately. Used to slightly shift position of windows
+
| 10 || 1 || 1 || 2 || 1 ||1 || 0 || 1 || 14
-- while collecting them.
+
|-
-------------------------------------------------------------------------------
+
| 20 || 1 || 2 || 3 || 1 || 1 || 0 || 1 || 29
 +
|-
 +
| 30 || 2 || 4 || 6 || 2 || 2 || 0 || 2 || 61
 +
|-
 +
| 40 || 3 || 5 || 9 || 2 || 2 || 1 || 3 || 92
 +
|-
 +
| 50 || 5 ||8 || 16 || 4 || 4 || 2 || 5 || 155
 +
|-
 +
| 60 || 6 || 11 || 22 || 5 || 5 || 2 || 6 || 217
 +
|-
 +
| 70 || 9 || 18 || 35 || 8 || 8 || 4 || 9 || 342
 +
|-
 +
| 80 || 12 || 24 || 47 || 10 || 10 || 5 || 12 || 467
 +
|-
 +
| 90 || 18 || 37 || 72 || 15 || 15 || 8 || 19|| 717
 +
|-
 +
| 100 || 24 || 49 || 97 || 20 || 20 || 10 || 25 || 967
 +
|-
 +
| 200 || 768 || 1599 || 3197 || 640 || 640 || 320 || 800 || 31967
 +
|}
  
toggleBit = 0;
+
==[[Sequence of Order]]==
 +
{{Template:BuildingInfo|image=SequenceOfOrder.jpg‎ |size=n/a|where=[[where::Small Construction Site]]|description=Used during the Test of the Covered Cartouche.}}
  
function getToggle()
+
* 7 [[Dirt]]
  if toggleBit == 0 then
+
* 2 [[Steel Wire]]
    toggleBit = 2;
+
* 0 [[Cable]]
  else
+
* 0 [[Marble|Grey Star Marble]]
    toggleBit = 0;
+
* 0 [[Marble|Tiger's Eye Granite]]
  end
+
* 4 [[Paints|Maroon Paint]]
  return toggleBit;
 
end
 
  
-------------------------------------------------------------------------------
+
== Upgrading ==
-- setStatus(msg)
+
Once built, the Sequence of Order may be expanded. The costs from level 1 are:
--
 
-- Use this to set the current status so that the instructions remain on the  
 
-- screen.
 
-------------------------------------------------------------------------------
 
  
function setStatus(message)
+
{|  border="1"
  if not message then
+
!Size!! Dirt !! Steel Wire !! Cable !! Grey Star Marble !! Tiger's Eye Granite !! Maroon Paint !! 3-output Gearbox
    message = "";
+
|-
  end
+
| 20 || 8 || 3 || &nbsp; || &nbsp; || &nbsp; || 5 || &nbsp;
  local color = 0xFFFFFFff;
+
|-
  local allow_break = true;
+
| 40 || 24 || 9 || 1 || 1 || &nbsp; || 14 || &nbsp;
  lsPrintWrapped(10, 80, 0, lsScreenX - 20, 0.8, 0.8, color, message);
+
|-
  lsPrintWrapped(10, lsScreenY-100, 0, lsScreenX - 20, 0.8, 0.8, 0xffd0d0ff,
+
| 60 || 55 || 21 || 3 || 2 || &nbsp; || 33 || 1
        error_status);
+
|-
  if lsButtonText(lsScreenX - 110, lsScreenY - 30, z, 100,
+
| 80 || 118 || 45 || 7 || 5 || 1 || 71 || 1
          0xFFFFFFff, "End script") then
+
|-
    error(quit_message);
+
| 100 || 243 || 93 || 15 || 10 || 2 || 146 || 2
  end
+
|-
  if allow_break then
+
| 120 || 493 || 188 || 30 || 20 || 4 || 296 || 2
    lsPrint(10, 10, 0, 0.7, 0.7, 0xB0B0B0ff,
+
|-
        "Hold Ctrl+Alt to cleanup and end.");
+
| 140 || 993 || 378 || 60 || 40 || 8 || 596 || 2
    lsPrint(10, 24, 0, 0.7, 0.7, 0xB0B0B0ff,
+
|-
        "Hold Ctrl+Shift to end this script.");
+
| 160 || 1993 || 758 || 120 || 80 || 16 || 1196 || 3
    if allow_pause then
+
|}
      lsPrint(10, 38, 0, 0.7, 0.7, 0xB0B0B0ff,
 
          "Hold Alt+Shift to pause this script.");
 
    end
 
    checkForEnd();
 
  end
 
  lsSleep(tick_delay);
 
  lsDoFrame();
 
end
 
  
-------------------------------------------------------------------------------
+
==[[Suspend of Green]]==
-- doit()
+
{{Template:BuildingInfo|image=Suspend_of_Green.jpg‎|size=n/a|where=[[where::Small Construction Site]]|description=Used during the Test of the Covered Cartouche.}}
-------------------------------------------------------------------------------
 
  
function doit()
+
* 0 [[Green Sun Marble]]
 +
* 18 [[Clay]]
 +
* 41 [[Raeli Tiles | Grayish Raeli Tiles]]
 +
* 1 [[Canvas]]
 +
* 4 [[White Sand]]
 +
* 0 [[Bearings]]
  
  promptFlaxNumbers();
+
== Upgrading ==
  promptSeeds();
+
Once built, the {{PAGENAME}} may be expanded. The costs from level 1 are:
  if water_needed then
 
    if not promptOkay("Make sure you have enough water in jugs to grow " ..
 
      (grid_w*grid_h) .. " flax beds and make sure the plant menu is pinned.") then
 
  error("User pressed cancel.");
 
end
 
  else
 
    if not promptOkay("Make sure the plant menu is pinned.") then
 
  error("User pressed cancel.");
 
end
 
  end
 
  askForWindow(askText);
 
  initGlobals();
 
  local startPos = findCoords();
 
  if not startPos then
 
    error("ATITD clock not found.\Verify entire clock and borders are visible. Try moving clock slightly.");
 
  end
 
  local tops = findAllImages(imgThisIs);
 
  if #tops > 0 then
 
    error("Only the Plant menu should be pinned.");
 
  end
 
  
  getPlantWindowPos();
+
{|  border="1"
  prepareOptions();
+
!Size!! Green Sun Marble !! Clay !! Grayish Raeli Tiles !! Canvas !! White Sand !! Bearings
  prepareCamera();
+
|-
 
+
| 10 || 0 || 8 || 6 || 1 || 2 || 0
  drawWater();
+
|-
  local beds_per_loop = grid_w*grid_h;
+
| 20 || 0 || 17 || 13 || 1 || 4 || 0
  for loop_count=1, num_loops do
+
|-
    for loop_count2=1, run_loops do
+
| 30 || 1 || 35 || 27 || 2 || 9 || 1
    is_plant = (seeds_in_pocket >= min_seeds + beds_per_loop);
+
|-
local planting = "false";
+
| 40 || 1 || 52 || 41 || 3 || 13 || 1  
if is_plant then
+
|-
  planting = "true";
+
| 50 || 2 || 87 || 69 || 5 || 22 || 2
end
+
|-
lsPrintln("is_plant == (" .. seeds_in_pocket .. " >= " .. min_seeds .. " + " .. beds_per_loop .. ") == " .. planting);
+
| 60 || 2 || 122 || 97 ||7 || 31 || 3
    error_status = "";
+
|-
    local finalPos = plantAndPin(loop_count);
+
| 70 || 3 || 192 || 153 || 12 || 49 || 5
    dragWindows(loop_count);
+
|-
    harvestAll(loop_count);
+
| 80 || 4 || 262 || 209 || 16 || 67 || 6
    closeAllFlaxWindows();
+
|-
    setStatus("(" .. loop_count .. "/" .. num_loops .. ") Walking...");
+
| 90 || 6 || 402 || 321 || 25 || 103 ||10
    lsPrintln("doit(): Walking to the starting location at (" .. startPos[0] .. ", " .. startPos[1] .. ")");
+
|-
    walk(startPos,True);
+
| 100 || 8 || 542 || 433 || 33 || 138 || 13
      end
+
|-
--
+
| 200 || 256 || 17,902 || 14,290 || 1,087 || 4,450 || 416
    if is_plant and (water_needed or rot_flax) then
+
|}
      lsPrintln("doit(): Walking to the water at (" .. water_location[0] .. ", " .. water_location[1] .. ")");
 
      walk(water_location,false);
 
      if water_needed then
 
        drawWater();
 
        lsSleep(150);
 
        clickMax(); -- Sometimes drawWater() misses the max button
 
      end
 
--
 
      if rot_flax then
 
        rotFlax();
 
      end
 
      setStatus("(" .. loop_count .. "/" .. num_loops .. ") Walking...");
 
    end
 
--
 
    if is_plant and store_flax then -- This should be done after rotting flax
 
      lsPrintln("doit(): Walking to the storage location at (" .. storage_location[0] .. ", " .. storage_location[1] .. ")");
 
      walk(storage_location,true);
 
      storeFlax();
 
      setStatus("(" .. loop_count .. "/" .. num_loops .. ") Walking...");
 
    end
 
    lsPrintln("doit(): Walking to the starting location at (" .. startPos[0] .. ", " .. startPos[1] .. ")");
 
    walk(startPos,false);
 
    is_plant = true;
 
  end
 
  lsPlaySound("Complete.wav");
 
end
 
  
-------------------------------------------------------------------------------
+
==[[Tale of Journey]]==
-- cleanup()
+
{{Template:BuildingInfo|image=Tale_Of_Journey.jpg‎ ‎|size=n/a|where=[[where::Small Construction Site]]|description=Used during the Test of the Covered Cartouche.}}
--
 
-- Tears out any remaining beds and unpins menus.
 
-------------------------------------------------------------------------------
 
  
function cleanup()
+
* 2 [[Water In Jugs]]
  local tops = findAllImages(imgThisIs);
+
* 3 [[Rope]]
  if #tops > 0 then
+
* 95 [[Treated Boards | Rotproof Treated Boards]]
    for i=1,#tops do
+
* 5  [[Canvas]]
      ripOut(tops[i]);
+
* 17 [[Nails]]
    end
+
* 1 [[Tar]]
  end
+
* 0 [[Silk Cloth]]
end
 
  
-------------------------------------------------------------------------------
+
== Upgrading ==
-- rotFlax()
+
Once built, the Tale of Journey may be expanded. The costs from level 1 are:
--
 
-- Rots flax in water.  Requires you to be standing near water already.
 
-------------------------------------------------------------------------------
 
  
function rotFlax()
+
{|  border="1"
  centerMouse();
+
!Size !! Canvas !! Nails!! Rope !! Silk Cloth !! Tar !! Rotproof Treated Boards!! Water In Jugs
  local escape = "\27";
+
|-
  local pos = nil;
+
| 10 || 2 || 7 || 2 || 0 || 0 || 40 || 1
  while(not pos) do
+
|-
lsSleep(refresh_time);
+
| 20 || 4 || 15 || 3 || 0 || 0 || 85 || 2
srKeyEvent(escape);
+
|-
lsSleep(refresh_time);
+
| 30 || 9 || 31 || 6 || 0 || 1 || 175 || 4
srReadScreen();
+
|-
pos = findText("Skills...");
+
| 40 || 13 || 47 || 9 || 0 || 2 || 265 || 6
  end
+
|-
  clickText(pos);
+
| 43 || 16 || 57 || 11 || 1 || 2 || 319 || 7
  lsSleep(refresh_time);
+
|-
  srReadScreen();
+
| 50 || 22 || 79 || 15 || 1 || 3 || 445 || 10
  local pos = findText("Rot flax");
+
|-
  if pos then
+
| 60 || 31 || 111 || 21 || 1 || 4 || 625 || 14
    clickText(pos);
+
|-
lsSleep(refresh_time);
+
| 100 || 139 || 495 || 93 || 4 || 20 || 2785 || 62
srReadScreen();
+
|-
    if not clickMax() then
+
| 200 || 4603 || 16367 || 3069 || 113 || 665 || 92065 || 2046
      fatalError("Unable to find the Max button.");
+
|}
    end
 
  end
 
end
 
  
-------------------------------------------------------------------------------
+
==[[Twist of Study]]==
-- storeFlax()
 
--
 
-- Stores flax in a storage container such as a wharehouse, chest, or tent.
 
-- Requires you to be standing next to the storage container.
 
-- storeFlax() checks frist for a pinned menu otherwise it clicks the nearest
 
-- pixel of the proper color. Given the large coordinate size in Egypt,
 
-- positioning is not very accurate.  You should only have one storage
 
-- container near where you are standing.
 
-------------------------------------------------------------------------------
 
  
function storeFlax()
+
{{Template:BuildingInfo|image=Twist_of_Study.jpg‎ ‎|size=n/a|where=[[where::Small Construction Site]]|description=Used during the Test of the Covered Cartouche.}}
  setStatus("Storing flax");
 
  local types = { "Flax (", "Rotten Flax", "Insect..." };
 
  stash(types);
 
  setStatus("");
 
end
 
 
 
-------------------------------------------------------------------------------
 
-- plantAndPin()
 
--
 
-- Walk around in a spiral, planting flax seeds and grabbing windows.
 
-------------------------------------------------------------------------------
 
  
function plantAndPin(loop_count)
+
*1 [[Tar]]
  local xyPlantFlax = getPlantWindowPos();
+
*9 [[Leather]]
       
+
*2 [[Oil]]
  -- for spiral
+
*1 [[Steel Wire]]
  local dxi=1;
+
*41 [[Treated Boards |Glossy Hard Boards]]
  local dt_max=grid_w;
+
*27 [[Treated Boards |Rigid Termite Resistant Boards]]
  local dt=grid_w;
+
*0 [[Bearings]]
--  local dx={1, 0, -1, 0};
 
--  local dy={0, -1, 0, 1};
 
  local i;
 
  local dx = {};
 
  local dy = {};
 
  for i=1, 4 do
 
dx[i] = grid_deltas[grid_direction][1][i];
 
    dy[i] = grid_deltas[grid_direction][2][i];
 
  end
 
  local num_at_this_length = 3;
 
  local x_pos = 0;
 
  local y_pos = 0;
 
  local success = true;
 
  
  for y=1, grid_h do
 
    for x=1, grid_w do
 
      setStatus("(" .. loop_count .. "/" .. num_loops .. ") Planting " ..
 
                  x .. ", " .. y);
 
      success = plantHere(xyPlantFlax, y);
 
      if not success then
 
        break;
 
      end
 
  
      -- Move to next position
+
== Upgrading ==
      if not ((x == grid_w) and (y == grid_h)) then
+
Once built, the Twist oif Study may be expanded. The costs from level 1 are:
        lsPrintln('walking dx=' .. dx[dxi] .. ' dy=' .. dy[dxi]);
 
        x_pos = x_pos + dx[dxi];
 
        y_pos = y_pos + dy[dxi];
 
        safeClick(xyCenter[0] + walk_px_x*dx[dxi],
 
                  xyCenter[1] + walk_px_y*dy[dxi], 0);
 
        local spot = getWaitSpot(xyFlaxMenu[0], xyFlaxMenu[1]);
 
        lsSleep(walk_time);
 
        waitForStasis(spot, 1500);
 
        dt = dt - 1;
 
        if dt == 1 then
 
          dxi = dxi + 1;
 
          num_at_this_length = num_at_this_length - 1;
 
          if num_at_this_length == 0 then
 
            dt_max = dt_max - 1;
 
            num_at_this_length = 2;
 
          end
 
          if dxi == 5 then
 
            dxi = 1;
 
          end
 
          dt = dt_max;
 
        end
 
      else
 
        lsPrintln('skipping walking, on last leg');
 
      end
 
    end
 
    checkForEnd();
 
    if not success then
 
      break;
 
    end
 
  end
 
  local finalPos = {};
 
  finalPos[0] = x_pos;
 
  finalPos[1] = y_pos;
 
  return finalPos;
 
end
 
  
-------------------------------------------------------------------------------
+
{|  border="1"
-- plantHere(xyPlantFlax)
+
!Size!! Bearings !! Leather !! Oil!! Steel Wire !! Tar !! Glossy Hard Boards !! Rigid Termite Resistant Boards
--
+
|-
-- Plant a single flax bed, get the window, pin it, then stash it.
+
| 10 || 0 || 5 || 1 || 1 || 1 ||18 ||13
-------------------------------------------------------------------------------
+
|-
 +
| 20 || 0 || 9 || 2 || 1 || 1 || 37||26
 +
|-
 +
| 30 || 1 || 18 || 4 || 2 || 2 || 77 ||53
 +
|-
 +
| 40 || 1 || 27 || 6 || 3 || 3 || 116 || 80
 +
|-
 +
| 50 || 2 || 45 || 10 || 5 || 5 || 195 || 134
 +
|-
 +
| 60 || 2 || 63 || 14 || 7 || 7 || 274 || 188
 +
|-
 +
| 70 || 4 || 100 || 22 ||12  || 11 || 432 ||296
 +
|-
 +
| 80 || 5 || 136 || 30 || 16 || 15 || 589 || 403
 +
|-
 +
| 90 || 8 || 209 || 47 || 25 || 24 || 904 ||618
 +
|-
 +
| 100 || 10|| 281 || 63 || 34 || 32 || 1219 || 833
 +
|-
 +
| 200 || 302 || 9271|| 2078 || 1119 || 1055 || 40279 ||27493
 +
|}
  
function plantHere(xyPlantFlax, y_pos)
 
  -- Plant
 
  lsPrintln('planting ' .. xyPlantFlax[0] .. ',' .. xyPlantFlax[1]);
 
  local bed = clickPlant(xyPlantFlax);
 
  if not bed then
 
    return false;
 
  end
 
  
  -- Bring up menu
 
  lsPrintln('menu ' .. bed[0] .. ',' .. bed[1]);
 
  if not openAndPin(bed[0], bed[1], 3500) then
 
    error_status = "No window came up after planting.";
 
    seeds_in_pocket = 0;
 
    return false;
 
  end
 
  
--  if plantType == ONIONS then
 
--    lsPrintln("Onions");
 
--    lsSleep(200);
 
--    srReadScreen();
 
--    local waters = findAllImages("WaterThese.png");
 
--    for i = 1,#waters do
 
--      lsPrintln("Water");
 
--      safeClick(waters[i][0]+5, waters[i][1]+5);
 
--    end
 
--    sleepWithStatus(1000, "First Water");
 
--  end
 
  
  -- Check for window size
 
  checkWindowSize(bed[0], bed[1]);
 
  
  -- Move window into corner
 
  stashWindow(bed[0] + 5, bed[1], BOTTOM_RIGHT);
 
  
  return true;
 
end
 
  
function clickPlant(xyPlantFlax)
 
  local result = xyFlaxMenu;
 
  local spot = getWaitSpot(xyFlaxMenu[0], xyFlaxMenu[1]);
 
  safeClick(xyPlantFlax[0], xyPlantFlax[1], 0);
 
  lsSleep(click_delay);
 
  
  local plantSuccess = waitForChange(spot, 1500);
 
  if not plantSuccess then
 
    error_status = "No flax bed was placed when planting.";
 
    result = nil;
 
  end
 
  seeds_in_pocket = seeds_in_pocket - 1;
 
  
  return result;
 
end
 
  
-------------------------------------------------------------------------------
+
==[[Churn of Earth]]==
-- dragWindows(loop_count)
 
--
 
-- Move flax windows into a grid on the screen.
 
-------------------------------------------------------------------------------
 
  
function dragWindows(loop_count)
+
{{Template:BuildingInfo|image=Churn_of_Earth.jpg ‎|size=n/a|where=[[where::Small Construction Site]]|description=Used during the Test of the Covered Cartouche.}}
  setStatus("(" .. loop_count .. "/" .. num_loops .. ")  " ..
 
              "Dragging Windows into Grid");
 
  arrangeStashed();
 
end
 
  
-------------------------------------------------------------------------------
+
*1 [[Medium Stone]]
-- harvestAll(loop_count)
+
*1 [[Steel Wire]]
--
+
*9 [[Orangeish Paint]]
-- Harvest all the flax or seeds and clean up the windows afterwards.
+
*5 [[Soft Pliable Boards]]
-------------------------------------------------------------------------------
 
  
function harvestAll(loop_count)
+
== Upgrading ==
  local did_harvest = false;
+
Once built, the Twist oif Study may be expanded. The costs from level 1 are:
  local harvestLeft = 0;
 
  local seedIndex = 1;
 
  local seedWave = 1;
 
  local lastTops = {};
 
  local tops = findAllImages(imgThisIs);
 
  local max = #tops;
 
  while not did_harvest do
 
    -- Monitor for Weed This/etc
 
    lsSleep(refresh_time);
 
    srReadScreen();
 
    tops = findAllImages(imgThisIs);
 
    for i=1,#tops do
 
      safeClick(tops[i][0], tops[i][1]);
 
      lsSleep(click_delay);
 
    end
 
  
    if is_plant then
+
{| border="1"
      harvestLeft = #tops;
+
!Size!! Canvas !! Linen !! Medium Stones!! Steel Wire !! Orangeish Paint !! Soft Pliable Boards !! random 2-output gearbox
    else
+
|-
      harvestLeft = (#tops - seedIndex) + 1 +
+
| 20 || 1 || 1 || 1 || 1 || 9 || 6||1
                    (#tops * (seeds_per_pass - seedWave));
+
|-
    end
+
| 50 || 3 || 3 || 7 || 5 || 47 || 28 || 2
 
+
|-
    setStatus("(" .. loop_count .. "/" .. num_loops ..
+
| 100 || 18|| 23 || 44 || 36 || 291 || 175|| 5
                ") Harvests Left: " .. harvestLeft);
+
|-
    lsSleep(refresh_time);
+
| 150 || 108|| 738 || 269 || 221 || 1791 || 1075 || 7
    srReadScreen();
+
|}
    if is_plant then
 
      local weeds = findAllImages(imgWeed);
 
      for i=1,#weeds do
 
        safeClick(weeds[i][0], weeds[i][1]);
 
      end
 
 
 
      local waters = findAllImages(imgWeedAndWater);
 
      for i=1,#waters do
 
        safeClick(waters[i][0], waters[i][1]);
 
      end
 
 
 
      local harvests = findAllImages(imgHarvest);
 
      for i=1,#harvests do
 
        safeClick(harvests[i][0], harvests[i][1]);
 
        lsSleep(refresh_time);
 
        safeClick(harvests[i][0], harvests[i][1] - 15, 1);
 
      end
 
 
 
      local seeds = findAllImages(imgSeeds);
 
      for i=1,#seeds do
 
        local seedTop = srFindImageInRange(imgThisIs,
 
                                        seeds[i][0] - 10, seeds[i][1]-window_h,
 
                                        window_w, window_h, 5000);
 
        if seedTop then
 
          ripOut(seedTop);
 
        end
 
      end
 
    else
 
      srReadScreen();
 
      local oks = srFindImage(imgOK,5000);
 
      while oks do
 
        safeClick(oks[0],oks[1]);
 
        lsSleep(100);
 
        oks = srFindImage(imgOK);
 
      end
 
      local tops = findAllImages(imgThisIs);
 
      if #tops > 0 then
 
        if seedIndex > #tops then
 
          seedIndex = 1;
 
          seedWave = seedWave + 1;
 
        end
 
        local seedPos = srFindImageInRange(imgSeeds,
 
                      tops[#tops - seedIndex + 1][0],
 
                      tops[#tops - seedIndex + 1][1],
 
                      160, 100);
 
        if seedPos and seedWave <= seeds_per_pass then
 
          local harvested = false;
 
          local lastClick = 0;
 
          while not harvested do
 
            if seedPos and lsGetTimer() > lastClick + 1000 then
 
              safeClick(seedPos[0] + 5, seedPos[1]);
 
              lastClick = lsGetTimer();
 
              lsSleep(100);
 
            end
 
              safeClick(tops[#tops - seedIndex + 1][0],
 
                    tops[#tops - seedIndex + 1][1]);
 
            lsSleep(100);
 
            srReadScreen();
 
            seedPos = srFindImageInRange(imgTheSeeds,
 
                    tops[#tops - seedIndex + 1][0],
 
                    tops[#tops - seedIndex + 1][1],
 
                    160, 100);
 
            if seedPos then
 
              harvested = true;
 
            else
 
              seedPos = srFindImageInRange(imgSeeds,
 
                      tops[#tops - seedIndex + 1][0],
 
                      tops[#tops - seedIndex + 1][1],
 
                      160, 100);
 
            end
 
            checkForEnd();
 
          end
 
          seedIndex = seedIndex + 1;
 
          seeds_in_pocket = seeds_in_pocket + seeds_per_harvest;
 
        end
 
      end
 
      if seedWave > seeds_per_pass then
 
        local seeds = findAllImages(imgThisIs);
 
        for i=1,#seeds do
 
          ripOut(seeds[i]);
 
        end
 
      end
 
    end
 
 
 
    if #tops <= 0 then
 
      did_harvest = true;
 
    end
 
    checkForEnd();
 
  end
 
  -- Wait for last flax bed to disappear
 
  sleepWithStatus(2500, "(" .. loop_count .. "/" .. num_loops ..
 
          ") ... Waiting for flax beds to disappear");
 
end
 
 
 
-------------------------------------------------------------------------------
 
-- walkHome(loop_count, finalPos)
 
--
 
-- Walk back to the origin (southwest corner) to start planting again.
 
-------------------------------------------------------------------------------
 
 
 
function walkHome(loop_count, finalPos)
 
  closeAllFlaxWindows();
 
  setStatus("(" .. loop_count .. "/" .. num_loops .. ") Walking...");
 
  walk(finalPos,false);
 
 
 
  -- Walk back
 
--  for x=1, finalPos[0] do
 
--    local spot = getWaitSpot(xyCenter[0] - walk_px_x, xyCenter[1]);
 
--    safeClick(xyCenter[0] - walk_px_x, xyCenter[1], 0);
 
--    lsSleep(walk_time);
 
--    waitForStasis(spot, 1000);
 
--  end
 
--  for x=1, -(finalPos[1]) do
 
--    local spot = getWaitSpot(xyCenter[0], xyCenter[1] + walk_px_y);
 
--    safeClick(xyCenter[0], xyCenter[1] + walk_px_y, 0);
 
--    lsSleep(walk_time);
 
--    waitForStasis(spot, 1000);
 
--  end
 
end
 
 
 
-------------------------------------------------------------------------------
 
-- ripOut(pos)
 
--
 
-- Use the Utility menu to rip out a flax bed that has gone to seed.
 
-- pos should be the screen position of the 'This Is' text on the window.
 
-------------------------------------------------------------------------------
 
 
 
function ripOut(pos)
 
  setStatus("Ripping Out");
 
  lsSleep(refresh_time);
 
  srReadScreen();
 
  local util_menu = srFindImageInRange(imgUtility, pos[0] - 10, pos[1] - 50,
 
                                      180, 200, 5000);
 
  if util_menu then
 
    safeClick(util_menu[0] + 5, util_menu[1], 0);
 
    local rip_out = waitForImage(imgRipOut, refresh_time);
 
    if rip_out then
 
      safeClick(rip_out[0] + 5, rip_out[1], 0);
 
      lsSleep(refresh_time);
 
      safeClick(pos[0], pos[1], 1); -- unpin
 
      lsSleep(refresh_time);
 
    else
 
      rip_out = srFindImage(imgTearDownThis);
 
      if rip_out then
 
        safeClick(rip_out[0] + 5, rip_out[1], 0);
 
        lsSleep(refresh_time);
 
        srReadScreen();
 
        rip_out = nil;
 
        while not rip_out do
 
          checkBreak();
 
          rip_out = srFindImage(imgTearDown);
 
          if rip_out then
 
            safeClick(rip_out[0], rip_out[1]);
 
          end
 
          lsSleep(refresh_time);
 
          srReadScreen();
 
        end
 
      end
 
      safeClick(pos[0],pos[1],true);
 
      lsSleep(refresh_time);
 
      srReadScreen();
 
    end
 
  end
 
end
 
 
 
-------------------------------------------------------------------------------
 
-- walk(dest,abortOnError)
 
--
 
-- Walk to dest while checking for menus caused by clicking on objects.
 
-- Returns true if you have arrived at dest.
 
-- If walking around brings up a menu, the menu will be dismissed.
 
-- If abortOnError is true and walking around brings up a menu,
 
-- the function will return. If abortOnError is false, the function will
 
-- attempt to move around a little randomly to get around whatever is in the
 
-- way.
 
-------------------------------------------------------------------------------
 
 
 
function walk(dest,abortOnError)
 
  centerMouse();
 
  srReadScreen();
 
  local coords = findCoords();
 
  local startPos = coords;
 
  local failures = 0;
 
  while coords[0] ~= dest[0] or coords[1] ~= dest[1] do
 
    centerMouse();
 
    local dx = 0;
 
    local dy = 0;
 
    if coords[0] < dest[0] then
 
      dx = 1;
 
    elseif coords[0] > dest[0] then
 
      dx = -1;
 
    end
 
    if coords[1] < dest[1] then
 
      dy = -1;
 
    elseif coords[1] > dest[1] then
 
      dy = 1;
 
    end
 
    lsPrintln("Walking from (" .. coords[0] .. "," .. coords[1] .. ") to (" .. dest[0] .. "," ..dest[1] .. ") stepping to (" .. dx .. "," .. dy .. ")");
 
    stepTo(makePoint(dx, dy));
 
srReadScreen();
 
    coords = findCoords();
 
    checkForEnd();
 
    if checkForMenu() then
 
  if(coords[0] == dest[0] and coords[1] == dest[1]) then
 
    return true;
 
  end
 
      if abortOnError then
 
        return false;
 
      end
 
      failures = failures + 1;
 
      if failures > 50 then
 
        return false;
 
      end
 
  lsPrintln("Hit a menu, moving randomly");
 
      stepTo(makePoint(math.random(-1,1),math.random(-1,1)));
 
  srReadScreen();
 
    else
 
      failures = 0;
 
    end
 
  end
 
  return true;
 
end
 
 
 
function walkOld(dest,abortOnError)
 
  centerMouse();
 
  local coords = findCoords();
 
  local startPos = coords;
 
  local failures = 0;
 
  srReadScreen();
 
  while coords[0] ~= dest[0] or coords[1] ~= dest[1] do
 
    while coords[0] < dest[0] do
 
      centerMouse();
 
      stepTo(makePoint(1, 0));
 
      coords = findCoords();
 
      checkForEnd();
 
      if checkForMenu() then
 
        if abortOnError then
 
          return false;
 
        end
 
        failures = failures + 1;
 
        if failures > 50 then
 
            return false;
 
        end
 
        stepTo(makePoint(math.random(-1,0),math.random(-1,1)));
 
      else
 
        failures = 0;
 
      end
 
    end
 
    while coords[0] > dest[0] do
 
      centerMouse();
 
      stepTo(makePoint(-1, 0));
 
      coords = findCoords();
 
      checkForEnd();
 
      if checkForMenu() then
 
        if abortOnError then
 
          return false;
 
        end
 
        failures = failures + 1;
 
        if failures > 50 then
 
            return false;
 
        end
 
        stepTo(makePoint(math.random(0,1),math.random(-1,1)));
 
      else
 
        failures = 0;
 
      end
 
    end
 
    while coords[1] < dest[1] do
 
      centerMouse();
 
      stepTo(makePoint(0, -1));
 
      coords = findCoords();
 
      checkForEnd();
 
      if checkForMenu() then
 
        if abortOnError then
 
          return false;
 
        end
 
        failures = failures + 1;
 
        if failures > 50 then
 
            return false;
 
        end
 
        stepTo(makePoint(math.random(-1,1),math.random(0,1)));
 
      else
 
        failures = 0;
 
      end
 
    end
 
    while coords[1] > dest[1] do
 
      centerMouse();
 
      stepTo(makePoint(0, 1));
 
      coords = findCoords();
 
      checkForEnd();
 
      if checkForMenu() then
 
        if abortOnError then
 
          return false;
 
        end
 
        failures = failures + 1;
 
        if failures > 50 then
 
            return false;
 
        end
 
        stepTo(makePoint(math.random(-1,1),math.random(-1,0)));
 
      else
 
        failures = 0;
 
      end
 
    end
 
  end
 
  return true;
 
end
 
 
 
function checkForMenu()
 
  srReadScreen();
 
  pos = srFindImage("unpinnedPin.png", 5000);
 
  if pos then
 
    safeClick(pos[0]-5,pos[1]);
 
    lsPrintln("checkForMenu(): Found a menu...returning true");
 
    return true;
 
  end
 
  return false;
 
end
 
 
 
-------------------------------------------------------------------------------
 
-- pixelBlockCheck(x, y, color, rgbTol, hueTol, size)
 
--
 
-- Checks for a block of pixels centered on (x, y), within radius size
 
-- matching color within the tolerances rgbTol and hueTol
 
-------------------------------------------------------------------------------
 
 
 
function pixelBlockCheck(x, y, color, rgbTol, hueTol, size)
 
    local startX = x - size;
 
    local startY = y - size;
 
    local endX = x + size;
 
    local endY = y + size;
 
    local i;
 
    for i = startX, endX do
 
        local j;
 
        for j = startY, endY do
 
            local currColor = srReadPixelFromBuffer(x, y);
 
            if(not compareColorEx(color,currColor,rgbTol,hueTol)) then
 
                return false;
 
            end
 
        end
 
    end
 
    return true;
 
end
 
 
 
-------------------------------------------------------------------------------
 
-- clickMax()
 
--
 
-- Waits for and then click the Max button
 
-------------------------------------------------------------------------------
 
 
 
function clickMax()
 
  local pos = srFindImage("crem-max.png", 1000);
 
  if pos then
 
    safeClick(pos[0]+5, pos[1]+5);
 
    return true;
 
  end
 
  return false;
 
end
 
 
 
-------------------------------------------------------------------------------
 
-- centerMouse()
 
--
 
-- Moves the mouse to the center of the screen
 
-------------------------------------------------------------------------------
 
 
 
function centerMouse()
 
  local xyWindowSize = srGetWindowSize();
 
  local mid = {};
 
  mid[0] = xyWindowSize[0] / 2;
 
  mid[1] = xyWindowSize[1] / 2;
 
  srSetMousePos(mid[0],mid[1]);
 
end
 
 
 
function prepareCamera()
 
statusScreen("Configuring camera");
 
    characterMenu();
 
    lsSleep(refresh_time);
 
    local pos = findText("Options...");
 
    if(pos) then
 
        offsetClick(pos,8);
 
        pos = findText("Camera");
 
        if(pos) then
 
            offsetClick(pos,8);
 
            pos = findText("Cartographer's Cam");
 
            if(pos) then
 
                offsetClick(pos,8);
 
                pos = srFindImage("ok-faint.png");
 
                if(pos) then
 
                    offsetClick(pos);
 
                else
 
                    error("Unable to find the Ok button.");
 
                end
 
            else
 
                error("Unable to find the Cartographer's Cam item.");
 
            end
 
        else
 
            error("Unable to find the Camera menu item.");
 
        end
 
    else
 
        error("Unable to find the Options menu item.");
 
    end
 
lsSleep(150);
 
    srReadScreen();
 
    pos = findText("Year");
 
    if(pos) then
 
offsetClick(pos);
 
else
 
--        error("Unable to find the clock.");
 
    end
 
    srSetMousePos(100,-20);
 
    sleepWithStatus(10000,"Zooming in");
 
    statusScreen("");
 
end
 
 
 
function prepareOptions()
 
statusScreen("Checking and setting avatar options");
 
 
 
    characterMenu();
 
    local pos = findText("Options...");
 
    if(pos) then
 
        offsetClick(pos,8);
 
        pos = findText("One-Click");
 
        if(pos) then
 
            offsetClick(pos,8);
 
            pos = srFindImage(imgPlantWhereChecked,5000);
 
            if(not pos) then
 
                pos = srFindImage(imgPlantWhereUnchecked,5000);
 
                if(pos) then
 
                    offsetClick(pos,4);
 
                end
 
            end
 
            pos = srFindImage(imgHotkeysOnFlax,5000);
 
            if(pos) then
 
                offsetClick(pos,4);
 
            end
 
            pos = srFindImage(imgOptionsX,5000);
 
            if(pos) then
 
                srClickMouse(pos[0]+24,pos[1]+9); -- close options window
 
                lsSleep(150);
 
                srReadScreen();
 
            end
 
        end
 
    end
 
    characterMenu();
 
    local pos = findText("Options...");
 
    if(pos) then
 
        offsetClick(pos,8);
 
        pos = findText("Interface Options");
 
        if(pos) then
 
            offsetClick(pos,8);
 
            pos = srFindImage(imgRightClickPins,5000);
 
            if(pos) then
 
                offsetClick(pos,4);
 
            end
 
        end
 
        pos = srFindImage(imgSmallX,5000);
 
        if(pos) then
 
            offsetClick(pos,4);
 
        end
 
    end
 
statusScreen("");
 
end
 
 
 
function offsetClick(pos,offset)
 
    if(offset == nil) then
 
        offset = 4;
 
    end
 
    srClickMouse(pos[0]+offset,pos[1]+offset);
 
    lsSleep(150);
 
    srReadScreen();
 
end
 
 
 
function characterMenu()
 
centerMouse();
 
    lsSleep(150);
 
    local escape = "\27";
 
    srKeyEvent(escape);
 
    lsSleep(150);
 
    srReadScreen();
 
end
 
 
 
-------------------------------------------------------------------------------
 
-- closeAllFlaxWindows()
 
--
 
-- Close all open flax windows and many others, but not the plant window.
 
--
 
-------------------------------------------------------------------------------
 
 
 
function closeAllFlaxWindows()
 
  x = 0;
 
  y = 0;
 
  width = srGetWindowSize()[0];
 
  height = srGetWindowSize()[1];
 
 
 
  local closeImages = {"ThisIs.png", "Ok.png"};
 
  local closeRight = {1, 1, nil};
 
 
 
  local found = true;
 
  while found do
 
    found = false;
 
    for i=1,#closeImages do
 
      local image = closeImages[i];
 
      local right = closeRight[i];
 
      srReadScreen();
 
      local images = findAllImagesInRange(image, x, y, width, height);
 
      while #images >= 1 do
 
    done = true;
 
    safeClick(images[#images][0], images[#images][1], right);
 
    sleepWithStatus(200, "Closing Windows");
 
    srReadScreen();
 
    images = findAllImagesInRange(image, x, y, width, height);
 
      end
 
    end
 
  end
 
  safeClick(width/2-45,height/2-45);
 
end
 
</pre>
 

Latest revision as of 01:16, 16 April 2013

Caress of Wind

CaressofWind.png
Size N/A
Where Small Construction Site



Upgrading

Once built, the Caress of Wind may be expanded. The costs from level 1 are:

Size Bearings Boards Oil Papyrus Paper Sail Steel Wire
10 1 14 10 2 2 2
20 1 28 20 4 3 4
30 2 57 41 7 6 8
40 3 86 62 10 9 12
50 5 144 104 17 15 20
60 7 202 146 24 21 28
100 31 898 652 105 93 124
200 1023 29666 21543 3438 3069 4092


Charm of Flight

CharmOfFlight.jpg
Size N/A
Where Small Construction Site



Upgrading

Once built, the Charm of Flight may be expanded. The costs from level 1 are:

Size Boards Clay Copper Strap Eyelet Cut Amethyst Lens Cut Garnet Rope
10 9 8 1 1 1 2
20 18 17 2 1 1 3
30 37 35 4 2 2 6
40 56 53 6 3 3 9
50 94 89 10 4 6 15
60 132 125 14 6 8 21
70 208 197 22 10 12 33
80 284 269 30 13 17 45
90 436 413 46 21 25 69
100 588 557 62 28 34 93
200 19436 18413 2046 921 1125 3069


Distract of Sky

DistractofSky.jpg
Size N/A
Where Small Construction Site



Upgrading

Once built, the Distract of Sky may be expanded. The costs from level 1 are:

Size Bearings Copper Wire Leather Violetish Paint Quicksilver Blueish Raeli Tiles White Sand
20 3 3 8 2   1  
40 9 8 23 6   4 1
60 22 19 53 15   9 3
80 47 41 114 32 1 19 6
100 97 85 236 66 3 40 12
120 197 172 479 134 6 81 24
140 397 346 965 270 12 163 48
160 797 694 1937 542 24 327 96

Fall of Balance

Fall Of Balance.jpg
Size N/A
Where Small Construction Site




Upgrading

Once built, the Fall of Balance may be expanded. The costs from level 1 are:

Size Bearings Beeswax Boards Concrete Papyrus Paper Sheet Glass Gearbox
10 1 8 16 12 4 0 0
20 1 16 34 24 8 0 0
30 2 33 70 49 15 1 1
40 3 50 106 74 23 1 1
50 5 84 178 124 38 2 2
60 7 118 250 174 53 4 2
70 11 186 394 274 82 6 3
80 15 254 538 374 112 8 3
90 23 390 826 574 172 13 3
100 31 526 1114 774 231 18 4
200 1023 17390 38626 25574 7612 593

Float of Ghost

FloatOfGhost.jpg
Size N/A
Where Small Construction Site





Upgrading

Once built, the Float Of Ghost may be expanded. The costs from level 1 are:

Size Amanti Cut Garnet Cut Stone Dalessi Cut
Turquoise
Ink Sheet Glass Small Diamond Water in Jugs
20 1 3 0 12 2 2 9
40 2 9 0 38 5 6 29
60 4 22 1 91 12 15 69
80 8 48 3 197 25 33 150
100 17 99 7 409 51 69 311
120 34 201 14 832 103 140 633
140 68 405 28 1678 207 282 1277
160 136 813 56 3370 415 566 2565

Glaze Of Light

Glaze Of Light.jpg
Size N/A
Where Small Construction Site




  • 0 Bearings
  • 0 Fine Glass Rods
  • 1 Medium Ruby
  • 0 Quicksilver
  • 1 Small Barrel
  • 33 Water in Jugs

Upgrading

Once built, the Glaze Of Light may be expanded. The costs from level 1 are:

Size Bearings Fine Glass Rods Medium Ruby Quicksilver Small Barrel Water in Jugs
20 0 0 1 0 2 32
40 1 1 1 0 4 98
60 2 3 9 1 13 229
80 5 7 20 2 27 492
100 10 15 42 4 56 1017
125 25 37 104 10 132 2417
150 60 90 244 24 303 5567

Hatch of Steel

HatchofSteel.PNG
Size N/A
Where Small Construction Site




Upgrading

Once built, the Hatch of Steel may be expanded. The costs from level 1 are:

Size Copper Sheeting Copper Wire Cut Stone Iron Bars Oil Slate
10 1 9 1 1 6 4
20 1 18 2 1 13 9
30 2 37 4 2 27 19
40 3 56 6 3 41 29
50 5 94 10 5 69 49
60 7 132 14 7 97 69
70 11 208 22 11 153 109
80 15 284 30 15 209 149
90 23 463 46 23 321 229
100 31 588 62 31 433 309
200 1023 19436 2046 1023 14321 10229

Pierce of Heaven

PierceOfHeaven.jpg
Size N/A
Where Small Construction Site







Point of Mind

PointOfMind.png
Size N/A
Where Small Construction Site




Upgrading

Once built, the Point of Mind may be expanded. The costs from level 1 are:

Size Boards Gear Box Honey Sheet Glass Small Ruby Cut Garnet Lens
10 0 0 10 0 1 0
20 1 1 32 0 2 0
30 2 1 54 1 3 0
40 5 2 98 1 4 0
50 7 2 142 2 6 1
60 12 3 230 3 9 1
70 17 3 317 5 14 2
80 27 4 492 7 21 2
90 36 4 667 11 30 3
100 55 5 1017 15 43 4

Puncture of Dark

Puncture Of Dark.JPG
Size N/A
Where Small Construction Site




Upgrading

Once built, the Puncture of Dark may be expanded. The costs from level 1 are:

Size 10 Large Diamond Bearings Steel Sheeting Gold Oil Leather Slate
10 0 0 0 0 4 4 2
20 0 0 0 0 4 7 4
30 0 1 1 0 14 20 8
40 0 1 1 0 21 30 12
50 0 2 2 1 35 51 20
60 0 3 3 1 49 72 27
100 2 13 12 6 216 322 117
200 64 416 384 192 7098 10645 3837

Pursuit of Soul

Pursuit Of Soul$PursuitOfSoul1.jpg
Size N/A
Where Small Construction Site




Upgrading

Once built, the Pursuit of Soul may be expanded. The costs from level 1 are:

Size Quicksilver Sulfurous Water Oil Glass Pipe Small Sapphire Small Topaz Small Ruby
10 0 4 2 1 1 1 2
20 0 7 4 1 1 2 3
30 0 14 8 3 2 4 6
40 0 21 12 4 3 5 8
50 1 36 20 7 5 9 13
60 1 50 28 9 6 12 18
100 7 223 122 39 24 54 78
200 224 7353 3997 1279 768 1759 2558

Reflect of Orbit

Reflection of Orbit.jpg
Size N/A
Where Small Construction Site



Upgrading

Once built, the Bardoth/info may be expanded. The costs from level 1 are:

Size Bearings Eyelet Cut Ameythyst Gold Mud Granite Oil Reddish Raeli Tiles Steel Sheeting
10 2 1 1   5 4 2
20 3 1 1   11 7 4
30 6 2 2   23 14 9
40 9 3 2   35 21 13
50 15 5 3 1 60 35 22
60 20 6 4 1 84 49 31
70 32 9 7 2 133 77 49
80 43 12 9 2 181 105 66
90 66 18 14 3 278 161 101
100 88 24 18 4 375 217 136
200 2878 768 567 128 12403 7130 4467

Return of Promise

ReturnofPromise.png
Size N/A
Where Small Construction Site



Upgrading

Once built, the Return of Promise may be expanded. The costs from level 1 are:

Size Bearings Cut Stone Blueish Tiles Reddish Yellowish Black White Small Gears
10 1 2 2 1 1 1 0 0
20 1 3 3 1 2 1 0 0
30 2 6 7 2 4 3 0 1
40 3 8 10 2 6 4 0 1
50 5 13 17 4 11 7 1 2
60 7 18 24 5 15 9 1 3
100 31 78 107 20 68 39 7 12
200 1023 2558 3517 640 2238 1729 224 384

Revolve of Time

Revolve of time.JPG
Size N/A
Where Small Construction Site




Upgrading

Once built, the Bardoth/info may be expanded. The costs from level 1 are:

Size Bearings Concrete Cut Stone Fine Glass Pipe Gold Mandibular Glue Greenish Raeli Tiles Red Sand
10 1 1 2 1 1 0 1 14
20 1 2 3 1 1 0 1 29
30 2 4 6 2 2 0 2 61
40 3 5 9 2 2 1 3 92
50 5 8 16 4 4 2 5 155
60 6 11 22 5 5 2 6 217
70 9 18 35 8 8 4 9 342
80 12 24 47 10 10 5 12 467
90 18 37 72 15 15 8 19 717
100 24 49 97 20 20 10 25 967
200 768 1599 3197 640 640 320 800 31967

Sequence of Order

SequenceOfOrder.jpg
Size N/A
Where Small Construction Site




Upgrading

Once built, the Sequence of Order may be expanded. The costs from level 1 are:

Size Dirt Steel Wire Cable Grey Star Marble Tiger's Eye Granite Maroon Paint 3-output Gearbox
20 8 3       5  
40 24 9 1 1   14  
60 55 21 3 2   33 1
80 118 45 7 5 1 71 1
100 243 93 15 10 2 146 2
120 493 188 30 20 4 296 2
140 993 378 60 40 8 596 2
160 1993 758 120 80 16 1196 3

Suspend of Green

Suspend of Green.jpg
Size N/A
Where Small Construction Site




Upgrading

Once built, the Bardoth/info may be expanded. The costs from level 1 are:

Size Green Sun Marble Clay Grayish Raeli Tiles Canvas White Sand Bearings
10 0 8 6 1 2 0
20 0 17 13 1 4 0
30 1 35 27 2 9 1
40 1 52 41 3 13 1
50 2 87 69 5 22 2
60 2 122 97 7 31 3
70 3 192 153 12 49 5
80 4 262 209 16 67 6
90 6 402 321 25 103 10
100 8 542 433 33 138 13
200 256 17,902 14,290 1,087 4,450 416

Tale of Journey

Tale Of Journey.jpg
Size N/A
Where Small Construction Site




Upgrading

Once built, the Tale of Journey may be expanded. The costs from level 1 are:

Size Canvas Nails Rope Silk Cloth Tar Rotproof Treated Boards Water In Jugs
10 2 7 2 0 0 40 1
20 4 15 3 0 0 85 2
30 9 31 6 0 1 175 4
40 13 47 9 0 2 265 6
43 16 57 11 1 2 319 7
50 22 79 15 1 3 445 10
60 31 111 21 1 4 625 14
100 139 495 93 4 20 2785 62
200 4603 16367 3069 113 665 92065 2046

Twist of Study

Twist of Study.jpg
Size N/A
Where Small Construction Site





Upgrading

Once built, the Twist oif Study may be expanded. The costs from level 1 are:

Size Bearings Leather Oil Steel Wire Tar Glossy Hard Boards Rigid Termite Resistant Boards
10 0 5 1 1 1 18 13
20 0 9 2 1 1 37 26
30 1 18 4 2 2 77 53
40 1 27 6 3 3 116 80
50 2 45 10 5 5 195 134
60 2 63 14 7 7 274 188
70 4 100 22 12 11 432 296
80 5 136 30 16 15 589 403
90 8 209 47 25 24 904 618
100 10 281 63 34 32 1219 833
200 302 9271 2078 1119 1055 40279 27493






Churn of Earth

Churn of Earth.jpg
Size N/A
Where Small Construction Site




Upgrading

Once built, the Twist oif Study may be expanded. The costs from level 1 are:

Size Canvas Linen Medium Stones Steel Wire Orangeish Paint Soft Pliable Boards random 2-output gearbox
20 1 1 1 1 9 6 1
50 3 3 7 5 47 28 2
100 18 23 44 36 291 175 5
150 108 738 269 221 1791 1075 7