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/Bricks/Code"
From A Tale in the Desert
< User:Cegaiel | Macros | Bricks
Jump to navigationJump to search (New page: <pre> ;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 ^!w:: ;Explanation of Seco...) |
|||
| (6 intermediate revisions by the same user not shown) | |||
| Line 3: | Line 3: | ||
;The AHK icon in system tray will turn red while paused. | ;The AHK icon in system tray will turn red while paused. | ||
;Ctrl+R to reload script | ;Ctrl+R to reload script | ||
| + | ;Date 3/17/2010 | ||
| + | ;Last Update: 11/14/2010 - Made all GUI's appear on upper left corner, so you do not need to drag out of way, anymore. | ||
| − | |||
| − | |||
| − | |||
;Explanation of Seconds variable below: | ;Explanation of Seconds variable below: | ||
| Line 20: | Line 19: | ||
| − | ;About | + | ;About 32s for 6 racks |
| − | ;About | + | ;About 28s for 20 racks |
| + | ; ? About 25s for 25 racks | ||
| + | ; ? About 16s for 48 racks | ||
| − | Seconds = | + | Seconds = 29 |
| Line 37: | Line 38: | ||
Gui, Add, DropDownList, vBrick Choose1, Bricks|Firebricks|Clay Bricks | Gui, Add, DropDownList, vBrick Choose1, Bricks|Firebricks|Clay Bricks | ||
Gui, Add, Button, gRecord, GO | Gui, Add, Button, gRecord, GO | ||
| − | Gui, Show | + | Gui, Show, x0 y25 |
return | return | ||
| Line 62: | Line 63: | ||
Gui, Add, Button, default gMineSetLoops, OK | Gui, Add, Button, default gMineSetLoops, OK | ||
| − | Gui, Show | + | Gui, Show, x0 y25 |
MineNum = 0 | MineNum = 0 | ||
| Line 114: | Line 115: | ||
Gui, Add, Text, vMineCycleText, 5 seconds to drag window out of way | Gui, Add, Text, vMineCycleText, 5 seconds to drag window out of way | ||
Gui, Font, norm | Gui, Font, norm | ||
| − | Gui, Show | + | Gui, Show, x0 y25 |
GuiControl, Text, MineCycleText, 5 seconds to drag window out of way | GuiControl, Text, MineCycleText, 5 seconds to drag window out of way | ||
| − | + | Delay = 5 | |
| + | ;You got 5 seconds to drag the status window out of the way | ||
| + | Loop, %Delay% | ||
| + | { | ||
| + | GuiControl, Text, MineCycleText, %Delay%s to drag window out of way | ||
| + | Delay -- | ||
| + | Sleep 1000 | ||
| + | } | ||
| + | |||
| + | |||
| + | |||
| + | SetDefaultMouseSpeed, 0 | ||
| + | |||
loop, %NumPulls% | loop, %NumPulls% | ||
| Line 138: | Line 151: | ||
MinePosY := MineY%MineNum% | MinePosY := MineY%MineNum% | ||
MouseMove, %MinePosX%, %MinePosY%, 0 | MouseMove, %MinePosX%, %MinePosY%, 0 | ||
| − | + | sleep 100 | |
Send {%Bricks%} | Send {%Bricks%} | ||
| − | Sleep, | + | Sleep, 100 |
MineNum++ | MineNum++ | ||
} | } | ||
| − | MouseMove, %OldMX%, %OldMY%, 0 | + | MouseMove, %OldMX%, %OldMY%, 0 |
SecondsCountDown := Seconds | SecondsCountDown := Seconds | ||
| Line 152: | Line 165: | ||
GuiControl, Text, MineCycleText, Waiting %SecondsCountdown%s for bricks to complete | GuiControl, Text, MineCycleText, Waiting %SecondsCountdown%s for bricks to complete | ||
SecondsCountdown := SecondsCountdown - 1 | SecondsCountdown := SecondsCountdown - 1 | ||
| − | + | sleep 1000 | |
} | } | ||
| Line 171: | Line 184: | ||
Sleep, 100 | Sleep, 100 | ||
Send {T} | Send {T} | ||
| − | Sleep, | + | Sleep, 100 |
MineNum++ | MineNum++ | ||
} | } | ||
| Line 190: | Line 203: | ||
return | return | ||
} | } | ||
| + | |||
| + | ^r::reload | ||
| + | ^p::Pause | ||
</pre> | </pre> | ||
Latest revision as of 05:55, 14 November 2010
;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
;Date 3/17/2010
;Last Update: 11/14/2010 - Made all GUI's appear on upper left corner, so you do not need to drag out of way, anymore.
;Explanation of Seconds variable below:
;If you find the bricks are getting done slightly late:
;(ie it begins making more bricks before they are done), then add 1 second at a time, below
;If you find the bricks are forming before the timer is done,
;(ie there is 1 or more seconds remaining on timer when bricks get done) then decrease 1 second at a time
;It takes about 33 seconds for the bricks to form, but the time it takes from when the first rack is loaded
;until the time the last one is loaded is the reason that time varies
;About 32s for 6 racks
;About 28s for 20 racks
; ? About 25s for 25 racks
; ? About 16s for 48 racks
Seconds = 29
IfWinExist eGenesis Client
{
WinActivate
Gui, Add, Text,, Brick Type:
Gui, Add, DropDownList, vBrick Choose1, Bricks|Firebricks|Clay Bricks
Gui, Add, Button, gRecord, GO
Gui, Show, x0 y25
return
Record:
Gui, Submit
Gui, Destroy
Gui, +AlwaysOnTop +ToolWindow
Gui, Font, bold
Gui, Add, Text, vMineNumText, Set brick rack locations
Gui, Font, norm
Gui, Add, Text,,
( LTrim
Hover and middle-click (Click mouse-wheel) on each rack, one by one,
until you've clicked on all the racks you want to use. Then click the OK button.
(Drag this box out of the way if any racks are hidden)
Make sure you chat is minimized and that your screen is locked (Alt+L)
AFTER setting brick rack locations, Press OK...
)
Gui, Add, Button, default gMineSetLoops, OK
Gui, Show, x0 y25
MineNum = 0
NumPulls = 100
if (Brick == "Bricks") {
Bricks := "B"
} else if (Brick == "Firebricks") {
Bricks := "F"
} else if (Brick == "Clay Bricks") {
Bricks := "C"
}
WinGet, GameWinHandle, ID, eGenesis Client
loop
{
WinActivate
CoordMode, Mouse, Relative
KeyWait, MButton, D
KeyWait, MButton
MouseGetPos, TestX, TestY, WinHandle
if (WinHandle = GameWinHandle)
{
Gosub, MineRecord
}
else
{
Gui, Destroy
break
}
}
return
MineRecord:
MineNum++
MouseGetPos, MineX%MineNum%, MineY%MineNum%
GuiControl, Text, MineNumText, %MineNum% brick racks captured
TotalRacks := MineNum
return
MineSetLoops:
Gui, Submit
Gui, Destroy
Gui, +AlwaysOnTop +ToolWindow
Gui, Font, bold
Gui, Add, Text, vMineCycleText, 5 seconds to drag window out of way
Gui, Font, norm
Gui, Show, x0 y25
GuiControl, Text, MineCycleText, 5 seconds to drag window out of way
Delay = 5
;You got 5 seconds to drag the status window out of the way
Loop, %Delay%
{
GuiControl, Text, MineCycleText, %Delay%s to drag window out of way
Delay --
Sleep 1000
}
SetDefaultMouseSpeed, 0
loop, %NumPulls%
{
MineNum = 1
MouseGetPos, OldMX, OldMY
;Make Bricks Loop
loop, %TotalRacks% {
WinActivate, eGenesis Client
;BlockInput, MouseMove
GuiControl, Text, MineCycleText, Making Bricks - Rack: %MineNum%
MinePosX := MineX%MineNum%
MinePosY := MineY%MineNum%
MouseMove, %MinePosX%, %MinePosY%, 0
sleep 100
Send {%Bricks%}
Sleep, 100
MineNum++
}
MouseMove, %OldMX%, %OldMY%, 0
SecondsCountDown := Seconds
loop, %Seconds% {
GuiControl, Text, MineCycleText, Waiting %SecondsCountdown%s for bricks to complete
SecondsCountdown := SecondsCountdown - 1
sleep 1000
}
MineNum = 1
;Take Bricks
loop, %TotalRacks% {
WinActivate, eGenesis Client
GuiControl, Text, MineCycleText, Taking Bricks - Rack: %MineNum%
MinePosX := MineX%MineNum%
MinePosY := MineY%MineNum%
MouseMove, %MinePosX%, %MinePosY%, 0
Sleep, 100
Send {T}
Sleep, 100
MineNum++
}
GuiControl, Text, MineCycleText, 2s Pause, Hit Ctrl+P to STOP BRICKS
Sleep 2000
}
Gui, Destroy
Gui, Add, Text,, Middle-click on this window to end the script.
Gui, Show
return
}
^r::reload
^p::Pause