The Wiki for Tale 5 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:Cegaiel/Temp2

From ATITD5
< User:Cegaiel
Revision as of 02:38, 13 October 2010 by Cegaiel (talk | contribs)
Jump to navigationJump to search

Plant flax beds only. You have to manually do the weedings and harvest. Theres a hotkey, F2, that will keep planting everytime you press that key.


#SingleInstance force

^r::reload
; Reload the script when you make changes
reload
return

!s::
suspend toggle
return

!q::
ExitApp
return



^!w::
InitGui()
return





ButtonFLAX:
Gui, Submit
; Validate input


if (dimension > 5) {
	MsgBox "Make sure your number of objects setting is maxed in video options"
}

Gui, Destroy


Flax()
return


InitGui()
{
	;global cycles
	global weedings
	global dimension


	Gui, Add, Text,, Plot dimensions (NxN):
	Gui, Add, DropDownList, vdimension Choose1, 3|4|5
	Gui, Add, Text,, Screen set and locked from previous flaxing?`nNo = Automatically zoom in to correct position.`nYes = Skip this step.

	Gui, Add, DropDownList, vLocked Choose2, Yes|No

	Gui, Add, Button, Default, FLAX
	Gui, Show
}

Flax()
{

	global Xcenter
	global Ycenter
	global width
	global cycles
	global dimension
	global Locked	


	message := "Please close your friends list and minimize chat and stat tabs in order to ensure proper macroage.`n"
	message .= "Also disable camera moves very fast and camera moves unreasonably fast.`n`n"
	message .= "Pin the plant menu at the very top left corner of the screen`n`n"
	message .= "IN CASE OF EMERGENCY: HIT ALT-Q"
	MsgBox,,, %message%, 5


	; Wait for the window to become active, then get the window stats
	WinWait, eGenesis Client, 
	IfWinNotActive, eGenesis Client, , WinActivate, eGenesis Client, 
	WinWaitActive, eGenesis Client,
	WinGetActiveStats, win_Title, Xmax, Ymax, win_Xpos, win_Ypos

	if (Locked == "No")
	{
	Send {F5}{F8}{F8}
	MouseMove, 0,0
	Sleep 5000
	MouseMove, 0, 0
	Sleep 5000
	}



	Xcenter := Xmax//2 - 3
	Ycenter := Ymax//2 + 16
	MouseMove, Xcenter, Ycenter, 0


	if (Locked == "No")
	{

	Loop 9 {
		MouseClick, WheelDown
		Sleep 1000
	}

	}



	;Flax beds are ~55 coords wide at this zoom level @ 1280 x 1024 (50 @ 1024 x 768)
	width := 50


Plant:

Loop 1
{
	Sleep 500
	i = 0
	Loop {	
		i += 1
		Plant_Row("right", dimension)
		Move("down")
		if (i >= dimension)
			break

		i += 1
		Plant_Row("left", dimension)
		Move("down")
		if (i >= dimension)
			break
	}




	Sleep 1000
	Move("left", half_dim)
	Move("up", half_dim)

	Locked = "Yes"
; end of cycle loop
}

if !(F2Warning = 1)
Msgbox, After gathering your flax, press F2 to plant another batch...`n`nThis message will not appear in future, but F2 will always work to plant a new batch.`n`nOtherwise hit Ctrl+R to reload script.

KeyWait, F2, D
F2Warning = 1

Gosub Plant


; end of function
}
























Move(direction, count = 1) {
	global width
	global Xcenter
	global Ycenter

	distance := width * count
	time := 650 * count
	MouseMove, Xcenter, Ycenter, 0

	if (direction == "right") {
		MouseClick,, distance, 0,, 0,, R
	} else if (direction == "left") {
		MouseClick,, -(distance), 0,, 0,, R
	} else if (direction == "down") {
		MouseClick,, 0, distance,, 0,, R
	} else if (direction == "up") {
		MouseClick,, 0, -(distance),, 0,, R
	}
	Sleep %time%
}
	

Plant_Row(direction, num)
{

;Look at 40,40 to see if the pinup menu is there. If you pinup menu is not at 40,40, then adjust...


	PixelSearch, Px, Py, 40, 40, 40, 40, 0xF2EBD3, 50, Fast|RGB
	if ErrorLevel = 0
	{
	MouseClick,, 40, 40,, 0
	if (num <= 0) {
		return
	}
	num -= 1
	Loop %num% {
		Move(direction)
		MouseClick,, 40, 40,, 0
	}

} else {
Msgbox, Plant menu, pinned in upper left corner, not found!`n`nExiting script. Restart script with Ctrl+Alt+W after you pin up the menu!
Exit
}

	return
}


^p::Pause