[SCRIPT] Map inverter!

Intended for use on live public servers.
1 post Page 1 of 1 First unread post
thepolm3
Scripter
Scripter
Posts: 424
Joined: Sat Feb 16, 2013 10:49 pm


I'M A BACK!
I've just arrived back from my holiday, so what better way to celebrate than with a script!
This script basically inverts maps. So far I've created 3. 3 VERY WIERD maps.
what it does is swaps blocks for air, inverts the colour and then flips the entire thing upside-down.
HAVE FUNFUN!
Code: Select all
"""
thepolm3
THE END IS NIGH
"""

def invertColour(colour):
    r,g,b = colour
    return (255-r,255-g,255-b)

def apply_script(protocol,connection,config):
    class InverterProtocol(protocol):
        def on_map_change(self,map):
            oldmap = map.copy()
            print("Map flipping in process...")
            for x in range(512):
                if x%50==0:
                    print(str(x/5)+"% done")
                for y in range(512):
                    colour = invertColour(map.get_color(x,y,map.get_z(x,y)))
                    for z in range(63):
                        solid = oldmap.get_solid(x,y,z)
                        if solid:
                            map.remove_point(x,y,63-z)
                        else:
                            map.set_point(x,y,63-z,colour)
            print("Map flipping complete.")
            return protocol.on_map_change(self,map)
    return InverterProtocol,connection

Attachments
mapinverter.py
(969 Bytes) Downloaded 183 times
1 post Page 1 of 1 First unread post
Return to “Completed Releases”

Who is online

Users browsing this forum: No registered users and 23 guests