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:Sithid/Macros/AutoIT/Watering"

From A Tale in the Desert
Jump to navigationJump to search
(New page: <pre> #cs -------------------------------------------------------------------------------------- AutoIt Version 3.2.12.1 Author: Sithid Date: 07.12.08 Version: 0.3 Script Functi...)
 
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
Simple plant watering hotkey-like macro. Build/Run, switch to atitd, and press alt + w over a plant.  Macro acts like a hotkey, clicks the plant, adjusts the cursor, and clicks water.
 +
 +
== The Macro ==
 
<pre>
 
<pre>
 
#cs --------------------------------------------------------------------------------------
 
#cs --------------------------------------------------------------------------------------
Line 8: Line 11:
 
 
 
Script Function:
 
Script Function:
Plant Watering Hotkey
+
Plant Watering - Automagical
  
 
#ce --------------------------------------------------------------------------------------
 
#ce --------------------------------------------------------------------------------------
 
#include <GUIConstants.au3>
 
#include <GUIConstantsEx.au3>
 
#include <WindowsConstants.au3>
 
  
 
Opt( "MustDeclareVars", 1 )
 
Opt( "MustDeclareVars", 1 )
Line 22: Line 21:
 
HotKeySet( "{ESC}", "Terminate" )
 
HotKeySet( "{ESC}", "Terminate" )
 
HotKeySet( "{PAUSE}", "TogglePause" )
 
HotKeySet( "{PAUSE}", "TogglePause" )
HotKeySet( "{w}", "WaterPlant" )
+
HotKeySet( "!{w}", "WaterPlant" )
  
 
WinWaitActive( "eGenesis Client" )
 
WinWaitActive( "eGenesis Client" )
Line 35: Line 34:
  
 
Func WaterPlant()
 
Func WaterPlant()
 +
If $Paused Then
 +
Return
 +
EndIf
 +
 
Local $MouseLoc = MouseGetPos()
 
Local $MouseLoc = MouseGetPos()
MouseClick( "left", $MouseLoc[0], $MouseLoc[1], 1, 1 )
+
MouseClick( "left", $MouseLoc[0], $MouseLoc[1], 1, 0 )
Sleep( 200 )
+
Sleep( 100 )
MouseClick( "left", $MouseLoc[0] + 50, $MouseLoc[1] + 3, 1, 1 )
+
MouseClick( "left", $MouseLoc[0] + 50, $MouseLoc[1] + 3, 1, 0 )
 
EndFunc
 
EndFunc
  
Line 53: Line 56:
 
EndFunc
 
EndFunc
 
</pre>
 
</pre>
 +
 +
== Download ==
 +
[[Media:Sithid_PlantWaterMacro.zip]]

Latest revision as of 08:51, 19 March 2009

Simple plant watering hotkey-like macro. Build/Run, switch to atitd, and press alt + w over a plant. Macro acts like a hotkey, clicks the plant, adjusts the cursor, and clicks water.

The Macro

#cs --------------------------------------------------------------------------------------
	
	AutoIt Version 3.2.12.1
	Author:		Sithid
	Date:		07.12.08
	Version:	0.3
	
	Script Function:
	Plant Watering - Automagical

#ce --------------------------------------------------------------------------------------

Opt( "MustDeclareVars", 1 )

Global $Paused = False

HotKeySet( "{ESC}", "Terminate" )
HotKeySet( "{PAUSE}", "TogglePause" )
HotKeySet( "!{w}", "WaterPlant" )

WinWaitActive( "eGenesis Client" )
	
Main()

Func Main()
	Do
		Sleep( 100 )
	Until 1 = 2
EndFunc

Func WaterPlant()
	If $Paused Then
		Return
	EndIf
	
	Local $MouseLoc = MouseGetPos()
	MouseClick( "left", $MouseLoc[0], $MouseLoc[1], 1, 0 )
	Sleep( 100 )
	MouseClick( "left", $MouseLoc[0] + 50, $MouseLoc[1] + 3, 1, 0 )
EndFunc

Func TogglePause()
	$Paused = Not $Paused
			
	While $Paused
		Sleep(100 )
	WEnd
EndFunc

Func Terminate()
		Exit
EndFunc

Download

Media:Sithid_PlantWaterMacro.zip