[Question:] Is this possible with Lua scripting?

  • English

We've posted a status update with some first screenshots of the new terrain generation. There is also a new update available for the Java version!

  • [Question:] Is this possible with Lua scripting?

    I don't know anything about LUA (yet), but I'd like to attempt a script that would use the teleport function to move an admin player sequentially across the map, as a way to discover/uncover/draw the map details.
    Details:
    For ease of use I'm starting with a brand new world, as soon as I enter I'll turn on flying and TP to location 0, 200, 0 (the 200 value can be anything as long as its above the surface). Next I give myself a blank map and from there I want to be able to run a script that will teleport, pause for the world to load, then repeat, until I have a finished map of the terrain for a predetermined number of chunks. An example of how it would uncover one full map page and what it would execute is below, also included are pictures of the first 3 locations being uncovered on the map.

    Display Spoiler

    /tp <player> 48 200 0
    /tp <player> 96 200 0
    /tp <player> 144 200 0
    /tp <player> 192 200 0
    /tp <player> 240 200 0
    /tp <player> 288 200 0
    /tp <player> 336 200 0
    /tp <player> 384 200 0
    /tp <player> 432 200 0
    /tp <player> 480 200 0
    /tp <player> 528 200 0
    /tp <player> 576 200 0
    /tp <player> 624 200 0
    /tp <player> 672 200 0
    /tp <player> 720 200 0
    /tp <player> 48 200 48
    /tp <player> 96 200 48
    /tp <player> 144 200 48
    /tp <player> 192 200 48
    /tp <player> 240 200 48
    /tp <player> 288 200 48
    /tp <player> 336 200 48
    /tp <player> 384 200 48
    /tp <player> 432 200 48
    /tp <player> 480 200 48
    /tp <player> 528 200 48
    /tp <player> 576 200 48
    /tp <player> 624 200 48
    /tp <player> 672 200 48
    /tp <player> 720 200 48
    /tp <player> 48 200 96
    /tp <player> 96 200 96
    /tp <player> 144 200 96
    /tp <player> 192 200 96
    /tp <player> 240 200 96
    /tp <player> 288 200 96
    /tp <player> 336 200 96
    /tp <player> 384 200 96
    /tp <player> 432 200 96
    /tp <player> 480 200 96
    /tp <player> 528 200 96
    /tp <player> 576 200 96
    /tp <player> 624 200 96
    /tp <player> 672 200 96
    /tp <player> 720 200 96
    ...


    Can this be automated into a lua script?

    It would be ideal to be able to start the script and walk away from the computer for a bit while it completes, because one full map page is 240 teleports. If you were to try to sprint to uncover the map it would take you approximately 37.5 minutes on a flat and relatively obstacle free terrain. If you're anything like me I want to have at least 4 full maps worth uncovered, but 16 full maps is really my goal, which ends up being either 3840 teleports, or more than 10 hours of sprinting across flat obstacle free terrain. ;(

    I would really, really like this to work. Is it possible?
    Images
    • starting point.jpg

      953.46 kB, 2,560×1,440, viewed 213 times
    • second teleport.jpg

      740.52 kB, 2,560×1,440, viewed 170 times
    • first teleport.jpg

      955.24 kB, 2,560×1,440, viewed 205 times
  • Yes, that's possible with Lua ;) You could create a timer which changes the position of the player every few seconds. Although I highly recommend to use the new Plugin API instead (which is more powerful and faster in terms of performance), since the Lua API will be discarded very soon (so it will be no longer supported).