Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #RequireAdmin
- #include <TrayConstants.au3>
- #include <Misc.au3>
- HotKeySet("{ESC}", "Terminate") ; Terminates script using [escape]
- HotKeySet("{RIGHT}", "Forward") ; Increments y coordinate by 1 (0,143) using [right arrow]
- HotKeySet("{LEFT}", "Backward") ; Decrements y coordinate by 1 (0,143) using [left arrow]
- HotKeySet("{UP}", "Up") ; Increments x coordinate by 1 [no limits] using [up arrow]
- HotKeySet("{DOWN}", "Down") ; Decrements x coordinate by 1 [no limits] using [down arrow]
- HotKeySet("{w}", "TerrainUp") ; Increment Terrain type (1, 2, 4, 8 ...) using [w]
- HotKeySet("{s}", "TerrainDown") ; Decrement Terrain type (4, 2, 1, f512 ...) using [s]
- Local $xx = 0
- Local $yy = 0
- WinActivate("???????????") ; Focus on Terrain Obstacles program
- WinWaitActive("???????????") ; Wait for Terrain Obstacles program to be active
- ControlCommand("","","[Class:TCheckBox; INSTANCE:1]","Check") ; Automatically turn on grid
- ControlSetText("","","[CLASS:TEdit; INSTANCE:2]",$xx) ; Set X coordinate
- ControlSetText("","","[CLASS:TEdit; INSTANCE:3]",$yy) ; Set Y coordinate
- Local $CurrentTerrain = 0
- Local $TerrainArray[19] = ["1","2","4","8","16","32","64","128","256","f1","f2","f4","f8","f16","f32","f64","f128","f256","f512"]
- ControlSetText("","","[CLASS:TEdit; INSTANCE:1]",$TerrainArray[$CurrentTerrain]) ; Set terrain to dirt
- ControlClick("","","[CLASS:TButton; INSTANCE:1]"); Generate Terrain
- While True
- ToolTip('w,s to change terrain type' & @CRLF & 'Arrow keys to move around' & @CRLF & 'ESC to terminate',0,0, 'HELP')
- sleep (10000)
- WEnd
- Func Terminate()
- Exit 0
- EndFunc
- Func Forward()
- $yy = $yy+1
- If $yy > 143 Then
- $yy = 0
- $xx = $xx+1
- EndIf
- If $xx > 143 Then
- $xx = 0
- EndIf
- ControlSetText("","","[CLASS:TEdit; INSTANCE:2]",$xx)
- ControlSetText("","","[CLASS:TEdit; INSTANCE:3]",$yy)
- ControlClick("","","[CLASS:TButton; INSTANCE:1]")
- EndFunc
- Func Backward()
- $yy = $yy-1
- If $yy < 0 Then
- $yy = 143
- $xx = $xx-1
- EndIf
- If $xx < 0 Then
- $xx = 143
- EndIf
- ControlSetText("","","[CLASS:TEdit; INSTANCE:2]",$xx)
- ControlSetText("","","[CLASS:TEdit; INSTANCE:3]",$yy)
- ControlClick("","","[CLASS:TButton; INSTANCE:1]")
- EndFunc
- Func Up()
- $xx = $xx+1
- If $xx > 143 Then
- $xx = 0
- $yy = $yy+1
- EndIf
- If $yy > 143 Then
- $yy = 0
- EndIf
- ControlSetText("","","[CLASS:TEdit; INSTANCE:2]",$xx)
- ControlSetText("","","[CLASS:TEdit; INSTANCE:3]",$yy)
- ControlClick("","","[CLASS:TButton; INSTANCE:1]")
- EndFunc
- Func Down()
- $xx = $xx-1
- If $xx < 0 Then
- $xx = 143
- $yy = $yy-1
- EndIf
- If $yy < 0 Then
- $yy = 143
- EndIf
- ControlSetText("","","[CLASS:TEdit; INSTANCE:2]",$xx)
- ControlSetText("","","[CLASS:TEdit; INSTANCE:3]",$yy)
- ControlClick("","","[CLASS:TButton; INSTANCE:1]")
- EndFunc
- Func TerrainUp()
- If $CurrentTerrain = 18 Then
- $CurrentTerrain = 0
- Else
- $CurrentTerrain = $CurrentTerrain+1
- EndIf
- ControlSetText("","","[CLASS:TEdit; INSTANCE:1]",$TerrainArray[$CurrentTerrain])
- ControlClick("","","[CLASS:TButton; INSTANCE:1]")
- EndFunc
- Func TerrainDown()
- If $CurrentTerrain = 0 Then
- $CurrentTerrain = 18
- Else
- $CurrentTerrain = $CurrentTerrain-1
- EndIf
- ControlSetText("","","[CLASS:TEdit; INSTANCE:1]",$TerrainArray[$CurrentTerrain])
- ControlClick("","","[CLASS:TButton; INSTANCE:1]")
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement