My Gradient Scripts Thread

  • FeynmanLogomaker
    11th Mar 2013 Member 2 Permalink

    What the heck, I might as well just post all my gradient scripts. To use them (all of them), just type 'start commannd'(Start value X, Start value Y, end value X, end value Y, property start value, property stop value.

     

    Wifi: 

    function wifilist(xstart,ystart,xstop,ystop,tempstart,tempstop)
    elemtype = tpt.input("Element Type","This is the element it will be drawn in")
    xincrement = (xstop - xstart) / (tempstop - tempstart)
    yincrement = (ystop - ystart) / (tempstop - tempstart)
    while tempstart < tempstop + 1 do
    tpt.create(xstart,ystart,elemtype)
    tpt.set_property('temp',tempstart * 100,xstart,ystart)
    tempstart = tempstart + 1 -- going to the next value
    xstart = xstart + xincrement
    ystart = ystart + yincrement
    end
    end

     

    tmp2:

     

    function tmp2list(xstart,ystart,xstop,ystop,tmp2start,tmp2stop)
    elemtype = tpt.input("Element Type","This is the element it will be drawn in")
    xincrement = (xstop - xstart) / (tmp2stop - tmp2start)
    yincrement = (ystop - ystart) / (tmp2stop - tmp2start)
    while tmp2start < tmp2stop + 1 do
    tpt.create(xstart,ystart,elemtype)
    tpt.set_property('tmp2',tmp2start,xstart,ystart)
    tmp2start = tmp2start + 1 -- going to the next value
    xstart = xstart + xincrement
    ystart = ystart + yincrement
    end
    end

     

    Channel (or temp, it says channel but it's really just doing temp)

     

     

    function chanlist(xstart,ystart,xstop,ystop,tempstart,tempstop)
    elemtype = tpt.input("Element Type","This is the element it will be drawn in")
    xincrement = (xstop - xstart) / (tempstop - tempstart)
    yincrement = (ystop - ystart) / (tempstop - tempstart)
    while tempstart < tempstop + 1 do
    tpt.create(xstart,ystart,elemtype)
    tpt.set_property('temp',tempstart * 100,xstart,ystart)
    tempstart = tempstart + 1 -- going to the next value
    xstart = xstart + xincrement
    ystart = ystart + yincrement
    end
    end

     

    Element type (Of course, it already has a thread of its own, but we don't want it to feel left out, do we? It is the most important one)


    function elemlist(xstart,ystart,xstop,ystop,elemtype,elemstop)
    xincrement = (xstop - xstart) / (elemstop - elemtype)
    yincrement = (ystop - ystart) / (elemstop - elemtype)
    while elemtype < elemstop + 1 do
    tpt.create(xstart,ystart,elemtype)
    if elemtype < 145 or elemtype > 146 then
    elemtype = elemtype + 1 -- going to the next element
    xstart = xstart + xincrement
    ystart = ystart + yincrement
    elseif elemtype > 144 and elemtype < 146 then
    elemtype = elemtype + 2 -- skipping element 145, it bugs for some reason
    end
    end

    end

     

    And life.

     

    function lifelist(xstart,ystart,xstop,ystop,lifestart,lifestop)
    elemtype = tpt.input("Element Type","This is the element it will be drawn in")
    xincrement = (xstop - xstart) / (lifestop - lifestart)
    yincrement = (ystop - ystart) / (lifestop - lifestart)
    while lifestart < lifestop + 1 do
    tpt.create(xstart,ystart,elemtype)
    tpt.set_property('life',lifestart,xstart,ystart)
    lifestart = lifestart + 1 -- going to the next value
    xstart = xstart + xincrement
    ystart = ystart + yincrement
    end
    end

     

    Filt (Don't worry about temp, 1 is darkest blue, 12 or so is red)

     

    function filtlist(xstart,ystart,xstop,ystop,colstart,colstop)
    elemtype = tpt.input("Element Type","Of course you want filt, but you can do really anything else.")
    xincrement = (xstop - xstart) / (colstop - colstart)
    yincrement = (ystop - ystart) / (colstop - colstart)
    colstart = colstart + 472.15
    colstop = (colstop + 473.15) * 50
    while colstart < colstop + 1 do
    tpt.create(xstart,ystart,elemtype)
    tpt.set_property('temp',colstart,xstart,ystart)
    colstart = colstart + 50 -- going to the next value
    xstart = xstart + xincrement
    ystart = ystart + yincrement
    end
    end

     

     

     

    All of them are free to copy, for whatever purpose, no credit needed. Feel free to post modifications or suggestions!

     

    EDITED: Even better script! More versatile, and you don't need to make a new script for each property!

     

    --STILL NEED TO TEST! Don't rely on it working...
    function list(xstart,ystart,xstop,ystop)
    valuer = 0
    valueg = 0
    valueb = 0
    property = tpt.input("Gradient Variable","Draws a gradient with this variable")
    if property ~= 'type' then
    type = tpt.input("Element type","Draws a gradient in this element")
    end
    if property ~= 'dcolor' and property ~= 'dcolour' then
    start = tpt.input("Start value","Draws a gradient starting at this value")
    stop = tpt.input("Stop value","Draws a gradient stopping at this value")
    elseif property == 'dcolor' or property == 'dcolour' then
    valuer = tpt.input("Red start value","Draws a gradient starting at this value")
    valueg = tpt.input("Green start value","Draws a gradient starting at this value")
    valueb = tpt.input("Blue start value","Draws a gradient starting at this value")
    stopr = tpt.input("Red stop value","Draws a gradient stopping at this value")
    stopg = tpt.input("Green stop value","Draws a gradient stopping at this value")
    stopb = tpt.input("Blue stop value","Draws a gradient stopping at this value")
    end
    if property ~= 'dcolor' and property ~= 'dcolour' then
    xincrement = (xstop - xstart) / (stop - start)
    yincrement = (ystop - ystart) / (stop - start)
    elseif property == 'dcolor' or property == 'dcolour' then
    rincrement = (xstop - xstart) / (valuer - stopr)
    gincrement = (xstop - xstart) / (valueg - stopg)
    bincrement = (xstop - xstart) / (valueb - stopb)
    end
    while value < stop + 1 do
    tpt.create(xstart,ystart,type)
    if property ~= 'dcolor' and property ~= 'dcolour' then
    tpt.set_property(property,value,xstart,ystart)
    elseif property == 'dcolor' or property == 'dcolour' then
    tpt.set_property(property,valuer*65536+valueg*256+valueb+16777216*255,xstart,ystart)
    if value ~= 145 then
    value = value + 1 -- going to the next element
    xstart = xstart + xincrement
    ystart = ystart + yincrement
    elseif value == 145 then
    value = value + 2 -- skipping element 145, it bugs for some reason
    elseif property == 'dcolor' or property == 'dcolour' then
    valuer = valuer + 1
    valueg = valueg + 1
    valueb = valueb + 1
    xstart = xstart + (rincrement + gincrement + bincrement) / 3
    ystart = ystart + (rincrement + gincrement + bincrement) / 3
    end
    end
    end
    end

  • asusoverclocked
    12th Mar 2013 Member 0 Permalink

    if i were u i would watch out this is kinda cgi

  • FeynmanLogomaker
    12th Mar 2013 Member 1 Permalink

    Umm...it only really does one thing, and people have done it lots of times before, but OK.

  • asusoverclocked
    22nd Mar 2013 Member 0 Permalink

    Yea good point I guess