Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not partTerm then
- if not (fs.exists("partTerm") or fs.exists(shell.resolve("partTerm"))) then
- shell.run("pastebin get hR8p9ML4 partTerm")
- os.loadAPI(shell.resolve("partTerm"))
- else os.loadAPI(fs.exists("partTerm") and "partTerm" or shell.resolve("partTerm")) end
- end
- partTerm.removeAll()
- partTerm.setDensity(30)
- local bombHead = {"aaeeeaa", "a00000a", "0444440", "04f4f40", "04f4f40", "04f4f40", "0444440", "a00000a"}
- local bombBody = {"a8bbb8a", "eaf1fae", "aabbbaa", "aa8a8aa", "aa8a8aa", "aaeaeaa"}
- local x, y, z = commands.getBlockPosition()
- x, y, z = x + 0.5, y + 0.5, z + 0.5 -- 'cause we're interested in the center of the block.
- local headWin = partTerm.createWindow(x, y + 2.5, z, 7, 8, colours.purple)
- local bodyWin = partTerm.createWindow(x, y + 1.1, z, 7, 6, colours.purple)
- for i = 1, 8 do
- headWin.setCursorPos(1, i)
- headWin.blit(nil, nil, bombHead[i])
- end
- for i = 1, 6 do
- bodyWin.setCursorPos(1, i)
- bodyWin.blit(nil, nil, bombBody[i])
- end
- headWin.setParticle("reddust")
- parallel.waitForAny(
- function()
- while true do
- local state, result = commands.tp("@p ~ ~ ~")
- if state then
- -- Match taken from: http://www.computercraft.info/forums2/index.php?/topic/24581-command-utils-get-players-coordinates-and-more/
- local pX, pY, pZ = result[1]:match( "Teleported %S+ to (.?%d+%.?%d*),(.?%d+%.?%d*),(.?%d+%.?%d*)" )
- local rotHori = partTerm.getHorizontalAngle(x, z, pX, pZ) + 90
- local rotVert = partTerm.getVerticalAngle(x, y, z, pX, pY, pZ) - 90
- headWin.setAngles(rotHori, rotVert)
- bodyWin.setAngles(rotHori, 0)
- end
- sleep(0.5)
- end
- end,
- partTerm.render
- )
Add Comment
Please, Sign In to add comment