How to upload to autorun.lua?

  • Sussy_Tiago
    10th October Member 0 Permalink

    I have a simple mod that adds a element called THGN (Thermal generator) that makes sparks everytime its temp is above 100C. And i want to publish it to autorun.lua

     

    Btw source code:

    local elemid=elements.allocate("WILLMOD","THGN")
    elements.property(elemid,"Name","THGN")
    elements.property(elemid,"MenuSection",9)
    elements.property(elemid,"MenuVisible",1)
    elements.property(elemid,"Weight",85)
    --elements.property(elemid,"Gravity",0.1)
    elements.property(elemid,"Color",0xFF646464)
    elements.property(elemid,"Properties",0x00004)
    elements.property(elemid,"Advection",0.7)
    elements.property(elemid,"AirLoss",0.96)
    elements.property(elemid,"Loss",0.80)
    elements.property(elemid,"Falldown",1)
    elements.property(elemid,"Collision",0)
    elements.property(elemid,"AirDrag",0.02)
    elements.property(elemid,"Description","Thermal Generator. Generates sparks when temp is above 100C.")
    functiongen(x2,y2,obj)
        forx1=-1, 1do

            fory1=-1, 1do
                sim.partCreate(-3,x2+x1,y2-y1,obj)
            end
        end
    end
    elements.property(elemid,"Update",function(i,x,y,ss,nt)
    localtemp=sim.partProperty(i,"temp")
    iftemp> (100+273.15) then
        gen(x,y,elem.DEFAULT_PT_SPRK)
    end
    end)
    Edited 2 times by Sussy_Tiago. Last: 10th October
  • LBPHacker
    10th October Developer 0 Permalink
    Read the instructions here.
  • Sussy_Tiago
    10th October Member 0 Permalink