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/Grass/Code"

From A Tale in the Desert
Jump to navigationJump to search
(New page: <pre> ; grass collector ^p::Pause ^!g:: ;This script collects grass in a small area. It will click/walk different in a circle around where you are standing. ;Make sure you have plenty of ...)
 
Line 1: Line 1:
 
<pre>
 
<pre>
 
; grass collector
 
; grass collector
 +
^r::reload
 
^p::Pause
 
^p::Pause
 
^!g::
 
^!g::
Line 52: Line 53:
 
GuiControl, Text, GrassCycleText, Cycle %GrassCycle% of %NumGrass%
 
GuiControl, Text, GrassCycleText, Cycle %GrassCycle% of %NumGrass%
 
WinActivate, eGenesis Client
 
WinActivate, eGenesis Client
CoordMode, Mouse, Relative
+
;CoordMode, Mouse, Relative
 +
 
 +
SetDefaultMouseSpeed, 0
 +
SetMouseDelay, -1
 +
 
 +
 
 
loop, %NumGrass%
 
loop, %NumGrass%
 
{
 
{
Line 99: Line 105:
 
;PixelSearch, Px, Py, 0, 0, 91, 74, 0xB46E6C
 
;PixelSearch, Px, Py, 0, 0, 91, 74, 0xB46E6C
  
ImageSearch, Px, Py, 92 , 61, 576, 150, %shades% Grass_icon.png
+
ImageSearch, Px, Py, 50 , 38, 244, 120, %shades% Grass_icon.png
 +
 
 
;Sleep, 1000
 
;Sleep, 1000
 
if ErrorLevel = 0  
 
if ErrorLevel = 0  

Revision as of 01:57, 25 May 2010

; grass collector
^r::reload
^p::Pause
^!g::

;This script collects grass in a small area. It will click/walk different in a circle around where you are standing.
;Make sure you have plenty of grass around you!
;Lock screen (Alt+L) and use F6 camera angle and zoom in about medium.
;Make sure you are Walking Slow (Esc, Emote..., Gait: Walking)
;Make sure that What Do I Do Now? icon (top left (Clipboard with notebook on it) is gone (Uncheck Utility, Interface)


;Ctrl+Alt+G to enter the amount of grass to collect.
;Ctrl+p to Pause script

shades:="*90"

IfWinExist eGenesis Client 
{
	WinActivate
	WinGetPos,,, winWidth, winHeight
	minorOffset = 70
	majorOffset = 100
	winXCenter := winWidth / 2
	winYCenter := ((winHeight - 22) / 2) + 32
	winXLeft := winXCenter - minorOffset
	winXFarLeft := winXCenter - majorOffset
	winXRight := winXCenter + minorOffset
	winXFarRight := winXCenter + majorOffset
	winYUp := winYCenter - minorOffset
	winYFarUp := winYCenter - majorOffset
	winYDown := winYCenter + minorOffset
	winYFarDown := winYCenter + majorOffset
	circleMove = 0
	
	Gui, +AlwaysOnTop +ToolWindow
	Gui, Add, Text,, How many grass cycles?
	Gui, Add, Edit, Number vNumGrass
	Gui, Add, Button, default gGrassCommit, OK
	Gui, Show
	return
	
	GrassCommit:
	Gui, Submit
	Gui, Destroy
	GrassCycle = 0
	Gui, +AlwaysOnTop +ToolWindow
	Gui, Font, bold
	Gui, Add, Text, vGrassCycleText, Cycle %NumGrass% of %NumGrass%
	Gui, Font, norm
	Gui, Show
	GuiControl, Text, GrassCycleText, Cycle %GrassCycle% of %NumGrass%
	WinActivate, eGenesis Client
	;CoordMode, Mouse, Relative

SetDefaultMouseSpeed, 0
SetMouseDelay, -1


	loop, %NumGrass%
	{
		if circleMove = 0 
		{
			MouseClick, left, %winXCenter%, %winYFarUp%
			circleMove++
		}
		else if circleMove = 1 
		{
			MouseClick, left, %winXRight%, %winYUp%
			circleMove++
		}
		else if circleMove = 2 
		{
			MouseClick, left, %winXFarRight%, %winYCenter%
			circleMove++
		}
		else if circleMove = 3 
		{
			MouseClick, left, %winXRight%, %winYDown%
			circleMove++
		}
		else if circleMove = 4 
		{
			MouseClick, left, %winXCenter%, %winYFarDown%
			circleMove++
		}
		else if circleMove = 5 
		{
			MouseClick, left, %winXLeft%, %winYDown%
			circleMove++
		}
		else if circleMove = 6 
		{
			MouseClick, left, %winXFarLeft%, %winYCenter%
			circleMove++
		}
		else if circleMove = 7 
		{
			MouseClick, left, %winXLeft%, %winYUp%
			circleMove = 0
		}
		loop
		{
			;PixelSearch, Px, Py, 0, 0, 91, 74, 0xB46E6C

			ImageSearch, Px, Py, 50 , 38, 244, 120, %shades% Grass_icon.png

			;Sleep, 1000
			if ErrorLevel = 0 
			{
				GrassCycle++
				GuiControl, Text, GrassCycleText, Cycle %GrassCycle% of %NumGrass%
				;MouseClick, left, 91, 74
				MouseClick, left, Px, Py
				Sleep, 250
				break
			}
		}
	}
	Gui, Destroy
	return
}
return