New Script!

  • QuentinADay
    22nd May 2014 Member 0 Permalink
    I am not really sure what to call it...

    local a = elements.allocate("AAA", "QQQQ")
    elements.element(elements.AAA_PT_QQQQ, elements.element(tpt.element("ELEC")))
    elements.property(elements.AAA_PT_QQQQ, "Name", "DNGR")
    elements.property(elements.AAA_PT_QQQQ, "Description", "Dangerous Explosive!")
    elements.property(elements.AAA_PT_QQQQ, "MenuVisible", 1)
    elements.property(elements.AAA_PT_QQQQ, "MenuSection", 5)
    elements.property(elements.AAA_PT_QQQQ, "Colour", FF000000)
    elements.property(elements.AAA_PT_QQQQ, "Advection", 1.0)
    elements.property(elements.AAA_PT_QQQQ, "AirDrag", 0)
    elements.property(elements.AAA_PT_QQQQ, "AirLoss", 0)
    elements.property(elements.AAA_PT_QQQQ, "Loss", 0)
    elements.property(elements.AAA_PT_QQQQ, "Collision", 0)
    elements.property(elements.AAA_PT_QQQQ, "Gravity", 0)
    elements.property(elements.AAA_PT_QQQQ, "Diffusion", 0)
    elements.property(elements.AAA_PT_QQQQ, "Flammable", 0)
    elements.property(elements.AAA_PT_QQQQ, "Explosive", 0)
    elements.property(elements.AAA_PT_QQQQ, "Temperature", 400)
    elements.property(elements.AAA_PT_QQQQ, "Meltable", 0)
    elements.property(elements.AAA_PT_QQQQ, "Hardness", 99999999)
    elements.property(elements.AAA_PT_QQQQ, "Weight", 90)
    elements.property(elements.AAA_PT_QQQQ, "HeatConduct", 100000)
    elements.property(elements.AAA_PT_QQQQ, "Properties", TYPE_ENERGY)

    local function Kk(i,x,y,s,n)
    if math.random(1,100) == 10 then
    tpt.create(x + math.random(-1,1), y + math.random(-1,1), 'WWWW')
    tpt.create(x + math.random(-1,1), y + math.random(-1,1), 'EEEE')
    tpt.create(x + math.random(-1,1), y + math.random(-1,1), 'RRRR')
    tpt.create(x + math.random(-1,1), y + math.random(-1,1), 'YYYY')
    tpt.create(x + math.random(-1,1), y + math.random(-1,1), 'fire')
    tpt.create(x + math.random(-1,1), y + math.random(-1,1), 'plsm')
    end
    end
    tpt.element_func(Kk,a)

    local b = elements.allocate("BBBBBB", "WWWW")
    elements.element(elements.BBBBBB_PT_WWWW, elements.element(elements.DEFAULT_PT_BCOL))
    elements.property(elements.BBBBBB_PT_WWWW, "Name", "WWWW")
    elements.property(elements.BBBBBB_PT_WWWW, "Description", "WWWW")
    elements.property(elements.BBBBBB_PT_WWWW, "Colour", 0xF875447)
    elements.property(elements.BBBBBB_PT_WWWW, "MenuSection", 5)
    elements.property(elements.BBBBBB_PT_WWWW, "Gravity", 0)
    elements.property(elements.BBBBBB_PT_WWWW, "Flammable", 0)
    elements.property(elements.BBBBBB_PT_WWWW, "Explosive", 0)
    elements.property(elements.BBBBBB_PT_WWWW, "Loss", 0.15)
    elements.property(elements.BBBBBB_PT_WWWW, "AirLoss", 0.96)
    elements.property(elements.BBBBBB_PT_WWWW, "AirDrag", 0.03)
    elements.property(elements.BBBBBB_PT_WWWW, "Advection", 0)
    elements.property(elements.BBBBBB_PT_WWWW, "Weight", 32)
    elements.property(elements.BBBBBB_PT_WWWW, "Diffusion", 0)
    elements.property(elements.BBBBBB_PT_WWWW, "Falldown", 0)
    elements.property(elements.BBBBBB_PT_WWWW, "MenuVisible", 0)

    GRBCUpdate = function(i, x, y, s, n)
    local clife = tpt.get_property('life', x, y)
    if clife > 1 then
    for cx = -1, 1, 2 do
    for cy = -1, 1, 2 do
    tpt.create(x + cx, y + cy, 'gbmb')
    end
    end
    tpt.set_property('life', clife - 1, x, y)
    elseif clife == 1 then
    tpt.set_property('type', 0, x, y)
    elseif s > 0 then
    for cx = -1, 1, 2 do
    for cy = -1, 1, 2 do
    if tpt.get_property('type', x + cx, y + cy) == 4 or tpt.get_property('type', x + cx, y + cy) == 49 then
    tpt.set_property('life', 100, x, y)
    return true
    end
    end
    end
    end
    end
    tpt.element_func(GRBCUpdate, b)

    local c = elements.allocate("CCCCCC" , "EEEE")
    elements.element(elements.CCCCCC_PT_EEEE, elements.element(elements.DEFAULT_PT_BCOL))
    elements.property(elements.CCCCCC_PT_EEEE, "Name" , "EEEE")
    elements.property(elements.CCCCCC_PT_EEEE, "Description" , "EEEE")
    elements.property(elements.CCCCCC_PT_EEEE, "MenuSection" , 5)
    elements.property(elements.CCCCCC_PT_EEEE, "Gravity" , 0)
    elements.property(elements.CCCCCC_PT_EEEE, "Falldown" , 0)
    elements.property(elements.CCCCCC_PT_EEEE, "Flammable" , 0)
    elements.property(elements.CCCCCC_PT_EEEE, "Explosive" , 0)
    elements.property(elements.CCCCCC_PT_EEEE, "Diffusion" , 0)
    elements.property(elements.CCCCCC_PT_EEEE, "Weight" , 32)
    elements.property(elements.CCCCCC_PT_EEEE, "Advection" , 0)
    elements.property(elements.CCCCCC_PT_EEEE, "AirLoss" , 0.95)
    elements.property(elements.CCCCCC_PT_EEEE, "Loss" , 0.15)
    elements.property(elements.CCCCCC_PT_EEEE, "Temperature" , 295.15)
    elements.property(elements.CCCCCC_PT_EEEE, "HeatConduct" , 255)
    elements.property(elements.CCCCCC_PT_EEEE, "MenuVisible" , 0)

    SIGCUpdate = function(i, x, y, s, n)
    local clife = tpt.get_property('life', x, y)
    if clife > 1 then
    for cx = -1, 1, 2 do
    for cy = -1, 1, 2 do
    tpt.create(x + cx, y + cy, 'sing')
    end
    end
    tpt.set_property('life', clife - 1, x, y)
    elseif clife == 1 then
    tpt.set_property('type', 0, x, y)
    elseif s > 0 then
    for cx = -1, 1, 2 do
    for cy = -1, 1, 2 do
    if tpt.get_property('type', x + cx, y + cy) == 4 or tpt.get_property('type', x + cx, y + cy) == 49 then
    tpt.set_property('life', 3000, x, y)
    return true
    end
    end
    end
    end
    end
    tpt.element_func(SIGCUpdate, c)

    local d = elements.allocate("DDDDDD" , "RRRR")
    elements.element(elements.DDDDDD_PT_RRRR, elements.element(elements.DEFAULT_PT_BCOL))
    elements.property(elements.DDDDDD_PT_RRRR, "Name" , "RRRR")
    elements.property(elements.DDDDDD_PT_RRRR, "Description" , "RRRR")
    elements.property(elements.DDDDDD_PT_RRRR, "MenuSection" , 5)
    elements.property(elements.DDDDDD_PT_RRRR, "Gravity" , 0)
    elements.property(elements.DDDDDD_PT_RRRR, "Falldown" , 0)
    elements.property(elements.DDDDDD_PT_RRRR, "Flammable" , 1)
    elements.property(elements.DDDDDD_PT_RRRR, "Explosive" , 1)
    elements.property(elements.DDDDDD_PT_RRRR, "Diffusion" , 0)
    elements.property(elements.DDDDDD_PT_RRRR, "Weight" , 100)
    elements.property(elements.DDDDDD_PT_RRRR, "Advection" , 0.05)
    elements.property(elements.DDDDDD_PT_RRRR, "AirLoss" , 0.95)
    elements.property(elements.DDDDDD_PT_RRRR, "Loss" , 0.15)
    elements.property(elements.DDDDDD_PT_RRRR, "Temperature" , 295.15)
    elements.property(elements.DDDDDD_PT_RRRR, "HeatConduct" , 255)
    elements.property(elements.DDDDDD_PT_RRRR, "MenuVisible" , 0)

    QWERTYUpdate = function(i, x, y, s, n)
    local clife = tpt.get_property('life', x, y)
    if clife > 1 then
    for cx = -1, 1, 2 do
    for cy = -1, 1, 2 do
    tpt.create(x + cx, y + cy, 'TTTT')
    end
    end
    tpt.set_property('life', clife - 1, x, y)
    elseif clife == 1 then
    tpt.set_property('type', 0, x, y)
    elseif s > 0 then
    for cx = -1, 1, 2 do
    for cy = -1, 1, 2 do
    if tpt.get_property('type', x + cx, y + cy) == 4 or tpt.get_property('type', x + cx, y + cy) == 49 then
    tpt.set_property('life', 200, x, y)
    return true
    end
    end
    end
    end
    end
    tpt.element_func(QWERTYUpdate, d)

    local e = elements.allocate("EEEEEE" , "TTTT")
    elements.element(elements.EEEEEE_PT_TTTT, elements.element(elements.DEFAULT_PT_NEUT))
    elements.property(elements.EEEEEE_PT_TTTT, "Name" , "TTTT")
    elements.property(elements.EEEEEE_PT_TTTT, "Description" , "TTTT")
    elements.property(elements.EEEEEE_PT_TTTT, "Temperature" , math.huge)
    elements.property(elements.EEEEEE_PT_TTTT, "Gravity" , 0)
    elements.property(elements.EEEEEE_PT_TTTT, "Falldown" , 0)
    elements.property(elements.EEEEEE_PT_TTTT, "Advection" , 0)
    elements.property(elements.EEEEEE_PT_TTTT, "MenuSection" , 10)
    elements.property(elements.EEEEEE_PT_TTTT, "AirLoss" , 1)
    elements.property(elements.EEEEEE_PT_TTTT, "Loss" , 1)
    elements.property(elements.EEEEEE_PT_TTTT, "Collision" , -0.99)
    elements.property(elements.EEEEEE_PT_TTTT, "Weight" , -1)
    elements.property(elements.EEEEEE_PT_TTTT, "HeatConduct" , 251)
    elements.property(elements.EEEEEE_PT_TTTT, "Properties" , 0x14410)
    elements.property(elements.EEEEEE_PT_TTTT, "MenuVisible" , 0)

    function hehe(i, x, y, surround, nt)
    if tpt.get_property("tmp",i) == 0 then
    local r = (math.random(128)+127) / 127;
    local a = (math.random(360)-1) * 0.01745329;
    tpt.set_property("life",math.random(480)+479,i)
    tpt.set_property("vx",r*math.cos(a),i)
    tpt.set_property("vy",r*math.sin(a),i)
    tpt.set_property("tmp", 1, i)
    end
    end
    tpt.element_func(hehe,elements.EEEEEE_PT_TTTT, 1)

    function haha(i,x,y,s,n)
    if tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1)) == EEEEEE_PT_TTTT then
    tpt.parts[i].type=tpt.el.uran.id
    end
    end
    tpt.element_func(haha,tpt.el.bvbr.id)

    function growth(i,x,y,s,n)
    type=tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
    if type==elements.EEEEEE_PT_TTTT then
    tpt.parts[i].type=tpt.el.neut.id
    end
    end
    tpt.element_func(haha,tpt.el.deut.id)


    function growth(i,x,y,s,n)
    type=tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
    if type==elements.EEEEEE_PT_TTTT then
    tpt.parts[i].type=tpt.el.amtr.id
    end
    end
    tpt.element_func(haha,tpt.el.prot.id)

    function haha(i,x,y,s,n)
    type=tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
    if type==tpt.el.amtr.id then
    tpt.parts[i].type=elements.EEEEEE_PT_TTTT
    end
    end
    tpt.element_func(haha,tpt.el.phot.id)

    local f = elements.allocate("FFFFFFF", "YYYY")
    elements.element(elements.FFFFFFF_PT_YYYY, elements.element(elements.DEFAULT_PT_BCOL))
    elements.property(elements.FFFFFFF_PT_YYYY, "Name", "YYYY")
    elements.property(elements.FFFFFFF_PT_YYYY, "Description", "YYYY")
    elements.property(elements.FFFFFFF_PT_YYYY, "Colour", 0x850000)
    elements.property(elements.FFFFFFF_PT_YYYY, "MenuSection", 5)
    elements.property(elements.FFFFFFF_PT_YYYY, "Gravity", .5)
    elements.property(elements.FFFFFFF_PT_YYYY, "Flammable", 0)
    elements.property(elements.FFFFFFF_PT_YYYY, "Explosive", 0)
    elements.property(elements.FFFFFFF_PT_YYYY, "Loss", 1)
    elements.property(elements.FFFFFFF_PT_YYYY, "AirLoss", .5)
    elements.property(elements.FFFFFFF_PT_YYYY, "AirDrag", .01)
    elements.property(elements.FFFFFFF_PT_YYYY, "Advection", .01)
    elements.property(elements.FFFFFFF_PT_YYYY, "Weight", 1)
    elements.property(elements.FFFFFFF_PT_YYYY, "Diffusion", 0)
    elements.property(elements.FFFFFFF_PT_YYYY, "MenuVisible", 0)

    LOLUpdate = function(i, x, y, s, n)
    local clife = tpt.get_property('life', x, y)
    if clife > 1 then
    for cx = -1, 1, 2 do
    for cy = -1, 1, 2 do
    tpt.create(x + cx, y + cy, 'fire')
    end
    end
    tpt.set_property('life', clife - 1, x, y)
    elseif clife == 1 then
    tpt.set_property('type', 0, x, y)
    elseif s > 0 then
    for cx = -1, 1, 2 do
    for cy = -1, 1, 2 do
    if tpt.get_property('type', x + cx, y + cy) == 4 or tpt.get_property('type', x + cx, y + cy) == 49 then
    tpt.set_property('life', 500, x, y)
    return true
    end
    end
    end
    end
    end
    tpt.element_func(LOLUpdate, f)


    Btw Its very buggy...
    Edited 2 times by QuentinADay, jacob1. Last: 22nd May 2014
  • dom2mom
    22nd May 2014 Member 1 Permalink

    Next time could you pastebin your code? Just a suggestion to avoid clutter.

  • KydonShadow
    22nd May 2014 Member 0 Permalink
    Yeah... This is a bit unreadable.
  • wolfy1339
    22nd May 2014 Member 1 Permalink

    Or use the HTML code editor and use <code> before the code and </code> after the code,

    also please add a description of what it does, description of elements added, etc. it'll make it easier for people to understand your script.

  • MiningMarsh
    22nd May 2014 Member 0 Permalink

    Here is an indented version.

  • QuentinADay
    23rd May 2014 Member 0 Permalink

    Its a LOT more neat with all the indenting and idk I was just messing around for the most part...