Guest User

startup

a guest
May 7th, 2018
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.84 KB | None | 0 0
  1. cb = peripheral.wrap("right")
  2. sb = peripheral.wrap("left")
  3. lp = peripheral.wrap("back")
  4. function request( itemID, amount, meta )
  5.   local amount = tostring(amount)
  6.   local meta = tostring(meta)
  7.   local result = lp.getLP().getItemIdentifierBuilder()
  8.   result.setItemID( itemID )
  9.   result.setItemData( meta )
  10.   lp.makeRequest( result.build(), amount )
  11. end
  12. request("minecraft:stone",1,1)
  13. function say(Str)
  14.   sleep(math.random(3,5))
  15.   cb.say(Str,1,false,"Brian")
  16.   sb.speak(Str)
  17. end
  18. while true do
  19. event,name,msg = os.pullEvent("command")
  20. for i=1,#msg do
  21.   print(msg[i])
  22. end
  23. if event == "command" then
  24.   say("Command detected")
  25. sleep(1)
  26. if msg[1] == "log" then
  27.   say("Logistics system detected.")
  28.   amount = msg[2]
  29.   item = msg[3]
  30.   data = msg[4]
  31.   print(amount)
  32.   print(item)
  33.   print(data)
  34.   request(amount,item,data)
  35. end
  36. end
  37. end
Advertisement
Add Comment
Please, Sign In to add comment