mmm
This commit is contained in:
parent
5422d52065
commit
4f2631b349
24 changed files with 414 additions and 5665 deletions
|
@ -1,5 +1,5 @@
|
|||
|
||||
while message~="i can halt now" do
|
||||
while messages~="i can halt now" do
|
||||
rednet.send(id,"halt")
|
||||
id,message = rednet.receve()
|
||||
id,messages = rednet.receve()
|
||||
end
|
||||
|
|
40
computer/5/scoundril
Normal file
40
computer/5/scoundril
Normal file
|
@ -0,0 +1,40 @@
|
|||
W = window.create(term.native(),5,10,39,13)
|
||||
--W.setBackgroundColor(colors.lightGray)
|
||||
--W.setTextColor(colors.black)
|
||||
W.clear()
|
||||
|
||||
function scoundrilmirror()
|
||||
while true do
|
||||
--local x,y = W.getCursorPos()
|
||||
--paintutils.drawBox(4,9,46,23,colors.gray)
|
||||
--W.setBackgroundColor(colors.brown)
|
||||
--W.setTextColor(colors.pink)
|
||||
id,mess = rednet.receive()
|
||||
if id == 4 then
|
||||
W[mess[1]](unpack(mess[2]))
|
||||
end
|
||||
--W.setCursorPos(x,y)
|
||||
--paintutils.drawBox(4,9,46,23,colors.gray)
|
||||
end
|
||||
end
|
||||
function eventmirror()
|
||||
while true do
|
||||
event = {os.pullEventRaw()}
|
||||
if event[1] == "rednet_message" then
|
||||
|
||||
elseif event[1] == "modem_message" then
|
||||
|
||||
else
|
||||
rednet.send(
|
||||
4,
|
||||
event,
|
||||
"pocketevent"
|
||||
)
|
||||
--print(event)
|
||||
end
|
||||
end
|
||||
end
|
||||
parallel.waitForAll(
|
||||
scoundrilmirror,
|
||||
eventmirror
|
||||
)
|
|
@ -7,7 +7,7 @@ local function splitprefixes(str,prefixes)
|
|||
end
|
||||
end
|
||||
end
|
||||
while true do
|
||||
while false do
|
||||
thing = read( nil, nil,
|
||||
function(str)
|
||||
copy = require("rednetcopy")
|
||||
|
@ -24,15 +24,15 @@ while true do
|
|||
if #choices > 0 then
|
||||
return choices
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
name,sub,id = splitprefixes(str,turts)
|
||||
--print(name,sub,id)
|
||||
--print(sub)
|
||||
if not id then return end
|
||||
rednet.send(id,sub,"complete")
|
||||
_,message = rednet.receive("completed",0.2)
|
||||
return message
|
||||
_,messages = rednet.receive("completed",0.2)
|
||||
return messages
|
||||
end
|
||||
)
|
||||
turts = copy.lookup("tomfoolery")
|
||||
|
|
34
computer/5/test2.lua
Normal file
34
computer/5/test2.lua
Normal file
|
@ -0,0 +1,34 @@
|
|||
tab = "self"
|
||||
|
||||
while true do
|
||||
copy = require("rednetcopy")
|
||||
turts = copy.lookup("tomfoolery")
|
||||
table.insert(turts,{-1,"self"})
|
||||
table.sort(
|
||||
turts,
|
||||
function(a,b)
|
||||
return a[1] < b[1]
|
||||
end
|
||||
)
|
||||
turtlenames = {}
|
||||
x,y = term.getCursorPos()
|
||||
term.setCursorPos(1,1)
|
||||
for i,v in pairs(turts) do
|
||||
if tab ~= v[2] then
|
||||
term.setBackgroundColor((math.mod(i,2) == 0) and colors.lightGray or colors.cyan)
|
||||
term.setTextColor(colors.black)
|
||||
else
|
||||
term.setBackgroundColor(colors.gray)
|
||||
term.setTextColor(colors.white)
|
||||
end
|
||||
table.insert(turtlenames,v[2])
|
||||
write(" "..v[2].." ")
|
||||
end
|
||||
term.setBackgroundColor(colors.brown)
|
||||
write(" ")
|
||||
term.setBackgroundColor(colors.black)
|
||||
term.setTextColor(colors.white)
|
||||
term.setCursorPos(x,y)
|
||||
|
||||
|
||||
end
|
30
computer/5/thief
Normal file
30
computer/5/thief
Normal file
|
@ -0,0 +1,30 @@
|
|||
W = window.create(term.native(),3,3,39,13)
|
||||
function thiefmirror()
|
||||
while true do
|
||||
id,mess = rednet.receive()
|
||||
if id == 3 then
|
||||
W[mess[1]](unpack(mess[2]))
|
||||
end
|
||||
end
|
||||
end
|
||||
function eventmirror()
|
||||
while true do
|
||||
event = {os.pullEventRaw()}
|
||||
if event[1] == "rednet_message" then
|
||||
|
||||
elseif event[1] == "modem_message" then
|
||||
|
||||
else
|
||||
rednet.send(
|
||||
3,
|
||||
event,
|
||||
"pocketevent"
|
||||
)
|
||||
--print(event)
|
||||
end
|
||||
end
|
||||
end
|
||||
parallel.waitForAll(
|
||||
thiefmirror,
|
||||
eventmirror
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue