I need help making WIFS.

  • Houseinik
    16th August Member 0 Permalink

    Hello so Im making WIFS (wireless FILT serializator) and I need help. The problem is that when I paste a thing using WIFS it doesnt work/doesnt update the FILT.

    Heres the code:

     

    wifilt = elem.allocate("WIFILTMOD", "WIFS")
    elem.element(wifilt,elem.element(elem.DEFAULT_PT_LDTC))
    elem.property(wifilt,"Name","WIFS")
    elem.property(wifilt,"Color",0x6E16BC)
    elem.property(wifilt,"Description","Wireless FILT serializator. Use life to set the x, tmp to set y and tmp2 to reverse the transfer.")
    local function update(i,x,y)
        local spectrum=0
        local setx=sim.partProperty(i,"life")
        local sety=sim.partProperty(i,"tmp")
        if (sim.partProperty(i,"tmp2")==1) then
            if (sim.partID(setx,sety)~=nil) then
                setPt=sim.partProperty(sim.partID(setx,sety),"type")
            else
                setPt=0
            end
            if (setPt==125) then
                spectrum=sim.partProperty(sim.partID(setx,sety),"ctype")
            end
            for pt in sim.neighbors(x,y,1,1) do
                if (sim.partProperty(pt,"type")==elem.DEFAULT_PT_FILT) then
                    sim.partProperty(pt,"ctype",spectrum)
                end
            end
        else
            for pt in sim.neighbors(x,y,1,1) do
                if (sim.partProperty(pt,"type")==elem.DEFAULT_PT_FILT) then
                    spectrum=sim.partProperty(pt,"ctype")
                end
            end
            local setPt
            if (sim.partID(setx,sety)~=nil) then
                setPt=sim.partProperty(sim.partID(setx,sety),"type")
            else
                setPt=0
            end
            if (setPt==125) then
                sim.partProperty(sim.partID(setx,sety),"ctype",spectrum)
            end
        end
    end
    elem.property(wifilt,"Update",update) 

     

    Edit: Im dumb and I forgot it SETS the x and y.

    Mods please remove this post.

    Edited once by Houseinik. Last: 16th August