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.

Difference between revisions of "User:Cegaiel/Macros/Plane/Code"

From A Tale in the Desert
Jump to navigationJump to search
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<pre>
 
<pre>
;Ctrl+Alt+W to start macro.
 
 
;Ctrl+P to pause script and Ctrl+P again to resume
 
;Ctrl+P to pause script and Ctrl+P again to resume
 
;The AHK icon in system tray will turn red while paused.
 
;The AHK icon in system tray will turn red while paused.
 
;Ctrl+R to reload script
 
;Ctrl+R to reload script
 +
;Date: 10/02/2010
 +
;Last Update: 1/19/2012 - Speeded it up and added delay variable so you can change if needed.
 +
 +
 +
 +
 +
;This is how many boards it will plane, if you resume past the initial stopping point
 +
DefaultResumingCounter = 50
 +
 +
 +
;Increase value to slow the movement down. 100 is 1/10 of a second, 1000 is 1 second
 +
 +
Delay = 100
 +
 +
 +
 +
 +
  
^r::reload
 
^p::Pause
 
^!w::
 
  
 +
Resuming = 0
  
SetDefaultMouseSpeed, 0
 
  
 
IfWinExist eGenesis Client
 
IfWinExist eGenesis Client
Line 35: Line 49:
  
 
Gui, Add, Button, default gMineSetLoops, OK
 
Gui, Add, Button, default gMineSetLoops, OK
Gui, Show
+
Gui, Show, x0 y25
  
 
MineNum = 0
 
MineNum = 0
Line 74: Line 88:
 
Gui, +AlwaysOnTop +ToolWindow
 
Gui, +AlwaysOnTop +ToolWindow
 
Gui, Font, bold
 
Gui, Font, bold
Gui, Add, Text, vMineCycleText, 5s to drag out of way from the benches
+
Gui, Add, Text, vMineCycleText, 5s to drag out of way from the benches`n`n`n`n`n
 
Gui, Font, norm
 
Gui, Font, norm
Gui, Show
+
Gui, Show, x0 y25
GuiControl, Text, MineCycleText, 5s to drag out of way from the benches
+
GuiControl, Text, MineCycleText, 5s to drag out of way from the benches`n`n`n`n`n
  
 
seconds = 5
 
seconds = 5
Line 83: Line 97:
 
Loop, %seconds%
 
Loop, %seconds%
 
{
 
{
GuiControl, Text, MineCycleText, %seconds%s countdown, drag window out of way
+
GuiControl, Text, MineCycleText, %seconds%s countdown, drag window out of way`n`n`nMake sure chat is MINIMIZED!
 
seconds --
 
seconds --
 
Sleep 1000
 
Sleep 1000
 
}
 
}
 +
 +
SetDefaultMouseSpeed,0
 +
  SetMouseDelay,-1
  
  
  
loop, %NumPulls%
+
loop
 
{
 
{
  
Line 107: Line 124:
 
MinePosY := MineY%MineNum%
 
MinePosY := MineY%MineNum%
 
MouseMove, %MinePosX%, %MinePosY%, 0
 
MouseMove, %MinePosX%, %MinePosY%, 0
Sleep, 250
+
Sleep, 100
 
Send {P}
 
Send {P}
Sleep, 250
+
Sleep, %Delay%
 
MineNum++
 
MineNum++
 
Boards++
 
Boards++
 +
 +
if Resuming = 1
 +
{
 +
GuiControl, Text, MineCycleText, Boards: %Boards% of %NumPulls%`n`n`n`n`nMaking
 +
 +
%ResumingCounter% more boards...
 +
ResumingCounter --
 +
} else {
 
GuiControl, Text, MineCycleText, Boards: %Boards% of %NumPulls%
 
GuiControl, Text, MineCycleText, Boards: %Boards% of %NumPulls%
 
+
}
  
  
 
if Boards = %NumPulls%
 
if Boards = %NumPulls%
 
{
 
{
Gui, Destroy
+
GuiControl, Text, MineCycleText, Boards: %Boards% of %NumPulls%`n`nAll Done, pausing script...`nHit Ctrl+P to Resume (if
Gui, Font, bold
+
 
Gui, Add, Text, MineCycleText, Boards: %Boards% of %NumPulls%
+
quota not met)`n`nMakes %DefaultResumingCounter% more boards...
Gui, Font, norm
+
Resuming = 1
Gui, Add, Text,,
+
ResumingCounter := DefaultResumingCounter
( LTrim
+
PAUSE
All Done!
+
}
 +
 
 +
 
  
Middle-click on this window to end the script.
+
if ResumingCounter = 0
)
+
{
Gui, Show
+
ResumingCounter := DefaultResumingCounter
 +
GuiControl, Text, MineCycleText, Boards: %Boards% of %NumPulls%`n`nAll Done, pausing script...`nHit Ctrl+P to Resume (if
  
Exit
+
quota not met)`n`nMakes %DefaultResumingCounter% more boards...
 +
PAUSE
 
}
 
}
 +
 +
 +
 +
  
 
}
 
}
Line 143: Line 176:
 
return
 
return
 
}
 
}
 +
 +
 +
^r::reload
 +
^p::Pause
 
</pre>
 
</pre>

Latest revision as of 04:14, 20 January 2012

;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: 10/02/2010
;Last Update: 1/19/2012 - Speeded it up and added delay variable so you can change if needed.




;This is how many boards it will plane, if you resume past the initial stopping point
DefaultResumingCounter = 50


;Increase value to slow the movement down. 100 is 1/10 of a second, 1000 is 1 second

Delay = 100







Resuming = 0


IfWinExist eGenesis Client
{
	WinActivate

InputBox, NumPulls, Boards, How many boards do you want to plane?


	Gui, +AlwaysOnTop +ToolWindow
	Gui, Font, bold
	Gui, Add, Text, vMineNumText, Recording bench positions
	Gui, Font, norm
	Gui, Add, Text,,
	( LTrim
	Hover and middle-click (Click mouse-wheel) on each carpentry bench, one by one,
	until you've clicked on all the benches you want to use. 

	AFTER setting middle clicking all your benches, then click the OK button.

	(Drag this box out of the way if any benches are hidden)

	)

	Gui, Add, Button, default gMineSetLoops, OK
	Gui, Show, x0 y25

	MineNum = 0
	Boards = 0

	WinGet, GameWinHandle, ID, eGenesis Client
	loop
	{

		WinActivate
		CoordMode, Mouse, Relative
		KeyWait, MButton, D
		KeyWait, MButton
		MouseGetPos, TestX, TestY, WinHandle
		if (WinHandle = GameWinHandle)
		{
			Gosub, MineRecord
		}
		else
		{
			Gui, Destroy
			break
		}
	}
	return

	MineRecord:
	MineNum++
	MouseGetPos, MineX%MineNum%, MineY%MineNum%
	GuiControl, Text, MineNumText, %MineNum% benches captured
	TotalBenches := MineNum
	return


	MineSetLoops:
	Gui, Submit
	Gui, Destroy
	Gui, +AlwaysOnTop +ToolWindow
	Gui, Font, bold
	Gui, Add, Text, vMineCycleText, 5s to drag out of way from the benches`n`n`n`n`n
	Gui, Font, norm
	Gui, Show, x0 y25
	GuiControl, Text, MineCycleText, 5s to drag out of way from the benches`n`n`n`n`n

	seconds = 5
	;You got 5 seconds to drag the status window out of the way
	Loop, %seconds%
	{
	GuiControl, Text, MineCycleText, %seconds%s countdown, drag window out of way`n`n`nMake sure chat is MINIMIZED!
	seconds --
	Sleep 1000
	}

SetDefaultMouseSpeed,0
  SetMouseDelay,-1



	loop
	{

			MineNum = 1



	loop, %TotalBenches% {




			WinActivate, eGenesis Client

			MinePosX := MineX%MineNum%
			MinePosY := MineY%MineNum%
			MouseMove, %MinePosX%, %MinePosY%, 0
			Sleep, 100	
			Send {P}
			Sleep, %Delay%	
			MineNum++
			Boards++

			if Resuming = 1
			{
			GuiControl, Text, MineCycleText, Boards: %Boards% of %NumPulls%`n`n`n`n`nMaking 

%ResumingCounter% more boards...
			ResumingCounter -- 
			} else {
			GuiControl, Text, MineCycleText, Boards: %Boards% of %NumPulls%
			}


if Boards = %NumPulls%
{
GuiControl, Text, MineCycleText, Boards: %Boards% of %NumPulls%`n`nAll Done, pausing script...`nHit Ctrl+P to Resume (if 

quota not met)`n`nMakes %DefaultResumingCounter% more boards...
Resuming = 1
ResumingCounter := DefaultResumingCounter
PAUSE
}



if ResumingCounter = 0
{
ResumingCounter := DefaultResumingCounter
GuiControl, Text, MineCycleText, Boards: %Boards% of %NumPulls%`n`nAll Done, pausing script...`nHit Ctrl+P to Resume (if 

quota not met)`n`nMakes %DefaultResumingCounter% more boards...
PAUSE
}





			}



	}
	Gui, Destroy
	Gui, Add, Text,, Middle-click on this window to end the script.
	Gui, Show
	return
}


^r::reload
^p::Pause