Adding or Subtracting the Temp in Console

  • Sergeant_Starfruit
    3rd Sep 2012 Member 3 Permalink

    I reckon it would be helpful if you could increase or decrease the temp of an entire element by like 1000 or something, and it would would actually add or subtract the original temp by the number imputed. Like if you have two dots of metal, and you want to increase the temperature of both of them - without using heat tool - by 100 or something, you could type in console: !set temp metl plus 100 or !set temp metl add 100. This would make heaps of jobs involving wifi and stuff so much easier because if you need to increase all the wifi temp by 1000, and there all scattered around the screen with a bunch of meltable stuff, you wouldn't want to add 1000 to each wifi individually, would you? You could just type in console: !set temp wifi plus 1000!

     

    I am sorry if this idea is already implanted in or it's been suggested before and I haven't found it yet. :|

  • therocketeer
    3rd Sep 2012 Member 0 Permalink
    @Sergeant_Starfruit (View Post)
    This is actually a really good idea. I'm not aware of any commands that do this sort of thing either. It would be more efficient though to make the command something like !set temp wifi +100 or !set temp wifi -100 (Because the temp scale in the console works in kelvin, so there are no "negative" values, and no need for a "+" anyway, so I think that could work.)
  • boxmein
    3rd Sep 2012 Former Staff 0 Permalink
    @Sergeant_Starfruit (View Post)
    You could easily do that with Lua, so I will provide to you some functions to do just that. Just save them to a nearby text file in the Powder Toy folder and load them with dofile("somefunctions.txt")
    --[[ Usage:
    addtoproperty("variable", change, x, y)
    addtoproperty("temp", -15, 100, 200) to remove 15 from temperature.
    addtoproperty("tmp2", 100, 100, 100) to add 100 to tmp2.
    addtoproperty("life", 10, 5, 1) to add 10 to life.
    --]]--
    function addtoproperty(property, add, x, y)
    local value = tpt.get_property(property, x, y)
    if typeof(value) == "number" then
    value = value + add
    tpt.set_property(property, value, x, y)
    else
    tpt.log("Can't add to type" .. typeof(value))
    end
    end
  • MasterMind555
    3rd Sep 2012 Member 0 Permalink

    @Sergeant_Starfruit (View Post)

    Would be easy, would just require a macro to be used easily, such as the one boxmein provided. 

    It just need to be officially implemented.