Skip to content

Instantly share code, notes, and snippets.

@onvo1
Last active August 16, 2023 18:20
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save onvo1/90365dcc00b3fdffc3eeccb57fc705f1 to your computer and use it in GitHub Desktop.
Save onvo1/90365dcc00b3fdffc3eeccb57fc705f1 to your computer and use it in GitHub Desktop.
Minecraft Auto Reset
;
; Minecraft Reset Script v1.1
; Author: onvo
;
; Script Function:
; The following only apply inside the Minecraft window:
; 1) When on the title screen, the "Y" key will create a world on Easy
; 2) After loading in the world, "Y" will exit the world and then auto create another world on Easy
; 3) To just exit the world and not auto create world, press "U" on keyboard.
; 4) To change the "Y" and "U", change the keys before the double colon "::" and reload the script
#NoEnv
SetWorkingDir %A_ScriptDir%
DELAY = 1 ; Set this to 0 for no delay, set this to 1 for delay between key presses
if DELAY
SetKeyDelay , 70 ; Change this value to increase delay between key presses
else {
SendMode Input
}
CreateWorld()
{
send {Tab}{Enter}{Tab}{Tab}{Tab}{Enter}{Tab}{Tab}{Enter}{Enter}{Enter}{Tab}{Tab}{Tab}{Tab}{Tab}{Enter}
}
ExitWorld()
{
send {Esc}+{Tab}{Enter}
}
#IfWinActive, Minecraft
{
Y::
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) {
Sleep, 100
IfWinActive, Minecraft
{
CreateWorld()
break
}
}
}
}
}
return
U::
ExitWorld()
return
J::
WinGetActiveTitle, Title
IfNotInString Title, player
{
IfWinActive, Minecraft
{
CreateWorld()
}
}
return
}
@onvo1
Copy link
Author

onvo1 commented Feb 27, 2021

To run:

  1. Install https://www.autohotkey.com/download/ahk-install.exe
  2. Install https://gist.github.com/onvo1/90365dcc00b3fdffc3eeccb57fc705f1
    save file as MinecraftAutoResetRSG.ahk
  3. Right click file and click "Run script" or just Left click

To turn off:

  1. Look in bottom right for the "H" icon
  2. Right click press "Exit"

@CodyNinja1
Copy link

it does not work, whenever i press y it does nothing.

@Cre3pa
Copy link

Cre3pa commented May 2, 2021

it always says Error at line 1.

Line Text: PK I have no clue how tf to write down that
Error: this like does not contain a recognized action

The program will exit.

@Muretes4
Copy link

it always says Error at line 1.

Line Text: PK I have no clue how tf to write down that
Error: this like does not contain a recognized action

The program will exit.
It happens to me too

@BrentRosen
Copy link

BrentRosen commented May 22, 2021

What would I have to add to the script in order to have it turn on the keep inventory under world settings?

@Moki420
Copy link

Moki420 commented Jul 21, 2021

What would I have to add to the script in order to have it turn on the keep inventory under world settings?

Keep Inventory isn't allowed

@TwoPolaar
Copy link

Where should I extract the file given on the first link?

@PagManImPagging
Copy link

can you make your macro change world names?

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