Advertisement
Marlingaming

CC Tweaked Online Applications Provider

Jan 10th, 2022 (edited)
701
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.18 KB | None | 0 0
  1. --this script displays possible online programs that the client can start.
  2. version = "1.0.0"
  3. settings.load(".settings")
  4. local Sites_Display = {"Federal Government Website","Laws","WebEngine","exit"}
  5. local Sites_Type = {"Paste","Paste","App","App"}
  6. local Sites_Link = {"LXFqgEQt","TLdkuycX","os/os_Programs/os_SearchEngine/Base",settings.get("os_DesktopLoc")}
  7.  
  8. local function Clear()
  9. term.clear()
  10. term.setCursorPos(1,1)
  11. end
  12.  
  13. function CUI(m) --declare function
  14. n=1
  15. local l = #m
  16. while true do
  17.  
  18. term.setCursorPos(1,2)
  19.  
  20. for i=1, #m, 1 do --traverse the table of options
  21. if i==n then term.clearLine() print(i, " ["..m[i].."]") else term.clearLine() print(i, " ", m[i]) end --print them
  22. end
  23. a, b= os.pullEvent("key") --wait for keypress
  24. if b==keys.w and n>1 then n=n-1 end
  25. if b==keys.s and n<l then n=n+1 end
  26. if b==keys.enter then break end
  27. end
  28. return n --return the value
  29. end
  30.  
  31.  
  32.  
  33. --os/os_Programs/os_SearchEngine/Base
  34. local function OptionsMenu()
  35. Clear()
  36. print("options")
  37. local n = CUI(Sites_Display)
  38. if Sites_Type[n] == "Paste" then
  39.     shell.run("pastebin","run",Sites_Link[n])
  40. elseif Sites_Type[n] == "App" then
  41.     shell.run(Sites_Link[n])
  42. end
  43. end
  44.    
  45. OptionsMenu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement