Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- print("ME-retriever online.")
- print("")
- print("Activity log:")
- chat = peripheral.wrap("top")
- me = peripheral.wrap("left")
- totalCount = 0
- while true do
- Event,Person,Message = os.pullEvent("chat")
- local string = {}
- for var in Message:gmatch("%w+") do
- table.insert(string,var)
- end
- intCheckQty = tonumber(string[3])
- intCheckID = tonumber(string[2])
- if intCheckID == nil then
- intCheckID = 0
- end
- if string[4] ~= nil then
- intCheckMetadata = tonumber(string[4])
- if intCheckMetadata == nil then
- intCheckMetadata = 0
- end
- intCheckID = (intCheckMetadata * 32768) + intCheckID
- end
- if string[4] == nil then
- intCheckMetadata = 0
- end
- if string[1] == "gimme" and intCheckID > 0 then
- totalCount = totalCount + 1
- me.retrieve(intCheckID,intCheckQty,1)
- if intCheckMetadata ~= 0 then
- final = (intCheckQty.."x of "..string[2]..":"..intCheckMetadata)
- else
- final = (intCheckQty.."x of "..string[2])
- end
- print(totalCount..". "..Person.." retrieved "..final)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement