The Wiki for Tale 4 is in read-only mode and is available for archival and reference purposes only. Please visit the current Tale 11 Wiki in the meantime.

If you have any issues with this Wiki, please post in #wiki-editing on Discord or contact Brad in-game.

User:Corrans/macros/Charcoal Oven

From A Tale in the Desert
Jump to navigationJump to search
;Charcoal macro ctrl-alt-c to start
;pin Charcoal oven window in extreme upper left corner of the window
;if you're as sick of the tedium of charcoal as me, this might just save your subscription

^!p:: 

pause

^!c::

IfWinExist eGenesis Client 
{

	WinActivate
	
	blue := 0xFD0606						;colour code for blue bars
	green := 0x05FE06						;colour code for green bar

	px05= 81							;x position of 05% of bar
	px25 = 108							;x position of 25% of bar
	px45 = 130							;x position of 45% of bar
	px50 = 136							;x position of 50% of bar
	px60 = 147							;x position of 60% of bar
	px65 = 152							;x position of 65% of bar
	px85 = 174							;x position of 85% of bar
	px90 =180							;x position of 90% of bar
	pxwood = 36							;x position of wood button
	pxwater = 89							;x position of water button	
	pxclose = 133							;x position of close vent button
	pxnorm = 158							;x position of normalvent button			
	pxwide = 183							;x position of wide open vent button
	pxbegin = 110							;x position of the begin button

	pyheat = 152							;y position of the heat bar
	pyoxy = 165							;y position of the oxygen bar
	pydanger = 201							;y position of the danger bar
	pyprogress = 212						;y position of the progress bar
	pyaction = 248							;y position of wood, water and vent buttons
	pybegin = 240							;y position of the begin button


	loop
	{
		WinActivate, eGenesis Client


									;check to see if the process has been started
		PixelSearch, px, py, %px05%, %pyheat%, %px05%, %pyheat%, %blue% , 4	
									;look for blue in the heat bar
		if errorlevel = 1
		{
			PixelSearch, px, py, %px05%, %pyoxy%, %px05%, %pyoxy%, %blue% , 4
									;look for blue in the oxy bar
			if errorlevel = 1
			{
				PixelSearch, px, py, %px05%, %pyprogress%, %px05%, %pyprogress%, %blue% , 4
									;look for blue in the progress bar
				if errorlevel = 1			;if all three have no blue
				{
					click %pxbegin%, %pybegin%	;start the process
					sleep 750			;allow tale servers to keep up
					click %pxwood%, %pyaction%	;start with wood
					click %pxwood%, %pyaction%	;twice
					sleep 3500			;wait three and a half secs before progressing
				}
			}
		}


									;check to see if progress is complete
		PixelSearch, px, py, %px05%, %pyprogress%, %px05%, %pyprogress%, %green% , 4
									;look for green in the progress bar
		if errorlevel = 0					;if its found
		{
			click %pxwater%, %pyaction%			;dump water in
			click %pxwater%, %pyaction%			;twice
			click %pxclose%, %pyaction%			;close down the vent
			sleep 3500					;give it a moment

			loop						;now wait for the progress bar to stop being green
			{
				PixelSearch, px, py, %px05%, %pyprogress%, %px05%, %pyprogress%, %green% , 4
				if errorlevel = 1
					break
				else
					sleep 3500
			}
		}


									;actions if the process is started, but not complete
		else
		{
			PixelSearch, px, py, %px65%, %pyheat%, %px65%, %pyheat%, %blue%, 4
			if errorlevel = 1
				click %pxwood%, %pyaction%		;if the heat bar is not blue at 65%, add wood

			sleep 100
			PixelSearch, px, py, %px85%, %pyheat%, %px85%, %pyheat%, %blue%, 4
			if errorlevel = 0
				click %pxwater%, %pyaction%		;if the heat bar is blue at 85%, add water
				
			sleep 100
			click %pxnorm%, %pyaction%			;default vent to normal

			sleep 100
			PixelSearch, px, py, %px25%, %pyoxy%, %px25%, %pyoxy%, %blue% , 4
			if errorlevel = 1
				click %pxwide%, %pyaction%		;if the oxygen bar is not blue at 25%, open vent
			
			sleep 100
			PixelSearch, px, py, %px45%, %pyoxy%, %px45%, %pyoxy%, %blue%, 4
			if errorlevel = 0
				click %pxclose%, %pyaction%		;if the oxygen bar is blue at 45%, close vent
			
			sleep 100
			PixelSearch, px, py, %px85%, %pydanger%, %px85%, %pydanger%, %blue%, 4
			if errorlevel = 0
				click %pxwater%, %pyaction%		;if the danger bar hits 90%, add water
				
						
			sleep 3500					;pause for three and a half seconds and start over
		}
	}	
}
return