Press J to change propertie. Press M to get information about current properties.
local RAND2 = elements.allocate("MOD", "RAND2")
elements.element(elements.MOD_PT_RAND2, elements.element(math.random(1,170)))
elements.property(elements.MOD_PT_RAND2, "Name", "RAND2")
elements.property(elements.MOD_PT_RAND2, "Description", "Element with random properties. Press j to change it.Press m to get info.")
elements.property(elements.MOD_PT_RAND2, "Colour", math.random(10000,99999))
elements.property(elements.MOD_PT_RAND2, "MenuSection", 11)
elements.property(elements.MOD_PT_RAND2, "Loss", math.random(0,2))
elements.property(elements.MOD_PT_RAND2, "AirLoss", math.random(0,2))
elements.property(elements.MOD_PT_RAND2, "Advection", math.random(0,10))
elements.property(elements.MOD_PT_RAND2, "Diffusion", math.random(0,10))
elements.property(elements.MOD_PT_RAND2, "Gravity", math.random(0,20))
elements.property(elements.MOD_PT_RAND2, "Flammable", math.random(0,20))
elements.property(elements.MOD_PT_RAND2, "Weight", math.random(-1,100))
elements.property(elements.MOD_PT_RAND2, "Explosive", math.random(0,2))
elements.property(elements.MOD_PT_RAND2, "Falldown", math.random(0,2))
elements.property(elements.MOD_PT_RAND2, "Meltable", math.random(0,1))
function elecKeyTest(b)
if b == "j" then
a1=math.random(1,170) a2=math.random(10000,99999) a3=math.random(0,1) a4=math.random(0,1) a5=math.random(0,5) a6=math.random(0,5) a7=math.random(0,5) a8=math.random(0,20) a9=math.random(-1,100) a10=math.random(0,2) a11=math.random(0,2) a12=math.random(0,1)
if a1~=4 then if a1~=105 then if a1~=64 then if a1~=77 then if a1~=78 then if a1~=94 then if a1~=101 then if a1~=104 then if a1~=112 then if a1~=116 then if a1~=117 then
if a1~=118 then if a1~=120 then if a1~=121 then if a1~=122 then if a1~=123 then if a1~=127 then if a1~=147 then --fix errors
elements.element(elements.MOD_PT_RAND2, elements.element(a1))
elements.property(elements.MOD_PT_RAND2, "Name", "RAND2")
elements.property(elements.MOD_PT_RAND2, "Description", "Element with random properties. Press j to change it.Press m to get info.")
elements.property(elements.MOD_PT_RAND2, "Colour", a2)
elements.property(elements.MOD_PT_RAND2, "MenuSection", 11)
elements.property(elements.MOD_PT_RAND2, "Loss", a3)
elements.property(elements.MOD_PT_RAND2, "AirLoss", a4)
elements.property(elements.MOD_PT_RAND2, "Advection", a5)
elements.property(elements.MOD_PT_RAND2, "Diffusion", a6)
elements.property(elements.MOD_PT_RAND2, "Gravity", a7)
elements.property(elements.MOD_PT_RAND2, "Flammable", a8)
elements.property(elements.MOD_PT_RAND2, "Weight", a9)
elements.property(elements.MOD_PT_RAND2, "Explosive", a10)
elements.property(elements.MOD_PT_RAND2, "Falldown", a11)
elements.property(elements.MOD_PT_RAND2, "Meltable", a12)
end end end end end end end end end end end end end end end end end end end end
tpt.register_keypress(elecKeyTest)function elecKeyTest(b)
if b == "m" then
tpt.log("") tpt.log("") tpt.log("") tpt.log("") tpt.log("") tpt.log("") tpt.log("Element:", a1) tpt.log("Colour:", a2) tpt.log("Loss:", a3) tpt.log("AirLoss:", a4) tpt.log("Advection:", a5) tpt.log("Diffusion:", a6) tpt.log("Gravity:", a7) tpt.log("Flammable:", a8) tpt.log("Weight:", a9)
tpt.log("Explosive:", a10) tpt.log("Falldown:", a11) tpt.log("Meltable:", a12)
end
end
tpt.register_keypress(elecKeyTest)