-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path_autosave_.txt
188 lines (161 loc) · 4.51 KB
/
_autosave_.txt
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
--@name LanAI X
--@author Yuri6037
--@class processor
--@autoupdate
--@model models/bidonstoragedest.mdl
--
-- LanAI X Main processor file
-- Pase using SF Processor tool
-- Report bugs and/or ask for improvements here https://github.com/Yuri6037/TSCM_Starfall
--
--For dynamic beams push wire GPS ~105 units to the bottom
--Beware lib_protocol might still be able to crash accross LanAI instances, if it happens,
--please remove it temporarly from Systems.Secondary
--The processor files
ProcessorFiles = {
Drivers = {
"basics",
"beam",
"props",
"timer",
"valve",
"warp",
"weapons",
"lanteansos",
"sensor",
"doors",
"engines",
"stargate",
"torpedomatrix",
"atlantisshield"
},
Systems = {
Primary = {
"wirehooks",
"internal_security_primary",
--The transmission protocol
"protocol",
"basic_packets",
"ai_utils",
"ai_decoder",
"ai_answer",
"permissions",
"multitarget", --Important system commands and combat system depends on it
"points_manager",
"dangeridentifier"
},
Secondary = {
"lib_protocol",
"ai_listener",
"ship_auto_load",
"automatic_mode",
"combat",
"internal_security_secondary",
"plan_gen",
"jailmanager",
--Extensions
"weapon_debugger"
}
},
OSApps = {
"resource",
"status",
"warp",
"beam",
"tactical",
"shieldpower",
"env",
"valve",
"doorsview",
"sgstatus",
"sgdial"
}
}
--LanAI Constants
--@require lanai/constants.txt
--Including server libs
--@require lanai/libs/processor/lanaifiles.txt
--@require lanai/libs/processor/string_lib.txt
--@require lanai/libs/processor/math_lib.txt
--@require lanai/libs/bypass.txt
--@require lanai/libs/processor/ship_sensor_hacker.txt
--@require lanai/libs/tasks.txt
--@require lanai/libs/logging.txt
--Including the LanAI loading process
--@include lanai/processor/internal/lanai_loader.txt
--Utilities
--@require lanai/processor/internal/utilities.txt
--The folder includes
--@includedir lanai/processor/ai_cmds/
--@includedir lanai/processor/systems/
--@includedir lanai/processor/drivers/
--
-- [[Load primary systems]]
--
--Setup starfall permissions
permissions.register(permissions.REMOVE_ENTITY)
permissions.register(permissions.SPAWN_ENTITY)
--Init logging
util.SetLogLevel(0)
util.AddLogHandler(function(msg)
printConsole("LanAI> " .. msg)
end)
--Set core to be loading
Loading = true
--Init task system
TaskError = nil
task.SetErrorCallback(function(id, err)
util.Log("Tasks", LOG_ERR, "Task '", id, "' : ", err)
end)
--Create required hooks
util.CreateHook("PreLoad")
util.CreateHook("PostLoad")
--Inject primary systems
util.Log("Main", LOG_INFO, "LanAI ", VERSION_AI)
for k, v in pairs(ProcessorFiles.Systems.Primary) do
util.Log("Systems", LOG_DEBUG, "Loading primary system '", v, "'...")
require("lanai/processor/systems/" .. v .. ".txt")
end
--
-- [[End]]
--
util.Log("Main", LOG_INFO, "ConstraintsRetriever V", VERSION_PLOADER)
aiSay("Retrieving all constrained entities...")
--Entity listing vars
SFAllowedSubEntities = {}
SHIP_PARTS_BOOL = {}
SHIP_PARTS = {}
--The preload thread
local Thread = nil
SendPacket("PRELOAD", "START")
ents.self():setSubMaterial(0, "glow/yellow_light")
ents.self():setSubMaterial(1, "Boba_Fett/textures/destiny")
function MasterBoot()
Thread = bypass.StartConstraintsRetriever(ents.self(), function(fuck, num)
util.Log("Main", LOG_INFO, "Found ship with ", #fuck, " entities.")
aiSay("Initializing Systems...")
SendPacket("PRELOAD", "END")
SHIP_PARTS = fuck
SHIP_PARTS_BOOL = bypass.GetRetrievedConstraintsBool()
util.RunHook("PreLoad")
require("lanai/processor/internal/lanai_loader.txt")
timer.remove("LanAI_AttemptConstraintsGetWait")
end, function(fuck, num, err)
if (err == "StoppedWorking") then
SendPacket("PRELOAD", "UPD", "FAILURE")
ents.self():setSubMaterial(0, "phoenix_storms/pack2/redlight")
util.Log("Main", LOG_ERR, "ConstraintsRetriever stopped working after ", #fuck, " loaded entities")
else
SendPacket("PRELOAD", "UPD", "FAILURE")
ents.self():setSubMaterial(0, "phoenix_storms/pack2/redlight")
util.Log("Main", LOG_ERR, "ConstraintsRetriever crashed after ", #fuck, " loaded entities")
util.Log("Main", LOG_ERR, "Error : ", ErrorString)
end
end)
end
--Run master boot (getConstraints replacement thread)
if (starfall.isSpawnedFromDuplicator()) then
timer.create("LanAI_ForceWaitAdvDupe2", 35, 1, MasterBoot)
else
MasterBoot()
end