This commit is contained in:
Crispy 2025-05-27 03:02:53 +02:00
parent 1ff3cea4d6
commit 5422d52065
21 changed files with 21953 additions and 369 deletions

View file

@ -1,14 +1,85 @@
_G.position = vector.new(-250,96,108)
_G.position = vector.new(-2,186,126)
_G.facing = vector.new(-1,0,0)
rednet.open("left")
old_print = _G.print
new_print = function(...)
--old_print = _G.print
--[[new_print = function(...)
x = ""
for i,v in ipairs(arg) do
x = x..tostring(v).." "
end
old_print(x)
rednet.broadcast(x)
end]]
--_G.print = new_print
--rednet.host("tomfoolery",os.computerLabel())
--while true do
function append(tbl,value)
table.insert(tbl,value)
return tbl
end
_G.print = new_print
rednet.host("tomfoolery",os.computerLabel())
rednet.host("tomfoolery",os.getComputerLabel())
queue = {}
history = {}
if true then
parallel.waitForAll(
function()
while true do
--print("reading")
while running do
coroutine.yield()
end
write(
shell.dir().."> "
)
table.insert(
queue,
append(
history,
not running and read(
nil,
history,
shell.complete
)
)[#history]
)
sleep(0.05)--coroutine.yield()
end
end,
function()
while true do
--print("attempting to run shell on :"..(queue[1] or ""))
running = true
shell.run(
table.remove(
queue,
1
)
)
running = false
--term.clear()
for i,v in pairs(queue) do
--print(v)
end
sleep(0.05)
end
end,
function()
while true do
--print("recieving")
id,mess,kind = rednet.receive()
if kind == "complete" then
rednet.send(id,shell.complete(mess),"completed")
elseif kind == "run" then
print("recieved")
print(id, mess, kind)
table.insert(queue,mess)
sleep(0.05)
else
end
end
end
)
end
rednet.receive()