fluid things

This commit is contained in:
Crispy 2025-05-25 03:02:48 +02:00
parent 7694798ad0
commit ad6af0fa35
21 changed files with 608 additions and 183 deletions

View file

@ -1,23 +1,84 @@
_G.position = vector.new(-250,96,106)
_G.position = vector.new(-1,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
end]]
--_G.print = new_print
rednet.host("tomfoolery",os.computerLabel())
--rednet.host("tomfoolery",os.computerLabel())
--while true do
if not _G.thing or true then
_G.thing = true
function append(tbl,value)
table.insert(tbl,value)
return tbl
end
rednet.host("tomfoolery",os.getComputerLabel())
queue = {}
history = {}
if true then
parallel.waitForAll(
function() while true do read() end end,
function() shell.run("felling") end,
function() while true do id,message = rednet.receive() print(message) end end
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()