Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Physics Mod
- --Please use cracker64's script manager
- --VER 0.0 UPDATE http://pastebin.com/raw.php?i=2ZZEtzu5
- --Version 0
- function DrawHUD()
- function mouseclicky(mousex, mousey, button, event)
- if (event == 1) then
- var5 = 1
- end
- if (event == 2) then
- var5 = 2
- end
- end
- function keyclicky(key, nkey, modifier, event)
- if (key == "." and event == 1) then
- var6 = 1
- else
- var6 = 2
- end
- if (key == "," and event == 1) then
- var7 = 1
- else
- var7 = 2
- end
- if (key == "z" and event == 1) then
- var8 = 1
- else
- var8 = 2
- end
- if (key == "=" and event == 1) then
- var10 = 1
- end
- if (key == "-" and event == 1) then
- var10 = 2
- end
- if (key == "m" and event == 1) then
- var13 = 1
- end
- end
- -- if var13 == 1 and tpt.get_name() == "Amy" then
- -- print("Valid.")
- -- var14 = 1
- -- end
- if var14 == 1 then
- tardis = 1
- else
- tardis = 0
- end
- tpt.register_keypress(keyclicky)
- tpt.register_mouseclick(mouseclicky)
- if var7 == 1 then
- var9 = 1
- end
- if var6 == 1 then
- var9 = 2
- end
- if var9 == 1 then
- rect = graphics.drawText
- draw = graphics.fillRect
- var10 = 2
- var8 = 1
- else
- rect = graphics.fillRect
- draw = graphics.drawText
- end
- if var10 == 1 then
- draw1 = graphics.drawText
- rect1 = graphics.fillRect
- else
- draw1 = graphics.fillRect
- rect1 = graphics.drawText
- end
- if var8 ~= 1 then
- draw2 = graphics.drawText
- else
- draw2 = graphics.fillRect
- end
- if tpt.mousex >= 611 then
- x2 = 611
- else
- x2 = tpt.mousex
- end
- if tpt.mousey >= 383 then
- y2 = 383
- else
- y2 = tpt.mousey
- end
- local x, y = sim.adjustCoords(x2, y2)
- if tpt.get_property("type", x, y) >= 1 then
- ptype = tpt.element(tpt.get_property("type", x, y))
- else
- ptype = "Empty,"
- end
- if tpt.get_property("type", x, y) >= 1 then
- var1 = tpt.get_property("temp", x, y)-273.15
- else
- var1 = 293.15
- end
- local var2 = var1*100
- local var3 = math.floor(var2)/100
- if tpt.get_property("type", x, y) >= 1 then
- temp = var3
- else
- temp = "()"
- end
- if tpt.get_property("type", x, y) >= 1 then
- var12312389 = tpt.get_property("ctype", x, y)
- end
- if tpt.get_property("type", x, y) >= 1 and var12312389 >= 0 and var12312389 < sim.PT_NUM then
- ctype = tpt.element(tpt.get_property("ctype", x, y))
- end
- if tpt.get_property("type", x, y) == 0 or tpt.get_property("ctype", x, y) < 1 then
- ctype = "()"
- end
- if x >= 609 then
- x1 = 609/4
- else
- x1 = x/4
- end
- if y >= 381 then
- y1 = 381/4
- else
- y1 = y/4
- end
- local var4 = sim.pressure(x1, y1)*100
- local pressure = math.floor(var4)/100
- local parts = tpt.get_numOfParts()
- if tpt.get_property("type", x, y) >= 1 then
- tmp = tpt.get_property("tmp", x, y)
- else
- tmp = "0"
- end
- if tpt.get_property("type", x, y) >= 1 then
- life = tpt.get_property("life", x, y)
- else
- life = "0"
- end
- if tpt.get_property("type", x, y) >= 1 then
- tmp = tpt.get_property("tmp2", x, y)
- else
- tmp2 = "0"
- end
- if tpt.get_property("type", x, y) >= 1 then
- var11 = tpt.get_property("vy", x, y)*1000
- else
- var11 = 0
- end
- local vy = math.floor(var11)/1000
- if tpt.get_property("type", x, y) >= 1 then
- var12 = tpt.get_property("vx", x, y)*1000
- else
- var12 = 0
- end
- local vx = math.floor(var12)/1000
- rect(398, 13, 187, 12, 55, 55, 55, 200)
- rect(398, 27, 200, 12, 55, 55, 55, 200)
- rect(14, 13, 210, 12, 55, 55, 55, 200)
- rect1(398, 41, 185, 12, 55, 55, 55, 200)
- --{MAY BE USEFUL LATER???}graphics.drawText(6, 6, os.date("%a %b %d, %l:%M:%S %p"), 0, 255, 165, 200)
- draw(16, 15, os.date(), 0, 255, 165, 200)
- draw(550, 30, x, 0, 255, 165, 200)
- draw(578, 30, y, 0, 255, 165, 200)
- draw(541, 30, "X:", 0, 255, 165, 200)
- draw(570, 30, "Y:", 0, 255, 165, 200)
- draw(435, 15, ctype, 0, 255, 165, 200)
- draw(400, 15, ptype, 0, 255, 165, 200)
- draw(558, 15, pressure, 0, 255, 165, 200)
- draw(465, 15, "Temp:", 0, 255, 165, 200)
- draw(465, 30, "Tmp:", 0, 255, 165, 200)
- draw(400, 30, "Life:", 0, 255, 165, 200)
- draw(535, 15, "Pres:", 0, 255, 165, 200)
- draw(160, 15, "Parts:", 0, 255, 165, 200)
- draw(490, 15, temp, 0, 255, 165, 200)
- draw(485, 30, tmp, 0, 255, 165, 200)
- draw(422, 30, life, 0, 255, 165, 200)
- draw(187, 15, parts, 0, 255, 165, 200)
- draw1(400, 44, "Tmp2:", 0, 255, 165, 200)
- draw1(425, 44, tmp2, 0, 255, 165, 200)
- draw1(465, 44, "VX:", 0, 255, 165, 200)
- draw1(535, 44, "VY:", 0, 255, 165, 200)
- draw1(480, 44, vx, 0, 255, 165, 200)
- draw1(550, 44, vy, 0, 255, 165, 200)
- draw2(250, 6, "</> Turn HUD On/Off", 0, 255, 165, 150)
- draw2(250, 16, "-/+ Extra On/Off", 0, 255, 165, 150)
- end
- tpt.hud(0)
- tpt.register_step(DrawHUD)
- tpt.setfpscap(200)
- --Draws starting texts
- print("Physics Mod")
- print("Version 0")
- print("Update 0")
- print("Created by Amy. 100% new programming.")
- print("Contact via amywilsonmaster@gmail.com or http://powdertoy.co.uk")
- --TUNG Mod :D
- function moo(i, x, y, surround_space, nt)
- if sim.pressure(x/4, y/4)<-7 and sim.partProperty(i, sim.FIELD_LIFE)~=0 and surround_space~=0 then
- sim.partCreate(-1, x+math.random(-3,3), y+math.random(-3,3), elem.DEFAULT_PT_ELEC) end
- end
- tpt.element_func(moo, tpt.el.tung.id, 0)
- tpt.el.tung.description="Tungsten. Brittle metal with a very high melting point. When sparked under a pressure of -7, emits electrons."
- --Quarks
- local QURK = elements.allocate("AMY", "QURK")
- elements.element(elements.AMY_PT_QURK, elements.element(elements.DEFAULT_PT_AMTR))
- elements.property(elements.AMY_PT_QURK, "Name", "QURK")
- elements.property(elements.AMY_PT_QURK, "Description", "Quarks. Make up all particles in existance.")
- elements.property(elements.AMY_PT_QURK, "Colour", 0x1E1E1E)
- elements.property(elements.AMY_PT_QURK, "MenuSection", elem.SC_NUCLEAR)
- elements.property(elements.AMY_PT_QURK, "MenuVisible", 1)
- elements.property(elements.AMY_PT_QURK, "Temperature",10000)
- elements.property(elements.AMY_PT_QURK, "Weight", 0)
- --elements.property(elements.AMY_PT_QURK, ")
- --elements.property(elements.AMY_PT_QURK, ")
- local function graphics1(i, colr, colg, colb)
- return 1,0x00010010,255,25,25,25,255,25,25,25
- end
- tpt.graphics_func(graphics1,QURK)
- --Change PROT
- --tpt.el.prot.name="NEUR"
- --tpt.el.prot.description="Neutrinos. Pass through everything."
- --tpt.el.prot.colour="0xFF27FE99"
- --Neutrinos
- local NEUR = elements.allocate("AMY", "NEUR")
- elements.element(elements.AMY_PT_NEUR, elements.element(elements.DEFAULT_PT_NEUT))
- elements.property(elements.AMY_PT_NEUR, "Name", "NEUR")
- elements.property(elements.AMY_PT_NEUR, "Description", "Neutrinos. Pass through everything.")
- elements.property(elements.AMY_PT_NEUR, "Colour", 0x27FE99)
- elements.property(elements.AMY_PT_NEUR, "MenuSection", elem.SC_NUCLEAR)
- elements.property(elements.AMY_PT_NEUR, "MenuVisible", 1)
- elements.property(elements.AMY_PT_NEUR, "Temperature", 0)
- elements.property(elements.AMY_PT_NEUR, "Weight", -10)
- elements.property(elements.AMY_PT_NEUR, "Diffusion", 1)
- --elements.property(elements.AMY_PT_NEUR, "Explosive", 0)
- math.randomseed(os.time())
- function NEUR_update(i, x, y, s, n)
- if tpt.get_property("tmp",i)==0 then
- tpt.parts[i].tmp=1
- randvel=math.random(-20,20)/5
- randvel2=math.random(-20,20)/5
- tpt.parts[i].vx=randvel
- tpt.parts[i].vy=randvel2
- end
- xvel=tpt.parts[i].vx
- yvel=tpt.parts[i].vy
- xpos=x+xvel
- ypos=y+yvel
- --if elemtype == 0 then
- -- tpt.create(xpos,ypos,"neut")
- -- tpt.set_property("temp",5000,xpos,ypos)
- -- end
- if xpos >= 608 then
- tpt.delete(i)
- end
- if ypos >= 380 then
- tpt.delete(i)
- end
- tpt.parts[i].temp=300
- end
- --[[local function Glow(i, colr, colg, colb)
- return 1, 0x00000008
- end
- tpt.graphics_func(Glow, NEUR)]]
- local function graphics1(i, colr, colg, colb)
- return 1,0x00010000,255,39,254,153,255,39,254,153
- end
- tpt.graphics_func(graphics1,NEUR)
- tpt.element_func(NEUR_update, elements.AMY_PT_NEUR,1)
- --39 254 153 255
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement