TL;DR I want to make a script that will teleport me in an ever-widening spiral from the center of a set of 4 bounding coordinates I choose (which can be set in the script file), preferably with the ability to exclude a (likely central) zone so as to aid in resumption after interruption. I'm using AutoHotKey because
A: I use AHK already anyway
B: It is usable in any console (CLI or the default MC server console) or even in single player (assuming cheats are enabled, of course). Which beats out the only script I've seen to date nethergen.sh in part 2 of this Reddit post.
So I have a mod pack (based on the Absque Sole sub-pack of Resonant Rise 3). I added many mods, but the important ones in this case are the Reasonable Realism mods by Draco18s. Not in and of themselves, but because they require Custom Ore Generation. I pre-generate all my worlds to prevent the single worst source of lag during normal play: Chunk Generation.
So most of you unfamiliar with COG at this point are probably wondering what the issue is.
The issue is that my usual methods of pre-generating the world aren't working! Admin Command Toolkit either crashes the world or stops running, and Minecraft Land Generator would take a frankly obscene amount of time to generate a reasonably sized world with some of my mods (yes even pared down to the ones that are REQUIRED for World Generation).
Enter my current AutoHotKey script.
Which methodically goes from the NW corner of the selected grid, teleports with whatever spacing you set, and goes south through the whole series of values, teleports one gap's width to the east and back up at the most northern coordinate, repeating until it hits the X/Z end values.
This works reasonably well, but is extremely inelegant, obnoxious to start/stop, causes some lag when it starts the next "column" of teleports, and also doesn't do very much good if you need to stop in the middle for some reason; the generated terrain is almost certainly nowhere near spawn, and if you have some form of mapping it looks HORRIBLE.
Which is where I'm asking for help. I can conceive of a better method, and the simple steps within which to produce those sets of coordinates to teleport to... I just can't translate that to a working script.
It's simple: a spiral!
You could even probably add the ability to exclude a zone for people that already have some terrain generated, or need to resume at a later date or something. Probably with some if statements like
I'm sure there's a better way to do that, too
Which brings me to the point... anyone able to actually make that script a reality?
If you want to check to see if something is possible http://ahkscript.org/docs/Variables.htm
That page should be all you need, if not this is the base page for the documentation: http://ahkscript.org/docs/AutoHotkey.htm
A: I use AHK already anyway
B: It is usable in any console (CLI or the default MC server console) or even in single player (assuming cheats are enabled, of course). Which beats out the only script I've seen to date nethergen.sh in part 2 of this Reddit post.
So I have a mod pack (based on the Absque Sole sub-pack of Resonant Rise 3). I added many mods, but the important ones in this case are the Reasonable Realism mods by Draco18s. Not in and of themselves, but because they require Custom Ore Generation. I pre-generate all my worlds to prevent the single worst source of lag during normal play: Chunk Generation.
So most of you unfamiliar with COG at this point are probably wondering what the issue is.
The issue is that my usual methods of pre-generating the world aren't working! Admin Command Toolkit either crashes the world or stops running, and Minecraft Land Generator would take a frankly obscene amount of time to generate a reasonably sized world with some of my mods (yes even pared down to the ones that are REQUIRED for World Generation).
Enter my current AutoHotKey script.
Code:
SetKeyDelay 100
Pause::Pause
$HOTKEYGOESHERE::
XStart := -512
ZStart := -512
XEnd := 512
ZEnd := 512
TeleportGap := 64
XCoord := XStart
ZCoord := ZStart
While XCoord <= XEnd
{
While ZCoord <= XEnd
{
Send /tp %XCoord% 256 %ZCoord%{enter}
ZCoord += TeleportGap
Sleep, 2500
}
ZCoord:= ZStart
XCoord+= TeleportGap
}
Return
Which methodically goes from the NW corner of the selected grid, teleports with whatever spacing you set, and goes south through the whole series of values, teleports one gap's width to the east and back up at the most northern coordinate, repeating until it hits the X/Z end values.
This works reasonably well, but is extremely inelegant, obnoxious to start/stop, causes some lag when it starts the next "column" of teleports, and also doesn't do very much good if you need to stop in the middle for some reason; the generated terrain is almost certainly nowhere near spawn, and if you have some form of mapping it looks HORRIBLE.
Which is where I'm asking for help. I can conceive of a better method, and the simple steps within which to produce those sets of coordinates to teleport to... I just can't translate that to a working script.
It's simple: a spiral!
- Start at the center of a given quartet of coordinates.
- Teleport after each math step.
- Increment your X coordinate by the gap amount
- Increment your Z coordinate by the gap amount
- Decrement X by gap amount twice
- Decrement Z by gap amount twice
- Increment X by gap amount thrice
- Increment Z by gap amount thrice
- Repeat, switching increment/decrement every X and increasing the number of times you do so by 1 each switch.
- Stop when you've reached (or exceeded) any two of "start" or "end" coordinates.
You could even probably add the ability to exclude a zone for people that already have some terrain generated, or need to resume at a later date or something. Probably with some if statements like
Code:
If X > XZoneMin
AND X < XZoneMax
AND Z > ZZoneMin
AND Z <ZZoneMax
Skip Teleport Step
else Teleport Step
I'm sure there's a better way to do that, too
Which brings me to the point... anyone able to actually make that script a reality?
If you want to check to see if something is possible http://ahkscript.org/docs/Variables.htm
That page should be all you need, if not this is the base page for the documentation: http://ahkscript.org/docs/AutoHotkey.htm