4epB9Ik

dbg

May 31st, 2018
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 49.69 KB | None | 0 0
  1. -- быдлокод для юзания карты отладки + чатбокс + карта эффектов частиц + радар --> pastebin get 8HEKiJvV /bin/.d.lua -f
  2.  
  3. local c = require('component')
  4. local ser = require('serialization')
  5. local fs = require('filesystem')
  6. local comp = require('computer')
  7. local ev = require('event')
  8. local term = require('term')
  9.  
  10. local av = c.isAvailable
  11. local g = c.gpu
  12. local xOld, yOld = g.getResolution()
  13. local w, h = 30, 15
  14. local int = 1
  15. local xPart, yPart, zPart = 0, 0, 0
  16. local radarSleep = 2
  17. local cbCor = 10
  18. local timer = 1
  19. local genJoke = { jokeLen = 5 }
  20. local textColor = '§f'
  21. local screen = 'main'
  22. local configPath, autorunPath = '/.deb_conf.cfg', '/.autorun.lua'
  23. local work = true
  24. local colors = {green = 0xff0000, darkGreen = 0x006600, red = 0x770000, gray = 0x454545, white = 0xffffff, black = 0x000000}
  25. local frases = { } -- фразы для шутника. { 'фраза1', 'фраза2' ... }
  26.  
  27. function main()
  28. screen = 'main'
  29. press()
  30. g.setResolution(w,h)
  31. g.setBackground(colors.black)
  32. finalMenu(9,'DEBUG > MAIN')
  33. g.fill(4,3,1,10,'│')
  34. g.fill(17,3,1,8,'│')
  35. g.set(4,3, '┌─ WORLD')
  36. g.set(4,5, '├─ PLAYER')
  37. g.set(4,7, '├─ GM 1')
  38. g.set(4,9, '├─ GM 0')
  39. g.set(4,11, '├─ CHAT')
  40. g.set(4,13, '└─ CONSOLE COMMAND >>')
  41. g.set(17,3, '┌─ WARPS')
  42. g.set(17,5, '├─ PEX ADD')
  43. g.set(17,7, '├─ PEX REM')
  44. g.set(17,9, '├─ NOCLIP')
  45. g.set(17,11,'└─ PARTS')
  46. if not chatAccess then
  47. g.setForeground(colors.gray)
  48. g.set(7,11,'CHAT')
  49. end
  50. if not particleAccess then
  51. g.setForeground(colors.gray)
  52. g.set(20,11,'PARTS')
  53. end
  54. end
  55.  
  56. function world()
  57. screen = 'world'
  58. finalMenu(9,'DEBUG > WORLD')
  59. g.fill(4,3,1,10,'│')
  60. g.fill(17,3,1,8,'│')
  61. g.set(4,3, '┌─ SETBLOCK')
  62. g.set(4,5, '├─ SETBLOCKS')
  63. g.set(4,7, '├─ REMITEM')
  64. g.set(4,9, '├─ INSITEM')
  65. g.set(4,11, '├─ DAYRAIN')
  66. g.set(4,13, '└─ SUMMON')
  67. g.set(17,3, '┌─ INSITEMS')
  68. g.set(17,5, '├─ NBTS')
  69. g.set(17,7, '├─ SIGNS')
  70. g.set(17,9, '├─ IMBPOTION')
  71. g.set(17,11,'└─ SOUNDS')
  72. end
  73.  
  74. function signsMenu()
  75. screen = 'signs'
  76. finalMenu(9,'DEBUG > SIGNS')
  77. g.fill(4,3,1,11, '│')
  78. g.fill(17,3,1,3,'│')
  79. g.set(4,3, '┌─ FREE')
  80. g.set(4,5, '├─ BUY')
  81. g.set(4,7, '├─ SELL')
  82. g.set(4,9, '├─ DISPENSER')
  83. g.set(4,11,'├─ CREATIVE')
  84. g.set(4,13,'└─ GATE')
  85. g.set(17,3,'┌─ EDIT')
  86. g.set(17,5,'└─ CLEAR')
  87. end
  88.  
  89. function player()
  90. screen = 'playr'
  91. finalMenu(9,'DEBUG > PLAYER')
  92. g.fill(4,3,1,9, '│')
  93. g.fill(17,3,1,9,'│')
  94. g.set(4,3, '┌─ INFO')
  95. g.set(4,5, '├─ TPA')
  96. g.set(4,7, '├─ TPAME')
  97. g.set(4,9, '├─ TPAMETO')
  98. g.set(4,11, '└─ FREEZE')
  99. g.set(17,3, '┌─ TPAHERE')
  100. g.set(17,5, '├─ TPAPTOP')
  101. g.set(17,7, '├─ SETHP')
  102. g.set(17,9, '├─ CLIPBRD')
  103. g.set(17,11,'└─ KICK')
  104. end
  105.  
  106. function finalMenu(center,menu)
  107. term.clear()
  108. g.setForeground(colors.white)
  109. g.set(27,1,'[*]')
  110. g.set(center,1,menu)
  111. g.set(30,1,'|||||HIDE||||||',true)
  112. g.set(26,15,'EXIT')
  113. g.set(14,15,'ADMS')
  114. g.set(2,15,'MAIN')
  115. g.setForeground(colors.green)
  116. end
  117.  
  118. function finalInputMenu(center,menu)
  119. term.clear()
  120. g.setForeground(colors.white)
  121. g.set(center,1,menu)
  122. g.setForeground(colors.green)
  123. g.fill(1,2,30,1,'─')
  124. term.setCursor(1,3)
  125. end
  126.  
  127. function warps()
  128. screen = 'warps'
  129. finalMenu(9,'DEBUG > WARPS')
  130. if #config.warps == 0 then
  131. g.set(1,3,'Press [+] to add the warp...')
  132. end
  133. g.fill(1,2,29,1,'─')
  134. g.set(27,2,'[+]')
  135. local startY = 2
  136. for i = 1, #config.warps do
  137. local warpName = config.warps[i].name
  138. g.setForeground(colors.white)
  139. g.set(3,i+startY,warpName)
  140. g.setForeground(colors.green)
  141. g.set(1,i+startY,'>')
  142. g.setForeground(colors.gray)
  143. g.set(28,i+startY,'x')
  144. end
  145. end
  146.  
  147. function addWarp()
  148. finalInputMenu(9,'WARPS > ADD')
  149. io.write('WarpName >> ')
  150. local newWarpName = io.read():sub(1,20)
  151. local x,y,z = getMyCoords()
  152. table.insert(config.warps,{ name = newWarpName, x = x, y = y, z = z })
  153. conf_S()
  154. end
  155.  
  156. function teleportToWarp(warpId)
  157. local x = config.warps[warpId].x
  158. local y = config.warps[warpId].y
  159. local z = config.warps[warpId].z
  160. dbg.getPlayer(config.admin).setPosition(x,y,z)
  161. end
  162.  
  163. function admins()
  164. screen = 'admns'
  165. finalMenu(5,'DEBUG > ADMINS')
  166. g.set(20,1,'[SCAN]')
  167. g.setForeground(colors.white)
  168. g.fill(1,2,29,1,'─')
  169. g.set(14,15,'EDIT')
  170. g.setForeground(colors.red)
  171. term.setCursor(1,3)
  172. local online = dbg.getPlayers()
  173. g.set(1,1,#online..' ')
  174. for i = 1, #online do
  175. local onePl = online[i]
  176. for c = 1, #config.admins do
  177. local oneAdm = config.admins[c]
  178. if onePl == oneAdm then
  179. local x1,y1,z1 = getMyCoords()
  180. local x2,y2,z2 = dbg.getPlayer(oneAdm).getPosition()
  181. local dim = dbg.getPlayer(oneAdm).getWorld().getDimensionId()
  182. local dist = math.sqrt((x2-x1)^2+(y2-y1)^2+(z2-z1)^2)
  183. print(oneAdm..' ('..dim..' dim, '..math.floor(dist)..'m)')
  184. end
  185. end
  186. end
  187. g.setForeground(colors.white)
  188. print('Press "A" for refresh...')
  189. end
  190.  
  191. function editAdmins()
  192. screen = 'edadm'
  193. finalMenu(9,'EDIT ADMINS')
  194. if #config.admins == 0 then
  195. g.set(1,3,'Press [+] to add the admin...')
  196. end
  197. g.fill(1,2,29,1,'─')
  198. g.set(27,2,'[+]')
  199. local startY = 2
  200. for i = 1, #config.admins do
  201. g.setForeground(colors.green)
  202. g.set(1,i+startY,'>')
  203. g.setForeground(colors.gray)
  204. g.set(28,i+startY,'x')
  205. g.setForeground(colors.white)
  206. g.set(3,i+startY,config.admins[i])
  207. end
  208. g.setForeground(colors.white)
  209. g.set(1,h,' MAIN ADMS EXIT|')
  210. end
  211.  
  212. function addAdmin()
  213. local newAdm = playersGet('ADMIN')
  214. if newAdm ~= 'main' then
  215. if testDuplet(config.admins,newAdm) then
  216. table.insert(config.admins,newAdm)
  217. conf_S()
  218. end
  219. end
  220. g.setResolution(w,h)
  221. end
  222.  
  223. function adminScan()
  224. local online = dbg.getPlayers()
  225. for i = 1, #online do
  226. local cPl = online[i]
  227. local gm = dbg.getPlayer(cPl).getGameType()
  228. if gm == 'creative' then
  229. if testDuplet(config.admins,cPl) then
  230. table.insert(config.admins,cPl)
  231. conf_S()
  232. end
  233. end
  234. end
  235. end
  236.  
  237. function testDuplet(mass,toTest)
  238. for i = 1, #mass do
  239. if toTest == mass[i] then
  240. return false
  241. end
  242. end
  243. return true
  244. end
  245.  
  246. function pexAdd()
  247. finalInputMenu(10,'PEX > ADD')
  248. io.write('PEX to add, or "main"\n >> ')
  249. PEX = io.read()
  250. if PEX ~= 'main' then
  251. local comand = '/pex user '..config.admin..' add '..PEX
  252. runComand(comand)
  253. end
  254. end
  255.  
  256. function pexRem()
  257. finalInputMenu(10,'PEX > REM')
  258. io.write('PEX to remove, or "main"\n >> ')
  259. PEX = io.read()
  260. if PEX ~= 'main' then
  261. local comand = '/pex user '..config.admin..' remove '..PEX
  262. runComand(comand)
  263. end
  264. end
  265.  
  266. function enterCommand()
  267. finalInputMenu(5,'DEBUG > ENTER COMMAND')
  268. io.write('Console Command or "main"\n >> ')
  269. local comand = io.read()
  270. if comand ~= 'main' then
  271. runComand(comand)
  272. end
  273. end
  274.  
  275. function resetChatBox()
  276. chat.setName(config.defaultChatBoxName)
  277. textColor = '§f'
  278. end
  279.  
  280. function chatBox()
  281. term.clear()
  282. g.setResolution(80,2)
  283. g.setForeground(colors.green)
  284. resetChatBox()
  285. while true do
  286. term.clear()
  287. g.set(1,1,'CHATBOX : rename cons nick cr kk kk2 spam joke main')
  288. io.write('\n >> ')
  289. menuChat = io.read()
  290. if menuChat == 'cons' then
  291. chat.setName('§r§dSERVER§7§o')
  292. textColor = '§d'
  293. elseif menuChat == 'nick' then
  294. resetChatBox()
  295. elseif menuChat == 'rename' then
  296. term.clear()
  297. io.write('NEW CHATBOX NAME\n >> ')
  298. newName = io.read()
  299. chat.setName('§r'..newName..'§7§o')
  300. textColor = '§f'
  301. elseif menuChat == 'spam' then
  302. spam()
  303. elseif menuChat == 'kk' then
  304. kick()
  305. elseif menuChat == 'kk2' then
  306. kick2()
  307. elseif menuChat == 'cr' and particleAccess then
  308. crash()
  309. elseif menuChat == 'joke' then
  310. pcall(joker)
  311. elseif menuChat == 'main' then
  312. break
  313. else
  314. chat.say(textColor..menuChat)
  315. end
  316. end
  317. end
  318.  
  319. function particles()
  320. finalInputMenu(9,'PARTICLE NAME')
  321. io.write('Particle, "wiki" or "main"\n >> ')
  322. menuParticle = io.read()
  323. if menuParticle ~= 'main' then
  324. if menuParticle == 'wiki' then
  325. printLink('http://minecraft-ru.gamepedia.com/Частицы')
  326. else
  327. spawn()
  328. end
  329. end
  330. end
  331.  
  332. function spawn()
  333. screen = 'spawn'
  334. press('clicks')
  335. term.clear()
  336. g.setResolution(80,2)
  337. g.setForeground(colors.green)
  338. g.set(1,1,'Particle: '..menuParticle)
  339. g.set(33,1,' [ STOP!! ] ')
  340. g.set(1,2,'[-][+] [-][+] [-][+] [circle] [default]')
  341. g.setForeground(colors.gray)
  342. g.set(8,2,'-- power')
  343. g.set(24,2,'-- radius')
  344. g.set(41,2,'-- height')
  345. spawnDefault()
  346. end
  347.  
  348. function spawnDefault()
  349. height = 0
  350. while screen == 'spawn' do
  351. p.spawn(menuParticle, math.random(-xPart,xPart)-0.5, math.random(-yPart,yPart)+height, math.random(-zPart,zPart)-0.5, 0, 0, 0)
  352. os.sleep(int)
  353. end
  354. end
  355.  
  356. function spawn360()
  357. height = 0
  358. while screen == 'spawn' do
  359. for i=0, 360 do
  360. p.spawn(menuParticle, math.sin(math.rad(i)) * xPart-0.5, height, math.cos(math.rad(i)) * xPart-0.5)
  361. end
  362. os.sleep(0.00001)
  363. end
  364. end
  365.  
  366. function spam()
  367. chat.setName('§kqwerty')
  368. term.clear()
  369. g.set(35,1,'[ STOP!! ]')
  370. while true do
  371. local br = ev.pull(0.00001)
  372. chat.say('§k'..math.random(100)..'qwertyqwertyqwertyqwertyqwerty')
  373. if br == 'touch' then
  374. link(35,1,'[ STOP!! ]')
  375. break
  376. end
  377. end
  378. resetChatBox()
  379. end
  380.  
  381. function crash()
  382. term.clear()
  383. g.set(35,1,'[ STOP!! ]')
  384. while true do
  385. local br = ev.pull(0.00001)
  386. p.spawn('smoke',0,0,0,math.huge,math.huge,math.huge)
  387. if br == 'touch' then
  388. link(35,1,'[ STOP!! ]')
  389. break
  390. end
  391. end
  392. end
  393.  
  394. function freeze()
  395. while true do
  396. local freezePlayer = playersGet('FREEZE')
  397. fx,fy,fz = dbg.getPlayer(freezePlayer).getPosition()
  398. if freezePlayer == 'main' then
  399. break
  400. else
  401. g.set(35,1,'[ STOP freezing '..freezePlayer..'! ]')
  402. while true do
  403. local br = ev.pull(0.00001)
  404. pcall(function() dbg.getPlayer(freezePlayer).setPosition(fx,fy,fz) end)
  405. if br == 'touch' then
  406. link(35,1,'[ STOP freezing '..freezePlayer..'! ]')
  407. break
  408. end
  409. end
  410. end
  411. end
  412. end
  413.  
  414. function longStr()
  415. local str1 = ''
  416. local str2 = 'лолкекчебурек'
  417. for i = 1, 2500 do
  418. str1 = str1..str2
  419. end
  420. return str1
  421. end
  422.  
  423. function kick2()
  424. term.clear()
  425. chat.setName(' ')
  426. g.set(35,1,'[ STOP!! ]')
  427. local str = longStr()
  428. while true do
  429. local br = ev.pull(0.00001)
  430. chat.say(str)
  431. if br == 'touch' then
  432. link(35,1,'[ STOP!! ]')
  433. break
  434. end
  435. end
  436. local str1 = ''
  437. resetChatBox()
  438. end
  439.  
  440. function kick()
  441. chat.setName(' ')
  442. local str = longStr()
  443. chat.say(str)
  444. resetChatBox()
  445. end
  446.  
  447. function tellrawKick(player)
  448. local str = longStr()
  449. dbg.runCommand('/tellraw '..player..' '..str)
  450. end
  451.  
  452. function tellrawKickInput()
  453. while true do
  454. local kickPlayer = playersGet('KICK')
  455. if kickPlayer == 'main' then
  456. break
  457. else
  458. tellrawKick(kickPlayer)
  459. end
  460. end
  461. end
  462.  
  463. function onTimer()
  464. local pls = r.getPlayers()
  465. chat.setName('§r§eАнтиВаниш§7§o')
  466. for a = 1,#pls do
  467. if pls[a].name ~= config.admin then chat.say('§4'..pls[a].name..' §e('..math.floor(pls[a].distance)..' m.)') end
  468. end
  469. resetChatBox()
  470. end
  471.  
  472. function joker()
  473. chat.setName('§r§4Шутник§63000§7§o')
  474. if #frases ~= 0 then
  475. for i = 1, genJoke.jokeLen do
  476. table.insert(genJoke,frases[math.random(#frases)])
  477. end
  478. local joke = ' --> '..table.concat(genJoke,' ')..'))0'
  479. chat.say(joke)
  480. genJoke = { }
  481. else
  482. chat.say(' --> Чтобы сгенерировать шутку, добавьте набор фраз через запятую в массив frases = { "фраза1", "фраза2" }')
  483. end
  484. resetChatBox()
  485. end
  486.  
  487. function dialog(_,_,who,message)
  488. if string.match(message,'сервер') ~= nil then
  489. chat.setName('§r§dSERVER§7§o')
  490. os.sleep(1)
  491. chat.say('§dЧего тебе, '..who..'?')
  492. resetChatBox()
  493. elseif string.match(message,'сасай') ~= nil then
  494. chat.setName('§r§dSERVER§7§o')
  495. os.sleep(1)
  496. chat.say('§dокай...')
  497. resetChatBox()
  498. elseif message == 'who' and who == config.admin and radarAccess then
  499. chat.setName('§r§eАнтиВаниш§7§o')
  500. local pl = r.getPlayers()
  501. for p = 1, #pl do
  502. if pl[p].name ~= config.admin then
  503. chat.say('§4'..pl[p].name..' §e('..math.floor(pl[p].distance)..' m.)')
  504. end
  505. end
  506. resetChatBox()
  507. elseif message == 'whereON' and who == config.admin and radarAccess then
  508. chat.setName('§r§eАнтиВаниш§7§o')
  509. chat.say('радар включён...')
  510. timer = ev.timer(radarSleep,onTimer,math.huge)
  511. elseif message == 'whereOFF' and who == config.admin and radarAccess then
  512. chat.setName('§r§eАнтиВаниш§7§o')
  513. chat.say('радар выключен...')
  514. resetChatBox()
  515. ev.cancel(timer)
  516. end
  517. end
  518.  
  519. function autoCompletePlayer(line)
  520. rs = { }
  521. for i = 1, #players do
  522. s = players[i]:find(line)
  523. if s == 1 then
  524. table.insert(rs, players[i])
  525. end
  526. end
  527. return rs
  528. end
  529.  
  530. function playersGet(playerAction)
  531. term.clear()
  532. g.setResolution(80,25)
  533. os.sleep(0.00001)
  534. g.setForeground(colors.green)
  535. g.fill(1,4,80,1,'─')
  536. g.fill(1,4,80,1,'─')
  537. g.set(2,3,'* enter "main" for back...')
  538. g.setForeground(colors.white)
  539. players = dbg.getPlayers()
  540. local startX = 1
  541. local startY = 4
  542. for i=1, #players do g.set(startX,startY+i,i..'. '..players[i])
  543. if i == 20 then startX = 22 startY = -16
  544. elseif i == 40 then startX = 44 startY = -36
  545. elseif i == 60 then startX = 64 startY = -56
  546. end
  547. end
  548. g.setForeground(colors.green)
  549. print('NICK FOR '..playerAction..' (can use TAB)\n >> ')
  550. term.setCursor(5,2)
  551. local targetPlayer = term.read({}, false, autoCompletePlayer):gsub("\n", "")
  552. return targetPlayer
  553. end
  554.  
  555. function playerInfo()
  556. plInf = playersGet('INFO')
  557. if plInf ~= 'main' then
  558. term.clear()
  559. g.setResolution(w,h)
  560. hp = dbg.getPlayer(plInf).getHealth()
  561. if hp == nil then
  562. print('Player "'..plInf..'" is offline')
  563. os.sleep(2)
  564. else
  565. while true do
  566. local dim = dbg.getPlayer(plInf).getWorld().getDimensionName()
  567. local dimId = dbg.getPlayer(plInf).getWorld().getDimensionId()
  568. local gm = dbg.getPlayer(plInf).getGameType()
  569. local maxHp = dbg.getPlayer(plInf).getMaxHealth()
  570. local x,y,z = dbg.getPlayer(plInf).getPosition()
  571. local xM,yM,zM = getMyCoords()
  572. local dist = math.sqrt((x-xM)^2+(y-yM)^2+(z-zM)^2)
  573. term.clear()
  574. g.fill(1,2,30,1,'─')
  575. print(' >> Info about '..plInf..':\n\nHealth: '..math.floor(hp)..'/'..maxHp..'\nDIM: '..dim..' ('..dimId..')\nGM: '..gm..'\nX >> '..math.floor(x)..'\nY >> '..math.floor(y)..'\nZ >> '..math.floor(z)..'\ndist >> '..math.floor(dist)..'\n\nPress "R" for refresh,\nor any key to exit...')
  576. local _,_,_,key = ev.pull('key_down')
  577. if key ~= 19 then
  578. break
  579. end
  580. end
  581. end
  582. end
  583. end
  584.  
  585. function tpa()
  586. local plTpa = playersGet('TPA')
  587. if plTpa ~= 'main' then
  588. term.setCursor(1,2)
  589. term.clearLine()
  590. io.write('X >> ')
  591. local x = io.read()
  592. term.setCursor(12,2)
  593. io.write('Y >> ')
  594. local y = io.read()
  595. term.setCursor(24,2)
  596. io.write('Z >> ')
  597. local z = io.read()
  598. pcall(function() dbg.getPlayer(plTpa).setPosition(tonumber(x),tonumber(y),tonumber(z)) end)
  599. end
  600. end
  601.  
  602. function tpaMe()
  603. finalInputMenu(7,'COORDS FOR TPAME')
  604. io.write('X or "main" >> ')
  605. local x = io.read()
  606. if x ~= 'main' then
  607. io.write('Y >> ')
  608. local y = io.read()
  609. io.write('Z >> ')
  610. local z = io.read()
  611. pcall(function() dbg.getPlayer(config.admin).setPosition(tonumber(x),tonumber(y),tonumber(z)) end)
  612. end
  613. end
  614.  
  615. function tpaMeTo()
  616. while true do
  617. local plTpaMe = playersGet('TPAMETO')
  618. if plTpaMe == 'main' then
  619. break
  620. else
  621. pcall(function() local x,y,z = dbg.getPlayer(plTpaMe).getPosition() if config.yCorrector then yCor = 100 else yCor = 0 end dbg.getPlayer(config.admin).setPosition(x,y+yCor,z) end)
  622. end
  623. end
  624. end
  625.  
  626. function tpaHere()
  627. local plTpaHere = playersGet('TPAHERE')
  628. if plTpaHere ~= 'main' then
  629. pcall(function() local x,y,z = dbg.getPlayer(config.admin).getPosition() dbg.getPlayer(plTpaHere).setPosition(x,y,z) end)
  630. end
  631. end
  632.  
  633. function tpaPtoP()
  634. local plForTp = playersGet('TP')
  635. if plForTp ~= 'main' then
  636. local plForTpAccept = playersGet('TPACCEPT')
  637. pcall(function() local x,y,z = dbg.getPlayer(plForTpAccept).getPosition() if config.yCorrector then yCor = 100 else yCor = 0 end dbg.getPlayer(plForTp).setPosition(x,y+yCor,z) end)
  638. end
  639. end
  640.  
  641. function setHp()
  642. local plSetHp = playersGet('SETHP')
  643. if plSetHp ~= 'main' then
  644. term.clearLine()
  645. io.write('HEALTH >> ')
  646. local hp = io.read()
  647. pcall(function() dbg.getPlayer(plSetHp).setHealth(tonumber(hp)) end)
  648. end
  649. end
  650.  
  651. function targetting(action,x,y,z)
  652. if not action then
  653. if not config.targetting then
  654. return x,y,z
  655. end
  656. end
  657. local key = 0
  658. term.clear()
  659. g.setResolution(w,4)
  660. g.setForeground(colors.gray)
  661. g.set(15,1,'(+x) to East')
  662. g.set(8,2,'(-z)')
  663. g.set(15,2,'(-x)')
  664. g.set(22,2,'(+z)')
  665. g.set(7,3,'(-y)')
  666. g.set(18,3,'(+y)')
  667. g.set(1,4,'X: Y: Z:')
  668. g.setForeground(colors.green)
  669. g.set(13,1,'W') -- + x (17)
  670. g.set(6,2,'A') -- - z (30)
  671. g.set(13,2,'S') -- - x (31)
  672. g.set(20,2,'D') -- + z (32)
  673. g.set(1,3,'SHIFT') -- - y (42)
  674. g.set(12,3,'SPACE') -- + y (57)
  675. g.set(23,3,'ENTER-->') -- exit (28)
  676. while true do
  677. if action then
  678. x, y, z = getMyCoords()
  679. end
  680. if key == 28 then
  681. if action then
  682. term.clear()
  683. g.setResolution(w,h)
  684. break
  685. else
  686. term.clear()
  687. g.setResolution(w,h)
  688. return x,y,z
  689. end
  690. elseif key == 17 then
  691. x = x + 1
  692. if action then
  693. dbg.getPlayer(config.admin).setPosition(x,y,z)
  694. end
  695. elseif key == 30 then
  696. z = z - 1
  697. if action then
  698. dbg.getPlayer(config.admin).setPosition(x,y,z)
  699. end
  700. elseif key == 31 then
  701. x = x - 1
  702. if action then
  703. dbg.getPlayer(config.admin).setPosition(x,y,z)
  704. end
  705. elseif key == 32 then
  706. z = z + 1
  707. if action then
  708. dbg.getPlayer(config.admin).setPosition(x,y,z)
  709. end
  710. elseif key == 42 then
  711. y = y - 1
  712. if action then
  713. dbg.getPlayer(config.admin).setPosition(x,y,z)
  714. end
  715. elseif key == 57 then
  716. y = y + 1
  717. if action then
  718. dbg.getPlayer(config.admin).setPosition(x,y,z)
  719. end
  720. end
  721. g.set(3,4,tostring(math.floor(x))..' ')
  722. g.set(13,4,tostring(math.floor(y))..' ')
  723. g.set(23,4,tostring(math.floor(z))..' ')
  724. _,_,_,key = ev.pull('key_down')
  725. end
  726. end
  727.  
  728. function getCoords(coordsAction)
  729. io.write('X or "m", "p" >> ')
  730. Gx = io.read()
  731. if Gx == 'm' then
  732. return targetting(false,getMyCoords())
  733. elseif Gx == 'p' then
  734. local plC = playersGet(coordsAction)
  735. local Px, Py, Pz = dbg.getPlayer(plC).getPosition()
  736. if Px == nil then
  737. term.clearLine()
  738. print(' >> Player "'..plC..'" is offline')
  739. os.sleep(2)
  740. term.clear()
  741. g.setResolution(w,h)
  742. else
  743. term.clear()
  744. g.setResolution(w,h)
  745. return targetting(false,Px,Py,Pz)
  746. end
  747. else
  748. Gx = tonumber(Gx)
  749. io.write('Y >> ')
  750. Gy = tonumber(io.read())
  751. io.write('Z >> ')
  752. Gz = tonumber(io.read())
  753. if not Gx or not Gy or not Gz then
  754. print('Uncorrect Input!')
  755. os.sleep(2)
  756. return nil, nil, nil
  757. else
  758. return targetting(false,Gx,Gy,Gz)
  759. end
  760. end
  761. end
  762.  
  763. function getMyCoords()
  764. local Mx, My, Mz = dbg.getPlayer(config.admin).getPosition()
  765. return math.floor(Mx), math.floor(My), math.floor(Mz)
  766. end
  767.  
  768. function yn()
  769. local _,_,_,key = ev.pull('key_down')
  770. if key == 21 then
  771. return true
  772. else
  773. return false
  774. end
  775. end
  776.  
  777. function setBlock()
  778. finalInputMenu(7,'WORLD > SETBLOCK')
  779. io.write('ID or "main" >> ')
  780. id = io.read()
  781. if id ~= 'main' then
  782. io.write('META >> ')
  783. meta = io.read()
  784. x, y, z = getCoords('SETBLOCK ID:'..id..', META:'..meta)
  785. end
  786. local result = pcall(function() dbg.getWorld().setBlock(math.floor(tonumber(x)),math.floor(tonumber(y)),math.floor(tonumber(z)),tonumber(id),tonumber(meta)) end)
  787. if result then
  788. print('Clear? y/n')
  789. if yn() then
  790. dbg.getWorld().setBlock(math.floor(tonumber(x)),math.floor(tonumber(y)),math.floor(tonumber(z)),0,0)
  791. end
  792. end
  793. end
  794.  
  795. function setBlocks()
  796. finalInputMenu(6,'WORLD > SETBLOCKS')
  797. io.write('ID or "main" >> ')
  798. id = io.read()
  799. if id ~= 'main' then
  800. io.write('META >> ')
  801. meta = io.read()
  802. print('1st POINT:')
  803. xMin, yMin, zMin = getCoords('1st POINT FOR SETBLOCKS ID:'..id..', META:'..meta)
  804. print('2nd POINT:')
  805. xMax, yMax, zMax = getCoords('2nd POINT FOR SETBLOCKS ID:'..id..', META:'..meta)
  806. local result = pcall(function() dbg.getPlayer(config.admin).getWorld().setBlocks(math.floor(tonumber(xMin)),math.floor(tonumber(yMin)),math.floor(tonumber(zMin)),math.floor(tonumber(xMax)),math.floor(tonumber(yMax)),math.floor(tonumber(zMax)),tonumber(id),tonumber(meta)) end)
  807. if result then
  808. print('Clear? y/n')
  809. if yn() then
  810. dbg.getWorld().setBlocks(math.floor(tonumber(xMin)),math.floor(tonumber(yMin)),math.floor(tonumber(zMin)),math.floor(tonumber(xMax)),math.floor(tonumber(yMax)),math.floor(tonumber(zMax)),0,0)
  811. end
  812. end
  813. end
  814. end
  815.  
  816. function remItem()
  817. finalInputMenu(8,'WORLD > REMITEM')
  818. io.write('SLOT or "main" >> ')
  819. slot = io.read()
  820. if slot ~= 'main' then
  821. io.write('COUNT >> ')
  822. count = io.read()
  823. x, y, z = getCoords('REMITEM')
  824. pcall(function() dbg.getWorld().removeItem(math.floor(tonumber(x)),math.floor(tonumber(y)),math.floor(tonumber(z)),tonumber(slot),tonumber(count)) end)
  825. end
  826. end
  827.  
  828. function insItem()
  829. finalInputMenu(8,'WORLD > INSITEM')
  830. io.write('ID (String) or "main"\n >> ')
  831. id = io.read()
  832. if id ~= 'main' then
  833. io.write('DAMAGE >> ')
  834. dmg = io.read()
  835. io.write('NBT (JSON) >> ')
  836. tags = io.read()
  837. io.write('COUNT >> ')
  838. count = io.read()
  839. x, y, z = getCoords('INSITEM')
  840. pcall(function() dbg.getWorld().insertItem(id,tonumber(count),tonumber(dmg),tags,math.floor(tonumber(x)),math.floor(tonumber(y)),math.floor(tonumber(z)),1) end)
  841. end
  842. end
  843.  
  844. function insItems()
  845. finalInputMenu(7,'WORLD > INSITEMS')
  846. io.write('ID (String) or "main"\n >> ')
  847. id = io.read()
  848. if id ~= 'main' then
  849. io.write('DAMAGE >> ')
  850. dmg = io.read()
  851. io.write('SLOTS FOR INS >> ')
  852. slots = io.read()
  853. x, y, z = getCoords('INSITEMS')
  854. pcall(function() for i = 1, tonumber(slots) do dbg.getWorld().insertItem(id,64,tonumber(dmg),'',math.floor(tonumber(x)),math.floor(tonumber(y)),math.floor(tonumber(z)),1) end end)
  855. end
  856. end
  857.  
  858. function nbts()
  859. finalInputMenu(9,'WORLD > GETNBT')
  860. io.write('FILENAME or "main"\n >> ')
  861. fn = io.read()
  862. if fn ~= 'main' then
  863. x, y, z = getCoords('NBT')
  864. print('"1" - getNbt, "2" - setNbt')
  865. local _,_,_,key = ev.pull('key_down')
  866. if key == 2 then
  867. local result = pcall(function() nbt = dbg.getWorld().getTileNBT(math.floor(tonumber(x)),math.floor(tonumber(y)),math.floor(tonumber(z))) file = io.open('/'..fn,'w'):write(ser.serialize(nbt,false)):flush():close() end)
  868. if result then
  869. print('Saved in "/'..fn..'"\n\n"1" - edit, "2" - pastebin,\n"3" - copy to clipboard,\nor press any key for exit...')
  870. local _,_,_,key = ev.pull('key_down')
  871. if key == 2 then
  872. g.setResolution(xOld,yOld)
  873. os.sleep(0.00001)
  874. os.execute('edit /'..fn)
  875. print('Set nbt at current pos? y/n')
  876. if yn() then
  877. local result = pcall(function() file = io.open('/'..fn,'r') local cr = ser.unserialize(file:read(fs.size('/'..fn))) file:close() dbg.getWorld().setTileNBT(math.floor(tonumber(x)),math.floor(tonumber(y)),math.floor(tonumber(z)),cr) end)
  878. if result then
  879. print('\nNBT setted from "/'..fn..'"')
  880. os.sleep(2)
  881. end
  882. end
  883. elseif key == 3 then
  884. if av('internet') then
  885. term.clear()
  886. g.setResolution(xOld,yOld)
  887. os.sleep(0.00001)
  888. g.setForeground(colors.white)
  889. os.execute('pastebin put /'..fn)
  890. g.setForeground(colors.green)
  891. print('\n\npress any key...')
  892. ev.pull('key_down')
  893. else
  894. print('\nNot found internet card!')
  895. os.sleep(2)
  896. end
  897. elseif key == 4 then
  898. local result = pcall(function() local toSend = ser.serialize(nbt) dbg.sendToClipboard(config.admin,toSend:gsub('\"',"'")) end)
  899. if result then
  900. print('Success!')
  901. else
  902. print('Fail...(')
  903. end
  904. os.sleep(2)
  905. end
  906. end
  907. elseif key == 3 then
  908. print('"/'..fn..'": "1" - edit,\nor any key for load...')
  909. local _,_,_,key = ev.pull('key_down')
  910. if key == 2 then
  911. g.setResolution(xOld,yOld)
  912. os.sleep(0.00001)
  913. os.execute('edit /'..fn)
  914. g.setResolution(w,h)
  915. os.sleep(0.00001)
  916. end
  917. local result = pcall(function() file = io.open('/'..fn,'r') local cr = ser.unserialize(file:read(fs.size('/'..fn))) file:close() dbg.getWorld().setTileNBT(math.floor(tonumber(x)),math.floor(tonumber(y)),math.floor(tonumber(z)),cr) end)
  918. if result then
  919. print('NBT setted from "/'..fn..'"')
  920. os.sleep(2)
  921. end
  922. end
  923. end
  924. end
  925.  
  926. function signsSet(toDo)
  927. term.clear()
  928. if toDo == 1 then
  929. io.write('FREE ID > ')
  930. local id = io.read()
  931. text1 = '§1[free]'
  932. text2 = id
  933. text3 = ''
  934. text4 = ''
  935. elseif toDo == 2 then
  936. io.write('BUY ID > ')
  937. local id = io.read()
  938. text1 = '§1[buy]'
  939. text2 = '64'
  940. text3 = id
  941. text4 = '$1'
  942. elseif toDo == 3 then
  943. io.write('TEXT1 > ')
  944. text1 = io.read()
  945. io.write('TEXT2 > ')
  946. text2 = io.read()
  947. io.write('TEXT3 > ')
  948. text3 = io.read()
  949. io.write('TEXT4 > ')
  950. text4 = io.read()
  951. elseif toDo == 4 then
  952. io.write('GATE ID > ')
  953. local id = io.read()
  954. io.write('GATE COUNT > ')
  955. local count = io.read()
  956. text1 = id
  957. text2 = '[Gate]'
  958. text3 = ''
  959. text4 = count
  960. end
  961. pcall(setSignText)
  962. end
  963.  
  964. function setSignText()
  965. local x,y,z = getMyCoords()
  966. local signNbt = dbg.getWorld().getTileNBT(x,y,z)
  967. signNbt.value.Text1.value = text1
  968. signNbt.value.Text2.value = text2
  969. signNbt.value.Text3.value = text3
  970. signNbt.value.Text4.value = text4
  971. dbg.getWorld().setTileNBT(x,y,z,signNbt)
  972. end
  973.  
  974. function runComand(comand)
  975. local pls = dbg.getPlayers()
  976. local randPl = pls[math.random(pls.n)]
  977. local d = dbg.getPlayer(randPl).getWorld()
  978. local posX,_,posZ = dbg.getPlayer(randPl).getPosition()
  979. posX, posZ = math.floor(posX+cbCor), math.floor(posZ+cbCor)
  980. d.setBlock(posX,0,posZ,137,0)
  981. local nbtCB = d.getTileNBT(posX,0,posZ)
  982. nbtCB.value.Command.value = comand
  983. nbtCB.value.CustomName.value = 'Console'
  984. d.setTileNBT(posX,0,posZ,nbtCB)
  985. d.setBlock(posX,1,posZ,152,0)
  986. os.sleep(0.5)
  987. d.setBlocks(posX,0,posZ,posX,1,posZ,7,0)
  988. end
  989.  
  990. function keyController(_,_,_,code)
  991. if code == 18 then
  992. hide()
  993. elseif code == 30 then
  994. admins()
  995. elseif code == 16 then
  996. main()
  997. elseif code == 17 then
  998. warps()
  999. end
  1000. end
  1001.  
  1002. function install()
  1003. term.clear()
  1004. g.setResolution(w,h)
  1005. g.setForeground(colors.green)
  1006. g.fill(1,1,30,15,'░')
  1007. g.set(11,6,'//TOUCH//')
  1008. local _,_,_,_,_,ownerNick = ev.pull('touch')
  1009. config = { admin = ownerNick, defaultChatBoxName = '§r§k|:|§r§2'..ownerNick..'§r§k|:|§r§7§o', admins = {}, warps = {}, activeAutorun = false, activeProtection = true, yCorrector = true, targetting = false }
  1010. conf_S()
  1011. g.set(5,9,'Welcome, '..config.admin..'!')
  1012. os.sleep(2)
  1013. end
  1014.  
  1015. function conf_S()
  1016. local file = io.open(configPath,'w')
  1017. file:write(ser.serialize(config,false)):flush():close()
  1018. end
  1019.  
  1020. function conf_R()
  1021. local file = io.open(configPath,'r')
  1022. config = ser.unserialize(file:read(fs.size(configPath)))
  1023. file:close()
  1024. end
  1025.  
  1026. function lockPress()
  1027. ev.ignore('touch',clicker)
  1028. ev.ignore('key_down',keyController)
  1029. end
  1030.  
  1031. function press(act)
  1032. if act == 'keys' then
  1033. lockPress()
  1034. ev.listen('key_down',keyController)
  1035. elseif act == 'clicks' then
  1036. lockPress()
  1037. ev.listen('touch',clicker)
  1038. elseif act == 'lock' then
  1039. lockPress()
  1040. else
  1041. lockPress()
  1042. ev.listen('touch',clicker)
  1043. ev.listen('key_down',keyController)
  1044. end
  1045. end
  1046.  
  1047. function link(bX,bY,button)
  1048. g.setForeground(colors.red)
  1049. g.set(bX,bY,button)
  1050. os.sleep(0.3)
  1051. g.setForeground(colors.green)
  1052. g.set(bX,bY,button)
  1053. end
  1054.  
  1055. function hide()
  1056. screen = 'hide'
  1057. press('clicks')
  1058. g.setForeground(colors.gray)
  1059. g.set(30,1,'|||||HIDE||||||',true)
  1060. os.sleep(0.2)
  1061. term.clear()
  1062. g.fill(1,1,30,15,'░')
  1063. end
  1064.  
  1065. function accessDenied(checkNick)
  1066. if config.activeProtection then
  1067. press('lock')
  1068. term.clear()
  1069. g.setResolution(w,h)
  1070. g.setForeground(colors.red)
  1071. g.fill(1,1,30,15,'░')
  1072. g.set(7,6,'ACCESS DENIED!!!')
  1073. g.set(10,9,'GOODBYE...')
  1074. dbg.getPlayer(checkNick).setHealth(0)
  1075. os.sleep(1)
  1076. if particleAccess then
  1077. p.spawn('smoke',0,0,0,math.huge,math.huge,math.huge)
  1078. end
  1079. tellrawKick(checkNick)
  1080. comp.shutdown()
  1081. end
  1082. end
  1083.  
  1084. function keysProtector(_,_,_,_,onKey)
  1085. if onKey ~= config.admin then
  1086. accessDenied(onKey)
  1087. end
  1088. end
  1089.  
  1090. function touchProtector(_,_,_,_,_,onTouch)
  1091. if onTouch ~= config.admin then
  1092. accessDenied(onTouch)
  1093. end
  1094. end
  1095.  
  1096. function settings()
  1097. screen = 'setts'
  1098. finalMenu(7,'DEBUG > SETTINGS ')
  1099. g.set(3,3,'AUTORUN')
  1100. g.set(3,5,'USER PROTECT')
  1101. g.set(3,7,'Y + 100 (TPA)')
  1102. g.set(3,9,'TARGETTING')
  1103. g.set(3,11,'[KEYBINDS]')
  1104. g.setForeground(colors.gray)
  1105. g.set(23,3,'▒▒▒▒')
  1106. g.set(23,5,'▒▒▒▒')
  1107. g.set(23,7,'▒▒▒▒')
  1108. g.set(23,9,'▒▒▒▒')
  1109. if config.activeAutorun then
  1110. g.setForeground(colors.green)
  1111. g.set(25,3,'██')
  1112. else
  1113. g.setForeground(colors.gray)
  1114. g.set(23,3,'██')
  1115. end
  1116. if config.activeProtection then
  1117. g.setForeground(colors.green)
  1118. g.set(25,5,'██')
  1119. else
  1120. g.setForeground(colors.gray)
  1121. g.set(23,5,'██')
  1122. end
  1123. if config.yCorrector then
  1124. g.setForeground(colors.green)
  1125. g.set(25,7,'██')
  1126. else
  1127. g.setForeground(colors.gray)
  1128. g.set(23,7,'██')
  1129. end
  1130. if config.targetting then
  1131. g.setForeground(colors.green)
  1132. g.set(25,9,'██')
  1133. else
  1134. g.setForeground(colors.gray)
  1135. g.set(23,9,'██')
  1136. end
  1137. end
  1138.  
  1139. function saveAutorun()
  1140. local scriptPath = debug.getinfo(2,'S').short_src
  1141. local file = io.open(autorunPath,'w')
  1142. file:write('os.sleep(1) os.execute("'..scriptPath..'")'):flush():close()
  1143. end
  1144.  
  1145. function swich(toSwich)
  1146. if toSwich == 'autorun' then
  1147. if config.activeAutorun then
  1148. config.activeAutorun = false
  1149. fs.remove(autorunPath)
  1150. else
  1151. config.activeAutorun = true
  1152. saveAutorun()
  1153. end
  1154. elseif toSwich == 'protection' then
  1155. if config.activeProtection then
  1156. config.activeProtection = false
  1157. else
  1158. config.activeProtection = true
  1159. end
  1160. elseif toSwich == 'yCorrector' then
  1161. if config.yCorrector then
  1162. config.yCorrector = false
  1163. else
  1164. config.yCorrector = true
  1165. end
  1166. elseif toSwich == 'targetting' then
  1167. if config.targetting then
  1168. config.targetting = false
  1169. else
  1170. config.targetting = true
  1171. end
  1172. end
  1173. conf_S()
  1174. end
  1175.  
  1176. function swichGamemode(gmm)
  1177. g.setForeground(colors.red)
  1178. if gmm == 1 then
  1179. g.set(7,7, 'Y/N?')
  1180. else
  1181. g.set(7,9, 'Y/N?')
  1182. end
  1183. if yn() then
  1184. runComand('/gamemode '..gmm..' '..config.admin)
  1185. end
  1186. end
  1187.  
  1188. function imbPotion()
  1189. local potionJson = '{CustomPotionEffects:[{Id:5,Amplifier:5500,Duration:100000000},{Id:6,Amplifier:5500,Duration:100000000},{Id:11,Amplifier:5500,Duration:100000000},{Id:12,Amplifier:5500,Duration:100000000},{Id:13,Amplifier:5500,Duration:100000000},{Id:23,Amplifier:5500,Duration:100000000}],display:{Name:§r§l§aТо что доктор прописал}}'
  1190. local x,y,z = getMyCoords()
  1191. dbg.getPlayer(config.admin).getWorld().insertItem('minecraft:potion',1,16,potionJson,x,y,z,1)
  1192. end
  1193.  
  1194. function dayrain()
  1195. if dbg.getWorld().isRaining() then
  1196. dbg.getWorld().setRaining(false)
  1197. else
  1198. dbg.getWorld().setTime(dbg.getWorld().getTime()+12000)
  1199. end
  1200. end
  1201.  
  1202. function printLink(link)
  1203. local result = pcall(function() dbg.sendToClipboard(config.admin,link) end)
  1204. if result then
  1205. print('\n'..link..'\n(copied in ClipBoard)\n\nPress any key...')
  1206. else
  1207. print('\n'..link..'\n\nPress any key...')
  1208. end
  1209. ev.pull('key_down')
  1210. end
  1211.  
  1212. function summon()
  1213. while true do
  1214. finalInputMenu(8,'WORLD > SUMMON')
  1215. io.write('MobName, "wiki" or "main"\n >> ')
  1216. local mob = io.read()
  1217. if mob == 'main' then
  1218. break
  1219. elseif mob == 'wiki' then
  1220. printLink('http://minecraft-ru.gamepedia.com/Участник:DrakD/Summon')
  1221. else
  1222. io.write('Count >> ')
  1223. local count = tonumber(io.read())
  1224. if count == nil then
  1225. count = 1
  1226. end
  1227. io.write('JSON for '..mob..' >> ')
  1228. local mobJson = io.read()
  1229. local x, y, z = getCoords('SUMMON '..mob)
  1230. local online = dbg.getPlayers()
  1231. local checkAdm = true
  1232. for i = 1, #online do
  1233. local onePl = online[i]
  1234. for c = 1, #config.admins do
  1235. local oneAdm = config.admins[c]
  1236. if onePl == oneAdm then
  1237. checkAdm = false
  1238. break
  1239. end
  1240. end
  1241. if not checkAdm then
  1242. break
  1243. end
  1244. end
  1245. if checkAdm then
  1246. for i = 1, count do
  1247. res1 = pcall(function() _,res2 = dbg.runCommand('/summon '..mob..' '..x..' '..y..' '..z..' '..mobJson) end)
  1248. end
  1249. if res1 then
  1250. print(res2)
  1251. os.sleep(2)
  1252. end
  1253. else
  1254. print('Break! Admin online...')
  1255. os.sleep(2)
  1256. end
  1257. end
  1258. end
  1259. end
  1260.  
  1261. function menuSounds()
  1262. while true do
  1263. finalInputMenu(8,'WORLD > SOUND')
  1264. io.write('SoundName, "wiki" or "main"\n >> ')
  1265. local sound = io.read()
  1266. if sound == 'main' then
  1267. break
  1268. elseif sound == 'wiki' then
  1269. printLink('http://www.gkrond.ru/Articles/Read/2/Imena_zvukov_i_rabota_komandy_playsound.html')
  1270. else
  1271. local x,y,z = getCoords('PLAY SOUND')
  1272. pcall(function() dbg.getWorld().playSoundAt(x,y,z,sound,500) end)
  1273. end
  1274. end
  1275. end
  1276.  
  1277. function meow()
  1278. g.setForeground(colors.green)
  1279. g.set(17,1,'MEOW')
  1280. local x,y,z = getMyCoords()
  1281. dbg.getWorld().playSoundAt(x,y,z,'mob.cat.meow',100)
  1282. g.setForeground(colors.white)
  1283. g.set(17,1,'MAIN')
  1284. end
  1285.  
  1286. function clipBoard()
  1287. clipToPlayer = ''
  1288. while true do
  1289. finalInputMenu(6,'PLAYER > CLIPBRD')
  1290. io.write('Text, "pl" or "main"\n >> ')
  1291. local text = io.read()
  1292. if text == 'main' then
  1293. break
  1294. elseif text == 'pl' then
  1295. clipToPlayer = playersGet('CLIPBRD')
  1296. g.setResolution(w,h)
  1297. else
  1298. local result = pcall(function() dbg.sendToClipboard(clipToPlayer,text) end)
  1299. end
  1300. end
  1301. end
  1302.  
  1303. function keybinds()
  1304. screen = 'keyb'
  1305. finalMenu(6,'SETTINGS > KEYBINDS')
  1306. g.set(10,4, 'MAIN [Q]')
  1307. g.set(10,6, 'ADMINS [A]')
  1308. g.set(10,8, 'HIDE [E]')
  1309. g.set(10,10,'WARPS [W]')
  1310. end
  1311.  
  1312. function clicker(_,_,xC,yC)
  1313. if xC >= 1 and yC >= 1 and screen == 'hide' then main()
  1314. elseif xC == 30 and yC <= 15 and screen ~= 'spawn' then hide()
  1315. elseif xC >= 26 and xC <= 30 and yC == 15 then link(26,yC,'EXIT') work = false
  1316. elseif xC >= 1 and xC <= 6 and yC == 15 then link(2,yC,'MAIN') main()
  1317. elseif xC >= 27 and xC <= 29 and yC == 1 and screen ~= 'setts' and screen ~= 'spawn' then link(27,yC,'[*]') settings()
  1318. elseif xC >= 7 and xC <= 12 and yC == 3 and screen == 'main' then link(7,yC,'WORLD') world()
  1319. elseif xC >= 17 and xC <= 20 and yC == 1 and screen == 'main' then meow()
  1320. elseif xC >= 7 and xC <= 12 and yC == 5 and screen == 'main' then link(7,yC,'PLAYER') player()
  1321. elseif xC >= 7 and xC <= 10 and yC == 7 and screen == 'main' then link(7,yC,'GM 1') press('lock') swichGamemode(1) main()
  1322. elseif xC >= 7 and xC <= 10 and yC == 9 and screen == 'main' then link(7,yC,'GM 0') press('lock') swichGamemode(0) main()
  1323. elseif xC >= 7 and xC <= 11 and yC == 11 and screen == 'main' and chatAccess then link(7,yC,'CHAT') press('lock') chatBox() main()
  1324. elseif xC >= 20 and xC <= 24 and yC == 3 and screen == 'main' then link(20,yC,'WARPS') warps()
  1325. elseif xC >= 14 and xC <= 17 and yC == 15 and screen ~= 'admns' then link(14,yC,'ADMS') admins()
  1326. elseif xC >= 20 and xC <= 25 and yC == 1 and screen == 'admns' then link(20,yC,'[SCAN]') adminScan() admins()
  1327. elseif xC >= 14 and xC <= 17 and yC == 15 and screen == 'admns' then link(14,yC,'EDIT') editAdmins()
  1328. elseif xC >= 20 and xC <= 26 and yC == 5 and screen == 'main' then link(20,yC,'PEX ADD') press('lock') pexAdd() main()
  1329. elseif xC >= 20 and xC <= 26 and yC == 7 and screen == 'main' then link(20,yC,'PEX REM') press('lock') pexRem() main()
  1330. elseif xC >= 20 and xC <= 25 and yC == 9 and screen == 'main' then link(20,yC,'NOCLIP') press('lock') targetting(true) main()
  1331. elseif xC >= 20 and xC <= 24 and yC == 11 and screen == 'main' and particleAccess then link(20,11,'PARTS') press('lock') particles() main()
  1332. elseif xC >= 7 and xC <= 24 and yC == 13 and screen == 'main' then link(7,yC,'CONSOLE COMMAND >>') press('lock') enterCommand() main()
  1333. elseif xC >= 7 and xC <= 10 and yC == 3 and screen == 'playr' then link(7,yC,'INFO') press('lock') playerInfo() main()
  1334. elseif xC >= 7 and xC <= 10 and yC == 5 and screen == 'playr' then link(7,yC,'TPA') press('lock') tpa() main()
  1335. elseif xC >= 7 and xC <= 11 and yC == 7 and screen == 'playr' then link(7,yC,'TPAME') press('lock') tpaMe() main()
  1336. elseif xC >= 7 and xC <= 13 and yC == 9 and screen == 'playr' then link(7,yC,'TPAMETO') press('lock') tpaMeTo() main()
  1337. elseif xC >= 7 and xC <= 12 and yC == 11 and screen == 'playr' then link(7,yC,'FREEZE') press('lock') freeze() main()
  1338. elseif xC >= 20 and xC <= 26 and yC == 3 and screen == 'playr' then link(20,yC,'TPAHERE') press('lock') tpaHere() main()
  1339. elseif xC >= 20 and xC <= 26 and yC == 5 and screen == 'playr' then link(20,yC,'TPAPTOP') press('lock') tpaPtoP() main()
  1340. elseif xC >= 20 and xC <= 24 and yC == 7 and screen == 'playr' then link(20,yC,'SETHP') press('lock') setHp() main()
  1341. elseif xC >= 20 and xC <= 26 and yC == 9 and screen == 'playr' then link(20,yC,'CLIPBRD') press('lock') clipBoard() main()
  1342. elseif xC >= 20 and xC <= 26 and yC == 11 and screen == 'playr' then link(20,yC,'KICK') press('lock') tellrawKickInput() main()
  1343. elseif xC >= 7 and xC <= 14 and yC == 3 and screen == 'world' then link(7,yC,'SETBLOCK') press('lock') setBlock() main()
  1344. elseif xC >= 7 and xC <= 15 and yC == 5 and screen == 'world' then link(7,yC,'SETBLOCKS') press('lock') setBlocks() main()
  1345. elseif xC >= 7 and xC <= 13 and yC == 7 and screen == 'world' then link(7,yC,'REMITEM') press('lock') remItem() main()
  1346. elseif xC >= 7 and xC <= 13 and yC == 9 and screen == 'world' then link(7,yC,'INSITEM') press('lock') insItem() main()
  1347. elseif xC >= 7 and xC <= 13 and yC == 11 and screen == 'world' then link(7,yC,'DAYRAIN') dayrain()
  1348. elseif xC >= 7 and xC <= 12 and yC == 13 and screen == 'world' then link(7,yC,'SUMMON') press('lock') summon() main()
  1349. elseif xC >= 20 and xC <= 27 and yC == 3 and screen == 'world' then link(20,yC,'INSITEMS') press('lock') insItems() main()
  1350. elseif xC >= 20 and xC <= 23 and yC == 5 and screen == 'world' then link(20,yC,'NBTS') press('lock') nbts() main()
  1351. elseif xC >= 20 and xC <= 24 and yC == 7 and screen == 'world' then link(20,yC,'SIGNS') signsMenu()
  1352. elseif xC >= 20 and xC <= 28 and yC == 9 and screen == 'world' then link(20,yC,'IMBPOTION') imbPotion()
  1353. elseif xC >= 20 and xC <= 25 and yC == 11 and screen == 'world' then link(20,yC,'SOUNDS') press('lock') menuSounds() main()
  1354. elseif xC >= 7 and xC <= 10 and yC == 3 and screen == 'signs' then link(7,yC,'FREE') press('lock') signsSet(1) press() signsMenu()
  1355. elseif xC >= 7 and xC <= 9 and yC == 5 and screen == 'signs' then link(7,yC,'BUY') press('lock') signsSet(2) press() signsMenu()
  1356. elseif xC >= 7 and xC <= 10 and yC == 7 and screen == 'signs' then link(7,yC,'SELL') text1 = '§1[sell]' text2 = '1' text3 = '4' text4 = '$50' pcall(setSignText) signsMenu()
  1357. elseif xC >= 7 and xC <= 15 and yC == 9 and screen == 'signs' then link(7,yC,'DISPENSER') text1 = '§3[dispenser]' text2 = '' text3 = '' text4 = '' pcall(setSignText) signsMenu()
  1358. elseif xC >= 7 and xC <= 14 and yC == 11 and screen == 'signs' then link(7,yC,'CREATIVE') text1 = '§1[gamemode]' text2 = 'creative' text3 = '' text4 = '' pcall(setSignText) signsMenu()
  1359. elseif xC >= 7 and xC <= 10 and yC == 13 and screen == 'signs' then link(7,yC,'GATE') press('lock') signsSet(4) press() signsMenu()
  1360. elseif xC >= 20 and xC <= 23 and yC == 3 and screen == 'signs' then link(20,yC,'EDIT') press('lock') signsSet(3) press() signsMenu()
  1361. elseif xC >= 20 and xC <= 24 and yC == 5 and screen == 'signs' then link(20,yC,'CLEAR') text1 = '' text2 = '' text3 = '' text4 = '' pcall(setSignText) signsMenu()
  1362. elseif xC >= 23 and xC <= 26 and yC == 3 and screen == 'setts' then swich('autorun') settings()
  1363. elseif xC >= 23 and xC <= 26 and yC == 5 and screen == 'setts' then swich('protection') settings()
  1364. elseif xC >= 23 and xC <= 26 and yC == 7 and screen == 'setts' then swich('yCorrector') settings()
  1365. elseif xC >= 23 and xC <= 26 and yC == 9 and screen == 'setts' then swich('targetting') settings()
  1366. elseif xC >= 3 and xC <= 12 and yC == 11 and screen == 'setts' then link(3,yC,'[KEYBINDS]') keybinds()
  1367. elseif xC >= 27 and xC <= 29 and yC == 2 and screen == 'warps' and #config.warps < 12 then link(27,yC,'[+]') press('lock') addWarp() press() warps()
  1368. elseif xC >= 27 and xC <= 29 and yC == 2 and screen == 'edadm' then link(27,yC,'[+]') press('lock') addAdmin() press() editAdmins()
  1369. elseif xC >= 1 and xC <= 25 and screen == 'warps' and yC >= 3 and (yC - 2) <= #config.warps then link(1,yC,'>') local warpId = yC - 2 teleportToWarp(warpId) warps()
  1370. elseif xC == 28 and screen == 'warps' and yC >= 3 and (yC - 2) <= #config.warps then link(28,yC,'x') local warpId = yC - 2 table.remove(config.warps,warpId) conf_S() warps()
  1371. elseif xC == 28 and screen == 'edadm' and yC >= 3 and (yC - 2) <= #config.admins then link(28,yC,'x') local admId = yC - 2 table.remove(config.admins,admId) conf_S() editAdmins()
  1372. elseif xC >= 35 and xC <= 44 and yC == 1 and screen == 'spawn' then link(35,yC,'[ STOP!! ]') screen = 'stop'
  1373. elseif xC >= 1 and xC <= 3 and yC == 2 and screen == 'spawn' then link(1,yC,'[-]') int = int + 0.05
  1374. elseif xC >= 4 and xC <= 6 and yC == 2 and screen == 'spawn' then link(4,yC,'[+]') int = int * 0.1
  1375. elseif xC >= 17 and xC <= 19 and yC == 2 and screen == 'spawn' then link(17,yC,'[-]') xPart = xPart - 1 yPart = yPart - 1 zPart = zPart - 1 if xPart <= 0 then xPart = 0 yPart = 0 zPart = 0 end
  1376. elseif xC >= 20 and xC <= 22 and yC == 2 and screen == 'spawn' then link(20,yC,'[+]') xPart = xPart + 1 yPart = yPart + 1 zPart = zPart + 1
  1377. elseif xC >= 34 and xC <= 36 and yC == 2 and screen == 'spawn' then link(34,yC,'[-]') height = height - 1
  1378. elseif xC >= 37 and xC <= 39 and yC == 2 and screen == 'spawn' then link(37,yC,'[+]') height = height + 1
  1379. elseif xC >= 51 and xC <= 58 and yC == 2 and screen == 'spawn' then link(51,yC,'[circle]') spawn360()
  1380. elseif xC >= 60 and xC <= 68 and yC == 2 and screen == 'spawn' then link(60,yC,'[default]') spawnDefault()
  1381. end
  1382. end
  1383.  
  1384. function run()
  1385. if fs.exists(configPath) then
  1386. conf_R()
  1387. else
  1388. install()
  1389. end
  1390. ev.listen('touch',touchProtector)
  1391. ev.listen('key_down',keysProtector)
  1392. main()
  1393. while work do
  1394. os.sleep(0.1)
  1395. end
  1396. exit()
  1397. end
  1398.  
  1399. function start()
  1400. if not av('debug') then
  1401. print('ERROR! Карта отладки не найдена!')
  1402. elseif c.debug.test() == nil then
  1403. print('ERROR! Карта отладки выключена в конфиге!')
  1404. elseif g.getDepth() == 1 then
  1405. print('ERROR! Монитор и видеокарта 1 тира не поддерживаются!')
  1406. else
  1407. dbg = c.debug
  1408. if av('tablet') then
  1409. if av('chat') then
  1410. chat = c.chat
  1411. chatAccess = true
  1412. ev.listen('chat_message',dialog)
  1413. else
  1414. chatAccess = false
  1415. end
  1416. else
  1417. if av('chat_box') then
  1418. chat = c.chat_box
  1419. chatAccess = true
  1420. ev.listen('chat_message',dialog)
  1421. else
  1422. chatAccess = false
  1423. end
  1424. end
  1425. if av('radar') then
  1426. r = c.radar
  1427. radarAccess = true
  1428. else
  1429. radarAccess = false
  1430. end
  1431. if av('particle') then
  1432. p = c.particle
  1433. particleAccess = true
  1434. else
  1435. particleAccess = false
  1436. end
  1437. run()
  1438. end
  1439. end
  1440.  
  1441. function exit()
  1442. term.clear()
  1443. press('lock')
  1444. ev.ignore('touch',touchProtector)
  1445. ev.ignore('key_down',keysProtector)
  1446. ev.ignore('chat_message',dialog)
  1447. ev.cancel(timer)
  1448. g.setForeground(colors.white)
  1449. g.setResolution(xOld,yOld)
  1450. os.sleep(0.00001)
  1451. end
  1452.  
  1453. function ev.shouldInterrupt()
  1454. return false
  1455. end
  1456.  
  1457. start()
Add Comment
Please, Sign In to add comment