Advertisement
AkaShiroKage

Greeter

Mar 15th, 2024 (edited)
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.22 KB | Source Code | 0 0
  1.  
  2. local function resetLine()
  3.   local x, y = term.getCursorPos()
  4.   term.clearLine()
  5.   term.setCursorPos(1, y)
  6. end
  7.  
  8. local dataPath = "lib/greeter/"
  9.  
  10. local function validateFS()
  11.   shell.setDir("")
  12.   if fs.exists(dataPath .. "greeter.lua") == false then
  13.     resetLine()
  14.     term.write("Installing copy of launcher...\n")
  15.     shell.run("pastebin", "get XC7CerBT " .. dataPath .. "greeter.lua")
  16.   end
  17.   if fs.exists(dataPath .. "player_data.lua") == false then
  18.     resetLine()
  19.     term.write("Installing player_data.lua...")
  20.     shell.run("pastebin", "get CAhYfSDP " .. dataPath .. "player_data.lua")
  21.   end
  22.   if fs.exists(dataPath .. "player_tracker.lua") == false then
  23.     resetLine()
  24.     term.write("Installing player_tracker.lua...")
  25.     shell.run("pastebin", "get z60S7B4t " .. dataPath .. "player_tracker.lua")
  26.   end
  27.   if fs.exists(dataPath .. "player_greeter.lua") == false then
  28.     resetLine()
  29.     term.write("Installing player_greeter.lua...")
  30.     shell.run("pastebin", "get 3XHgyPW4 " .. dataPath .. "player_greeter.lua")
  31.   end
  32. end
  33.  
  34. validateFS()
  35.  
  36. multishell.launch({}, dataPath .. "player_tracker.lua")
  37. multishell.launch({}, dataPath .. "player_greeter.lua")
  38.  
  39. shell.setAlias("greet", dataPath .. "greeter.lua")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement