Advertisement
Guest User

craft

a guest
Dec 19th, 2014
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 KB | None | 0 0
  1. args = {...}
  2.  
  3. if args[1] == nil then
  4.   print("Give me more than one arguemnt")
  5.   return
  6. end
  7.  
  8. if args[2] == nil then
  9.   args[2] = "1"
  10. end
  11.  
  12. rednet.open("back")
  13.  
  14. function getSide(i)
  15.   if i == 0 then
  16.     return "bottom,"  
  17.   elseif i == 1 then
  18.     return "left,"
  19.   elseif i == 2 then
  20.     return "top,"
  21.   elseif i == 3 then
  22.     return "right,"
  23.   end
  24. end
  25.  
  26. comps = {26, 30}
  27. list = {"GoldPressurePlate"
  28.         , "Piston"
  29.         , "GlassPane"
  30.         , "InventoryCable"
  31.         , "Computer"
  32.         , "FactoryMachineBlock"
  33.         , "BasicCapacitor"}
  34.        
  35. for key, value in pairs(list) do
  36.   if args[1] == value then
  37.     rednet.send(comps[math.floor(key / 4) + 1], getSide(((key - 1) % 4))..args[2])
  38.   end
  39. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement