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/Fishing/Code"
From A Tale in the Desert
< User:Cegaiel | Macros | Fishing
Jump to navigationJump to search|  (New page: <pre> ;Ctrl+Alt+F to start macro. ;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  ^r::reload ^p::Pause...) | |||
| Line 8: | Line 8: | ||
| ^p::Pause | ^p::Pause | ||
| ^!f:: | ^!f:: | ||
| + | |||
| + | |||
| + | Seconds = 15 | ||
| Line 103: | Line 106: | ||
| 			MouseMove, %OldMX%, %OldMY%, 0			 | 			MouseMove, %OldMX%, %OldMY%, 0			 | ||
| 			Cycle++ | 			Cycle++ | ||
| − | |||
| − | Sleep  | + | 			SecondsCountDown := Seconds | 
| + | 	;Loops to do nothing but display seconds countdown	 | ||
| + | 	loop, %Seconds% | ||
| + | 	{ | ||
| + | 			GuiControl, Text, LocationText, Cast: %Cycle% of %NumPulls%  Next: %SecondsCountdown%s | ||
| + | 			SecondsCountdown := SecondsCountdown - 1 | ||
| + | 			Sleep 1000 | ||
| + | |||
| + | 	} | ||
| Line 114: | Line 124: | ||
| 	Gui, Destroy | 	Gui, Destroy | ||
| 	Gui, Font, bold | 	Gui, Font, bold | ||
| − | 	Gui, Add, Text, LocationText,  | + | 	Gui, Add, Text, LocationText, Cast: %Cycle% of %NumPulls% | 
| 	Gui, Font, norm | 	Gui, Font, norm | ||
| 	Gui, Add, Text,, | 	Gui, Add, Text,, | ||
Revision as of 00:36, 19 January 2010
;Ctrl+Alt+F to start macro.
;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
^r::reload
^p::Pause
^!f::
Seconds = 15
IfWinExist eGenesis Client
{
	WinActivate
	InputBox, NumPulls, Fishing, Step 1: Enter how many times do you want to cast?
	Location = 1
	Cycle = 0
	Gui, +AlwaysOnTop +ToolWindow
	Gui, Font, bold
	Gui, Add, Text, vLocationText, Step 2: Record the location of fishing icon...
	Gui, Font, norm
	Gui, Add, Text,, Hover and middle-click (Click mouse-wheel) on the fishing icon
	Gui, Show
	WinGet, GameWinHandle, ID, eGenesis Client
	loop
	{
		WinActivate, eGenesis Client
		CoordMode, Mouse, Relative
		KeyWait, MButton, D
		KeyWait, MButton
		MouseGetPos, TestX, TestY, WinHandle
		if (WinHandle = GameWinHandle)
		{
			Gosub, RecordIcon
		}
		else
		{
			Gui, Destroy
			break
		}
	}
	return
	RecordIcon:
	MouseGetPos, LocX%Location%, LocY%Location%
	Gui, Destroy
	Gui, +AlwaysOnTop +ToolWindow
	Gui, Font, bold
	Gui, Add, Text, LocationText, Fishing icon captured!
	Gui, Font, norm
	Gui, Add, Text,, 
	( LTrim
	Hotkeys:
	Ctrl+P to Pause script, Ctrl+P again to Resume
	Ctrl+R to Reload script
	Note: If you are eating grilled cabbage for +speed, to increase fishing yields,
	then 43 casts is about when stats will wear off...
	Also: Uncheck the box Esc, Options, Interface Options:
	"Ask about mounting record-breaking fishes"
	If you dont, then a popup box occurs, you will lose about 3 casts,
	while waiting on the popup box to disappear on its own.
	Message will say "You are already fishing" while the popup box remains open!
	)
	Gui, Add, Button, default gSetLoops, GO FISHING
	Gui, Show
	return
	SetLoops:
	Gui, Submit
	Gui, Destroy
	Gui, +AlwaysOnTop +ToolWindow
	Gui, Font, bold
	Gui, Add, Text, vLocationText, Ready to fish, Good Luck!
	Gui, Show
Sleep 2000
	loop, %NumPulls%
	{
			WinActivate, eGenesis Client
			LocPosX := LocX%Location%
			LocPosY := LocY%Location%
			MouseGetPos, OldMX, OldMY
			Click, %LocPosX%, %LocPosY%
			MouseMove, %OldMX%, %OldMY%, 0			
			Cycle++
			SecondsCountDown := Seconds
	;Loops to do nothing but display seconds countdown	
	loop, %Seconds%
	{
			GuiControl, Text, LocationText, Cast: %Cycle% of %NumPulls%  Next: %SecondsCountdown%s
			SecondsCountdown := SecondsCountdown - 1
			Sleep 1000
			
	}
if Cycle = %NumPulls%
{
	Gui, Destroy
	Gui, Font, bold
	Gui, Add, Text, LocationText, Cast: %Cycle% of %NumPulls%
	Gui, Font, norm
	Gui, Add, Text,,
	( LTrim
	All Done!
	Hope you caught lots of fish!
	Middle-click on this window to end the script.
	)
	Gui, Show
Exit
}
	}
	Gui, Destroy
	Gui, Add, Text,, Middle-click on this window to end the script.
	Gui, Show
	return
}
