The Wiki for Tale 8 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.

Guild:ZFree/Acoustics/Macro

From A Wiki in the Desert
Jump to navigation Jump to search
dofile("common.inc");

local askText = "This will produce a chime based upon the Acoustics Laboratory in zFree (1419, 2927), it will most likely not work for any other lab. Click Start working a Chime, Pin Open the Tuning menu, select the chime showing in the main chat, select the chime you want to get to, then click Go to the Chime. Alternatively, press the direction you wish to go.";

local scale = 1.0;
local actionToTake = nil;
local StepsTaken = "";

local StartingChimeArray = {"Diving Nightingale", "Soaring Sparrow", "Gliding Condor"};
local ChimeActionArray = {"Diving", "Floating", "Gliding", "Hovering", "Soaring"}
local ChimeBirdArray ={"Albatross", "Buzzard", "Condor", "Crane", "Eagle", "Finch", "Gull", "Hawk", "Hummingbird", "Lark", "Nightingale", "Osprey", "Owl", "Parrot", "Pheasant", "Puffin", "Raven", "Sparrow", "Warbler", "Waxwing"}
local StartingChime = 1;
local ChimeAction = 1;
local ChimeBird = 1;


local done = false;
local MovementResult = "";

local AP = "Mill with Aluminum Powder"
local BW = "Coat in Beeswax"
local CS = "Dope with Cactus Sap"
local CW = "Plunge into Cold Water"
local HB = "Shock against Heavy Block"
local HW = "Plunge into Hot Water"
local IL = "Expose to Intense Light"
local LP = "Fracture against Leopard's Paw"
local QS = "Bathe in Quicksilver"
local RP = "Polish using Rabbit Pelts"
local SA = "Tumble with White Sand"
local SC = "Shine with Silk Cloth"
local SP = "Clean with Worm Spirits"
local SF = "Stress with Shearing Force"
local StartingChime = "Starting Chime";


local ChimeRecipe = {
		
  {1, 1, 1, HB, HW}, 		
 {1, 1, 2, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, CW, CW, LP, LP, CW, CW, CW, CW}, 	 {2, 1, 2, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, LP, LP, CW, CW}, 	
 {1, 1, 3, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, CW, CW, LP, LP}, 	 {2, 1, 3, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, LP, LP}, 	
 {1, 1, 4, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, CW, CW, IL, IL, IL, IL, IL, CW, CW, CW, CW, LP}, 	 {2, 1, 4, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, CW, CW, CS, CW, CW, LP}, 	
	 {2, 1, 5, IL, QS, QS, CW, HB, CW, SF, CS, RP, SP, RP, RP, BW, SP}, 	
 {1, 1, 6, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, LP, LP}, 	 {2, 1, 6, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW}, 	
	 {2, 1, 7, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, CW, CW, CS, CW, CW, LP, CW, CW, CW, CW, CS, CW, CW}, 	
	 {2, 1, 8, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, CW, CW, CS, CW, CW, LP, LP, IL, IL, IL, IL, IL, CW, CW}, 	
	 {2, 1, 9, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, CW, CW, CS, CW, CW, LP, LP, IL, IL, IL, IL, IL, CW, CW, CW, CW}, 	
	 {2, 1, 10, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, CW, CW, CS, CW, CW, LP, LP, IL, IL, IL, IL, IL, CW, CW, CW, CW, CW, CW, CW, SP, CW, CW}, 	
 {1, 1, 11, StartingChime}, 		
 {1, 1, 12, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, LP}, 		
	 {2, 1, 13, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, CW, CW, CS, CW, CW, LP, CW, CW, CW, CW, CS}, 	
	 {2, 1, 14, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, CW, CW, CS, CW, CW, LP, LP}, 	
	 {2, 1, 15, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, CW, CW, CS, CW, CW, LP, LP, IL, IL, IL, IL, IL, CW, CW, CW, CW, CW, CW, CW, SP, CW, CW, SP, SP, CS, CS}, 	
 {1, 1, 16, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, CW, CW, LP}, 	 {2, 1, 16, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, LP}, 	
 {1, 1, 17, HB, HW, QS, IL, IL}, 		
 {1, 1, 18, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, LP, LP, BW}, 	 {2, 1, 18, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, BW}, 	
 {1, 1, 19, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, CW, CW, IL, IL, IL, IL, IL, CW, CW, CW, CW, LP, BW, BW, BW, CW, CW, CW, SP}, 		
 {1, 1, 20, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, LP}, 	 {2, 1, 20, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, LP}, 	
		
		 {3, 2, 1, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, BW, BW, CW, SP, BW, SF, SF, RP, SF, CW, CW, CW, CW, SF, CW, CW, CW, CW, CW}, 
		 {3, 2, 2, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, BW, BW, CW, SP, BW, SF, SF, RP, RP, RP, SP, SP, BW, BW, CW}, 
		 {3, 2, 3, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, BW, BW, CW, SP, BW, SF, SF, RP, SF, CW, SP, SP, BW, BW, SP, SP, RP, RP, HW, HW, QS, QS, LP, LP, QS, QS, LP, LP, HW, HW, SF, LP}, 
		 {3, 2, 4, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, BW, BW, CW, SP, BW, SF, SF, RP, SF, CW, SP, SP, BW}, 
		 {3, 2, 5, HB, HW, SA, SP, SA, SP, SA, RP}, 
		 {3, 2, 6, HB, HW, CW, HB, CS, IL, AP, HB}, 
		 {3, 2, 7, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, BW, BW, CW, SP, BW, SF, SF, RP, SF, CW, CW, CW}, 
		 {3, 2, 8, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, BW, BW, CW, SP, BW, SF, SF, RP}, 
 {1, 2, 9, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, HB, SF, LP, IL, SF, HB}, 		 {3, 2, 9, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, BW, BW, CW, SP, BW, IL, BW, HB}, 
 {1, 2, 10, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, HB, SF, LP, IL, SF, HB, CW, CW}, 		 {3, 2, 10, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, BW, BW, CW, SP, BW, IL, BW, HB, CW, CW}, 
		 {3, 2, 11, HB, HW, SA, SP, SA, SP, SA, RP, SP, CW, BW, BW}, 
		 {3, 2, 12, HB, HW, SA, SP, SA, SP, SA, RP, SP, SF, IL, HB, BW, CW, CW, CW}, 
		 {3, 2, 13, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, BW, BW, CW, SP, BW, SF, SF, RP, SF, CW}, 
		 {3, 2, 14, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, BW, BW, CW, SP, BW, SF, SF, RP}, 
		 {3, 2, 15, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, BW, BW, CW, SP, BW, SF, SF, RP, SF, CW, CW, CW, CW, SF, CW, CW}, 
		 {3, 2, 16, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, BW, BW, CW, SP, BW, SF, SF, RP, SF, CW, SP, SP, BW, BW, SP, SP, RP, RP}, 
		 {3, 2, 17, HB, HW, SA, SP, SA, SP, SA, RP, SP, SF, IL, HB, BW, CW}, 
		 {3, 2, 18, HB, HW, CW, HB, CS, IL, AP, HB, RP, SA, SP}, 
		 {3, 2, 19, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, BW, BW, CW, SP, BW, SF, SF, RP, SF, CW, SP, SP, BW, BW}, 
		
		
 {1, 3, 1, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, HB, SF, LP, IL, SF}, 		 {3, 3, 1, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, BW, BW, CW, SP, BW}, 
		 {3, 3, 2, HB, HW, CW, HB, CS, IL, AP, LP}, 
		 {3, 3, 3, StartingChime}, 
 {1, 3, 4, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, HB, SF, LP, IL, SF, BW, RP, SP, BW, CW, SP, SP, RP, SP, RP, BW, SP, CW}, 		
 {1, 3, 5, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, CW, CW, SF, SF, SF, SF, SF, HB, HB, HB, SF, LP, HB}, 		
		 {3, 3, 6, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, LP, CW, CW, AP, CS, CW, CW, SF, SF, IL, IL, SP}, 
 {1, 3, 7, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, HB, SF, LP, IL, SF, BW, RP, SP, BW, CW}, 		
 {1, 3, 8, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, SF, SF, QS, BW, SP, SP, BW, SP, RP}, 		 {3, 3, 8, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, BW, BW, CW, SP, BW, LP, BW, SP, BW, SP, BW}, 
 {1, 3, 9, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, SF, SF, QS, BW, SP, SP, BW}, 		 {3, 3, 9, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, BW, BW, CW, SP, BW, LP, BW, SP, BW}, 
 {1, 3, 10, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, SF, SF, QS, BW}, 		 {3, 3, 10, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, BW, BW, CW, SP, BW, LP, BW}, 
 {1, 3, 11, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, SF, SF, QS}, 		 {3, 3, 11, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, BW, BW, CW, SP, BW, LP}, 
		 {3, 3, 12, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW}, 
 {1, 3, 13, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, HB, SF, LP, IL, SF, BW, RP, SP, BW, CW, SP, SP, RP}, 		
 {1, 3, 14, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, SF, SF, QS, BW, SP, SP, BW, SP, RP, SP, RP, SP, RP, BW, CW}, 		 {3, 3, 14, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, BW, BW, CW, SP, BW, LP, BW, SP, BW, SP, BW, BW, SP, LP, CW}, 
 {1, 3, 15, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, HB, SF, LP, IL, SF, BW}, 		 {3, 3, 15, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, BW, BW, CW, SP, BW, BW, BW, CW, CW, IL, SP, SP, RP}, 
		 {3, 3, 16, HB, HW}, 
		 {3, 3, 17, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, BW, BW, CW, SP}, 
		 {3, 3, 18, HB, HW, SA, SP, SA, SP, SA, RP, LP}, 
		 {3, 3, 19, HB, HW, CW, HB, CS, IL, AP}, 
		 {3, 3, 20, HB, HW, SA, SP, SA}, 
		
 {1, 4, 1, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL}, 	 {2, 4, 1, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, BW, CW, SF, BW}, 	
	 {2, 4, 2, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, CW, CW, CS, CW, CW, LP, CW, CW, CW, CW, CS, SF}, 	
 {1, 4, 3, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, CW, CW, IL, IL, IL, IL, IL, CW, CW, CW, CW}, 	 {2, 4, 3, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, CW, CW, CS, CW, CW}, 	
		 {3, 4, 4, LP}, 
 {1, 4, 5, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, LP, RP, RP, SP}, 	 {2, 4, 5, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, LP, BW}, 	
 {1, 4, 6, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, CW, CW, IL, IL, IL, IL, IL, CW}, 	 {2, 4, 6, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, CW, CW}, 	
 {1, 4, 7, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, SF, SF, QS, BW, SP, SP, BW, SP, RP, SP, RP, SP, RP, BW, CW, LP}, 		 {3, 4, 7, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, BW, BW, CW, SP, BW, LP, BW, SP, BW, SP, BW, BW, SP, LP, CW, LP}, 
	 {2, 4, 8, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, CW, CW, CS, CW, CW, LP, LP, IL, IL, IL, IL, IL, CW, CW, CW, CW, CW, CW, CW, SP, CW, CW, SF, SF, HB}, 	
 {1, 4, 9, HB, HW, QS, IL, IL, SF, CS, CW, BW}, 		
 {1, 4, 10, HB, HW, QS, IL, IL, SF, CS, CW}, 		
 {1, 4, 11, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS}, 		
 {1, 4, 12, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL}, 	 {2, 4, 12, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF}, 	 {3, 4, 12, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, BW, BW, CW, SP, BW, LP, LP}, 
		 {3, 4, 13, LP, CW, CW, CW}, 
	 {2, 4, 14, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, CW, CW, CS, CW, CW, LP, CW, CW, CW, CW, CS, SF, CW, CW, CW}, 	
 {1, 4, 15, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, SF, BW}, 	 {2, 4, 15,  }, 	
		 {3, 4, 16, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, LP, CW, CW}, 
 {1, 4, 17, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS}, 	 {2, 4, 17,  IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, BW, CW, SF, BW, CW, IL}, 	 {3, 4, 17, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, BW, BW, CW, SP, BW, LP, LP, BW}, 
 {1, 4, 18, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, CW, CW}, 	 {2, 4, 18, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS}, 	
		 {3, 4, 19, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, LP, CW, CW, AP, CS, CW, CW}, 
		 {3, 4, 20, HB, HW, SA, SP, SA, SP, SA, RP, LP, SA, SC, BW, SP, SF, CW, BW, LP}, 
		
	 {2, 5, 1, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, CW, CW, CS, CW, CW, LP, LP, IL, IL, IL, IL, IL, CW, CW, CW, CW, LP}, 	
 {1, 5, 2, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, CW, CW, LP, LP, CW, CW, CW, CW, LP, LP, SP, SP, SP, CW, BW, BW, CW, IL, BW, SP}, 	 {2, 5, 2, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, LP, LP, CW, CW, LP, LP, SP, SP, RP, BW}, 	
	 {2, 5, 3, IL, QS, QS, CW, HB, CW}, 	
 {1, 5, 4, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, LP, LP, LP, HW, QS, CW, CS, HB, AP}, 	 {2, 5, 4, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CW, CS, HB, AP}, 	
 {1, 5, 5, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, CW, CW, LP, LP, CW, CW, CW, CW, LP, LP, CW, CS, CS, CS, CS, SP, SF, CW, CW, CW, CW, CW, QS, QS, QS, HB, HB, HB, CW, CW}, 	 {2, 5, 5, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, LP, LP, CW, CW, LP, LP, CW, CS, CS, CS, CS, CW, CW, CW, CW, CS, CS, CW, CW, CW, CW, CW}, 	
	 {2, 5, 6, IL, QS, QS}, 	
	 {2, 5, 7, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, CW, CW, CS, CW, CW, LP, LP, LP}, 	
 {1, 5, 8, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, CW, CW, LP, LP, CW, CW, CW, CW, LP, LP}, 	 {2, 5, 8, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, LP, LP, CW, CW, LP, LP}, 	
 {1, 5, 9, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, CW, CW, LP, LP, CW, CW, CW, CW, LP, LP, CW, CS, CS, CS, CS, SP, SF, CW}, 	 {2, 5, 9, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, LP, LP, CW, CW, LP, LP, CW, CS, CS, CS, CS, CW}, 	
 {1, 5, 10, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, CW, CW, LP, LP, CW, CW, CW, CW, LP, LP, CW, CS, CS, CS, CS, SP, SF, CW, CW, CW}, 	 {2, 5, 10, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, LP, LP, CW, CW, LP, LP, CW, CS, CS, CS, CS, CW, CW, CW, CW}, 	
 {1, 5, 11, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, CW, CW, LP, LP, CW, CW, CW, CW, LP, LP, CW, CS, CS, CS, CS, SP, SF, CW, CW, CW, CW, CW}, 	 {2, 5, 11, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, LP, LP, CW, CW, LP, LP, CW, CS, CS, CS, CS, CW, CW, CW, CW, CS, CS, CW, CW}, 	
 {1, 5, 12, LP}, 		
 {1, 5, 13, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, CW, CW, LP, LP, CW, CW, CW, CW, LP}, 	 {2, 5, 13, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, LP, LP, CW, CW, LP}, 	
	 {2, 5, 14, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, LP, LP, CW, CW, LP, LP, SP, SP, RP}, 	
	 {2, 5, 15, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, CW, CW, CS, CW, CW, LP, LP, IL, IL, IL, IL, IL, CW, CW, LP}, 	
	 {2, 5, 16, IL, QS, QS, CW, HB, CW, SF, CS}, 	
	 {2, 5, 17, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP, CS, SF, IL, SP, HB, CW, HB, SF, CW, CW, CW, CS, CW, CW, CS, CW, CW, LP, LP, IL, IL, IL, IL, IL, CW, CW, CW, CW, CW, CW, CW, SP, CW, CW, LP}, 	
	 {2, 5, 18, StartingChime}, 	
 {1, 5, 19, HB, HW, QS, IL, IL, SF, CS, CW, CW, IL, QS, SP, IL, IL, QS, IL, QS, IL, LP, LP, LP, HW, QS}, 	 {2, 5, 19, IL, QS, QS, CW, HB, CW, SF, CS, CW, HB, CS, IL, AP}, 	
	 {2, 5, 20, IL, QS, QS, CW, HB, CW, SF, CS, RP, SP, RP}, 	
		

		
}	



function doit()
	askForWindow(askText);

	while 1 do
		MainMenu()

		PerformAction()
	end
end


local MovesToTake = {};

function PerformAction()
	MovementResult = " "; -- Reset the action taken
	MovesToTake = {}; -- declare an array for the movements to be taken
	
	if StartingChimeArray[StartingChime] == ChimeActionArray[ChimeAction] .. " " .. ChimeBirdArray[ChimeBird] then
		MovementResult = "The destination is the same as the starting chime!";
		return;
	end

	for i=1, #ChimeRecipe do
		if ChimeRecipe[i][1] == StartingChime and ChimeRecipe[i][2] == ChimeAction and ChimeRecipe[i][3] == ChimeBird then
			-- Array includes an entry for this combination
			for j=1, #ChimeRecipe[i]-3 do
				-- Add all moves to the array
				MovesToTake[#MovesToTake + 1] = (ChimeRecipe[i][j+3]);
			end
		end
	end
	
	if not (#MovesToTake > 0) then
		-- Array entry not found, so moves to take is empty
		MovementResult = ("Not yet found a route from " .. StartingChimeArray[StartingChime] .. " to " .. ChimeActionArray[ChimeAction] .. " " .. ChimeBirdArray[ChimeBird].. ".");
		return;
	end
	
	
	-- There's a list of moves to take
	for i=1, #MovesToTake do
		clickText(MovesToTake[i]);
	end
	
	StepsTaken = ""; -- Reset the previous Steps Taken
	
	
end

function MainMenu()
	done = false;
	
	while not done do	
		-- Put these everywhere to make sure we don't lock up with no easy way to escape!
		checkBreak("disallow pause");
		
		lsPrint(10, 10, 0, scale, scale, 0xFFFFFFff, "What is the starting Chime?");
		
		StartingChime = lsDropdown("StartingChimeSelected", 8, 40, 0, 275, StartingChime, StartingChimeArray);
		
		lsPrint(10, 70, 0, scale, scale, 0xFFFFFFff, "Where are we going to?");
		
		ChimeAction = lsDropdown("ChimeAction", 8, 100, 0, 120, ChimeAction, ChimeActionArray);
		ChimeBird = lsDropdown("ChimeBird", 130, 100, 0, 160, ChimeBird, ChimeBirdArray);
		
		
		if lsButtonText(10, 130, 0, 275, 0x00FFFFff, "Go to the chime") then
			done = true;
		end
		
		lsPrintWrapped(10, 175, 1, lsScreenX-10, 0.7, 0.7, 0xFF00FFff, MovementResult);

		if lsButtonText(lsScreenX - 110, lsScreenY - 30, z, 100, 0xFFFFFFff, "End script") then
			error ("End Script pressed");
		end
		

		-- Direction Buttons at the bottom of  the window
		
		local scale = 1.25;
		lsSetCamera(0,0,lsScreenX*scale,lsScreenY*scale);
		
		y = 300
		x = 62
		leftx = -25
		width = 60
		
		if lsButtonText(leftx + (1 * x), y, 0.5, width, 0xFFFF00ff, "SA nw") then
			-- north Gliding Nightingale to Hovering Ospray
			--north Gliding Puffin to Gliding Condor
			action("SA");
		end

		if lsButtonText(leftx + (2 * x), y, 0.5, width, 0xFFFF00ff, "HW nw") then
			-- north Floating Eagle to Gliding Sparrow
			-- west Gliding Waxwing to Floating Eagle
			action("HW");
		end
		if lsButtonText(leftx + (3 * x), y, 0.5, width, 0xFFFF00ff, "LP n") then
			-- north Floating Eagle to Gliding Sparrow
			-- north Soaring Puffin to Soaring Condor
			action("LP");
		end
		
		if lsButtonText(leftx + (4 * x), y, 0.5, width, 0xFFFFFFff, "QS ne") then
			-- Goes east Soaring Sparrow to Soaring Finch
			-- Goes north Gliding Condor to Hovering Crane
			-- east Diving Eagle to Soaring Waxwing
			action("QS");
		end

		if lsButtonText(leftx + (5 * x), y, 0.5, width, 0xFFFFFFff, "AP ne") then
			-- north Soaring Puffin to Soaring Condor
			-- east Soaring Puffin to Soaring Warbler
			action("AP");
		end
		
		
		
		y = y + 32;
		if lsButtonText(leftx + (1 * x), y, 0.5, width, 0xFFFFFFff, "RP nw") then
			-- Soaring Finch to Soaring Sparrow
			-- north Diving Waxwing to Diving Finch
			action("RP");
		end
		
		if lsButtonText(leftx + (2 * x), y, 0.5, width, 0xFFFFFFff, "SC nw") then
			-- west Soaring Crane to Soaring Warbler
			-- north Diving Finch to Soaring Warbler
			action("SC");
		end
		

		
		
		
		y = y + 32;

		
		if lsButtonText(leftx + (1 * x), y, 0.5, width, 0xFFFF00ff, "BW nw") then
			-- west Gliding Puffin to Gliding Waxwing
			-- west Gliding Waxwing to Floating Eagle
			-- north Floating Finch to Gliding Warbler
			action("BW");
		end

		if lsButtonText(leftx + (5 * x), y-10, 0.5, width, 0xFFFF00ff, "CW ne") then
			-- Goes East Hovering Crane to Hovering Owl
			-- east Soaring Finch to Soaring Condor
			-- east Soaring Puffin to Soaring Warbler
			-- north Diving Finch to Soaring Warbler
			action("CW");
		end
	

		
		y = y + 32;



		if lsButtonText(leftx + (5 * x), y-10, 0.5, width, 0xFFFF00ff, "IL se") then
			-- south Hovering Osprey to Gliding Nightingale
			-- east Hovering Lark to Hovering Nightingale
			action("IL");
		end

		
		y = y + 32;

		
		if lsButtonText(leftx + (1 * x), y, 0.5, width, 0xFFFFFFff, "SP sw") then
			-- west Soaring Puffin to Soaring Waxwing
			-- west Soaring Waxwing to Diving Eagle
			-- south Gliding Condor to Gliding Puffin
			action("SP");
		end

		if lsButtonText(leftx + (2 * x), y, 0.5, width, 0xFFFF00ff, "SF sw") then
			-- south Soaringn Condor to Soaring Puffin
			-- southh Gliding Condor to Gliding Puffin
			-- west Soaring Waxwing to Diving Eagle
			action("SF");
		end

		
				
		if lsButtonText(leftx + (4 * x), y, 0.5, width, 0xFFFFFFff, "HB se") then
			-- east Gliding Puffin to Gliding Warbler
			-- south Gliding Sparrow to Floating Eagle
			-- south Soaring Warbler to Diving Finch
			-- south Diving Finch to Diving Waxwing
			action("HB");
		end
	
		if lsButtonText(leftx + (5 * x), y, 0.5, width, 0xFFFFFFff, "CS se") then
			-- south Gliding Sparrow to Floating Eagle
			-- east Diving Eagle to Soaring Waxwing
			action("CS");
		end
			
		
		
		
		
		

		
		
		y = y + 40;
		--lsPrint(20, y, 0, scale*0.75, scale*0.75, 0x00FF00ff, StepsTaken);
		
		
		lsPrintWrapped(20, y, 1, lsScreenX-10, scale*0.75, scale*0.75, 0x00FF00ff, StepsTaken);
				
		
		lsDoFrame();
		lsSleep(10); -- Sleep just so we don't eat up all the CPU for no reason

	end

end












function action(actionToTake)

	StepsTaken = StepsTaken .. actionToTake .. " ";
	
	if (actionToTake == "HW") then
		clickText("Plunge into Hot Water");
	elseif (actionToTake == "CW") then
		clickText("Plunge into Cold Water");
	elseif (actionToTake == "SF") then
		clickText("Stress with Shearing Force");
	elseif (actionToTake == "QS") then
		clickText("Bathe in Quicksilver");
	elseif (actionToTake == "SA") then
		clickText("Tumble with White Sand");
	elseif (actionToTake == "SC") then
		clickText("Shine with Silk Cloth");
	elseif (actionToTake == "SP") then
		clickText("Clean with Worm Spirits");
	elseif (actionToTake == "LP") then
		clickText("Fracture against Leopard's Paw");
	elseif (actionToTake == "AP") then
		clickText("Mill with Aluminum Powder");
	elseif (actionToTake == "IL") then
		clickText("Expose to Intense Light");
	elseif (actionToTake == "HB") then
		clickText("Shock against Heavy Block");
	elseif (actionToTake == "RP") then
		clickText("Polish using Rabbit Pelts");
	elseif (actionToTake == "BW") then
		clickText("Coat in Beeswax");
	elseif (actionToTake == "CS") then
		clickText("Dope with Cactus Sap");
	else
		Error("Could not find action [" .. actionToTake .. "]");
	end
end

function clickText(stringToClick)
	srReadScreen();
	local MenuEntry = findText(stringToClick);
	if MenuEntry then
		safeClick(MenuEntry[0]+25,MenuEntry[1]+5);
		lsSleep(200);
	else
		error("Did not find " .. stringToClick .. "!");
	end

end