4 New Buttons

  • QuentinADay
    24th Oct 2014 Member 1 Permalink


    local deletesparkButton = Button:new(539, 0, 15, 15, "D", "Delete Spark")
    deletesparkButton:action(function(sender)
    tpt.reset_spark()
    end)
    interface.addComponent(deletesparkButton)

    local MeltButton = Button:new(524, 0, 15, 15, "M", "Makes Everything Melt")
    MeltButton:action(function(sender)
    for x=4,607,1 do
    for y=4,379,1 do
    ctype = tpt.get_property("type", x, y)
    tpt.set_property("type", 6, x, y)
    tpt.set_property("ctype", ctype, x, y)
    tpt.set_property("temp", 10000, x, y)
    end
    end
    end)
    interface.addComponent(MeltButton)

    local everythingButton = Button:new(509, 0, 15, 15, "E", "Sets Everything on screen to specified element")
    everythingButton:action(function(sender)
    tpt.set_property("type", tpt.input("Element Name: "))
    end)
    interface.addComponent(everythingButton)

    local lifemaxButton = Button:new(494, 0, 15, 15, "L", "Sets life of Everything on screen to 99999999")
    lifemaxButton:action(function(sender)
    tpt.set_property("life", 99999999)
    end)
    interface.addComponent(lifemaxButton)

     

    Makes 4 New Buttons: D: Deletes All Sparks On Screen, M: Melts Everything On Screen, E: Sets Everything On Screen To Specified Element, L: Sets Everything On Screen's Life to 99999999

    Edited once by QuentinADay. Last: 25th Oct 2014
  • MirrorrorriM
    24th Oct 2014 Member 0 Permalink

    Do you mean hotkeys?

    Edit: I'm not Google.

    Edited once by MirrorrorriM. Last: 24th Oct 2014
  • QuentinADay
    24th Oct 2014 Member 0 Permalink

    No I don't think they are the same as hotkeys... but I'm not really sure.

  • zBuilder
    25th Oct 2014 Member 0 Permalink

    it adds them as those little buttons like "P","N",etc in the upper right right?

  • QuentinADay
    25th Oct 2014 Member 0 Permalink

    Yes, that is correct.

  • jward212
    25th Oct 2014 Member 0 Permalink

    this is very useful try what I did in my radio script so it goes away with the hud

    something like this in a function, also remember to register step  

    partHUD = tpt.hud()
    if partHUD == 1 then
    deletesparkButton:visible(true)
    else
    deletesparkButton:visible(false)
    end

  • Jimmyfriend
    25th Oct 2014 Member 0 Permalink

    Reset sparks is a BRILLIANT idea. Nice job!

  • QuentinADay
    25th Oct 2014 Member 0 Permalink

    @Jimmyfriend (View Post) I actually remembered that I saw that in a Mod I tested out so i dicided to put it in this. I Have No idea who to give credit to. 

     

    @jward212 (View Post) I have No idea what to do with that lol

     

     

  • GreenFireDragon
    25th Oct 2014 Member 0 Permalink

    @Jimmyfriend (View Post)

     You can do that in the official TPT with ctrl+=

     

    @QuentinADay (View Post)

     You say that M melts EVERYTHING, so actually you should use

    for x=4,607,1 do
    for y=4,379,1 do
    ctype = tpt.get_property("type", x, y)
    tpt.set_property("type", 6, x, y)
    tpt.set_property("ctype", ctype, x, y)
    tpt.set_property("temp", 10000, x, y)
    end
    end

    This melts EVERYTHING, even DMND :P (It works but it can probably be done better, this is the first time I created something with lua)

  • QuentinADay
    25th Oct 2014 Member 0 Permalink

    I'm surprised I never thought of that lol. Nice job though, I'll add it now