Element Creator

  • FeynmanLogomaker
    8th Mar 2013 Member 0 Permalink

    For lack of a better name for it.

    <code>msg = "Element Lister is running, to use, just type 'elemlist(start position X, start position Y, start element, stop element)'"

    function elemlist(x,y,elemtype,elemstop,separation) -- elemtype being the element it starts on, elemstop being the element it
    goes to, separation being the distance between pixels
    while elemtype < elemstop do
    tpt.create(x,y,elemtype)
    if elemtype < 145 or elemtype > 146 then
    elemtype = elemtype + 1 -- going to the next element
    elseif elemtype > 144 and elemtype < 146 then
    elemtype = elemtype + 2 -- skipping element 145, it bugs for some reason
    end
    x = x + separation
    end
    end</code>

    It just creates every element between elemtype and elemstop (except a few bugs)

     

    Updated version: 

    <code>

    tpt.log("To use the Element Lister, type in console\n'elemlist(start position X,start position Y,stop position X,stop position Y,start element,stop element)'\nIt will draw a line of the elements between the start element and the
    stop element going from start X and Y to stop X and Y.")
    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</code>

     

  • boxmein
    8th Mar 2013 Former Staff 0 Permalink
    @FeynmanLogomaker (View Post)
    No offense, but may I rewrite it?

    -- Script starts here
    -- by Feynman
    -- function elemlist - creates all elements from to
    -- x: where to create said element (why stack them?)
    -- y: where to create said element (why stack them?)
    -- elemtype: starter ID passed to tpt.create, either a string or elements.DEFAULT_...
    -- elemstop: ender element ID passed to tpt.create
    -- separator: increment step
    function elemlist(x,y,elemtype,elemstop,separation)
    for i = elemtype, elemstop, separation do
    if i == 144 then i += 1 end
    tpt.create(x, y, elemtype)
    end
    end

  • FeynmanLogomaker
    9th Mar 2013 Member 0 Permalink

    Wow, thanks! That's rather impressive. (And how do you embed it like that?)

  • jacob1
    9th Mar 2013 Developer 0 Permalink
    @FeynmanLogomaker (View Post)
    use:
    code
    asdf
    more code


    <code>this</code>
  • FeynmanLogomaker
    10th Mar 2013 Member 0 Permalink

    Y U NO EMBED?