![]() Add a line like # -*- coding: utf-8 -*- to your file." Do you know what I`m doing wrong? Then I used Midori to surf to your site, copied the sourcecode, opened IDLE, used "paste" to copy the code, but when I click "Save As" I get the error: "Non-ASCII found, yet no encoding declared. I made a folder home/pi/mcpi/minecraft-clock and copied all the files from the mcpi folder (like event.pyc, until.py etc.) into it. First of all I have to tell you that I don`t know much about programming, especially in linux/python.Īllright, so here`s what I already figured out:īut know I want to do more and therefore I tried to install your program, but I`m stuck. UpdateTime(mc, clockCentre, lastTime, nowTime)Īfter spending several hours trying to figure out on my own how to run this program, I now ask for your help. Mc.postToChat("Hi, Minecraft Analogue Clock, time.sleep(2)ĭrawClock(mc, clockCentre, radius, lastTime) #Post a message to the minecraft chat window # - minecraft needs to be running and in a game #Connect to minecraft by creating the minecraft object #function to update the time on the clockĭef updateTime(mc, clockCentre, lastTime, time):ĭrawHourHand(mc, clockCentre, lastTime.hour, lastTime.minute, block.AIR)ĭrawMinuteHand(mc, clockCentre, lastTime.minute, block.AIR)ĭrawSecondHand(mc, clockCentre, cond, block.AIR) SecondHandEnd = findPointOnCircle(clockCentre.x, clockCentre.y, 20.0, angle)ĭrawLine(mc, clockCentre.x, clockCentre.y, clockCentre.z + 1, secondHandEnd, secondHandEnd, blockType)ĭef drawClock(mc, clockCentre, radius, time):ĭrawCircle(mc, clockCentre.x, clockCentre.y, clockCentre.z, radius, blockType)ĭrawHourHand(mc, clockCentre, time.hour, time.minute, block.DIRT)ĭrawMinuteHand(mc, clockCentre, time.minute, block.STONE)ĭrawSecondHand(mc, clockCentre, cond, block.WOOD_PLANKS) MinuteHandEnd = findPointOnCircle(clockCentre.x, clockCentre.y, 18.0, angle)ĭrawLine(mc, clockCentre.x, clockCentre.y, clockCentre.z, minuteHandEnd, minuteHandEnd, blockType)ĭef drawSecondHand(mc, clockCentre, seconds, blockType): HourHandEnd = findPointOnCircle(clockCentre.x, clockCentre.y, 10.0, angle)ĭrawLine(mc, clockCentre.x, clockCentre.y, clockCentre.z - 1, hourHandEnd, hourHandEnd, blockType)ĭef drawMinuteHand(mc, clockCentre, minutes, blockType): Y = cy + s(math.radians(angle)) * radiusĭef drawHourHand(mc, clockCentre, hours, minutes, blockType):Īngle = getAngleForHand(int((hours * 5) + (minutes * (5.0/60.0)))) X = cx + math.sin(math.radians(angle)) * radius If steep: mc.setBlock(y, x, z, blockType)ĭef findPointOnCircle(cx, cy, radius, angle): Mc.setBlock(x0 - y, y0 - x, z, blockType)ĭef drawLine(mc, x, y, z, x2, y2, blockType): Mc.setBlock(x0 + y, y0 - x, z, blockType) Mc.setBlock(x0 - y, y0 + x, z, blockType) Mc.setBlock(x0 + y, y0 + x, z, blockType) Mc.setBlock(x0 - x, y0 - y, z, blockType) Mc.setBlock(x0 + x, y0 - y, z, blockType) Mc.setBlock(x0 - x, y0 + y, z, blockType) Mc.setBlock(x0 + x, y0 + y, z, blockType) Mc.setBlock(x0 - radius, y0, z, blockType) Mc.setBlock(x0 + radius, y0, z, blockType) Mc.setBlock(x0, y0 - radius, z, blockType) Mc.setBlock(x0, y0 + radius, z, blockType) #import the minecraft.py module from the minecraft directoryĭef drawCircle(mc, x0, y0, z, radius, blockType):
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |