Advertisement
Guest User

Untitled

a guest
Feb 14th, 2014
946
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.87 KB | None | 0 0
  1. Ekw,A,o,t={},"",0,0
  2.  
  3. Pole={}
  4. for i=1,200 do
  5. Pole[i]=""
  6. end
  7.  
  8. Klaw={{73,75,74,76,"I\nJ K L"},{71,66,86,78,"G\nV B N"},{50,90,65,69,"2\nQ W E"},{219,222,186,220,"\[\n; \' \\"},{104,101,100,102,"<CH>8\n4 5 6"}}
  9.  
  10. TEXT={
  11. pomoc=' <J>• Piksus •\n\n<BV>Cel: <N>Zamaluj swoim pionkiem jak najwięcej pól.\n\n<BV>Jak grać:\n <N>Zamiast sterowć <VP>WSAD<N>em należy używać <VP>IKJL<N>.\n\n<BV>Komendy:\n<BL>!pomoc\t\t<N>- wyświetla to co teraz czytasz...\n<BL>!info\t\t<N>- wyświetla informacje na temat minigry\n<BL>!dodaj\t\t<N>- otwiera okno dołączanie do gry\n<BL>!odejdź\t\t<N>- odłącza Cię z gry\n\nWięcej o minigrze w temacie:\n[ <V><U>Topic-?</U> <N>]-/-',
  12. info =' <J>Informacje o Piksus\n\n<BV>Autor: <V>Ouake\n<BV>Twórca: <V>Ouake\n\n<BV>Ilość kolorów: <N>215 (co do koloru zapisu)\n<BV>Ilość trybów: <N>1\n<BV>Trybów gracza: <N>3'
  13. }
  14.  
  15. ui.addTextArea(301,"<B><font color='#333333'>» Piksus</font>",n,4,-17,0,0,n,n,0,true)
  16. ui.addTextArea(302,"<B><V>» Piksus",n,5,-18,0,0,n,n,0,true)
  17.  
  18. has=""..math.random(100,999)
  19. print("<T>Hasło : <VP>"..has)
  20. system.disableChatCommandDisplay(has,true)
  21.  
  22. function eventNewPlayer(nick)
  23. tfm.exec.setNameColor(nick,0x777777)
  24. Ekw[nick]={}
  25. Ekw[nick][1]={tr="online",t=0,il=1,w=1,o=0,pkt=0,x=1,y=1,k1="?",k2="?",r1="00",r2="00",g1="00",g2="00",b1="00",b2="00"}
  26. end
  27.  
  28. for nick in pairs(tfm.get.room.playerList) do
  29. eventNewPlayer(nick)
  30. end
  31.  
  32. function Lista()
  33. TXT="Gracze:\n"
  34. for gracz in pairs(Ekw) do
  35. for id,stat in pairs(Ekw[gracz]) do
  36. if stat.k1~="?" then
  37. if stat.tr=="online" then
  38. TXT=TXT.."\n<N>("..stat.k1:sub(3,8)..") <font color='#"..stat.k1:sub(3).."'>"..gracz
  39. elseif stat.tr=="mixline" then
  40. TXT=TXT.."\n<N>("..stat.k1:sub(3,8)..") <font color='#"..stat.k1:sub(3).."'>"..gracz.." "..id
  41. end
  42. end
  43. end
  44. end
  45. ui.addTextArea(9,TXT,A,50,50,n,n,n,n,1,true)
  46. end
  47.  
  48. function GR(nick)
  49. TX2=""
  50. for i in pairs(Ekw[nick]) do
  51. if i==1 then
  52. TX1="<G>- <J>"
  53. else
  54. TX1="<J><a href='event:-'>-</a> "
  55. end
  56. TX2=TX2.."<a href='event:"..i.."'>"..i.."</a> "
  57. ii=i
  58. end
  59. if ii==5 then
  60. TXT=TX1..TX2.." <G>+"
  61. else
  62. TXT=TX1..TX2.." <a href='event:+'>+</a>"
  63. end
  64. ui.addTextArea(7,TXT,nick,300,70,200,n,n,n,1,true)
  65. end
  66.  
  67. function Wybr(nick)
  68. ui.addTextArea(0," Wybierz swój kolor:<textformat tabstops='[20,50,80]'>\n\n\n\t<R><B>R</B>\t<VP><B>G</B>\t<BL><B>B</B>\n\n\t<J><a href='event:R0'>[00]</a>\t<a href='event:G0'>[00]</a>\t<a href='event:B0'>[00]</a>\n\t<a href='event:R1'>[33]</a>\t<a href='event:G1'>[33]</a>\t<a href='event:B1'>[33]</a>\n\t<a href='event:R2'>[66]</a>\t<a href='event:G2'>[66]</a>\t<a href='event:B2'>[66]</a>\n\t<a href='event:R3'>[99]</a>\t<a href='event:G3'>[99]</a>\t<a href='event:B3'>[99]</a>\n\t<a href='event:R4'>[cc]</a>\t<a href='event:G4'>[cc]</a>\t<a href='event:B4'>[cc]</a>\n\t<a href='event:R5'>[FF]</a>\t<a href='event:G5'>[FF]</a>\t<a href='event:B5'>[FF]</a>\n ",nick,300,100,200,180,n,n,1,true)
  69. ui.addTextArea(1,"",nick,420,130,60,60,0xe242d,0xe242d,1,true)
  70. eventTextAreaCallback(0,nick,"N9")
  71. ui.addTextArea(5,"<p align='center'><J><a href='event:ANL'>Anuluj",nick,410,255,80,n,n,n,1,true)
  72. ui.addTextArea(6,"<a href='event:ZAM'><R><B>X",nick,490,100,n,n,n,n,0,true)
  73. end
  74.  
  75. function eventChatCommand(nick,komd)
  76. if komd==has and A=="" then
  77. A=nick
  78. S=tfm.get.room.playerList[A]
  79. for i=1,7 do
  80. tfm.exec.displayParticle(13,S.x,S.y-50,math.random(-30,30)/10,math.random(-10,10)/10,0,0,nil)
  81. end
  82. tfm.exec.setNameColor(A,0xeb1d51)
  83. Lista()
  84. elseif komd=="pomoc" or komd=="info" then
  85. ui.addTextArea(303,TEXT[komd],nick,230,110,340,200,0x1c3c41,0x1c3c41,1,true)
  86. ui.addTextArea(304,'<B><R><a href="event:ZMP">X</a>',nick,550,110,14,18,n,n,0,true)
  87. elseif komd=="online" and Ekw[nick][1].o==0 then
  88. Ekw[nick]={}
  89. Ekw[nick][1]={tr=komd,t=0,il=1,w=1,o=0,pkt=0,x=1,y=1,k1="?",k2="?",r1="00",r2="00",g1="00",g2="00",b1="00",b2="00"}
  90. if A~=nick then
  91. tfm.exec.setNameColor(nick,0x777777)
  92. end
  93. Lista()
  94. elseif komd=="offline" and Ekw[nick][1].o==0 then
  95. Ekw[nick]={}
  96. Ekw[nick][1]={tr=komd,t=0,il=1,w=1,o=0,pkt=0,x=1,y=1,k1="?",k2="?",r1="00",r2="00",g1="00",g2="00",b1="00",b2="00"}
  97. if A~=nick then
  98. tfm.exec.setNameColor(nick,0x77aaaa)
  99. end
  100. elseif komd=="mixline" and Ekw[nick][1].o==0 then
  101. Ekw[nick]={}
  102. Ekw[nick][1]={tr=komd,t=0,il=1,w=1,o=0,pkt=0,x=1,y=1,k1="?",k2="?",r1="00",r2="00",g1="00",g2="00",b1="00",b2="00"}
  103. if A~=nick then
  104. tfm.exec.setNameColor(nick,0xaaaa77)
  105. end
  106. Lista()
  107. elseif komd=="dodaj" and o==0 and Ekw[nick][1].tr=="online" then
  108. Wybr(nick)
  109. Ekw[nick][1].o=1
  110. if A~=nick then
  111. tfm.exec.setNameColor(nick,0x77aa77)
  112. end
  113. elseif komd=="dodaj" and Ekw[nick][1].tr=="offline" then
  114. Wybr(nick)
  115. GR(nick)
  116. ui.addTextArea(8,"<p align='center'>Sterowanie:\n\n<J>"..Klaw[Ekw[nick][1].w][5],nick,520,100,n,n,n,n,1,true)
  117. elseif komd=="dodaj" and o==0 and Ekw[nick][1].tr=="mixline" then
  118. Wybr(nick)
  119. GR(nick)
  120. ui.addTextArea(8,"<p align='center'>Sterowanie:\n\n<J>"..Klaw[Ekw[nick][1].w][5],nick,520,100,n,n,n,n,1,true)
  121. Ekw[nick][1].o=1
  122. if A~=nick then
  123. tfm.exec.setNameColor(nick,0xaaaa77)
  124. end
  125. elseif komd=="odejdź" and Ekw[nick][1].tr~="offline" then
  126. for i=1,Gr.il do
  127. for j=1,4 do
  128. tfm.exec.bindKeyboard(nick,Klaw[i][j],true,false)
  129. end
  130. end
  131. if o==1 then
  132. for gracz in pairs(Ekw) do
  133. for id,stat in pairs(Ekw[gracz]) do
  134. if stat.tr~="offline" and stat.k1~="?" then
  135. ui.addTextArea(Ekw[nick][1].x+(Ekw[nick][1].y-1)*20,"",gracz,110+30*((Ekw[nick][1].x-1)%20),80+30*((Ekw[nick][1].y-1)%10),20,20,Ekw[nick][1].k2,Ekw[nick][1].k2,1,true)
  136. end
  137. end
  138. end
  139. end
  140. if A~=nick then
  141. tfm.exec.setNameColor(nick,0x777777)
  142. if Ekw[nick][1].tr=="mixline" then
  143. tfm.exec.setNameColor(nick,0xaaaa77)
  144. end
  145. end
  146. ST=Ekw[gracz][1].tr
  147. Ekw[nick]={}
  148. Ekw[nick][1]={tr=ST,t=0,il=1,w=1,o=0,pkt=0,x=1,y=1,k1="?",k2="?",r1="00",r2="00",g1="00",g2="00",b1="00",b2="00"}
  149. Lista()
  150. elseif komd=="start" and Ekw[nick][1].tr=="offline" and Ekw[nick][1].o==1 then
  151. for i=1,200 do
  152. Ekw[nick][1].Pole[i]=""
  153. end
  154. ui.addTextArea(201,"",nick,90,60,630,330,0x1c3c41,0x1c3c41,1,true)
  155. ui.addTextArea(202,"",nick,100,70,610,310,0xe242d,0xe242d,1,true)
  156. ui.addTextArea(203,"",nick,40,30,730,10,0x1c3c41,0x1c3c41,1,true)
  157. ui.addTextArea(204,"",nick,45,34,720,2,0xcc0000,0xcc0000,1,true)
  158. ui.addTextArea(205,"",nick,45,34,720,2,0xcc00,0xcc00,1,true)
  159. for i=1,200 do
  160. ui.addTextArea(i,"",nick,110+30*((i-1)%20),80+30*math.floor((i-1)/20),20,20,0x1c3c41,0x1c3c41,1,true)
  161. end
  162. for id,stat in pairs(Ekw[nick]) do
  163. ui.addTextArea(stat.x+(stat.y-1)*20,"<V>"..id,nick,110+30*((stat.x-1)%20),80+30*((stat.y-1)%10),20,20,stat.k1,stat.k1,1,true)
  164. end
  165. Ekw[nick][1].o=2
  166. elseif komd=="koniec" and Ekw[nick][1].tr=="offline" and Ekw[nick][1].o==2 then
  167. ST=Ekw[nick][1].tr
  168. Ekw[nick]={}
  169. Ekw[nick][1]={tr=ST,t=0,il=1,w=1,o=0,pkt=0,x=1,y=1,k1="?",k2="?",r1="00",r2="00",g1="00",g2="00",b1="00",b2="00"}
  170. for i=1,Gr.il do
  171. for j=1,4 do
  172. tfm.exec.bindKeyboard(nick,Klaw[i][j],true,false)
  173. end
  174. end
  175. for i=0,205 do
  176. ui.removeTextArea(i,nick)
  177. end
  178. elseif A==nick then
  179. if komd=="start" and Ekw[nick][1].tr~="offline" and o==0 then
  180. il=0
  181. for gracz in pairs(Ekw) do
  182. for id,stat in pairs(Ekw[gracz]) do
  183. if stat.k1~="?" then
  184. il=il+1
  185. end
  186. end
  187. end
  188. if il~=0 then
  189. o=1
  190. for i=1,200 do
  191. Pole[i]=""
  192. end
  193. for gracz in pairs(Ekw) do
  194. for id,stat in pairs(Ekw[gracz]) do
  195. if id==1 and stat.tr~="offline" and stat.k1~="?" then
  196. ui.addTextArea(201,"",gracz,90,60,630,330,0x1c3c41,0x1c3c41,1,true)
  197. ui.addTextArea(202,"",gracz,100,70,610,310,0xe242d,0xe242d,1,true)
  198. ui.addTextArea(203,"",gracz,40,30,730,10,0x1c3c41,0x1c3c41,1,true)
  199. ui.addTextArea(204,"",gracz,45,34,720,2,0xcc0000,0xcc0000,1,true)
  200. ui.addTextArea(205,"",gracz,45,34,720,2,0xcc00,0xcc00,1,true)
  201. for i=1,200 do
  202. ui.addTextArea(i,"",gracz,110+30*((i-1)%20),80+30*math.floor((i-1)/20),20,20,0x1c3c41,0x1c3c41,1,true)
  203. end
  204. end
  205. end
  206. end
  207. for gracz in pairs(Ekw) do
  208. for id,st1 in pairs(Ekw[gracz]) do
  209. if st1.tr~="offline" and st1.k1~="?" then
  210. for wrog in pairs(Ekw) do
  211. for di,st2 in pairs(Ekw[wrog]) do
  212. if st2.tr~="offline" and st2.k1~="?" then
  213. ui.addTextArea(st2.x+(st2.y-1)*20,"",gracz,110+30*((st2.x-1)%20),80+30*((st2.y-1)%10),20,20,st2.k1,st2.k1,1,true)
  214. end
  215. end
  216. end
  217. end
  218. end
  219. end
  220. for gracz in pairs(Ekw) do
  221. for id,stat in pairs(Ekw[gracz]) do
  222. if stat.k1~="?" then
  223. if stat.tr=="online" then
  224. ui.addTextArea(stat.x+(stat.y-1)*20,"<V>Ty",gracz,110+30*((stat.x-1)%20),80+30*((stat.y-1)%10),20,20,stat.k1,stat.k1,1,true)
  225. elseif stat.tr=="mixline" then
  226. ui.addTextArea(stat.x+(stat.y-1)*20,"<V>"..id,gracz,110+30*((stat.x-1)%20),80+30*((stat.y-1)%10),20,20,stat.k1,stat.k1,1,true)
  227. end
  228. end
  229. end
  230. end
  231. end
  232. elseif komd=="koniec" and o==1 then
  233. o,t=0,0
  234. for gracz in pairs(Ekw) do
  235. for id,stat in pairs(Ekw[gracz]) do
  236. if stat.tr~="offline" then
  237. ST=Ekw[gracz][1].tr
  238. Ekw[gracz]={}
  239. Ekw[gracz][1]={tr=ST,t="x",il=1,w=1,o=0,pkt=0,x=1,y=1,k1="?",k2="?",r1="00",r2="00",g1="00",g2="00",b1="00",b2="00"}
  240. for i=0,205 do
  241. ui.removeTextArea(i,gracz)
  242. end
  243. end
  244. for i=73,76 do
  245. tfm.exec.bindKeyboard(gracz,i,true,false)
  246. end
  247. end
  248. end
  249. Lista()
  250. end
  251. end
  252. end
  253.  
  254. function eventTextAreaCallback(id,nick,odp)
  255. Gr=Ekw[nick][1]
  256. Gx=Ekw[nick][Ekw[nick][1].w]
  257. if odp=="ZMP" then
  258. ui.removeTextArea(303,nick)
  259. ui.removeTextArea(304,nick)
  260. elseif odp=="OK" then
  261. eventTextAreaCallback(0,nick,"ZAM")
  262. for i=1,Gr.il do
  263. Ekw[nick][i].k1="0x"..Ekw[nick][i].r1..Ekw[nick][i].g1..Ekw[nick][i].b1
  264. Ekw[nick][i].k2="0x"..Ekw[nick][i].r2..Ekw[nick][i].g2..Ekw[nick][i].b2
  265. Ekw[nick][i].pkt=0
  266. Ekw[nick][i].x,Ekw[nick][i].y=math.random(1,20),math.random(1,10)
  267. end
  268. if A~=nick and Gr.tr=="online" then
  269. tfm.exec.setNameColor(nick,0x77ff77)
  270. elseif A~=nick and Gr.tr=="offline" then
  271. tfm.exec.setNameColor(nick,0x77ffff)
  272. Gr.Pole={}
  273. Gr.t=0
  274. Gr.o=1
  275. elseif A~=nick and Gr.tr=="mixline" then
  276. tfm.exec.setNameColor(nick,0xffff77)
  277. end
  278. Lista()
  279. elseif odp=="ANL" then
  280. eventTextAreaCallback(0,nick,"ZAM")
  281. Ekw[nick][1].o=0
  282. if A~=nick then
  283. tfm.exec.setNameColor(nick,0x777777)
  284. end
  285. elseif odp=="ZAM" then
  286. for i=0,8 do
  287. ui.removeTextArea(i,nick)
  288. end
  289. elseif odp=="KON" then
  290. eventChatCommand(nick,"koniec")
  291. elseif odp=="+" then
  292. Gr.il=Gr.il+1
  293. Ekw[nick][Gr.il]={tr=Gr.tr,pkt=0,x=1,y=1,k1="?",k2="?",r1="00",r2="00",g1="00",g2="00",b1="00",b2="00"}
  294. GR(nick)
  295. eventTextAreaCallback(0,nick,"N9")
  296. elseif odp=="-" then
  297. Ekw[nick][Gr.il]=nil
  298. Gr.il=Gr.il-1
  299. Ekw[nick][1].w=1
  300. GR(nick)
  301. eventTextAreaCallback(0,nick,"N9")
  302. elseif type(tonumber(odp))=="number" then
  303. odp=tonumber(odp)
  304. Ekw[nick][1].w=odp
  305. ui.addTextArea(2,"",nick,440,150,20,20,"0x"..Ekw[nick][odp].r1..Ekw[nick][odp].g1..Ekw[nick][odp].b1,"0x"..Ekw[nick][odp].r1..Ekw[nick][odp].g1..Ekw[nick][odp].b1,1,true)
  306. ui.addTextArea(3,"<R>R<N> : "..Ekw[nick][odp].r1.."\n<VP>G<N> : "..Ekw[nick][odp].g1.."\n<BL>B<N> : "..Ekw[nick][odp].b1,nick,420,200,60,n,n,n,0,true)
  307. ui.addTextArea(8,"<p align='center'>Sterowanie:\n\n<J>"..Klaw[Ekw[nick][1].w][5],nick,520,100,n,n,n,n,1,true)
  308. eventTextAreaCallback(0,nick,"N9")
  309. elseif id==0 then
  310. for v,k in pairs({{"R","r"},{"G","g"},{"B","b"}}) do
  311. for v,l in pairs({{0,"00","00"},{1,33,22},{2,66,44},{3,99,66},{4,"cc",88},{5,"ff","aa"}}) do
  312. if odp==k[1]..l[1] then
  313. Gx[k[2]..1],Gx[k[2]..2]=l[2],l[3]
  314. end
  315. end
  316. end
  317. ui.addTextArea(2,"",nick,440,150,20,20,"0x"..Gx.r1..Gx.g1..Gx.b1,"0x"..Gx.r1..Gx.g1..Gx.b1,1,true)
  318. ui.addTextArea(3,"<R>R<N> : "..Gx.r1.."\n<VP>G<N> : "..Gx.g1.."\n<BL>B<N> : "..Gx.b1,nick,420,200,60,n,n,n,0,true)
  319. kk=0
  320. for id,stat in pairs(Ekw[nick]) do
  321. if stat.r1=="00" and stat.g1=="00" and stat.b1=="00" then
  322. kk=kk+1
  323. end
  324. end
  325. if kk==0 then
  326. ui.addTextArea(4,"<p align='center'><J><a href='event:OK'>Wybierz</a> ",nick,310,255,80,n,n,n,1,true)
  327. else
  328. ui.addTextArea(4,"<p align='center'><G>Wybierz",nick,310,255,80,n,n,n,1,true)
  329. end
  330. end
  331. end
  332.  
  333. function eventKeyboard(nick,klaw)
  334. if Ekw[nick][1].tr~="offline" then
  335. for gracz in pairs(Ekw) do
  336. for id,stat in pairs(Ekw[gracz]) do
  337. if stat.tr~="offline" and stat.k1~="?" then
  338. for i=1,Ekw[nick][1].il do
  339. ui.addTextArea(Ekw[nick][i].x+(Ekw[nick][i].y-1)*20,"",gracz,110+30*((Ekw[nick][i].x-1)%20),80+30*((Ekw[nick][i].y-1)%10),20,20,Ekw[nick][i].k2,Ekw[nick][i].k2,1,true)
  340. end
  341. end
  342. end
  343. end
  344. elseif Ekw[nick][1].tr=="offline" then
  345. for id,stat in pairs(Ekw[nick]) do
  346. ui.addTextArea(stat.x+(stat.y-1)*20,"",nick,110+30*((stat.x-1)%20),80+30*((stat.y-1)%10),20,20,stat.k2,stat.k2,1,true)
  347. end
  348. end
  349. for i,k in pairs(Klaw) do
  350. if klaw==k[1] and Ekw[nick][i].y>1 then
  351. Ekw[nick][i].y=Ekw[nick][i].y-1
  352. elseif klaw==k[3] and Ekw[nick][i].x>1 then
  353. Ekw[nick][i].x=Ekw[nick][i].x-1
  354. elseif klaw==k[2] and Ekw[nick][i].y<10 then
  355. Ekw[nick][i].y=Ekw[nick][i].y+1
  356. elseif klaw==k[4] and Ekw[nick][i].x<20 then
  357. Ekw[nick][i].x=Ekw[nick][i].x+1
  358. end
  359. end
  360. if Ekw[nick][1].tr~="offline" then
  361. for gracz in pairs(Ekw) do
  362. for id,stat in pairs(Ekw[gracz]) do
  363. if stat.tr~="offline" and stat.k1~="?" then
  364. for i=1,Ekw[nick][1].il do
  365. ui.addTextArea(Ekw[nick][i].x+(Ekw[nick][i].y-1)*20,"",gracz,110+30*((Ekw[nick][i].x-1)%20),80+30*((Ekw[nick][i].y-1)%10),20,20,Ekw[nick][i].k1,Ekw[nick][i].k1,1,true)
  366. end
  367. end
  368. end
  369. end
  370. for id,stat in pairs(Ekw[nick]) do
  371. if stat.tr~="offline" and stat.k1~="?" then
  372. if stat.tr=="online" then
  373. ui.addTextArea(stat.x+(stat.y-1)*20,"<V>Ty",nick,110+30*((stat.x-1)%20),80+30*((stat.y-1)%10),20,20,stat.k1,stat.k1,1,true)
  374. else
  375. ui.addTextArea(stat.x+(stat.y-1)*20,"<V>"..id,nick,110+30*((stat.x-1)%20),80+30*((stat.y-1)%10),20,20,stat.k1,stat.k1,1,true)
  376. end
  377. Pole[stat.x+(stat.y-1)*20]={nick,id}
  378. end
  379. end
  380. elseif Ekw[nick][1].tr=="offline" then
  381. for id,stat in pairs(Ekw[nick]) do
  382. ui.addTextArea(stat.x+(stat.y-1)*20,"",nick,110+30*((stat.x-1)%20),80+30*((stat.y-1)%10),20,20,stat.k1,stat.k1,1,true)
  383. Ekw[nick][1].Pole[stat.x+(stat.y-1)*20]=id
  384. end
  385. end
  386. end
  387.  
  388. function eventLoop()
  389. if o==1 then
  390. if t<151 then
  391. t=t+1
  392. end
  393. ST="<p align='center'><B>"
  394. if t>16 and t<136 then
  395. Okno(3)
  396. elseif t==150 then
  397. TXT="<textformat tabstops='[120]'>"
  398. for gracz in pairs(Ekw) do
  399. for id,stat in pairs(Ekw[gracz]) do
  400. if stat.tr~="offline" and stat.pkt>0 then
  401. if stat.tr=="online" then
  402. TXT=TXT.."<font color='#"..stat.k1:sub(3).."'>███ <V>"..gracz.."\t<N>- <J>"..stat.pkt.."\n<V>"
  403. else
  404. TXT=TXT.."<font color='#"..stat.k1:sub(3).."'>███ <V>"..gracz.." <T>"..id.."\t<N>- <J>"..stat.pkt.."\n<V>"
  405. end
  406. tfm.exec.setPlayerScore(gracz,stat.pkt,true)
  407. if A~=gracz then
  408. tfm.exec.setNameColor(gracz,0x777777)
  409. if stat.tr=="mixline" then
  410. tfm.exec.setNameColor(gracz,0xaaaa77)
  411. end
  412. end
  413. end
  414. end
  415. end
  416. Okno(5,TXT,"<B><R><a href='event:KON'>X</a>")
  417. elseif t==148 then
  418. for i=1,200 do
  419. if Pole[i]~="" then
  420. Ekw[Pole[i][1]][Pole[i][2]].pkt=Ekw[Pole[i][1]][Pole[i][2]].pkt+1
  421. end
  422. end
  423. Okno(4)
  424. elseif t==146 then
  425. Okno(2)
  426. elseif t==144 then
  427. for i=1,200 do
  428. Okno(9,i)
  429. end
  430. elseif t==142 then
  431. Okno(9,203)
  432. Okno(9,204)
  433. Okno(9,206)
  434. elseif t==140 then
  435. Okno(1,"888800","KONIEC")
  436. elseif t==136 then
  437. Okno(1,"cccc00","KONIEC")
  438. Okno(9,205)
  439. for gracz in pairs(Ekw) do
  440. for id,stat in pairs(Ekw[gracz]) do
  441. if stat.k1~="?" then
  442. for i=1,Ekw[gracz][1].il do
  443. for j=1,4 do
  444. tfm.exec.bindKeyboard(gracz,Klaw[i][j],true,false)
  445. end
  446. end
  447. end
  448. end
  449. end
  450. elseif t==8 then
  451. Okno(1,"cccc00",3)
  452. elseif t==9 then
  453. Okno(1,"888800",3)
  454. elseif t==10 then
  455. Okno(1,"cccc00",2)
  456. elseif t==11 then
  457. Okno(1,"888800",2)
  458. elseif t==12 then
  459. Okno(1,"cccc00",1)
  460. elseif t==13 then
  461. Okno(1,"888800",1)
  462. elseif t==14 then
  463. Okno(1,"cccc00","START")
  464. for gracz in pairs(Ekw) do
  465. for id,stat in pairs(Ekw[gracz]) do
  466. if id==1 and stat.k1~="?" then
  467. for i=1,Ekw[gracz][1].il do
  468. for j=1,4 do
  469. tfm.exec.bindKeyboard(gracz,Klaw[i][j],true)
  470. end
  471. end
  472. Pole[Ekw[gracz][1].x+(Ekw[gracz][1].y-1)*20]={gracz,id}
  473. end
  474. end
  475. end
  476. elseif t==16 then
  477. Okno(9,206)
  478. end
  479. end
  480. for nick in pairs(tfm.get.room.playerList) do
  481. Gr=Ekw[nick][1]
  482. if Gr.o==2 then
  483. if Gr.t<151 then
  484. Gr.t=Gr.t+1
  485. end
  486. ST="<p align='center'><B>"
  487. if Gr.t>16 and Gr.t<136 then
  488. ui.addTextArea(205,"",nick,45,34,720-6*(Gr.t-16),2,0xcc00,0xcc00,1,true)
  489. elseif Gr.t==150 then
  490. TXT="<textformat tabstops='[120]'>"
  491. for id,stat in pairs(Ekw[nick]) do
  492. if stat.pkt>0 then
  493. TXT=TXT.."<font color='#"..stat.k1:sub(3).."'>███ <V>"..nick.." <T>"..id.."\t<N>- <J>"..stat.pkt.."\n<V>"
  494. end
  495. end
  496. if A~=gracz then
  497. tfm.exec.setNameColor(nick,0x7777aa)
  498. end
  499. ui.addTextArea(1,TXT,nick,340,120,n,n,n,n,0,true)
  500. ui.addTextArea(2,"<B><R><a href='event:KON'>X</a>",nick,680,90,n,n,n,n,0,true)
  501. elseif Gr.t==148 then
  502. for i=1,200 do
  503. if Gr.Pole[i]~="" then
  504. Ekw[nick][Gr.Pole[i]].pkt=Ekw[nick][Gr.Pole[i]].pkt+1
  505. end
  506. end
  507. ui.addTextArea(204,ST.."<font size='20'>Wynik:",nick,120,90,570,n,n,n,0,true)
  508. elseif Gr.t==146 then
  509. ui.addTextArea(203,"",nick,120,90,570,270,0x1c3c41,0x1c3c41,1,true)
  510. elseif Gr.t==144 then
  511. for i=1,200 do
  512. ui.removeTextArea(i,nick)
  513. end
  514. elseif Gr.t==142 then
  515. ui.removeTextArea(203,nick)
  516. ui.removeTextArea(204,nick)
  517. ui.removeTextArea(206,nick)
  518. elseif Gr.t==140 then
  519. ui.addTextArea(206,ST.."<font size='60' color='#888800'>KONIEC",nick,0,150,800,n,n,n,0,true)
  520. elseif Gr.t==136 then
  521. ui.addTextArea(206,ST.."<font size='60' color='#cccc00'>KONIEC",nick,0,150,800,n,n,n,0,true)
  522. ui.removeTextArea(205,nick)
  523. for i=1,Gr.il do
  524. for j=1,4 do
  525. tfm.exec.bindKeyboard(nick,Klaw[i][j],true,false)
  526. end
  527. end
  528. elseif Gr.t==8 then
  529. ui.addTextArea(206,ST.."<font size='60' color='#cccc00'>3",nick,0,150,800,n,n,n,0,true)
  530. elseif Gr.t==9 then
  531. ui.addTextArea(206,ST.."<font size='60' color='#888800'>3",nick,0,150,800,n,n,n,0,true)
  532. elseif Gr.t==10 then
  533. ui.addTextArea(206,ST.."<font size='60' color='#cccc00'>2",nick,0,150,800,n,n,n,0,true)
  534. elseif Gr.t==11 then
  535. ui.addTextArea(206,ST.."<font size='60' color='#888800'>2",nick,0,150,800,n,n,n,0,true)
  536. elseif Gr.t==12 then
  537. ui.addTextArea(206,ST.."<font size='60' color='#cccc00'>1",nick,0,150,800,n,n,n,0,true)
  538. elseif Gr.t==13 then
  539. ui.addTextArea(206,ST.."<font size='60' color='#888800'>1",nick,0,150,800,n,n,n,0,true)
  540. elseif Gr.t==14 then
  541. ui.addTextArea(206,ST.."<font size='60' color='#cccc00'>START",nick,0,150,800,n,n,n,0,true)
  542. for id,stat in pairs(Ekw[nick]) do
  543. Gr.Pole[stat.x+(stat.y-1)*20]=id
  544. end
  545. for i=1,Gr.il do
  546. for j=1,4 do
  547. tfm.exec.bindKeyboard(nick,Klaw[i][j],true)
  548. end
  549. end
  550. elseif Gr.t==16 then
  551. ui.removeTextArea(206,nick)
  552. end
  553. end
  554. end
  555. end
  556.  
  557. function Okno(a,b,c)
  558. for gracz in pairs(Ekw) do
  559. for id,stat in pairs(Ekw[gracz]) do
  560. if id==1 and stat.tr~="offline" and stat.k1~="?" then
  561. if a==3 then
  562. ui.addTextArea(205,"",gracz,45,34,720-6*(t-16),2,0xcc00,0xcc00,1,true)
  563. elseif a==1 then
  564. ui.addTextArea(206,ST.."<font size='60' color='#"..b.."'>"..c,gracz,0,150,800,n,n,n,0,true)
  565. elseif a==2 then
  566. ui.addTextArea(203,"",gracz,120,90,570,270,0x1c3c41,0x1c3c41,1,true)
  567. elseif a==4 then
  568. ui.addTextArea(204,ST.."<font size='20'>Wynik:",gracz,120,90,570,n,n,n,0,true)
  569. elseif a==5 then
  570. ui.addTextArea(1,b,gracz,340,120,n,n,n,n,0,true)
  571. ui.addTextArea(2,c,gracz,680,90,n,n,n,n,0,true)
  572. elseif a==9 then
  573. ui.removeTextArea(b,gracz)
  574. end
  575. end
  576. end
  577. end
  578. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement