Advertisement
Guest User

computercraft smartglass

a guest
Jun 25th, 2014
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.00 KB | None | 0 0
  1. echest = "west"
  2. net = peripheral.wrap("back")
  3. ae = "appeng_me_tilecolorlesscable_1"
  4. glass= "openperipheral_glassesbridge_0"
  5. net.callRemote(glass,"clear")
  6. screenheight = 768
  7. screenwidth = 1366
  8.  
  9.  
  10.  
  11.  
  12. request = function()
  13.    event,itmqty = os.pullEvent("chat_command")
  14.    if type(itqty) == "number" then
  15.       event,itmid = os.pullEvent("chat_command")
  16.       if type(itmid) == "number" then
  17.      event,itmdmg = os.pullevent("chat_command")
  18.      if type(itmdmg) == "number" then
  19.         reqitem = {qty = itmqty;id = itmid;dmg = itmdmg}
  20.      else
  21.         if itmdmg == "none" then
  22.         reqitem = {qty = itmqty,id = itmid}
  23.         end
  24.      end
  25.      unavailable = itmqty - net.callRemote(ae,"reqitem")
  26.      if unavailable > 0 then
  27.         craft = reqitem
  28.         craft[qty] = unavailable
  29.         net.callRemote(ae,requestCrafting,craft)
  30.      end
  31.      net.callRemote(ae,"extractItem",reqitem,echest)     
  32.       end
  33.    end
  34. end
  35.        
  36.  
  37.  
  38. refresh = function()
  39. end
  40.  
  41. event,action = os.pullEvent("chat_command")
  42. if action == "req" then
  43.    request()
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement