Guest User

lua

a guest
Aug 5th, 2015
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.43 KB | None | 0 0
  1. function unhide()
  2. elements.property(elements.DEFAULT_PT_MORT, "MenuSection", 11)
  3. elements.property(elements.DEFAULT_PT_SHD4, "MenuSection", 11)
  4. elements.property(elements.DEFAULT_PT_SHD3, "MenuSection", 11)
  5. elements.property(elements.DEFAULT_PT_SHD2, "MenuSection", 11)
  6. elements.property(elements.DEFAULT_PT_BIZS, "MenuSection", 11)
  7. elements.property(elements.DEFAULT_PT_RIME, "MenuSection", 11)
  8. elements.property(elements.DEFAULT_PT_LOLZ, "MenuSection", 11)
  9. elements.property(elements.DEFAULT_PT_SPWN, "MenuSection", 11)
  10. elements.property(elements.DEFAULT_PT_BRAY, "MenuSection", 11)
  11. elements.property(elements.DEFAULT_PT_LOVE, "MenuSection", 11)
  12. elements.property(elements.DEFAULT_PT_MORT, "MenuSection", 11)
  13. elements.property(elements.DEFAULT_PT_EQVE, "MenuSection", 11)
  14. elements.property(elements.DEFAULT_PT_DYST, "MenuSection", 11)
  15. elements.property(elements.DEFAULT_PT_BIZG, "MenuSection", 11)
  16. elements.property(elements.DEFAULT_PT_FRZW, "MenuSection", 11)
  17. elements.property(elements.DEFAULT_PT_PSTS, "MenuSection", 11)
  18. elements.property(elements.DEFAULT_PT_EMBR, "MenuSection", 11)
  19. elements.property(elements.DEFAULT_PT_MORT, "MenuVisible", 1)
  20. elements.property(elements.DEFAULT_PT_SHD4, "MenuVisible", 1)
  21. elements.property(elements.DEFAULT_PT_SHD3, "MenuVisible", 1)
  22. elements.property(elements.DEFAULT_PT_SHD2, "MenuVisible", 1)
  23. elements.property(elements.DEFAULT_PT_BIZS, "MenuVisible", 1)
  24. elements.property(elements.DEFAULT_PT_RIME, "MenuVisible", 1)
  25. elements.property(elements.DEFAULT_PT_LOLZ, "MenuVisible", 1)
  26. elements.property(elements.DEFAULT_PT_SPWN, "MenuVisible", 1)
  27. elements.property(elements.DEFAULT_PT_BRAY, "MenuVisible", 1)
  28. elements.property(elements.DEFAULT_PT_LOVE, "MenuVisible", 1)
  29. elements.property(elements.DEFAULT_PT_MORT, "MenuVisible", 1)
  30. elements.property(elements.DEFAULT_PT_EQVE, "MenuVisible", 1)
  31. elements.property(elements.DEFAULT_PT_DYST, "MenuVisible", 1)
  32. elements.property(elements.DEFAULT_PT_BIZG, "MenuVisible", 1)
  33. elements.property(elements.DEFAULT_PT_FRZW, "MenuVisible", 1)
  34. elements.property(elements.DEFAULT_PT_PSTS, "MenuVisible", 1)
  35. elements.property(elements.DEFAULT_PT_EMBR, "MenuVisible", 1)
  36. end
  37.  
  38. moveicon=0
  39. iconx=100
  40. icony=100
  41. time=0
  42. tmp2=0
  43. icons=0
  44. checkbox1=0
  45. checkbox2=0
  46. checkbox3=0
  47. checkbox4=0
  48. checkbox5=0
  49. button1='unpressed'
  50. button2='unpressed'
  51. button3='unpressed'
  52. button4='unpressed'
  53. button5='unpressed'
  54. button6='unpressed'
  55. show=0
  56. filename='luamod.ini'
  57.  
  58. --read config file--
  59. if tostring(fs.exists('luamod.ini'))=='true' then
  60. local f=io.open(filename,'rb')
  61. ab1=tonumber(f:read("*line"))
  62. ab2=tonumber(f:read("*line"))
  63. ab3=tonumber(f:read("*line"))
  64. ab4=tonumber(f:read("*line"))
  65. ab5=tonumber(f:read("*line"))
  66. ab6=tonumber(f:read("*line"))
  67. ab7=tonumber(f:read("*line"))
  68. f:close()
  69. if ab6==nil then
  70. iconx=100
  71. else
  72. iconx=ab6
  73. end
  74. if ab7==nil then
  75. icony=100
  76. else
  77. icony=ab7
  78. end
  79. time=ab1
  80. checkbox3=ab1
  81. tmp2=ab2
  82. checkbox4=ab2
  83. icons=ab3
  84. checkbox5=ab3
  85. mfps=ab4
  86. checkbox1=ab4
  87. elh=ab5
  88. checkbox2=ab5
  89. if mfps==1 then
  90. tpt.setfpscap(10000)
  91. end
  92. if elh==1 then
  93. unhide()
  94. end
  95. end
  96. --------------------
  97.  
  98. function press(mousex, mousey, button, event)
  99. if show==1 then
  100. if (mousex>=179) and (mousex<=191) and (mousey>=129) and (mousey<=141) and (button==1) and (event==2) then
  101. if checkbox1==0 then
  102. tpt.setfpscap(10000)
  103. checkbox1=1
  104. else
  105. tpt.setfpscap(60)
  106. checkbox1=0
  107. end
  108. end
  109.  
  110. if (mousex>=340) and (mousex<=352) and (mousey>=146) and (mousey<=158) and (button==1) and (event==2) then
  111. if checkbox2==0 then
  112. checkbox2=1
  113. unhide()
  114. else
  115. checkbox2=0
  116. elements.property(elements.DEFAULT_PT_MORT, "MenuVisible", 0)
  117. elements.property(elements.DEFAULT_PT_SHD4, "MenuVisible", 0)
  118. elements.property(elements.DEFAULT_PT_SHD3, "MenuVisible", 0)
  119. elements.property(elements.DEFAULT_PT_SHD2, "MenuVisible", 0)
  120. elements.property(elements.DEFAULT_PT_BIZS, "MenuVisible", 0)
  121. elements.property(elements.DEFAULT_PT_RIME, "MenuVisible", 0)
  122. elements.property(elements.DEFAULT_PT_LOLZ, "MenuVisible", 0)
  123. elements.property(elements.DEFAULT_PT_SPWN, "MenuVisible", 0)
  124. elements.property(elements.DEFAULT_PT_BRAY, "MenuVisible", 0)
  125. elements.property(elements.DEFAULT_PT_LOVE, "MenuVisible", 0)
  126. elements.property(elements.DEFAULT_PT_MORT, "MenuVisible", 0)
  127. elements.property(elements.DEFAULT_PT_EQVE, "MenuVisible", 0)
  128. elements.property(elements.DEFAULT_PT_DYST, "MenuVisible", 0)
  129. elements.property(elements.DEFAULT_PT_BIZG, "MenuVisible", 0)
  130. elements.property(elements.DEFAULT_PT_FRZW, "MenuVisible", 0)
  131. elements.property(elements.DEFAULT_PT_PSTS, "MenuVisible", 0)
  132. elements.property(elements.DEFAULT_PT_EMBR, "MenuVisible", 0)
  133. end
  134. end
  135. if (mousex>=397) and (mousex<=409) and (mousey>=170) and (mousey<=182) and (button==1) and (event==2) then
  136. if checkbox3==0 then
  137. checkbox3=1
  138. time=1
  139. else
  140. checkbox3=0
  141. time=0
  142. end
  143. end
  144.  
  145. if (mousex>=352) and (mousex<=364) and (mousey>=187) and (mousey<=199) and (button==1) and (event==2) then
  146. if checkbox4==0 then
  147. checkbox4=1
  148. tmp2=1
  149. else
  150. checkbox4=0
  151. tmp2=0
  152. end
  153. end
  154.  
  155. if (mousex>=357) and (mousex<=369) and (mousey>=206) and (mousey<=218) and (button==1) and (event==2) then
  156. if checkbox5==0 then
  157. checkbox5=1
  158. icons=1
  159. else
  160. checkbox5=0
  161. icons=0
  162. end
  163. end
  164.  
  165. if (mousex>=118) and (mousex<=267) and (mousey>=167) and (mousey<=182) and (button==1) and (event==2) then
  166. tpt.set_property("type","none","clne")
  167. tpt.set_property("type","none","bcln")
  168. end
  169. if (mousex>=118) and (mousex<=267) and (mousey>=190) and (mousey<=205) and (button==1) and (event==2) then
  170. tpt.set_property("life","1000000","metl")
  171. tpt.set_property("life","1000000","merc")
  172. tpt.set_property("life","1000000","tung")
  173. tpt.set_property("life","1000000","inst")
  174. tpt.set_property("life","1000000","tesc")
  175. tpt.set_property("life","1000000","wwld")
  176. tpt.set_property("life","1000000","etrd")
  177. tpt.set_property("life","1000000","ptct")
  178. tpt.set_property("life","1000000","ntct")
  179. tpt.set_property("life","1000000","nscn")
  180. tpt.set_property("life","1000000","pscn")
  181. tpt.set_property("life","1000000","lrbd")
  182. tpt.set_property("life","1000000","rbdm")
  183. tpt.set_property("life","1000000","nble")
  184. tpt.set_property("life","1000000","rbdm")
  185. tpt.set_property("life","1000000","brmt")
  186. tpt.set_property("life","1000000","brel")
  187. tpt.set_property("life","1000000","bmtl")
  188. tpt.set_property("life","1000000","iron")
  189. tpt.set_property("life","1000000","ttan")
  190. tpt.set_property("life","1000000","gold")
  191. end
  192. if (mousex>=117) and (mousex<=268) and (mousey>=260) and (mousey<=275) and (button==1) and (event==2) then
  193. button6='unpressed'
  194. show=0
  195. moveicon=1
  196. tpt.log('Drag the \'M\' icon in the new place.')
  197. end
  198. if (mousex>=118) and (mousex<=267) and (mousey>=213) and (mousey<=228) and (button==1) and (event==2) then
  199. sim.resetTemp()
  200. end
  201. if (mousex>=118) and (mousex<=267) and (mousey>=236) and (mousey<=251) and (button==1) and (event==2) then
  202. for i1=1, 607 do
  203. for i2=1, 379 do
  204. if tpt.get_property('type',i1,i2) ~=0 then
  205. local t=tpt.get_property('dcolour',i1,i2)
  206. sim.partCreate(-3,i1,i2,115)
  207. tpt.set_property("dcolour",t,i1,i2)
  208. end
  209. end
  210. end
  211. end
  212. if (mousex>=467) and (mousex<=479) and (mousey>=100) and (mousey<=112) and (button==1) and (event==2) then
  213. show=0
  214. end
  215. if (mousex>=103) and (mousex<=476) and (mousey>=291) and (mousey<=306) and (button==1) and (event==2) then
  216. conf=time..'\n'..tmp2..'\n'..icons..'\n'..checkbox1..'\n'..checkbox2..'\n'..iconx..'\n'..icony..'\n^^config file for tpt lua script by ssccsscc^^'
  217. local f = io.open(filename,"w")
  218. if f then
  219. f:write(conf)
  220. f:close()
  221. end
  222. show=0
  223. button5='unpressed'
  224. end
  225. end
  226. end
  227. tpt.register_mouseclick(press)
  228.  
  229.  
  230.  
  231. function HUD()
  232. if tpt.hud()==0 then
  233. return
  234. end
  235. local x2=tpt.mousex
  236. local y2=tpt.mousey
  237. local x, y = sim.adjustCoords(x2, y2)
  238. if tpt.get_property("type", x, y)~=0 then
  239. a=tpt.get_property('tmp2', x, y)
  240. b=tpt.get_property('dcolour', x, y)
  241. else
  242. a=0
  243. b=0
  244. end
  245. if tmp2==1 then
  246. graphics.drawText(15,30,'Tmp2: '..a..', dcolour: '..string.upper(bit.tohex(b)), 255, 255, 255, 170)
  247. end
  248. if time==1 then
  249. if renderer.debugHUD()==0 then
  250. graphics.drawText(250, 15, os.date())
  251. else
  252. graphics.drawText(200, 15, os.date())
  253. end
  254. end
  255. end
  256. tpt.register_step(HUD)
  257.  
  258. function icon1(mousex, mousey, button, event)
  259. if (mousex>=0+iconx) and (mousex<=10+iconx) and (mousey>=0+icony) and (mousey<=10+icony) and (button==1) and (event==2) then
  260. show=1
  261. end
  262. end
  263. tpt.register_mouseclick(icon1)
  264.  
  265. function moveicon(mousex, mousey, button, event)
  266. if moveicon==1 then
  267.  
  268. if ((button==1) and (event==1)) and (((mousex<iconx) or (mousex>11+iconx)) or ((mousey<icony) or (mousey>11+icony))) then
  269. fpi=0
  270. end
  271. if (button==1) and (event==1) and (mousex>=iconx) and (mousex<=11+iconx) and (mousey>=icony) and (mousey<=11+icony) then
  272. fpi=1
  273. fxi=mousex-iconx
  274. fyi=mousey-icony
  275. end
  276. if (button==1) and (event==3) and (fpi==1) then
  277. iconx=mousex-fxi
  278. icony=mousey-fyi
  279. if icony<1 then
  280. icony=-1
  281. end
  282. if icony>411 then
  283. icony=412
  284. end
  285. end
  286. if iconx<2 then
  287. iconx=1
  288. end
  289. if iconx>617 then
  290. iconx=618
  291. end
  292. end
  293. if (button==1) and (event==2) and (mousex>=iconx) and (mousex<=11+iconx) and (mousey>=icony) and (mousey<=11+icony) then
  294. moveicon=0
  295. end
  296. end
  297. tpt.register_mouseclick(moveicon)
  298.  
  299. function icon()
  300. end
  301. tpt.register_step(icon)
  302.  
  303. function image()
  304. if show==0 then
  305. return
  306. end
  307. --Show UI
  308. function press2(mousex, mousey, button, event)
  309. if show==1 then
  310. if (mousex>=118) and (mousex<=267) and (mousey>=167) and (mousey<=182) and (button==1) and (event==1) then
  311. button1='pressed'
  312. elseif (mousex>=118) and (mousex<=267) and (mousey>=167) and (mousey<=182) and (button==1) and (event==2) then
  313. button1='unpressed'
  314. end
  315. if (mousex>=118) and (mousex<=267) and (mousey>=190) and (mousey<=205) and (button==1) and (event==1) then
  316. button2='pressed'
  317. elseif (mousex>=118) and (mousex<=267) and (mousey>=190) and (mousey<=205) and (button==1) and (event==2) then
  318. button2='unpressed'
  319. end
  320. if (mousex>=118) and (mousex<=267) and (mousey>=213) and (mousey<=228) and (button==1) and (event==1) then
  321. button3='pressed'
  322. elseif (mousex>=118) and (mousex<=267) and (mousey>=213) and (mousey<=228) and (button==1) and (event==2) then
  323. button3='unpressed'
  324. end
  325. if (mousex>=118) and (mousex<=267) and (mousey>=236) and (mousey<=251) and (button==1) and (event==1) then
  326. button4='pressed'
  327. elseif (mousex>=118) and (mousex<=267) and (mousey>=236) and (mousey<=251) and (button==1) and (event==2) then
  328. button4='unpressed'
  329. end
  330. if (mousex>=103) and (mousex<=476) and (mousey>=291) and (mousey<=306) and (button==1) and (event==1) then
  331. button5='pressed'
  332. elseif (mousex>=103) and (mousex<=476) and (mousey>=291) and (mousey<=306) and (button==1) and (event==2) then
  333. button5='unpressed'
  334. end
  335. if (mousex>=117) and (mousex<=268) and (mousey>=260) and (mousey<=275) and (button==1) and (event==1) then
  336. button6='pressed'
  337. elseif (mousex>=117) and (mousex<=268) and (mousey>=260) and (mousey<=275) and (button==1) and (event==2) then
  338. button6='unpressed'
  339. end
  340. end
  341. end
  342. tpt.register_mouseclick(press2)
  343. if button4=='pressed' then
  344. else
  345. end
  346. if button3=='pressed' then
  347. else
  348. end
  349. if checkbox1==0 then
  350. else
  351. end
  352. if checkbox2==0 then
  353. else
  354. end
  355. if button1=='unpressed' then
  356. else
  357. end
  358. if button2=='pressed' then
  359. else
  360. end
  361. if checkbox3==0 then
  362. else
  363. end
  364. if checkbox4==0 then
  365. else
  366. end
  367. if checkbox5==0 then
  368. else
  369. end
  370. if button5=='unpressed' then
  371. else
  372. end
  373. if button6=='unpressed' then
  374. else
  375. end
  376. end
  377. tpt.register_step(image)
  378. function UI()
  379. if show==0 then
  380. return
  381. end
  382. end
  383. tpt.register_step(UI)
  384. function image()
  385. if icons==1 then
  386. end
  387. end
  388. tpt.register_step(image)
Advertisement
Add Comment
Please, Sign In to add comment