TPT Script Server

This page is used for previewing and submitting scripts for use with the Script Manager

Available Scripts

(2) TPTMulti by LBPHacker
(3) set wifi v2 by jacob1
(4) Script Paste by jacob1
(5) Random Element by jacob1
(6) Magical Merge Master 3000 by nucular
(7) More Fuel Mod-heavy by jward212
(9) Breakpoints (BRPT) by boxmein
(10) Cockroaches! by boxmein
(11) Random tree by ssccsscc
(12) Element with random properties by ssccsscc
(15) Minimalistic Element Dehider by nucular
(16) FPS Gauge by mniip
(17) TPT Radio by jward212
(18) Print Debugger by FeynmanLogomaker
(19) Powered BHOL by jacob1
(20) Light and lamps by electronic_steve
(21) Extremely Durable TTAN by QuentinADay
(22) New Buttons by QuentinADay
(23) Pure Energy by QuentinADay
(25) RCA's HUD XV Update I by RCAProduction
(27) 123456787654 vols by mjpowder
(28) Singularity Bomb by QuentinADay
(29) ES wifi set by electronic_steve
(30) Lua Elements Pack by FeynmanLogomaker
(31) stkm gun by jward212
(32) space building materials by kjack1111
(34) Rust bomb by Damian97
(35) Simple command block by ssccsscc
(36) Everlasting Fusion by QuentinADay
(37) Screenshot Organiser by mecha-man
(38) Napalm mod by cccp3
(39) Rocket fuel mod v0.15 by cccp3
(41) Useful web links by jward212
(42) TPT Logic Gates Mod by iamdumb
(43) ESTools by electronic_steve
(44) Head Crabs-HL2 by jward212
(45) Procedural Save Generator by boxmein
(46) smooth colours for nametag by jward212
(47) ZAKPACK by zak03
(49) Performance Monitor by FeynmanLogomaker
(51) Texter by byzod
(52) Texter default fonts by byzod
(53) Schicko's Font Pack for Texter by Schicko
(54) Realistic Element Names by Atomic10
(55) TPT's Mod V.3 Update 1 by Amy
(56) Temporaryaccount-Decorator by Temporaryaccount
(57) random save loader by jward212
(58) Tmp gradient display by ssccsscc
(59) particle re-orderer by mniip
(60) Electric Glow by jacob1
(61) More Fuel Mod-lite by jward212
(63) Rythidium by janekbe04
(64) Simple FPS GUI by Sfsjunior
(65) Enhanced Element Dehider by ChargedCreeper
(66) Graph of average temp by ssccsscc
(67) Template save loader by jacob1
(68) Lua Text Generator by jBot-42
(70) Pixel's Freezer by Pixelguru26
(71) Thingy | Fusion For Ever by TheChosenEvilOne
(72) op explosions by zolly_bro
(73) Scar by DorkyBobster
(74) ScreenShotMod by lill74
(77) Useful Things by TheEvilChosenOne
(78) Alchemy Mod by _MrN_
(79) Nuke v2 by Fnaf65
(80) Compressor mod by TheChosenEvilOne
(81) Custom Render Mode Loader by jacob1
(82) Spacewars by JosephMA
(83) MOAR - Alpha 0.1 by TheChosenEvilOne
(86) Element Creator by cxi
(88) Soapworm by LBPHacker
(90) Pressure Bomb by God_Kra
(91) SMFB by wntjq69
(92) Potato by cxi
(93) Subatomic Pack (BDS) by TPT_PL
(94) Acidic Pack (BDS) by TPT_PL
(95) Starbound Building Materials by Sanpypr
(96) Factory problems by TPT_PL
(97) Gamma Ray-diation by Kostia4381
(98) Magic by livingfossil
(99) Cross-window Copy/Cut/Paste by LBPHacker
(100) Langton's Ant with variations by LBPHacker
(101) Remote particle creator/deleter by TPT_PL
(102) Force fields by electronic_steve
(103) Reinforced Concrete by 12Me21
(105) TPT_PL's Lua Mod by TPT_PL
(106) Nuke v4 by Fnaf65
(107) CHEMMOD V1 by KevAK
(108) Chemicals by Ligan
(109) VonDaniel's Template by VonDaniel
(110) The Inaccurate Radioactivity Toy Mod by TuDoR2007
(112) textmonsterPack by textmonster404
(113) Meteor by TheScienceKid
(114) Tgpm by TuDoR2007
(115) Civilizations by TPT_PL
(116) RAD-MOD 1.2.1B by Kev_AK
(117) MicroLua by RamiLego4Game
(118) Extra customizable HUD by djy0212
(119) Ingame brush editor by ssccsscc
(120) Window Maker by Paul_31415
(121) CHEM-MOD V1.2B by Kev_AK
(122) Rainbow PHOT by Mrprocom
(123) stronger stickmanv by yuval
(124) 3D Pressure Visualizer by mniip
(125) Arkadian Liquid by JanKaszanka
(126) Fuel by nukers473
(127) Immersive Radioactivity v2.1 by Potbelly
(128) ElementLaunchingTool by juh9870
(129) CHEM-MOD_v1.2.2b by KevAK
(130) Slingshot by Mrprocom
(131) Perlin Noise Generator by DoubleF
(132) Element Replace by TomW1605
(133) Flooder V2 by TheAwesomeMutant
(134) Link Sign GUI by QuanTech
(135) Element dehider by 4e616d65
(136) Subphoton ROM Builder by mad-cow
(137) Hardened Dust by Liftski
(138) Bio-Vir by TheAwesomeMutant
(140) Orbit Simulator by Mrprocom
(141) johnnyou's Font for Texter by johnnyou (49796346)
(142) auto_wifi by phisically
(143) Layering helper by ssccsscc
(144) Layering Helper Extended by LuaMaster
(145) TPT Remade by TuDoR2007
(146) All-seeing sampler by djy0212
(147) Layering helper remastered by ssccsscc
(148) Eraser by thepowdertoy12
(149) EXPLOSIONS by olix3001
(150) Simple rocket fuel mod by ArseniyPlotnikov2006
(151) Pure Fission by Fnaf65
(154) Graph by ssccsscc
(155) Little's Pack! by LittleProgramming
(156) Lead by LoftisGaming
(157) WIFI Tuner by ssccsscc
(158) Previous Brush by TomW1605
(159) HUD Auto-Hider by Tim
(161) Stack tool by thepowdertoy12
(162) Oil and plastic by ArseniyPlotnikov2006
(163) Colored Ember by DUC
(164) Timer by ssccsscc
(165) Bacteria Mod by TuDoR2007
(166) Noise filter by LBPHacker
(167) Future-proof element dehider by LBPHacker
(168) RadioactiveNuke by DreamingWarlord
(169) Only Hot Element by DreamingWarlord
(170) Philosopher's Stone by Godhydra
(171) Conic section generator by LBPHacker
(172) Interface API by ssccsscc
(173) Metals&Materials by Ferrous26
(174) tpt.all by LBPHacker
(175) The Visual Elements Pack by Goblin01, vvv331
(176) Layering Helper Reforged by PowderNotSolid
(177) SNOWified SING by LBPHacker
(178) FPS Chart by Goblin01
(179) TPT font writer by Goblin01
(180) Simple Ruler by PowderNotSolid
(181) Heat Modifier by DreamingWarlord
(182) TPT Remade II by TuDoR2007
(183) Gravity simulator by ArseniyPlotnikov2k6
(184) Unobtainium by christheboss894
(185) TPTMIDI noteblock in tpt by djy0212
(186) DreamingWarlord's Lua Tool by DreamingWarlord
(187) Elements Tooltip by Goblin01
(189) Explodium script by 0d15ea5ebe57c0debadc0ffee0ddf00d
(190) more powered force elements by 6nop6nop
(191) Yzaak1Scifire Modpack by Yzaak1Scifire
(194) Fluor and more modpack! by galaktor
(195) Hot Powder by lieve_blendi
(196) Star by TUANMINHVIETNAM
(197) Heat Powders by lieve_blendi
(200) Tangeriinium (thx 2 cxi 4 code) by LostEditor
(201) Freezer by lieve_blendi
(202) Powder Power! by TPTSortaGuy
(203) PowderPlus v1.4 by PowderPlus Team
(204) fire by ME
(205) Stacked Goo Animations by Maticzpl
(206) Stickman Control for Android Version by PhauloRiquelme
(207) Spark Removal Button by Xyz
(208) More HEAC's! by Maxhd1234
(209) Immersive Radioactivity v3.0 by Potbelly
(210) Subframe Chipmaker Script by Maticzpl
(211) Realistic Propellants by ArseniyPlotnikov2k6
(212) Mass Equals Gravity by Maticzpl
(213) PhiMod v1 by ArolaunTech
(214) PC Controls for Android by Cracker1000
(217) Single-pixel pipe configurator by LBPHacker
(218) Omega Death Laser Gun by Dogeoum
(219) Notifications by Maticzpl
(221) Powderizer by ArolaunTech
(222) ElemDehider 1.2 by Inventor70
(223) Unobtainum V2 by DoomKittyAttack
(224) Organics Mod v0.2B by PowderPlus Team
(225) Gravity distortion by Avolte55
(226) tmp Wifi by PhauloRiquelme
(227) Alchemagica Mod v1.0 by RebMiami
(228) Fan Elements Mod by RebMiami
(229) Impossibilities by ArolaunTech
(230) Realistic Explosives by ArseniyPlotnikov2k6
(231) libactivation by anamorphic
(232) Alloy Brushes by Maticzpl
(233) Gravity bender by pres
(234) Slow Tick by Pixel
(235) Paste ID by Maticzpl
(236) many things by jadenflp2
(237) Territect by Rebmiami
(238) Better Descriptions v1.0.5 by ashyboi2022
(239) LIGHTNING SPRK by GOLmaster10101
(240) Small Bombs by juh9870
(241) Save Shop by aaccbb
(242) Moving solids v1.3.0 Beta by ArolaunTech
(244) Alchemistry by rdococ
(245) ETRD (Formerly PowderIM) by aaccbb
(246) RadonX by Justadirtblock
(248) Water-X by deuterium_oxide
(250) Indestructible INSL by CheekyRand0m
(252) Console's Mod by Console/Compec
(255) Slow motion by LBPHacker
(256) Powered Repeller by Hythonia
(257) Zeta's Electric Tools. by Zetalasis
(258) Azure serum (AZSR) by ALumpOfPowderToy
(259) COLORFULSAND by xert
(260) Lightning Circle by defaultuser0
(261) Powder Future Tech by JonaHungary
(262) TPTGlowingSolids by DestinyDyson
(263) Volcano Bomb by I_am_the_NugsWorld
(264) Neon Lights by Rebmiami
(265) Radioactive Materials by xyz
(266) Eater mod by VIPERGAMEZ
(267) the biology mod by someone
(268) Atomic Physics by qe
(269) Pure Radiation by ronansb
(270) Fake Elements by That_PowderToy_Guy
(271) Tachyons and MISC by RamenNoods
(272) Exotic Particles by rdococ
(273) FPS Slider by aaccbb
(274) Enphosian's Radioactive mod pack by Enphosian
(276) ROM Builder by QnpfvTPz

+ Submit new script!

Title: Author:
Script:
--Version 2.0
--Author: djy0212

--not fully compatible with jacob1's mod (because jacob1's mod doesn't have a lua interface api)
--in jacob1's mod,you can load configs but can't save configs or open the config window
--in vanilla version, it's fine

--Config reference(press ctrl+'(apostrophe) to open config window):
--    The displaying config is 2 strings, string 1 is the upper one at the top left corner(green)
--    string 2 is the lower one
--    Use jacob1/cracker64's script manager API to save settings
--
--    Use these keywords in the string to show particle properties:
--    %id%             Element ID
--    %cid%            Ctype element ID
--    %life%           Part life
--    %tempK|digits%   Part temperature in Kelvin
--    %tempF|digits%   Part temperature in Fahrenheit
--    %tmp%            Part tmp
--    %tmp2%           Part tmp2
--    %dcolorD%        Decoration color in decimal(unconverted 32-bit int)(the hex one is better)
--    %dcolorH%        Decoration color in hex (more common), see HTML color code, this one is AARRGGBB(A stands for alpha) without "0x" prefix
--    %pavg0|digits%   pavg0,some magic stuff, see http://powdertoy.co.uk/Wiki/W/Pavg.html
--    %pavg1|digits%   pavg1,same as above
--    %vx|digits%      Particle velocity at X direction
--    %vy|digits%      Particle velocity at Y direction
--
--The "digits" in keywords above are how many decimal places to show
--
--Here is an example:
--    (Default) config:
--        String1:'ID: %id% (%cid%), Temp: %tempK|2% K, Tmp2: %tmp2%, DColor: 0x%dcolorH%'
--        String2:'Pavg: [%pavg0|2%, %pavg1|2%], VX: %vx|4%, VY: %vy|4%'
--    result(falling PQRT):
--        ID: 133 (0), Temp: 295.15 K, Tmp2: 8, DColor: 0x4D9AB9CA
--        Pavg: [0.00, 0.00], VX: -0.0848, VY: 2.1896
--
--
--(sorry for my bad English, you can see the example to have a better understanding)

--Known bugs:
--"temp: %tempK|2%,bla bla:%tempK|4%"-->"temp: 295.15,bla bla:295.15"("temp: 295.15,bla bla:295.1500" excepted)
--when you point at a empty space, there's always "ID: 0"(actually not a bug :D)
--
--

local MODID="djy_hudplus"

HUDplus = {
	--Don't modify the variables below, these are default values
	d_cfg = {
		enable = true,
		config1 = 'ID: %id% (%cid%), Temp: %tempK|2% K, Tmp2: %tmp2%, DColor: 0x%dcolorH%',
		config2 = 'Pavg: [%pavg0|2%, %pavg1|2%], VX: %vx|4%, VY: %vy|4%',
		color = {192,0,238,118},
	},
	cfg = {},
	--visibility={
	--	cid=true,tempF=false,tempK=true,tmp=false,tmp2=true,dColor=true,pavg=true
	--}
	using_manager=MANAGER ~= nil,
	
	load_config = function()
		if HUDplus.using_manager then
			HUDplus.cfg.color = HUDplus.hex2color(MANAGER.getsetting(MODID,"color") or "C000EE76")
			HUDplus.cfg.config1 = MANAGER.getsetting(MODID,"string1") or HUDplus.d_cfg.config1
			HUDplus.cfg.config2 = MANAGER.getsetting(MODID,"string2") or HUDplus.d_cfg.config2
			local enable_str = MANAGER.getsetting(MODID,"enable") or HUDplus.d_cfg.enable
			if enable_str == "true" then
				HUDplus.cfg.enable = true
			elseif enable_str == "false" then
				HUDplus.cfg.enable = false
			else
				HUDplus.cfg.enable = HUDplus.d_cfg.enable
			end
		else
			HUDplus.load_default()
		end
	end,
	
	load_default = function()
		HUDplus.cfg = HUDplus.d_cfg
	end,
	
	save_config = function()
		MANAGER.savesetting(MODID,"enable",tostring(HUDplus.cfg.enable))
		MANAGER.savesetting(MODID,"string1",HUDplus.cfg.config1)
		MANAGER.savesetting(MODID,"string2",HUDplus.cfg.config2)
		MANAGER.savesetting(MODID,"color",HUDplus.color2hex(HUDplus.cfg.color))
	end,
	
	apply_config = function()
		HUDplus.cfg.config1=HUDplus.components.str1Textbox:text()
		HUDplus.cfg.config2=HUDplus.components.str2Textbox:text()
		HUDplus.cfg.color[2]=HUDplus.components.colorRTextbox:text()
		HUDplus.cfg.color[3]=HUDplus.components.colorGTextbox:text()
		HUDplus.cfg.color[4]=HUDplus.components.colorBTextbox:text()
	end,
	
	step = function()
		local visible
		if tpt.hud() == 1 and HUDplus.cfg.enable then
			visible = true
			else
			visible = false
		end
		if visible then
			local x, y = sim.adjustCoords(tpt.mousex, tpt.mousey)
			--if x > 611 then
			--	x = 611
			--end
			--if y > 383 then
			--	y = 383
			--end
			--no longer needed
			local text1, text2 = HUDplus.make_string(x, y)
			--if HUDplus.keydown then
			--	tpt.confirm("copy?", 'copy content?', "Yes")
			--	tpt.set_clipboard(text1..'\n'..text2)
			--	print('copied')
			--end
			HUDplus.draw(text1,text2)
		end
		
	end,
	
	make_string = function(x, y)
		--local id,cid,life,tmp,tmp2,deco,pavg0,pavg1,vx,vy,kelvin
		local index = sim.partID(x, y)
		local text1,text2
		--mode0:normal integer,mode1:float with digit number,mode2:dcolor-like
		--mode3:fahrenheit temperature
		local pattern_list = {
			--format:{match pattern,property field,mode,[extra argument]}
			{'%%id%%',sim.FIELD_TYPE,0},
			{'%%cid%%',sim.FIELD_CTYPE,0},
			{'%%life%%',sim.FIELD_LIFE,0},
			{'%%tmp%%',sim.FIELD_TMP,0},
			{'%%tmp2%%',sim.FIELD_TMP2,0},
			{'%%tempK|(%d)%%',sim.FIELD_TEMP,1},
			{'%%tempF|(%d)%%',sim.FIELD_TEMP,3},
			{'%%dcolorD%%',sim.FIELD_DCOLOUR,1},
			{'%%dcolorH%%',sim.FIELD_DCOLOUR,2,true},
			{'%%pavg0|(%d)%%','pavg0',1},
			{'%%pavg1|(%d)%%','pavg1',1},
			{'%%vx|(%d)%%',sim.FIELD_VX,1},
			{'%%vy|(%d)%%',sim.FIELD_VY,1},
		}
		if index then
			text1=HUDplus.mode_replace(HUDplus.cfg.config1,pattern_list,index)
			text2=HUDplus.mode_replace(HUDplus.cfg.config2,pattern_list,index)
		else
			--I can't think out a better solution,you can manually replace this
			text1 = "ID: 0"
			text2 = ""
		end
		return text1, text2
	end,
	
	mode_replace = function (text,pattern,index)
		for i,li in ipairs(pattern) do
			if li[3]==0 then --mode 0:normal mode
				text = string.gsub(text,li[1],sim.partProperty(index,li[2]))
			elseif li[3]==1 then --mode 1:float mode
				digit = tonumber(({string.find(text,li[1])})[3])
				text = string.gsub(text,li[1],string.format("%."..(digit or "0").."f",sim.partProperty(index,li[2])))
			elseif li[3]==2 then --mode 2:dcolor-like mode[ex:true-uppercase,false-lowercase]
				text = string.gsub(text,li[1],string.format(li[4] and "%08X" or "%08x",sim.partProperty(index,li[2])))
			elseif li[3]==3 then --mode 3:fahrenheit temperature
				digit = tonumber(({string.find(text,li[1])})[3])
				text = string.gsub(text,li[1],string.format("%."..(digit or "0").."f",(sim.partProperty(index,li[2])-273.15)*1.8+32))
			end
		end
		return text
	end,
	
	draw = function(line1, line2)
		local HUDx = 12
		local HUDy = 27
		local line2visible = false
		local color = HUDplus.cfg.color
		if string.len(line2)~=0 then line2visible = true end
		if line2visible
			then graphics.fillRect(HUDx, HUDy, tpt.textwidth(line1)+8, 12, 0, 0, 0, 128)     --line1back
				 graphics.fillRect(HUDx, HUDy+12, tpt.textwidth(line2)+8, 12, 0, 0, 0, 128)  --line2back
			else graphics.fillRect(HUDx, HUDy, tpt.textwidth(line1)+8, 14, 0, 0, 0, 128) end --line1back
		graphics.drawText(HUDx+3, HUDy+3, line1, color[2], color[3], color[4], color[1])  --line1text
		graphics.drawText(HUDx+3, HUDy+14, line2, color[2], color[3], color[4], color[1]) --line2text
	end,
	
	key = function(key, code, modifiers, event)
		if key=='\'' and event==1 and modifiers==64 and HUDplus.using_manager then
			HUDplus.refresh_window()
			interface.showWindow(HUDplus.configWindow)
		end
	end,
	
	color2hex = function(color)
		local hex = ""
		for i=1,4,1 do
			hex = hex..bit.tohex(color[i],2)
		end
		return hex
	end,
	
	hex2color = function(hex)
		local color ={} local str =""
		for i=1,4,1 do
			str=string.sub(hex,i*2-1,i*2)
			color[i]=string.format("%d","0x"..str)
		end
		return color
	end,
	
	components ={},
	build_window = function()
		local configWindow = Window:new(-1, -1, 600, 150)
		local currentY = 10
		local components = HUDplus.components
		
		components.titleLabel = Label:new(10, currentY, (select(1, configWindow:size())/2)-20, 16, "DebugHUD Configs")
		components.enableCheckbox = Checkbox:new(select(1, configWindow:size())/2, currentY, (select(1, configWindow:size())/2)-20, 16, "Enabled")
		components.enableCheckbox:action(
			function(sender, checked)
				HUDplus.cfg.enable=checked
			end
		)
		
		currentY = currentY + 20
		components.str1Label = Label:new(10, currentY, (select(1, configWindow:size())/8)-20, 16, "Line 1:")
		components.str1Textbox = Textbox:new(select(1, configWindow:size())/8, currentY, (select(1, configWindow:size())*7/8)-20, 16, "Line 1")
		
		currentY = currentY + 20
		components.str2Label = Label:new(10, currentY, (select(1, configWindow:size())/8)-20, 16, "Line 2:")
		components.str2Textbox = Textbox:new(select(1, configWindow:size())/8, currentY, (select(1, configWindow:size())*7/8)-20, 16, "Line 2")
		
		currentY = currentY + 20
		components.colorLabel = Label:new(10, currentY, (select(1, configWindow:size())/8)-20, 16, "Color")
		components.colorRTextbox = Textbox:new(select(1, configWindow:size())/8, currentY, (select(1, configWindow:size())/8)-20, 16, "R","Red")
		components.colorGTextbox = Textbox:new(select(1, configWindow:size())*2/8, currentY, (select(1, configWindow:size())/8)-20, 16, "G","Green")
		components.colorBTextbox = Textbox:new(select(1, configWindow:size())*3/8, currentY, (select(1, configWindow:size())/8)-20, 16, "B","Blue")
		
		currentY = currentY + 20
		components.readmeLabel = Label:new(10, currentY, select(1, configWindow:size()), 16, "Note: read lua source file for more information")
		
		components.saveButton = Button:new(select(1, configWindow:size())/8, select(2, configWindow:size())-26, (select(1, configWindow:size())/8)-20, 16, "Save")
		components.saveButton:action(function()
			HUDplus.apply_config()
			HUDplus.save_config()
			interface.closeWindow(HUDplus.configWindow)
		end)
		components.defaultButton = Button:new(select(1, configWindow:size())*2/8, select(2, configWindow:size())-26, (select(1, configWindow:size())/8)-20, 16, "Default")
		components.defaultButton:action(function()
			HUDplus.load_default()
			HUDplus.save_config()
			interface.closeWindow(HUDplus.configWindow)
		end)
		components.closeButton = Button:new(select(1, configWindow:size())*3/8, select(2, configWindow:size())-26, (select(1, configWindow:size())/8)-20, 16, "Close")
		components.closeButton:action(function()
			HUDplus.apply_config()
			interface.closeWindow(HUDplus.configWindow)
		end)
		
		for i,comp in pairs(components) do
			configWindow:addComponent(comp)
		end
		
		configWindow:onTryExit(function()
			HUDplus.apply_config()
			interface.closeWindow(configWindow) end)
		HUDplus.configWindow = configWindow
		HUDplus.refresh_window()
	end,
	
	refresh_window = function()
		HUDplus.components.enableCheckbox:checked(HUDplus.cfg.enable)
		HUDplus.components.str1Textbox:text(HUDplus.cfg.config1)
		HUDplus.components.str2Textbox:text(HUDplus.cfg.config2)
		HUDplus.components.colorRTextbox:text(HUDplus.cfg.color[2])
		HUDplus.components.colorGTextbox:text(HUDplus.cfg.color[3])
		HUDplus.components.colorBTextbox:text(HUDplus.cfg.color[4])
	end
}

HUDplus.load_config()
if not tpt.version.jacob1s_mod then
	HUDplus.build_window()
	tpt.register_keypress(HUDplus.key)
end

tpt.register_step(HUDplus.step)

Description:

Changelog: