-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathremote.lua
More file actions
92 lines (79 loc) · 2.59 KB
/
remote.lua
File metadata and controls
92 lines (79 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
-- Random
local version = "1.1.0a" --is that right?
local tardisID = "ce9e7f33-1dae-417d-9994-b8e49e7d3f4b"
-- Save file load/save stuff
--local save = fs.open("save.txt", "w")
--save.write("test")
--save.close --(trying to make a save system for victims)
--Error from CC: /remote.lua:57: attempt to call global 'handleSettingChoice' (a nil value)
-- Menu Shit
local function printMenu() --MAIN
term.clear()
term.setCursorPos(1, 1)
print("=== Welcome! ===")
--print("Version " .. version ..", Tardis-ID: " .. tardisID .. "") --DEBUG
print("=== Who do you want to fly to? ===")
print("1. Divine590")
print("2. EchoInfinite")
print("3. GateMC")
print("4. Settings/Debug Info")
print("5. Exit")
print("=== Service by Echo ===")
write("Select an option: ")
end
local function printSettings() --SETTINGS
term.clear()
term.setCursorPos(1, 1)
print("=== Settings ===")
print("Version " .. version .. " present")
print("Current TARDIS-ID: " .. tardisID .. "")
print("1. Add Person to list")
print("2. Remove Person from list")
print("3. Change TARDIS-ID")
print("4. Exit (stops program)")
write("Select an option: ")
end
local function handleSettingChoice(choice) --SETTINGS HANDLER
if choice == "1" then
print("W.I.P Feature")
elseif choice == "2" then
print("W.I.P Feature")
elseif choice == "3" then
print("W.I.P Feature")
elseif choice == "4" then
return false
else
print("Invalid choice. Please try again.")
end
return true
end
local function handleChoice(choice) --MAIN HANDLER
if choice == "1" then
exec("execute as Divine590 at Divine590 run ait summon " .. tardisID .. " ~ ~ ~")
elseif choice == "2" then
exec("execute as EchoInfinite at EchoInfinite run ait summon " .. tardisID .. " ~ ~ ~")
elseif choice == "3" then
exec("execute as GateMC at GateMC run ait summon " .. tardisID .. " ~ ~ ~")
elseif choice == "4" then
local inSetting = true
while inSetting do
printSettings()
local settingChoice = read()
inSetting = handleSettingChoice(settingChoice)
sleep(1)
end
elseif choice == "5" then
print("Goodbye!")
return false
else
print("Invalid choice. Please try again.")
end
return true
end
local running = true -- MAIN PRINT
while running do
printMenu()
local choice = read()
running = handleChoice(choice)
sleep(1)
end