Lua toolbox with custom UI

  • ssccsscc
    5th Aug 2015 Member 2 Permalink

    Screenshot:

    If you want to save current settings to file use 'Save' button.
    Download(MediaFire)(Too big for pastebin)

    Edited once by ssccsscc. Last: 5th Aug 2015
  • jacob1
    5th Aug 2015 Developer 2 Permalink
    This script is literally over 3MB of tpt.drawpixel, almost 100000 lines of them. It's pretty obviously CGI (just generating tpt.drawpixels instead of tpt pixels ...).

    I'm not sure why it has to be so large or what it does, but I don't really want to run this. I also can't approve the one you submitted to the script server because I can't look through 100000 lines of tpt.drawpixel to make sure it doesn't do anything suspicious.
  • ssccsscc
    5th Aug 2015 Member 1 Permalink

    @jacob1 (View Post)

    near 65% of tpt.drawpixel = main window
    10% of tpt.drawpixel =buttons(in 2 states)
    10% of tpt.drawpixel  =cheackbox
    10% of tpt.drawpixel =Addes color to tpt menu icons
    3%=need to update it.
    1.5%=functions like: remove clne,reset temp,etc
    0.5%=Save button (Saving curently selected checkbox to file and read it file on tpt startup)

    (all functions of this on screenshot)

    Edited 3 times by ssccsscc. Last: 5th Aug 2015
  • ChargedCreeper
    5th Aug 2015 Member 1 Permalink

    jacob1:

    This script is literally over 3MB of tpt.drawpixel, almost 100000 lines of them. It's pretty obviously CGI (just generating tpt.drawpixels instead of tpt pixels ...).

    I'm not sure why it has to be so large or what it does, but I don't really want to run this. I also can't approve the one you submitted to the script server because I can't look through 100000 lines of tpt.drawpixel to make sure it doesn't do anything suspicious.
     
    Here is the script with all tpt drawline instances removed via regex:

     

     

    The script to me looks harmless. The only file IO in it reads and writes to a file called luamod.ini. No instances of os.execute, lua socket or http from searches I ran on it.

    Edited 2 times by ChargedCreeper. Last: 5th Aug 2015
  • RCAProduction
    7th Aug 2015 Member 1 Permalink

    ssccsscc:

    @jacob1 (View Post)

    near 65% of tpt.drawpixel = main window
    10% of tpt.drawpixel =buttons(in 2 states)
    10% of tpt.drawpixel  =cheackbox
    10% of tpt.drawpixel =Addes color to tpt menu icons
    3%=need to update it.
    1.5%=functions like: remove clne,reset temp,etc
    0.5%=Save button (Saving curently selected checkbox to file and read it file on tpt startup)

    (all functions of this on screenshot)

     

    First of all, start by drawing lines. Don't do it pixel by pixel. A few lines can take away the task of drawing hundreds of pixels. Better yet, use fillrect, and draw filled rectangles. Suddenly you only have maybe 300 lines total. That's like a 99.9% reduction in size.

     

    It's something like tpt.fillrect. Check the lua api in our wiki. For the fading so it looks nice, use tpt.drawline and most likely you will never need to draw an individual pixel in the whole thing.

     

    I will also add, it looks great, and you did some nice work.

    Edited 2 times by RCAProduction. Last: 7th Aug 2015
  • oldmud0
    7th Aug 2015 Member 3 Permalink

    ...but why? Vanilla UI toolbox is all right, just needs a bit of fixing up. No need to reinvent the wheel.

  • Pixelguru
    26th Oct 2015 Member 1 Permalink

    Good grief...

    I don't know much about TPT's Lua implimentation, but shouldn't it be possible to replace most of those "tpt.drawpixel"s with a couple of loops?

  • ChargedCreeper
    27th Oct 2015 Member 1 Permalink

    caranintast:

    Good grief...

    I don't know much about TPT's Lua implimentation, but shouldn't it be possible to replace most of those "tpt.drawpixel"s with a couple of loops?

     

    Yes it would be possible. TPT's Lua supports all the standard Lua functions as far as I'm aware. Also, I have done loops in TPT too.

  • jBot-42
    27th Oct 2015 Banned 0 Permalink
    This post is hidden because the user is banned
    Edited once by jBot-42. Last: 27th Oct 2015
  • ssccsscc
    28th Oct 2015 Member 0 Permalink

    I tried to do it with loops, but it created lags.