<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://www.atitd.org/wiki/t6w/index.php?action=history&amp;feed=atom&amp;title=User%3ACegaiel%2FMacros%2FPotteryWheel%2FCode</id>
	<title>User:Cegaiel/Macros/PotteryWheel/Code - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://www.atitd.org/wiki/t6w/index.php?action=history&amp;feed=atom&amp;title=User%3ACegaiel%2FMacros%2FPotteryWheel%2FCode"/>
	<link rel="alternate" type="text/html" href="http://www.atitd.org/wiki/t6w/index.php?title=User:Cegaiel/Macros/PotteryWheel/Code&amp;action=history"/>
	<updated>2026-06-03T16:34:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>http://www.atitd.org/wiki/t6w/index.php?title=User:Cegaiel/Macros/PotteryWheel/Code&amp;diff=149022&amp;oldid=prev</id>
		<title>Cegaiel: Created page with &quot;&lt;pre&gt; ;Ctrl+P to pause script and Ctrl+P again to resume ;The AHK icon in system tray will turn red while paused. ;Ctrl+R to reload script ;Date 6/22/2010 ;Author: Cegaiel   ;Las...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.atitd.org/wiki/t6w/index.php?title=User:Cegaiel/Macros/PotteryWheel/Code&amp;diff=149022&amp;oldid=prev"/>
		<updated>2012-02-03T05:23:33Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;pre&amp;gt; ;Ctrl+P to pause script and Ctrl+P again to resume ;The AHK icon in system tray will turn red while paused. ;Ctrl+R to reload script ;Date 6/22/2010 ;Author: Cegaiel   ;Las...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
;Ctrl+P to pause script and Ctrl+P again to resume&lt;br /&gt;
;The AHK icon in system tray will turn red while paused.&lt;br /&gt;
;Ctrl+R to reload script&lt;br /&gt;
;Date 6/22/2010&lt;br /&gt;
;Author: Cegaiel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Last Update: 1/14/2012 - No longer requires you to press Ctrl+Alt+W to start the macro. It now launches directly to a &lt;br /&gt;
&lt;br /&gt;
GUI. Windows now appear on upper left corner of screen, and dont require you to drag out of the way. Now automatically &lt;br /&gt;
&lt;br /&gt;
detects popup boxes and closes it, in case lag caused a &amp;quot;Pottery Wheel busy&amp;quot; error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Explanation of Seconds variable below:&lt;br /&gt;
&lt;br /&gt;
;If you find the jugs are getting done slightly late:&lt;br /&gt;
;(ie it begins making more jugs before they are done), then add 1 second at a time, below&lt;br /&gt;
&lt;br /&gt;
;If you find the jugs are forming before the timer is done,&lt;br /&gt;
;(ie there is 1 or more seconds remaining on timer when jugs get done) then decrease 1 second at a time&lt;br /&gt;
&lt;br /&gt;
;It takes about 33 seconds for the jugs to form, but the time it takes from when the first wheel is loaded&lt;br /&gt;
;until the time the last one is loaded is the reason that time varies&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;About 69s for 1 wheel&lt;br /&gt;
;About 49s for 36 wheels&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Seconds = 67&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IfWinExist eGenesis Client&lt;br /&gt;
{&lt;br /&gt;
	WinActivate&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	Gui, +AlwaysOnTop +ToolWindow&lt;br /&gt;
	Gui, Font, bold&lt;br /&gt;
	Gui, Add, Text, vMineNumText, Set Pottery Wheel locations&lt;br /&gt;
	Gui, Font, norm&lt;br /&gt;
	Gui, Add, Text,,&lt;br /&gt;
	( LTrim&lt;br /&gt;
	Hover and middle-click (Click mouse-wheel) on each pottery wheel, one by one,&lt;br /&gt;
	until you've clicked on all the wheels you want to use. Then click the OK button.&lt;br /&gt;
&lt;br /&gt;
	(Drag this box out of the way if any wheels are hidden)&lt;br /&gt;
&lt;br /&gt;
	Make sure you chat is minimized and that your screen is locked (Alt+L)&lt;br /&gt;
&lt;br /&gt;
	AFTER setting pottery wheel locations, Press OK...&lt;br /&gt;
&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
	Gui, Add, Button, default gMineSetLoops, OK&lt;br /&gt;
	Gui, Show, x0 y25&lt;br /&gt;
&lt;br /&gt;
	MineNum = 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	WinGet, GameWinHandle, ID, eGenesis Client&lt;br /&gt;
	loop&lt;br /&gt;
	{&lt;br /&gt;
		WinActivate&lt;br /&gt;
		CoordMode, Mouse, Relative&lt;br /&gt;
		KeyWait, MButton, D&lt;br /&gt;
		KeyWait, MButton&lt;br /&gt;
		MouseGetPos, TestX, TestY, WinHandle&lt;br /&gt;
		if (WinHandle = GameWinHandle)&lt;br /&gt;
		{&lt;br /&gt;
			Gosub, MineRecord&lt;br /&gt;
		}&lt;br /&gt;
		else&lt;br /&gt;
		{&lt;br /&gt;
			Gui, Destroy&lt;br /&gt;
			break&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	return&lt;br /&gt;
&lt;br /&gt;
	MineRecord:&lt;br /&gt;
	MineNum++&lt;br /&gt;
	MouseGetPos, MineX%MineNum%, MineY%MineNum%&lt;br /&gt;
	GuiControl, Text, MineNumText, %MineNum% pottery wheel captured&lt;br /&gt;
	TotalRacks := MineNum&lt;br /&gt;
	return&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	MineSetLoops:&lt;br /&gt;
	Gui, Submit&lt;br /&gt;
	Gui, Destroy&lt;br /&gt;
	Gui, +AlwaysOnTop +ToolWindow&lt;br /&gt;
	Gui, Font, bold&lt;br /&gt;
	Gui, Add, Text, vMineCycleText, Starting in 2 seconds ..................&lt;br /&gt;
	Gui, Font, norm&lt;br /&gt;
	Gui, Show, x0 y25&lt;br /&gt;
	GuiControl, Text, MineCycleText, Starting in 2 seconds .............&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	Delay = 2&lt;br /&gt;
&lt;br /&gt;
	Loop, %Delay%&lt;br /&gt;
	{&lt;br /&gt;
	GuiControl, Text, MineCycleText, Starting in %Delay%s seconds .....&lt;br /&gt;
	Delay --&lt;br /&gt;
	Sleep 1000&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SetDefaultMouseSpeed, 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	loop&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	MineNum = 1&lt;br /&gt;
	MouseGetPos, OldMX, OldMY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	ImageSearch, PopX, PopY, 458, 459, 667, 621, *50 OK.PNG&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	if ErrorLevel = 0&lt;br /&gt;
	{&lt;br /&gt;
	Click, %PopX%, %PopY%&lt;br /&gt;
	Sleep 1000&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	;Make Jugs Loop&lt;br /&gt;
	loop, %TotalRacks%&lt;br /&gt;
			{&lt;br /&gt;
&lt;br /&gt;
			WinActivate, eGenesis Client&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
			;BlockInput, MouseMove&lt;br /&gt;
			GuiControl, Text, MineCycleText, Making Jugs -  Wheel: %MineNum%/%TotalRacks%&lt;br /&gt;
			MinePosX := MineX%MineNum%&lt;br /&gt;
			MinePosY := MineY%MineNum%&lt;br /&gt;
			MouseMove, %MinePosX%, %MinePosY%, 0&lt;br /&gt;
			Key = J&lt;br /&gt;
			Sleep 100&lt;br /&gt;
			Send {%Key%}&lt;br /&gt;
			Sleep 100&lt;br /&gt;
			Gosub, SearchPopupBox&lt;br /&gt;
			MineNum++&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
			MouseMove, %OldMX%, %OldMY%, 0		&lt;br /&gt;
&lt;br /&gt;
			SecondsCountDown := Seconds&lt;br /&gt;
&lt;br /&gt;
			loop, %Seconds% {&lt;br /&gt;
			GuiControl, Text, MineCycleText, Waiting %SecondsCountdown%s for Jugs to complete &lt;br /&gt;
			SecondsCountdown --&lt;br /&gt;
			sleep 1000&lt;br /&gt;
			}&lt;br /&gt;
	&lt;br /&gt;
			MineNum = 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
			&lt;br /&gt;
			;Take Jugs&lt;br /&gt;
&lt;br /&gt;
			loop, %TotalRacks% {&lt;br /&gt;
&lt;br /&gt;
			WinActivate, eGenesis Client&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
			GuiControl, Text, MineCycleText, Taking Jugs -  Wheel: %MineNum% &lt;br /&gt;
			MinePosX := MineX%MineNum%&lt;br /&gt;
			MinePosY := MineY%MineNum%&lt;br /&gt;
			MouseMove, %MinePosX%, %MinePosY%, 0&lt;br /&gt;
			Key = T&lt;br /&gt;
			Sleep 100&lt;br /&gt;
			Send {%Key%}&lt;br /&gt;
			Sleep 100&lt;br /&gt;
			Gosub, SearchPopupBox&lt;br /&gt;
			MineNum++&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
			GuiControl, Text, MineCycleText, 2s Pause, Hit Ctrl+P to STOP MAKING &lt;br /&gt;
			Sleep 2000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	Gui, Destroy&lt;br /&gt;
	Gui, Add, Text,, Middle-click on this window to end the script.&lt;br /&gt;
	Gui, Show&lt;br /&gt;
	return&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SearchPopupBox:&lt;br /&gt;
;This searches for a poup box which I occassionally would get (Pottery wheel busy) and closes it immediately.&lt;br /&gt;
&lt;br /&gt;
ImageSearch, PopX, PopY, 458, 459, 667, 621, *50 OK.PNG&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
			if ErrorLevel = 0&lt;br /&gt;
			{&lt;br /&gt;
			NewX := PopX + 3&lt;br /&gt;
			NewY := PopY + 3&lt;br /&gt;
			;BlockInput, MouseMove&lt;br /&gt;
			Click %NewX%, %NewY%&lt;br /&gt;
			Sleep 250&lt;br /&gt;
			;BlockInput, MouseMoveOff			&lt;br /&gt;
				&lt;br /&gt;
			MineNum--&lt;br /&gt;
			MouseMove, %MinePosX%, %MinePosY%, 0&lt;br /&gt;
			Send {%Key%}&lt;br /&gt;
&lt;br /&gt;
			;If popup is detected, then go back and keep checking until it is closed for sure, in case lag &lt;br /&gt;
&lt;br /&gt;
interfered with it closing properly&lt;br /&gt;
&lt;br /&gt;
			Gosub, SearchPopupBox    &lt;br /&gt;
			;Send %Key%  ;Resend the key from Patternset sub, after closing popup box (sometimes doesn't &lt;br /&gt;
&lt;br /&gt;
work as desired, commenting out...&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
return&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
^r::reload&lt;br /&gt;
^p::Pause&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cegaiel</name></author>
	</entry>
</feed>