Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- INSTALLATION (for those who don't know how) :
- --
- -- - Copy to a text editor (Notepad, Notepad++, SciTE, ....)
- -- - Save as Autorun.lua
- -- - Place Autorun.lua to Powder Toy directory OR to scripts folder if you use Script Manager
- -- - Run Powder toy
- -- - Play ! OR if you use Script Manager, enable this mod in the ui
- --
- --
- -- PowderIsFalling Script V4.0
- --
- --
- ----CODE----------------------------------------------------------------------------------------------
- --
- --
- ----ELEMENTS
- --
- -- UPTE {
- local element1 = elements.allocate("PIFMOD", "UPTE")
- elements.element(elements.PIFMOD_PT_UPTE, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(elements.PIFMOD_PT_UPTE, "Name", "UPTE")
- elements.property(elements.PIFMOD_PT_UPTE, "Description", "Unidentified-Powder-Toy-Element. Try it yourself.")
- elements.property(elements.PIFMOD_PT_UPTE, "Colour", 0xffffff)
- elements.property(elements.PIFMOD_PT_UPTE, "MenuSection", 8)
- elements.property(elements.PIFMOD_PT_UPTE, "Gravity", 1)
- elements.property(elements.PIFMOD_PT_UPTE, "Loss", 0.8)
- elements.property(elements.PIFMOD_PT_UPTE, "AirLoss", 0.01)
- elements.property(elements.PIFMOD_PT_UPTE, "AirDrag", 0)
- elements.property(elements.PIFMOD_PT_UPTE, "Advection", 0.5)
- elements.property(elements.PIFMOD_PT_UPTE, "Weight", 5)
- elements.property(elements.PIFMOD_PT_UPTE, "Diffusion", 0.5)
- --elements.property(elements.PIFMOD_PT_UPTE, "Properties", PROP_nil_nil)
- --elements.property(elements.PIFMOD_PT_UPTE, "Properties", PROP_nil_nil_nil)
- -- UPTE }
- --
- -- BREZ {
- local element1 = elements.allocate("PIFMOD", "BREZ")
- elements.element(elements.PIFMOD_PT_BREZ, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(elements.PIFMOD_PT_BREZ, "Name", "BREZ")
- elements.property(elements.PIFMOD_PT_BREZ, "Description", "BREEZE element. Freeze the surroundings.")
- elements.property(elements.PIFMOD_PT_BREZ, "Colour", 0xbebeff)
- elements.property(elements.PIFMOD_PT_BREZ, "MenuSection", 8)
- elements.property(elements.PIFMOD_PT_BREZ, "Gravity", 0)
- elements.property(elements.PIFMOD_PT_BREZ, "Loss", 0.2)
- elements.property(elements.PIFMOD_PT_BREZ, "AirLoss", 0)
- elements.property(elements.PIFMOD_PT_BREZ, "AirDrag", 0)
- elements.property(elements.PIFMOD_PT_BREZ, "Advection", 0.2)
- elements.property(elements.PIFMOD_PT_BREZ, "Weight", 0)
- elements.property(elements.PIFMOD_PT_BREZ, "Diffusion", 0.2)
- --elements.property(elements.PIFMOD_PT_UPTE, "Properties", PROP_nil_nil)
- --elements.property(elements.PIFMOD_PT_UPTE, "Properties", PROP_nil_nil_nil)
- -- BREZ }
- --
- -- CHIL {
- local element1 = elements.allocate("PIFMOD", "CHIL")
- elements.element(elements.PIFMOD_PT_CHIL, elements.element(elements.DEFAULT_PT_PHOT))
- elements.property(elements.PIFMOD_PT_CHIL, "Name", "CHIL")
- elements.property(elements.PIFMOD_PT_CHIL, "Description", "CHILL element. Very cold element. It weaken the life force of the surroundings.")
- elements.property(elements.PIFMOD_PT_CHIL, "Colour", 0xdfdfff)
- --elements.property(elements.PIFMOD_PT_CHIL, "MenuSection", 8)
- --elements.property(elements.PIFMOD_PT_CHIL, "Gravity", 0)
- --elements.property(elements.PIFMOD_PT_CHIL, "Loss", 0.2)
- --elements.property(elements.PIFMOD_PT_CHIL, "AirLoss", 0)
- --elements.property(elements.PIFMOD_PT_CHIL, "AirDrag", 0)
- --elements.property(elements.PIFMOD_PT_CHIL, "Advection", 0.2)
- --elements.property(elements.PIFMOD_PT_CHIL, "Weight", 0)
- --elements.property(elements.PIFMOD_PT_CHIL, "Diffusion", 0.2)
- --elements.property(elements.PIFMOD_PT_UPTE, "Properties", PROP_nil_nil)
- --elements.property(elements.PIFMOD_PT_UPTE, "Properties", PROP_nil_nil_nil)
- -- CHIL }
- --
- -- VIRS {
- local element1 = elements.allocate("PIFMOD", "VIRS")
- elements.element(elements.PIFMOD_PT_VIRS, elements.element(elements.DEFAULT_PT_GAS))
- elements.property(elements.PIFMOD_PT_VIRS, "Name", "VIRS")
- elements.property(elements.PIFMOD_PT_VIRS, "Description", "Virus!")
- elements.property(elements.PIFMOD_PT_VIRS, "Colour", 0xff9c9c)
- elements.property(elements.PIFMOD_PT_VIRS, "MenuSection", 6)
- elements.property(elements.PIFMOD_PT_VIRS, "Gravity", 0)
- --elements.property(elements.PIFMOD_PT_VIRS, "Loss", nil)
- --elements.property(elements.PIFMOD_PT_VIRS, "AirLoss", nil)
- --elements.property(elements.PIFMOD_PT_VIRS, "AirDrag", nil)
- --elements.property(elements.PIFMOD_PT_VIRS, "Advection", nil)
- elements.property(elements.PIFMOD_PT_VIRS, "Weight", 0)
- --elements.property(elements.PIFMOD_PT_VIRS, "Diffusion", nil)
- elements.property(elements.PIFMOD_PT_VIRS, "Properties", PROP_LIFE_DEC)
- elements.property(elements.PIFMOD_PT_VIRS, "Properties", PROP_LIFE_KILL_DEC)
- -- VIRS }
- --
- ----FUNCTIONS
- --
- -- UPTE {
- function upte(i, x, y, s, n)
- tpt.set_property("temp", 90000, x, y)
- tpt.create(x+1, y+1, "bray")
- tpt.create(x-1, y-1, "bray")
- tpt.create(x+1, y-1, "bray")
- tpt.create(x-1, y+1, "bray")
- end
- -- UPTE }
- --
- -- BREZ {
- function brez(i, x, y, s, n)
- -- Create Flames And Set Life
- tpt.create(x+1, y+1, "cflm")
- tpt.create(x-1, y-1, "cflm")
- tpt.create(x+1, y-1, "cflm")
- tpt.create(x-1, y+1, "cflm")
- tpt.set_property("life", 90, x+1, y+1)
- tpt.set_property("life", 90, x-1, y-1)
- tpt.set_property("life", 90, x+1, y-1)
- tpt.set_property("life", 90, x-1, y+1)
- -- Self property set
- tpt.set_property("temp", -273, x, y)
- -- | TEMP SET FOR SURROUNDINGS | --
- xx = {1,-1,1,-1,0,0,1,-1,2,-2,2,-2,2,-2,1,-1,2,-2,1,-1,0,0,2,-2}
- yy = {1,-1,-1,1,1,-1,0,0,2,-2,-2,2,1,-1,2,-2,-1,1,-2,2,2,-2,0,0}
- for i = 1, 24 do
- tpt.set_property("temp", -273, x+xx[i], y+yy[i])
- end
- end
- -- BREZ }
- --
- -- SETT {
- function set(xt, yt, bt, et)
- if et == 2 and xt < 613 and yt < 384 then
- at = tpt.get_property("type", xt, yt)
- if at == tpt.el.wifi.id then
- ct = tpt.input("WIFI Setting", "Type the channel (1 - 900)")
- if tonumber(ct) == nil then
- tpt.log("Cancelled.")
- tpt.delete(xt, yt)
- else
- gt = tonumber(ct)+273.15
- tpt.set_property("temp", gt, x, y)
- end
- end
- end
- if et == 2 and xt < 613 and yt < 384 then
- at = tpt.get_property("type", xt, yt)
- if at == tpt.el.prto.id then
- ct = tpt.input("PRTO Setting", "Type the channel (1 - 900)")
- if tonumber(ct) == nil then
- tpt.log("Cancelled.")
- tpt.delete(xt, yt)
- else
- gt = tonumber(ct)+273.15
- tpt.set_property("temp", gt, x, y)
- end
- end
- end
- if et == 2 and xt < 613 and yt < 384 then
- at = tpt.get_property("type", xt, yt)
- if at == tpt.el.prti.id then
- ct = tpt.input("PRTI Setting", "Type the channel (1 - 900)")
- if tonumber(ct) == nil then
- tpt.log("Cancelled.")
- tpt.delete(xt, yt)
- else
- gt = tonumber(ct)+273.15
- tpt.set_property("temp", gt, x, y)
- end
- end
- end
- end
- -- SETT }
- --
- -- CHIL {
- function chil(i, x, y, s, n)
- tpt.set_property("temp", -1000, x, y)
- tpt.create(x+1, y+1, "cflm")
- tpt.create(x-1, y-1, "cflm")
- tpt.create(x+1, y-1, "cflm")
- tpt.create(x-1, y+1, "cflm")
- tpt.set_property("temp", -1000, x+1, y+1)
- tpt.set_property("temp", -1000, x-1, y-1)
- tpt.set_property("temp", -1000, x+1, y-1)
- tpt.set_property("temp", -1000, x-1, y+1)
- tpt.set_property("life", 90, x+1, y+1)
- tpt.set_property("life", 90, x-1, y-1)
- tpt.set_property("life", 90, x+1, y-1)
- tpt.set_property("life", 90, x-1, y+1)
- end
- -- CHIL }
- --
- -- FPSC {
- function keydet(key, keyx, modifier, events)
- if key == "t" then
- answer = tpt.input("Max FPS", "Type new max FPS :")
- if tonumber(answer) == nil then
- tpt.log("Cancelled.")
- else
- tpt.setfpscap(tonumber(answer))
- end
- end
- end
- -- FPSC }
- --
- -- VIRS {
- function v_spread(i, x, y, s, n)
- tick1 = math.random(1, 10)
- if tick1 == 1 then
- xxx = {1,-1,1,-1,1,0,-1,0}
- yyy = {1,-1,-1,1,0,1,0,-1}
- for l = 1, 8 do
- tpt.set_property("type", "VIRS", x+xxx[l], y+yyy[l])
- end
- end
- tick2 = math.random(1, 100)
- if tick2 == 50 then
- tpt.delete(x, y)
- end
- end
- -- VIRS }
- --
- ----FUNCTION SETS
- --
- -- UPTE {
- tpt.element_func(upte, elements.PIFMOD_PT_UPTE)
- -- UPTE }
- --
- -- BREZ {
- tpt.element_func(brez, elements.PIFMOD_PT_BREZ)
- -- BREZ }
- --
- -- WIFI {
- tpt.register_mouseclick(set)
- -- WIFI }
- --
- -- CHIL {
- tpt.element_func(chil, elements.PIFMOD_PT_CHIL)
- -- CHIL }
- --
- -- FPSC {
- tpt.register_keypress(keydet)
- -- FPSC }
- --
- -- VIRS {
- tpt.element_func(v_spread, elements.PIFMOD_PT_VIRS)
- -- VIRS }
- --
- ----END-OF-CODE---------------------------------------------------------------------------------------
- --
- -- Thanks for using this script!
- --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement