Advertisement
Chaos_Cash

pocket playerdata

Sep 9th, 2024 (edited)
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.78 KB | None | 0 0
  1. function startup()
  2. term.clear()
  3. sleep(0.1)
  4.  
  5. rednet.open("back")
  6.  
  7.  
  8. readingOutput = {}
  9.  
  10.  
  11. blinkIsOn = true
  12.  
  13.  
  14. posData = {}
  15.  
  16.  
  17. scrollmenuLen={}
  18. scrollmenuInfos={}
  19.  
  20.  
  21. dropdown = {}
  22. dropdown["loaded"] = {}
  23. dropdown["loaded"]["len"] = 0
  24.  
  25.  
  26. os.startTimer(0.1)
  27.     repeat
  28.     rednet.send(935,"getPlayers")
  29.     timer=os.startTimer(0.2)
  30.     info1,info2,info3,info4 = os.pullEvent()
  31.     os.cancelTimer(timer)
  32.     until info1=="rednet_message" and info3["action"] == "sendingPlayers" and type(info3["players"]) == "table" or info1 == "timer"
  33.  
  34.     if info1 == "timer" then
  35.     createDropdownMenu("players",{},3,6,18)
  36.     createDropdownMenu("menuOptions",{"Home","Teleport"},3,4,16)
  37.     else
  38.     createDropdownMenu("players",info3["players"],3,6,18)
  39.     knowsOnlinePlayers = true
  40.     readPlayerPosData()
  41.         if fs.exists("playerPos") then
  42.         createDropdownMenu("menuOptions",{"Home","Teleport","Online Players"},3,4,16)
  43.         else
  44.         createDropdownMenu("menuOptions",{"Home","Teleport"},3,4,16)
  45.         end
  46.        
  47.     end
  48.    
  49.  
  50.  
  51. readPlayerPosData()
  52. end
  53.  
  54.  
  55.  
  56. function main()
  57.  
  58.     while true do
  59.  
  60.     info1,info2,info3,info4 = os.pullEvent()
  61.     overwriteDropdown()
  62.    
  63.    
  64.         if dropdownMenuCheck("menuOptions") == "changed" then
  65.         info1 = nil
  66.        
  67.             if dropdown["menuOptions"]["option1"] == "Home" then
  68.             homeMenu()
  69.             end
  70.            
  71.             if dropdown["menuOptions"]["option1"] == "Teleport" then
  72.             teleportMenu()
  73.             end
  74.            
  75.             if dropdown["menuOptions"]["option1"] == "Online Players" then
  76.             onlinePlayersMenu()
  77.             end
  78.        
  79.        
  80.         end
  81.        
  82.        
  83.    
  84.         if info1 == "rednet_message" then  
  85.            
  86.            
  87.                 if type(info3) == "table" then
  88.                
  89.                     if info3["action"] == "sendingPosData" then
  90.                         for k,v in pairs(info3["posData"]) do
  91.                         file = fs.open("playerPos/"..info3["posData"][k]["day"].."/"..info3["posData"][k]["time"].."/"..info3["posData"][k]["player"],"w")
  92.                         file.writeLine(info3["posData"][k]["x"])
  93.                         file.writeLine(info3["posData"][k]["y"])
  94.                         file.writeLine(info3["posData"][k]["z"])
  95.                         file.write(info3["posData"][k]["dim"])
  96.                         file.flush()
  97.                         file.close()
  98.                             if type(posData[info3["posData"][k]["player"]]) ~= "table" then
  99.                             posData[info3["posData"][k]["player"]] = {}
  100.                             end
  101.                         posData[info3["posData"][k]["player"]][table.maxn(posData[info3["posData"][k]["player"]])+1] = info3["posData"][k]
  102.                         end
  103.                     printMenu(curEnv)
  104.                     end
  105.                    
  106.                    
  107.                     if info3["action"] == "sendingPlayers" and type(info3["players"]) == "table" then
  108.                     createDropdownMenu("players",info3["players"],3,6,18)
  109.                         if fs.exists("playerPos") then
  110.                         createDropdownMenu("menuOptions",{"Home","Teleport","Online Players"},3,4,16)
  111.                         end
  112.                     printMenu(curEnv)
  113.                     end
  114.                    
  115.                 end
  116.            
  117.            
  118.                 if type(info3) == "string" then
  119.                
  120.                     if info3 == "ping" then
  121.                     rednet.send(info2,"pong")
  122.                     end
  123.                
  124.                 end
  125.        
  126.        
  127.         end
  128.    
  129.    
  130.    
  131.         if curEnv == "onlinePlayersMenu" then
  132.        
  133.         scrollOutput = checkScrollmenu("playerData")
  134.             if scrollOutput ~= nil then
  135.                 if type(scrollOutput) == "number" then
  136.                
  137.                 inspectPosDataMenu(dropdown["players"]["option1"],table.maxn(posData[dropdown["players"]["option1"]])-scrollOutput)
  138.                
  139.                 end
  140.             end
  141.        
  142.             if dropdownMenuCheck("players") == "changed" then
  143.             onlinePlayersMenu()
  144.             end
  145.         end
  146.        
  147.        
  148.         if curEnv == "inspectPosDataMenu" then
  149.        
  150.             if buttonCheck(46,17,51,19) then
  151.             onlinePlayersMenu()
  152.             end
  153.        
  154.         end
  155.     end
  156.    
  157. end
  158.  
  159.  
  160.  
  161. function homeMenu()
  162. curEnv = "homeMenu"
  163. term.clear()
  164.  
  165. closeDropdownMenus()
  166. loadDropdownMenu("menuOptions")
  167. end
  168.  
  169.  
  170.  
  171. function teleportMenu()
  172. curEnv = "teleportMenu"
  173. term.clear()
  174.  
  175. closeDropdownMenus()
  176. loadDropdownMenu("menuOptions")
  177. end
  178.  
  179.  
  180.  
  181. function onlinePlayersMenu()
  182. term.setBackgroundColor(colors.black)
  183. curEnv = "onlinePlayersMenu"
  184. term.clear()
  185.  
  186. closeDropdownMenus()
  187. loadDropdownMenu("menuOptions")
  188. loadDropdownMenu("players")
  189.  
  190.  
  191.  
  192. scrollText = {}
  193.     for k,v in pairs(posData[dropdown["players"]["option1"]]) do
  194.     scrollText[k] = ""
  195.         if os.day("local")-posData[dropdown["players"]["option1"]][k]["day"] == 0 then
  196.         scrollText[k] = scrollText[k] .. "Today: "
  197.         elseif os.day("local")-posData[dropdown["players"]["option1"]][k]["day"] == 1 then
  198.         scrollText[k] = scrollText[k] .. os.day("local")-posData[dropdown["players"]["option1"]][k]["day"] .. " Day Ago: "
  199.         else
  200.         scrollText[k] = scrollText[k] .. os.day("local")-posData[dropdown["players"]["option1"]][k]["day"] .. " Days Ago: "
  201.         end
  202.        
  203.     scrollText[k] = scrollText[k] .. posData[dropdown["players"]["option1"]][k]["x"] .. " " .. posData[dropdown["players"]["option1"]][k]["y"] .. " " .. posData[dropdown["players"]["option1"]][k]["z"]
  204.     end
  205.    
  206.  
  207. tableLen = table.maxn(scrollText)
  208. saveScrollText = {}
  209.  
  210.     for i=1,tableLen do
  211.     saveScrollText[tableLen-i+1] = scrollText[i-1]
  212.     end
  213. scrollText = saveScrollText
  214.  
  215. createScrollmenu("playerData",22,1,51,19,scrollText,0)
  216. printScrollmenu("playerData")
  217. end
  218.  
  219.  
  220.  
  221. function readPlayerPosData()
  222.  
  223.     if fs.exists("playerPos") then
  224.         for k1,v1 in pairs(fs.list("playerPos")) do
  225.         curDay = fs.list("playerPos")[k1]
  226.    
  227.             for k2,v2 in pairs(fs.list("playerPos/"..curDay)) do
  228.             curTime = fs.list("playerPos/"..curDay)[k2]
  229.        
  230.                 for k3,v3 in pairs(fs.list("playerPos/"..curDay.."/"..curTime)) do
  231.                 curPlayer = fs.list("playerPos/"..curDay.."/"..curTime)[k3]
  232.            
  233.                     if fs.exists("playerPos/"..curDay.."/"..curTime.."/"..curPlayer) then
  234.                     file = fs.open("playerPos/"..curDay.."/"..curTime.."/"..curPlayer,"r")
  235.                     curPosData = {}
  236.                     curPosData["day"]=curDay
  237.                     curPosData["time"]=curTime
  238.                     curPosData["x"]=file.readLine()
  239.                     curPosData["y"]=file.readLine()
  240.                     curPosData["z"]=file.readLine()
  241.                     curPosData["dim"]=file.readLine()
  242.                     file.close()
  243.                         if type(posData[curPlayer]) ~= "table" then
  244.                         posData[curPlayer] = {}
  245.                         posData[curPlayer][1] = curPosData
  246.                         else
  247.                         posData[curPlayer][table.maxn(posData[curPlayer])+1] = curPosData
  248.                         end
  249.                     end
  250.                 end
  251.             end
  252.         end
  253.     end
  254.  
  255. end
  256.  
  257.  
  258.  
  259. function inspectPosDataMenu(player,number)
  260. term.setBackgroundColor(colors.black)
  261. term.clear()
  262. closeDropdownMenus()
  263. curEnv = "inspectPosDataMenu"
  264.  
  265. headline(player)
  266. button("Back",46,17,51,19)
  267.  
  268. term.setCursorPos(1,4)
  269. term.setTextColor(colors.green)
  270. term.write("Day: ")
  271. term.setTextColor(colors.white)
  272. print(posData[player][number]["day"])
  273. term.setTextColor(colors.green)
  274. term.write("Time: ")
  275. term.setTextColor(colors.white)
  276. print(posData[player][number]["time"])
  277. print("")
  278.  
  279. term.setTextColor(colors.green)
  280. term.write("Dim: ")
  281. term.setTextColor(colors.white)
  282. print(posData[player][number]["dim"])
  283. print("")
  284.  
  285. term.setTextColor(colors.green)
  286. term.write("X: ")
  287. term.setTextColor(colors.white)
  288. print(posData[player][number]["x"])
  289. term.setTextColor(colors.green)
  290. term.write("Y: ")
  291. term.setTextColor(colors.white)
  292. print(posData[player][number]["y"])
  293. term.setTextColor(colors.green)
  294. term.write("Z: ")
  295. term.setTextColor(colors.white)
  296. print(posData[player][number]["z"])
  297.  
  298. end
  299.  
  300.  
  301.  
  302.  
  303.  
  304. -- buttons and all that stuff
  305.  
  306. function betterRead(isBlacklist,filter)
  307.  
  308.     if curReading ~= nil then
  309.    
  310.    
  311.         if curReadingPosX == nil then
  312.         curReadingPosX = readingPosX+string.len(readingOutput[curReading])
  313.         end
  314.        
  315.        
  316.         if cursorBlinkTimer == nil then
  317.         cursorBlinkTimer = os.startTimer(0.5)
  318.         end
  319.        
  320.  
  321.         if info1 == "char" then
  322.        
  323.         isBlacklisted = not isBlacklist
  324.             for k,v in pairs(filter) do
  325.            
  326.                 if info2 == filter[k] then
  327.                 isBlacklisted = isBlacklist
  328.                 end
  329.            
  330.             end
  331.        
  332.        
  333.             if not isBlacklisted then
  334.                 if readingOutput[curReading] == nil then
  335.                 readingOutput[curReading] = ""
  336.                 end
  337.    
  338.             readingOutput[curReading] = readingOutput[curReading] .. info2
  339.             term.setCursorPos(curReadingPosX,readingPosY)
  340.             term.write(info2)
  341.             curReadingPosX = curReadingPosX+1
  342.        
  343.                 if blinkIsOn then
  344.                 term.write("_")
  345.                 end
  346.            
  347.             end
  348.    
  349.         end
  350.    
  351.    
  352.         if info1 == "key" and info2 == 259 and curReadingPosX > readingPosX then
  353.    
  354.         curReadingPosX = curReadingPosX-1
  355.         term.setCursorPos(curReadingPosX+1,readingPosY)
  356.         term.write("           ")
  357.         term.setCursorPos(curReadingPosX,readingPosY)
  358.             if blinkIsOn then
  359.             term.write("_")
  360.             else
  361.             term.write(" ")
  362.             end
  363.    
  364.         readSave = readingOutput[curReading]
  365.         readingOutput[curReading] = ""
  366.             for i=1,string.len(readSave)-1 do
  367.             readingOutput[curReading] = readingOutput[curReading] .. string.char(string.byte(readSave,i))
  368.             end
  369.    
  370.         end
  371.        
  372.        
  373.         if info1 == "timer" and info2 == cursorBlinkTimer then
  374.        
  375.             if blinkIsOn then
  376.             term.setCursorPos(curReadingPosX,readingPosY)
  377.             term.write("_")
  378.             else
  379.             term.setCursorPos(curReadingPosX,readingPosY)
  380.             term.write(" ")
  381.             end
  382.        
  383.         cursorBlinkTimer = os.startTimer(0.5)
  384.         blinkIsOn = (not blinkIsOn)
  385.         end
  386.    
  387.        
  388.     end
  389. end
  390.  
  391.  
  392.  
  393. function changeReading(readingName,xPos,yPos)
  394.     if type(curReadingPosX) == "number" and type(readingPosY) == "number" then
  395.     term.setCursorPos(curReadingPosX,readingPosY)
  396.     term.write(" ")
  397.     end
  398.  
  399. blinkIsOn = true
  400. curReading = readingName
  401. readingPosX = xPos
  402. readingPosY = yPos
  403. curReadingPosX = nil
  404. cursorBlinkTimer = os.startTimer(0.05)
  405.  
  406. end
  407.  
  408.  
  409.  
  410. function stopReading()
  411.  
  412. term.setCursorPos(curReadingPosX,readingPosY)
  413. term.write(" ")
  414. curReading = nil
  415. cursorBlinkTimer = nil
  416.  
  417. end
  418.  
  419.  
  420.  
  421. function resetEvent()
  422. info1 = nil
  423. end
  424.  
  425.  
  426.  
  427. function createScrollmenu(name,x1,y1,x2,y2,content,position)
  428. scrollmenuLen[name]=0
  429. scrollmenuInfos[name]={["x1"]=x1,["y1"]=y1,["x2"]=x2,["y2"]=y2,["content"]=content,["position"]=position}
  430.  
  431.     for k,v in pairs(content) do
  432.         if content[k] ~= nil then
  433.         scrollmenuLen[name]=scrollmenuLen[name]+1
  434.         else
  435.             for i=1,table.maxn(content)-scrollmenuLen[name] do
  436.             content[scrollmenuLen[name]+i] = content[scrollmenuLen[name]+1+i]
  437.             end
  438.         end
  439.     end
  440.  
  441. end
  442.  
  443.  
  444.  
  445.  
  446. function printScrollmenu(name)
  447.  
  448.     for i=1,math.min(scrollmenuLen[name],scrollmenuInfos[name]["y2"]-scrollmenuInfos[name]["y1"]+1) do
  449.    
  450.         if (i+scrollmenuInfos[name]["position"])%2==0 then
  451.         term.setBackgroundColor(colors.gray)
  452.         else
  453.         term.setBackgroundColor(colors.black)
  454.         end
  455.        
  456.     term.setCursorPos(scrollmenuInfos[name]["x1"],scrollmenuInfos[name]["y1"]+i-1)
  457.     term.write(scrollmenuInfos[name]["content"][i+scrollmenuInfos[name]["position"]])
  458.    
  459.         for i2=1,scrollmenuInfos[name]["x2"]-scrollmenuInfos[name]["x1"]+1-string.len(scrollmenuInfos[name]["content"][i+scrollmenuInfos[name]["position"]]) do
  460.         term.write(" ")
  461.         end
  462.  
  463.     end
  464.  
  465.  
  466.  
  467. end
  468.  
  469.  
  470.  
  471. function checkScrollmenu(name)
  472.  
  473.     if info1 == "mouse_click" and info3 > scrollmenuInfos[name]["x1"]-1 and info3 < scrollmenuInfos[name]["x2"]+1 and info4 > scrollmenuInfos[name]["y1"]-1 and info4 < scrollmenuInfos[name]["y2"]+1 then
  474.     resetEvent()
  475.     return scrollmenuInfos[name]["position"]+info4-scrollmenuInfos[name]["y1"]+1
  476.     end
  477.    
  478.     if info1 == "mouse_scroll" and not (scrollmenuInfos[name]["position"]+info2 > scrollmenuLen[name]-(scrollmenuInfos[name]["y2"]-scrollmenuInfos[name]["y1"]+1)) and not (scrollmenuInfos[name]["position"]+info2 < 0) then
  479.     scrollmenuInfos[name]["position"] = scrollmenuInfos[name]["position"] + info2
  480.     printScrollmenu(name)
  481.     end
  482.  
  483.  
  484. end
  485.  
  486.  
  487.  
  488. function headline(headline)
  489. width = term.getSize()
  490. headline_lenght=string.len("   "..headline.."   ")
  491. headline_pos=(width/2)-(headline_lenght/2)+1
  492. term.setCursorPos(headline_pos,1)
  493. term.setBackgroundColor(colors.yellow)
  494. term.setTextColor(colors.blue)
  495. term.write("   "..headline.."   ")
  496. term.setBackgroundColor(colors.black)
  497. term.setTextColor(colors.white)
  498. end
  499.  
  500.  
  501.  
  502. function button(button_text,button_pos_x1,button_pos_y1,button_pos_x2,button_pos_y2,button_color)
  503. term.setTextColor(colors.green)
  504.  
  505.   if button_color~=nil then
  506.   term.setTextColor(button_color)
  507.   end
  508.  
  509. square(button_pos_x1,button_pos_y1,button_pos_x2,button_pos_y2,colors.black,"-","|")
  510. term.setCursorPos(math.ceil(button_pos_x1-string.len(button_text)/2+(button_pos_x2-button_pos_x1)/2),button_pos_y1+(button_pos_y2-button_pos_y1)/2)
  511. term.write(button_text)
  512. end
  513.  
  514.  
  515.  
  516. function buttonCheck(b_check_x1,b_check_y1,b_check_x2,b_check_y2)
  517.   if info1=="mouse_click" and info3 > b_check_x1-1 and info3 < b_check_x2+1 and info4 > b_check_y1-1 and info4 < b_check_y2+1 then
  518.   resetEvent()
  519.   return true
  520.   else
  521.   return false
  522.   end
  523. end
  524.  
  525.  
  526.  
  527. function square(x1,y1,x2,y2,back_color_square,symbol_square_x,symbol_square_y,text_color)
  528. x_1=x1
  529. y_1=y1
  530. x_2=x2
  531. y_2=y2
  532.   while x_1~=x2+1 do
  533.   term.setBackgroundColor(back_color_square)
  534.   term.setCursorPos(x_1,y_1)
  535.     if text_color~=nil then
  536.     term.setTextColor(text_color)
  537.     end
  538.   term.write(symbol_square_x)
  539.   x_1=x_1+1
  540.   end
  541.  
  542.   while y_1~=y2-1 do
  543.   term.setCursorPos(x_1-1,y_1+1)
  544.   term.write(symbol_square_y)
  545.   y_1=y_1+1
  546.   end
  547. x2=x2-1
  548.   while x_2~=x1-1 do
  549.   term.setCursorPos(x_2,y_2)
  550.   term.write(symbol_square_x)
  551.   x_2=x_2-1
  552.   end
  553.  
  554.   while y_2~=y1+1 do
  555.   term.setCursorPos(x_2+1,y_2-1)
  556.   term.write(symbol_square_y)
  557.   y_2=y_2-1
  558.   end
  559. term.setBackgroundColor(colors.black)
  560. end
  561.  
  562.  
  563.  
  564. function overwriteDropdown()
  565.  
  566.   for i=1,dropdown["loaded"]["len"] do
  567.  
  568.     if not dropdown[dropdown["loaded"][i]]["is_open"] then
  569.  
  570.       if info1=="mouse_click" and info3 < dropdown[dropdown["loaded"][i]]["pos_x2"]+1 and info3 > dropdown[dropdown["loaded"][i]]["pos_x1"]-1 and info4==dropdown[dropdown["loaded"][i]]["pos_y"] then
  571.       info1 = "dropdown_menu"
  572.       end
  573.  
  574.     else
  575.  
  576.       if info1=="mouse_click" and info3 < dropdown[dropdown["loaded"][i]]["pos_x2"]+1 and info3 > dropdown[dropdown["loaded"][i]]["pos_x1"]-1 and info4 < dropdown[dropdown["loaded"][i]]["pos_y"]+dropdown[dropdown["loaded"][i]]["len"] and info4 > dropdown[dropdown["loaded"][i]]["pos_y"]-1  then
  577.       info1 = "dropdown_menu"
  578.       end
  579.  
  580.     end
  581.  
  582.   end
  583. end
  584.  
  585.  
  586.  
  587. function closeDropdownMenus()
  588. dropdown["loaded"]["len"]=0
  589. end
  590.  
  591.  
  592.  
  593. function createDropdownMenu(name,options,pos_x1,pos_y,pos_x2)
  594.  
  595. dropdown[name] = {}
  596. dropdown[name]["pos_x1"] = pos_x1
  597. dropdown[name]["pos_x2"] = pos_x2
  598. dropdown[name]["pos_y"] = pos_y
  599. dropdown[name]["is_open"] = false
  600. dropdown[name]["len"] = 0
  601.  
  602. i=1
  603.   while options[i]~= nil do
  604.   dropdown[name]["len"] = dropdown[name]["len"]+1
  605.   dropdown[name]["option"..i] = options[i]
  606.   i=i+1
  607.   end
  608.  
  609. end
  610.  
  611.  
  612.  
  613. function printDropdownMenu(name)
  614.  
  615.   for i=1,dropdown[name]["len"] do
  616.   term.setCursorPos(dropdown[name]["pos_x1"],dropdown[name]["pos_y"]+i-1)
  617.  
  618.     if not (i%2==0) then
  619.     term.setBackgroundColor(colors.gray)
  620.     term.setTextColor(colors.white)
  621.     else
  622.     term.setBackgroundColor(colors.lightGray)
  623.     term.setTextColor(colors.black)
  624.     end
  625.  
  626.     if dropdown[name]["is_open"] or i==1 then
  627.     term.write(dropdown[name]["option"..i])
  628.       for i1=1,(dropdown[name]["pos_x2"]-dropdown[name]["pos_x1"])-string.len(dropdown[name]["option"..i])+1 do
  629.       term.write(" ")
  630.       end
  631.     end
  632.   end
  633.  
  634. term.setBackgroundColor(colors.black)
  635. term.setTextColor(colors.white)
  636. end
  637.  
  638.  
  639.  
  640. function dropdownMenuCheck(name)
  641.  
  642.   if dropdown[name]["is_open"] then
  643.  
  644.     if info1=="dropdown_menu" and info3 < dropdown[name]["pos_x2"]+1 and info3 > dropdown[name]["pos_x1"]-1 and info4==dropdown[name]["pos_y"] then
  645.     dropdown[name]["is_open"]=false
  646.     printMenu(curEnv)
  647.     return "closed"
  648.     end
  649.    
  650.     if info1=="dropdown_menu" and info3 < dropdown[name]["pos_x2"]+1 and info3 > dropdown[name]["pos_x1"]-1 and info4 < dropdown[name]["pos_y"]+dropdown[name]["len"]+1 and info4 > dropdown[name]["pos_y"] then
  651.     option_save = dropdown[name]["option"..1]
  652.     dropdown[name]["option"..1] = dropdown[name]["option"..info4-dropdown[name]["pos_y"]+1]
  653.     dropdown[name]["option"..info4-dropdown[name]["pos_y"]+1] = option_save
  654.     dropdown[name]["is_open"]=false
  655.     printMenu(curEnv)
  656.     return "changed"
  657.     end
  658.  
  659.   else
  660.  
  661.     if info1=="dropdown_menu" and info3 < dropdown[name]["pos_x2"]+1 and info3 > dropdown[name]["pos_x1"]-1 and info4==dropdown[name]["pos_y"] then
  662.     dropdown[name]["is_open"]=true
  663.     printDropdownMenu(name)
  664.     return "opened"
  665.     end
  666.  
  667.   end
  668.  
  669. end
  670.  
  671.  
  672.  
  673. function loadDropdownMenu(name)
  674. dropdown["loaded"]["len"] = dropdown["loaded"]["len"]+1
  675. dropdown["loaded"][dropdown["loaded"]["len"]] = name
  676. printDropdownMenu(name)
  677. end
  678.  
  679.  
  680.  
  681. function printMenu(env)
  682.  
  683.     if env=="homeMenu" then
  684.     homeMenu()
  685.     end
  686.  
  687.     if env=="teleportMenu" then
  688.     teleportMenu()
  689.     end
  690.    
  691.     if env=="onlinePlayersMenu" then
  692.     onlinePlayersMenu()
  693.     end
  694.  
  695. end
  696.  
  697.  
  698.  
  699. function filled_square(fill_x1,fill_y1,fill_x2,fill_y2,fill_color)
  700. term.setBackgroundColor(fill_color)
  701. curr_fill_pos_x=fill_x1
  702. curr_fill_pos_y=fill_y1
  703.   while curr_fill_pos_y~=fill_y2+1 do
  704.     while curr_fill_pos_x~=fill_x2+1 do
  705.     term.setCursorPos(curr_fill_pos_x,curr_fill_pos_y)
  706.     term.write(" ")
  707.     curr_fill_pos_x=curr_fill_pos_x+1
  708.     end
  709.   curr_fill_pos_x=fill_x1
  710.   curr_fill_pos_y=curr_fill_pos_y+1
  711.   end
  712. term.setBackgroundColor(colors.black)
  713. end
  714.  
  715.  
  716.  
  717. function lineCheck(y)
  718.  
  719.     if info1 == "mouse_click" and info4 == y then
  720.     return true
  721.     else
  722.     return false
  723.     end
  724.  
  725. end
  726.  
  727. -------------------------------------------------
  728.  
  729.  
  730.  
  731.  
  732. startup()
  733. homeMenu()
  734. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement