Skip to content

Instantly share code, notes, and snippets.

@Specnr
Last active July 12, 2021 17:09
Show Gist options
  • Save Specnr/1ead481c2838ca79e96381dd9bc6bd72 to your computer and use it in GitHub Desktop.
Save Specnr/1ead481c2838ca79e96381dd9bc6bd72 to your computer and use it in GitHub Desktop.
SRG Macro
; Made by Specnr
#NoEnv
SavesDirectory = C:\Users\Spencer\AppData\Roaming\.minecraft\saves\ ; Replace this with your minecraft saves
SetWorkingDir %SavesDirectory%
global delay := 36 ; Frame delay (1 frame = 16.66, round up to be safe)
SetKeyDelay, 0
IfNotExist, %SavesDirectory%
msgBox, Please set your saves directory!!!
IfNotExist, %SavesDirectory%_oldWorlds
FileCreateDir, %SavesDirectory%_oldWorlds
CreateWorld()
{
Loop, Files, %SavesDirectory%*, D
{
_Check := SubStr(A_LoopFileName,1,1)
If (_Check != "_")
{
FileMoveDir, %SavesDirectory%%A_LoopFileName%, %SavesDirectory%_oldWorlds\%A_LoopFileName%_%A_NowUTC%, R
}
}
SetKeyDelay, 10
send {Tab}{Enter}
SetKeyDelay, delay
send {Tab}{Enter}
SetKeyDelay, 10
send {Tab}{Tab}{Enter}{Tab}{Tab}{Enter}{Enter}{Enter}{Shift down}{Tab}
SetKeyDelay, delay
send {Tab}{Enter}{Shift up}
}
ExitWorld()
{
SetKeyDelay, 0
send {Esc}{Shift}+{Tab}{Enter}
SetKeyDelay, delay
}
OpenToLAN() {
SetKeyDelay, delay
send {Esc}
send {Shift down}
send {Tab}{Tab}{Enter}{Tab}{Enter}
send {Shift up}
send {Tab}{Enter}
send {F3 down}{N down}{F3 up}{N up}
}
MakeNetherPortal() {
Send, {t}
Sleep, 100
Send, {/}
Send, setblock
Send, {Space}{~}{Space}{~}{Space}{~}{Space}
Send, minecraft:nether_portal
Sleep, 100
Send, {Enter}
}
LocateStructure(structure) {
Send, {t}
Sleep, 100
Send, {/}
Send, locate
Send, {Space}
Send %structure%
Sleep, 100
Send, {Enter}
}
GetCords() {
Send, {F3 down}{C down}{F3 up}{C up}
sleep, 100
coords := StrSplit(clipboard, " ")
X := Round(coords[7], 2)
Y := Round(coords[8], 2)
Z := Round(coords[9], 2)
clipboard = %X% %Y% %Z%
}
GetBlindCoords() {
GetCords()
coords := StrSplit(clipboard, " ")
X := Round(coords[1] / 8, 2)
Y := Round(coords[2], 2)
Z := Round(coords[3] / 8, 2)
clipboard = %X% %Y% %Z%
}
GoToBlindCoords() {
GetBlindCoords()
Send, {t}
Sleep, 100
Send, {/}
Send, execute in minecraft:the_nether run tp @s %clipboard%
Sleep, 100
Send, {Enter}
}
#IfWinActive, Minecraft
{
U:: ; Resetting
WinGetPos, X, Y, W, H, Minecraft
WinGetActiveTitle, Title
IfNotInString Title, player
CreateWorld()
else {
ExitWorld()
Loop {
IfWinActive, Minecraft
{
PixelSearch, Px, Py, 0, 0, W, H, 0x00FCFC, 1, Fast
if (!ErrorLevel) {
IfWinActive, Minecraft
{
CreateWorld()
break
}
}
}
}
}
return
`;:: OpenToLAN() ; Open to LAN and spec mode
Up:: ; Locate burred treasure
LocateStructure("buried_treasure")
return
Left:: ; Locate bastion
LocateStructure("bastion_remnant")
return
Right:: ; Locate fortress
LocateStructure("fortress")
return
Down:: ; Locate stronghold
LocateStructure("stronghold")
return
,:: GetCords() ; F3+C & translate to just x,y,z
.:: GetBlindCoords() ; Calculates & copies blind coords
>:: GoToBlindCoords() ; Calculates, copies & teleports player to blind coords
<:: MakeNetherPortal() ; Setblock nether portal
}
@Specnr
Copy link
Author

Specnr commented Jul 12, 2021

They made this illegal a day after I made it OMEGALULiguess

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment