Advertisement
MrSalit0s

MrSalit0sMod

Oct 24th, 2012
976
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 12.12 KB | None | 0 0
  1. --Mod made by MrSalit0s
  2.  
  3. tpt.setfpscap(120)
  4.  
  5. --[[    hidden elements in regular menus    ]]
  6. elements.property(elements.DEFAULT_PT_EMBR, "MenuSection", 5)
  7. elements.property(elements.DEFAULT_PT_EMBR, "MenuVisible", 1)
  8. elements.property(elements.DEFAULT_PT_BIZRG, "MenuSection", 6)
  9. elements.property(elements.DEFAULT_PT_BIZRG, "MenuVisible", 1)
  10. elements.property(elements.DEFAULT_PT_FRZW, "MenuSection", 7)
  11. elements.property(elements.DEFAULT_PT_FRZW, "MenuVisible", 1)
  12. elements.property(elements.DEFAULT_PT_BIZRS, "MenuSection", 9)
  13. elements.property(elements.DEFAULT_PT_BIZRS, "MenuVisible", 1)
  14. elements.property(elements.DEFAULT_PT_MORT, "MenuSection", 8)
  15. elements.property(elements.DEFAULT_PT_MORT, "MenuVisible", 1)
  16. elements.property(elements.DEFAULT_PT_DYST, "MenuSection", 8)
  17. elements.property(elements.DEFAULT_PT_DYST, "MenuVisible", 1)
  18. elements.property(elements.DEFAULT_PT_RIME, "MenuSection", 9)
  19. elements.property(elements.DEFAULT_PT_RIME, "MenuVisible", 1)
  20. elements.property(elements.DEFAULT_PT_SHLD2, "MenuSection", 9)
  21. elements.property(elements.DEFAULT_PT_SHLD2, "MenuVisible", 1)
  22. elements.property(elements.DEFAULT_PT_SHLD3, "MenuSection", 98)
  23. elements.property(elements.DEFAULT_PT_SHLD3, "MenuVisible", 1)
  24. elements.property(elements.DEFAULT_PT_SHLD4, "MenuSection", 9)
  25. elements.property(elements.DEFAULT_PT_SHLD4, "MenuVisible", 1)
  26. elements.property(elements.DEFAULT_PT_PSTS, "MenuSection", 8)
  27. elements.property(elements.DEFAULT_PT_PSTS, "MenuVisible", 1)
  28. elements.property(elements.DEFAULT_PT_LOVE, "MenuSection", 11)
  29. elements.property(elements.DEFAULT_PT_LOVE, "MenuVisible", 1)
  30. elements.property(elements.DEFAULT_PT_LOLZ, "MenuSection", 11)
  31. elements.property(elements.DEFAULT_PT_LOLZ, "MenuVisible", 1)
  32. elements.property(elements.DEFAULT_PT_FOG, "MenuSection", 6)
  33. elements.property(elements.DEFAULT_PT_FOG, "MenuVisible", 1)
  34. elements.property(elements.DEFAULT_PT_SPAWN, "MenuSection", 11)
  35. elements.property(elements.DEFAULT_PT_SPAWN, "MenuVisible", 1)
  36. elements.property(elements.DEFAULT_PT_SPAWN2, "MenuSection", 11)
  37. elements.property(elements.DEFAULT_PT_SPAWN2, "MenuVisible", 1)
  38. elements.property(elements.DEFAULT_PT_SPAWN2, "Name", "SPW2")
  39. elements.property(elements.DEFAULT_PT_BRAY, "MenuSection", 11)
  40. elements.property(elements.DEFAULT_PT_BRAY, "MenuVisible", 1)
  41.  
  42. --[[    element: Termites   ]]
  43. local Termites = elements.allocate("MOD", "TRMT")
  44. elements.element(elements.MOD_PT_TRMT, elements.element(elements.DEFAULT_PT_ACID))
  45. elements.property(elements.MOD_PT_TRMT, "Name", "TRMT")
  46. elements.property(elements.MOD_PT_TRMT, "Description", "termites")
  47. elements.property(elements.MOD_PT_TRMT, "Colour", 0xFFB33702)
  48. elements.property(elements.MOD_PT_TRMT, "MenuSection", 11)
  49. elements.property(elements.MOD_PT_TRMT, "Gravity", 0.1)
  50. elements.property(elements.MOD_PT_TRMT, "Loss", 0.8)
  51. elements.property(elements.MOD_PT_TRMT, "AirLoss", 0.56)
  52. elements.property(elements.MOD_PT_TRMT, "AirDrag", 0.02)
  53. elements.property(elements.MOD_PT_TRMT, "Advection", 0.7)
  54. elements.property(elements.MOD_PT_TRMT, "Weight", 0.1)
  55. elements.property(elements.MOD_PT_TRMT, "Diffusion", 0.2)
  56.  
  57. local Element2 = elements.allocate("MOD", "TRM2")
  58. elements.element(elements.MOD_PT_TRM2, elements.element(elements.DEFAULT_PT_CAUS))
  59. elements.property(elements.MOD_PT_TRM2, "Name", "TRM2")
  60. elements.property(elements.MOD_PT_TRM2, "Description", "termites")
  61. elements.property(elements.MOD_PT_TRM2, "Colour", 0xFFB33702)
  62. elements.property(elements.MOD_PT_TRM2, "MenuSection", 11)
  63. elements.property(elements.MOD_PT_TRM2, "MenuVisible", 0)
  64.  
  65. math.randomseed(os.time())
  66. local function termites(i,x,y,s,n)
  67. local ox=math.random(x-2,x+2)
  68. local oy=math.random(y-2,y+2)
  69. local oz=math.random(0,30)
  70. local oc=math.random(0,300)
  71.     if oz==10 then
  72.         tpt.set_property("type",elements.MOD_PT_TRM2,ox,oy)
  73.     end
  74.     if oz==20 then
  75.         tpt.set_property("type",elements.MOD_PT_TRMT,ox,oy)
  76.     end
  77.     if oc==150 then
  78.     tpt.delete(i)
  79.     end
  80. end
  81.  
  82. local function trmgraphics(i, colr, colg, colb)
  83.     return 1,0x00000001,255,200,48,0,255,200,48,0
  84. end
  85.  
  86. tpt.element_func(termites,elements.MOD_PT_TRMT)
  87. tpt.element_func(termites,elements.MOD_PT_TRM2)
  88. tpt.graphics_func(trmgraphics,elements.MOD_PT_TRMT)
  89. tpt.graphics_func(trmgraphics,elements.MOD_PT_TRM2)
  90.  
  91. --[[    element: Nanobot    ]]
  92. local Nano = elements.allocate("MOD", "NANO")
  93. elements.element(elements.MOD_PT_NANO, elements.element(elements.DEFAULT_PT_METL))
  94. elements.property(elements.MOD_PT_NANO, "Name", "NANO")
  95. elements.property(elements.MOD_PT_NANO, "Description", "Nanobot - create it's ctype - controllable with arrow keys")
  96. elements.property(elements.MOD_PT_NANO, "Colour", 0x0000FF00)
  97. elements.property(elements.MOD_PT_NANO, "MenuSection", 1)
  98. elements.property(elements.MOD_PT_NANO, "MenuVisible", 1)
  99.  
  100. local nup = false
  101. local ndown = false
  102. local nright = false
  103. local nleft = false
  104. local active = true
  105. local function ctrl(key,dkey,_,event)
  106.     if dkey == 273 then
  107.         nup = true
  108.         ndown = false
  109.         nright = false
  110.         nleft = false
  111.         active = true
  112.     end
  113.     if dkey == 274 then
  114.         nup = false
  115.         ndown = true
  116.         nright = false
  117.         nleft = false
  118.         active = true
  119.     end
  120.     if dkey == 276 then
  121.         nup = false
  122.         ndown = false
  123.         nright = true
  124.         nleft = false
  125.         active = true
  126.     end
  127.     if dkey == 275 then
  128.         nup = false
  129.         ndown = false
  130.         nright = false
  131.         nleft = true
  132.         active = true
  133.     end
  134. end
  135.  
  136. local function nanoctrl(i,x,y,s,n)
  137.     if tpt.get_property("ctype",i)==elements.DEFAULT_PT_NONE then
  138.         tpt.set_property("ctype",elements.DEFAULT_PT_METL,i)
  139.     end
  140.     if tpt.get_property("tmp2",i)==0 then
  141.         if active then
  142.             if nup then
  143.                 tpt.set_property('y',y-2,i)
  144.                 tpt.create(x,y-1,tpt.get_property("ctype", i))
  145.             end
  146.             if ndown then
  147.                 tpt.set_property('y',y+2,i)
  148.                 tpt.create(x,y+1,tpt.get_property("ctype", i))
  149.             end
  150.             if nright then
  151.                 tpt.set_property('x',x-2,i)
  152.                 tpt.create(x-1,y,tpt.get_property("ctype", i))
  153.             end
  154.             if nleft then
  155.                 tpt.set_property('x',x+2,i)
  156.                 tpt.create(x+1,y,tpt.get_property("ctype", i))
  157.             end
  158.             active = false
  159.         end
  160.     end
  161. end
  162.  
  163. tpt.element_func(nanoctrl,elements.MOD_PT_NANO)
  164. tpt.register_keypress(ctrl)
  165.  
  166. --[[    element: Gold   ]]
  167. local Gold = elements.allocate("MOD", "GOLD")
  168. elements.element(elements.MOD_PT_GOLD, elements.element(elements.DEFAULT_PT_METL))
  169. elements.property(elements.MOD_PT_GOLD, "Name", "GOLD")
  170. elements.property(elements.MOD_PT_GOLD, "Description", "Gold")
  171. elements.property(elements.MOD_PT_GOLD, "Colour", 0xFFFE9E19)
  172. elements.property(elements.MOD_PT_GOLD, "MenuSection", 9)
  173. elements.property(elements.MOD_PT_GOLD, "Properties", 0x4024)
  174.  
  175. local function gold(i,x,y,s,n)
  176. local g=math.random(0,300)
  177.     if g==60 then
  178.         tpt.set_property("dcolour",0xFFFE9E19,i)
  179.     end
  180.     if g==120 then
  181.         tpt.set_property("dcolour",0xFFFEA31B,i)
  182.     end
  183.     if g==180 then
  184.         tpt.set_property("dcolour",0xFFDA8C18,i)
  185.     end
  186.     if g==240 then
  187.         tpt.set_property("dcolour",0xFFF28705,i)
  188.     end
  189.     if g==300 then
  190.         tpt.set_property("dcolour",0xFFF29D01,i)
  191.     end
  192. end
  193. local function goldgraphics(i, colr, colg, colb)
  194.     return 1,0x00000124,255,250,130,0,255,250,130,0
  195. end
  196.  
  197. tpt.graphics_func(goldgraphics,elements.MOD_PT_GOLD)
  198. tpt.element_func(gold,elements.MOD_PT_GOLD)
  199.  
  200. --[[    element: Seeds  ]]
  201. local Seed = elements.allocate("MOD", "SEED")
  202. elements.element(elements.MOD_PT_SEED, elements.element(elements.DEFAULT_PT_DUST))
  203. elements.property(elements.MOD_PT_SEED, "Name", "SEED")
  204. elements.property(elements.MOD_PT_SEED, "Description", "Seeds")
  205. elements.property(elements.MOD_PT_SEED, "Colour", 0xFFA15410)
  206. elements.property(elements.MOD_PT_SEED, "MenuSection", 8)
  207. elements.property(elements.MOD_PT_SEED, "Weight", 0.1)
  208.  
  209. local function seed(i,x,y,s,n)
  210. local etype=tpt.get_property("type",x+math.random(-1,1),y+math.random(-1,1))
  211.     if etype==elements.DEFAULT_PT_WOOD or etype==elements.DEFAULT_PT_SAND or etype==elements.DEFAULT_PT_DUST or etype==elements.DEFAULT_PT_WATR or etype==elements.DEFAULT_PT_CLAY or etype==elements.DEFAULT_PT_PLNT or etype==elements.DEFAULT_PT_VINE then
  212.         tpt.parts[i].type=elements.DEFAULT_PT_VINE
  213.     end
  214. end
  215.  
  216. tpt.element_func(seed,elements.MOD_PT_SEED)
  217.  
  218. --[[    element: Cloud  ]]
  219. local Cloud = elements.allocate("MOD", "CLD")
  220. elements.element(elements.MOD_PT_CLD, elements.element(elements.DEFAULT_PT_WTRV))
  221. elements.property(elements.MOD_PT_CLD, "Name", "CLD")
  222. elements.property(elements.MOD_PT_CLD, "Description", "Cloud - produces water")
  223. elements.property(elements.MOD_PT_CLD, "Colour", 0x00FFFFFF)
  224. elements.property(elements.MOD_PT_CLD, "MenuSection", 6)
  225. elements.property(elements.MOD_PT_CLD, "Loss", 0.1)
  226. elements.property(elements.MOD_PT_CLD, "AirLoss", 0.3)
  227. elements.property(elements.MOD_PT_CLD, "Advection", 1)
  228. elements.property(elements.MOD_PT_CLD, "Diffusion", 0.3)
  229. elements.property(elements.MOD_PT_CLD, "Temperature", 273.15)
  230.  
  231. local function cloud(i,x,y,s,n)
  232. local w=math.random(0,2000)
  233.     if w==1000 then
  234.         tpt.parts[i].type=elements.DEFAULT_PT_WATR
  235.     end
  236. end
  237.  
  238. tpt.element_func(cloud,elements.MOD_PT_CLD)
  239.  
  240. --[[    element: Neon gas   ]]
  241. local NEON = elements.allocate("MOD", "NEON")
  242. elements.element(elements.MOD_PT_NEON, elements.element(elements.DEFAULT_PT_NBLE))
  243. elements.property(elements.MOD_PT_NEON, "Name", "NEON")
  244. elements.property(elements.MOD_PT_NEON, "Description", "Neon gas - glows in contact with electricity")
  245. elements.property(elements.MOD_PT_NEON, "Colour", 0x00242424)
  246. elements.property(elements.MOD_PT_NEON, "MenuSection", 6)
  247. elements.property(elements.MOD_PT_NEON, "Loss", 0.1)
  248. elements.property(elements.MOD_PT_NEON, "AirLoss", 1)
  249. elements.property(elements.MOD_PT_NEON, "Advection", 0.4)
  250. elements.property(elements.MOD_PT_NEON, "Diffusion", 0.5)
  251. elements.property(elements.MOD_PT_NEON, "Temperature", 295)
  252. elements.property(elements.MOD_PT_NEON, "Gravity", 0)
  253. elements.property(elements.MOD_PT_NEON, "Flammable", 0)
  254. elements.property(elements.MOD_PT_NEON, "Weight", 0)
  255. elements.property(elements.MOD_PT_NEON, "Properties", 0x4828)
  256.  
  257. local colour={0xFFAA0000,0xFFFF6600,0xFFFFFF00,0xFF00FF00,0xFF00FFFF,0xFF0000FF,0xFF9900CC}
  258. local none=0x00242424
  259.  
  260. local function neon(i,x,y,s,n)
  261.     if tpt.get_property("tmp",i)== 0 then
  262.         tpt.set_property("tmp",1,i)
  263.     end
  264.     if tpt.get_property("tmp2",i)== 1 then
  265.         tpt.set_property("life",180+math.random(0,20),i)
  266.         tpt.set_property("tmp2",0,i)
  267.     end
  268.     if tpt.parts[i].life<=0 then
  269.         tpt.set_property("dcolour",none,i)
  270.     end
  271. end
  272.  
  273. local function neonsprk(i,x,y,s,n)
  274. local ntmp=tpt.get_property("tmp",i)
  275. local neontype=tpt.get_property("ctype",i)
  276.     if tpt.get_property("ctype",i)==elements.MOD_PT_NEON then
  277.         if tpt.get_property("tmp",i)==ntmp then
  278.         tpt.set_property("dcolour",colour[ntmp],i)
  279.         tpt.set_property("tmp2",1,i)
  280.     end
  281.         if tpt.get_property("tmp",i)==8 then
  282.             tpt.set_property("dcolour",colour[math.random(1,7)],i)
  283.             tpt.set_property("tmp2",1,i)
  284.         end
  285.     end
  286. end
  287.  
  288. local function neongraphics(i, colr, colg, colb)
  289.     return 1,0x00022110,30,30,30,30,30,30,30,30
  290. end
  291.  
  292. tpt.graphics_func(neongraphics,elements.MOD_PT_NEON)
  293. tpt.element_func(neon,elements.MOD_PT_NEON)
  294. tpt.element_func(neonsprk,elements.DEFAULT_PT_SPRK)
  295.  
  296. --[[    element: Pressure detector  ]]
  297. local PressureDTEC = elements.allocate("MOD", "PDTC")
  298. elements.element(elements.MOD_PT_PDTC, elements.element(elements.DEFAULT_PT_DTEC))
  299. elements.property(elements.MOD_PT_PDTC, "Name", "PDTC")
  300. elements.property(elements.MOD_PT_PDTC, "Description", "Creates a spark when pressure nearby (tmp 1 detects pressure of 0.1)")
  301. elements.property(elements.MOD_PT_PDTC, "Colour", 0x00202060)
  302. elements.property(elements.MOD_PT_PDTC, "MenuSection", 3)
  303. elements.property(elements.MOD_PT_PDTC, "MenuVisible", 1)
  304.  
  305. local function pdtc(i,x,y,s,n)
  306. local ptmp = tpt.get_property("tmp",i)
  307.     if tpt.get_property("tmp",i)==0 then
  308.         tpt.set_property("tmp",1,i)
  309.     end
  310.     if simulation.pressure(x/4,y/4)>=ptmp/10 then
  311.         tpt.create(x,y+1,elements.DEFAULT_PT_SPRK)
  312.         tpt.create(x,y-1,elements.DEFAULT_PT_SPRK)
  313.         tpt.create(x+1,y,elements.DEFAULT_PT_SPRK)
  314.         tpt.create(x-1,y,elements.DEFAULT_PT_SPRK)
  315.         tpt.create(x+1,y+1,elements.DEFAULT_PT_SPRK)
  316.         tpt.create(x+1,y-1,elements.DEFAULT_PT_SPRK)
  317.         tpt.create(x-1,y+1,elements.DEFAULT_PT_SPRK)
  318.         tpt.create(x-1,y-1,elements.DEFAULT_PT_SPRK)
  319.     end
  320. end
  321.  
  322. tpt.element_func(pdtc,elements.MOD_PT_PDTC)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement