Advertisement
Guest User

computercraft smartglass

a guest
Jun 26th, 2014
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 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.    itmqty = tonumber(itmqty)
  15.    event, itmid = os.pullEvent("chat_command")
  16.    itmid = tonumber(itmid)
  17.    event, itmdmg = os.pullEvent("chat_command")
  18.    itmdmg = tonumber(itmdmg)
  19.    reqitem = {id = itmid;dmg = itmdmg;qty = itmqty;}
  20.    unavailable = itmqty - net.callRemote(ae,"countOfItemType",itmid,itmdmg)
  21.       if unavailable > 0 then
  22.       craft = reqitem
  23.       craft[qty] = unavailable
  24.       net.callRemote(ae,requestCrafting,craft)
  25.    end
  26.    net.callRemote(ae,"extractItem",reqitem,echest)   
  27. end
  28.        
  29.  
  30.  
  31. refresh = function()
  32. end
  33.  
  34. event,action = os.pullEvent("chat_command")
  35. if action == "req" then
  36.    request()
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement