Advertisement
Marlingaming

Online Tab - Gov Site

Jan 11th, 2022 (edited)
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.52 KB | None | 0 0
  1. --this script allows the player to change their Gov info
  2. networkVersion = "1.0.0"
  3. SecCode = "0000"
  4. local returnScript = settings.get("os_DesktopLoc")
  5. local tArg = {...}
  6. if #tArg > 0 then
  7.     returnScript = tArg[1]
  8. end
  9. local w, h = term.getSize()
  10. local n = 1
  11. local Headlines_1 = {"Capital Times 1/11/22","Head Builder of the capital has announced today that the construction of the Imperial Palace will be delayed, so a quicker and smaller Government Building could be set for temporary use, in the rush for the governments expected establishment on the 20th"}
  12. local Headlines_2 = {"Emperors Insight 1/10/22","Politicians across the nation are in complete agreement over the idea of rushing the constitutions Development. How will they legally do this? Experts say the only way they can is by forcing DeathsMainDomain out of the circle using the Arguement that he is slowing down its completion"}
  13. local function Clear()
  14. term.clear()
  15. term.setCursorPos(1,1)
  16. end
  17.  
  18. local function CenterText(y,text)
  19.     local x = math.floor((w - string.len(text)) /2)
  20.     term.setCursorPos(x,y)
  21.     term.clearLine()
  22.     term.write(text)
  23. end
  24.  
  25. local function HomePage()
  26.  
  27. end
  28.  
  29. function CUI(m) --declare function
  30.  
  31.  
  32. n=1
  33. local l = #m
  34. while true do
  35.  
  36. CenterText(2,os.date())
  37. term.setCursorPos(1,3)
  38. term.clearLine()
  39. local Text = "-"
  40. for i = 1, #m do
  41.  
  42. if i==n then Text = Text.."["..m[i].."]-" else Text = Text..m[i].."-" end
  43. end
  44. term.write(Text)
  45. local event = {os.pullEvent()}
  46. local Cat = {event[3]}
  47. a, b= os.pullEvent("key") --wait for keypress
  48. if b==keys.a and n>1 then n=n-1 end
  49. if b==keys.d and n<l then n=n+1 end
  50. if b==keys.enter then break end
  51. end
  52. return n --return the value
  53. end
  54.  
  55. function DrawMenus(M)
  56. Clear()
  57. local Options
  58.  
  59. print("Government Web Panel")
  60. term.setCursorPos(1,9)
  61. print(M)
  62. if M == "Home" then
  63.    
  64.     Options = {"Home","Politics","Account","Taxes","exit"}
  65.    
  66. elseif M == "Politics" then
  67.         Options = {"Home","Politics","Account","Taxes","exit"}
  68.     term.setCursorPos(1,10)
  69.     print("====Latest News====")
  70.     print(Headlines_1[1])
  71.     print(Headlines_1[2])
  72.     print(Headlines_2[1])
  73.     print(Headlines_2[2])
  74.    
  75. elseif M == "Account" then
  76.     Options = {"Home","Politics","Account","Taxes","exit"}
  77.     print("Coming Soon!")
  78. elseif M == "Taxes" then
  79.     Options = {"Home","Politics","Account","Taxes","exit"}
  80.     print("Coming Soon!")
  81. elseif M == "exit" then
  82.     shell.run(returnScript)
  83. end
  84. if M == "exit" then
  85.  
  86. else
  87.     local n = CUI(Options)
  88.     DrawMenus(Options[n])
  89. end
  90. end
  91.  
  92.  
  93. DrawMenus("Home")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement