Advertisement
An93l0fD3ath

Loaders

May 8th, 2018
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.82 KB | None | 0 0
  1. local component = require("component")
  2. --local itemTrans = component.proxy(component.get("0224"))
  3. --local me = component.proxy(component.get("4947"))
  4. local MilkTrans = component.proxy(component.get("8969"))
  5. local SewageTrans = component.proxy(component.get("9f87"))
  6. --local loaderInfo = component.proxy(component.get("8b6a"))
  7. local loaderInfo = component.proxy(component.get("7dfe"))
  8. local rs = component.redstone
  9. local colors = require("colors")
  10. local sides = require("sides")
  11. local myTable = loaderInfo.getFluidInTank(sides.down)
  12. print (myTable[1]["amount"],"local")
  13.  
  14. --local inUse = false --for later use
  15. local Milk = MilkTrans
  16. local Sewage = SewageTrans
  17.  
  18. print("Input Fluid Type: Milk,Sewage")
  19. local fluid = io.read()
  20.  
  21. if fluid=="Milk" or fluid=="Sewage" then
  22.     print("Fluid Type", fluid)
  23.     print("Input Amount To Order Max=256000")
  24.     local order = io.read("n")
  25.     print("Order Amount", order)
  26. else
  27.     print("Incorrect Input")
  28. end
  29.  
  30.  
  31. --while order > 256000 do
  32. --  print("The maximum order amount is 256000. The inputted number is too high. Please try again")
  33. --  order = io.read("n")
  34. --end
  35.  
  36. --This will only execute if the order number is less than 256000
  37.  
  38. local function cartRelease()
  39. rs.setBundledOutput(sides.east, colors.blue, 253)
  40. os.sleep(1)
  41. rs.setBundledOutput(sides.east, colors.blue, 0)
  42. myTable = loaderInfo.getFluidInTank(sides.down)
  43. print(myTable[1]["amount"],"cartRelease")
  44. end
  45.  
  46. local function loaderCheck()
  47. while myTable[1]["amount"] > 0 do
  48. print(myTable[1]["amount"],"loaderCheck1")
  49. --elseif
  50. cartRelease()
  51. os.sleep(60)
  52. end
  53. end
  54.  
  55.  
  56.  
  57.  
  58. local function getRemainder()
  59. if myTable[1]["amount"] <= 32000 then
  60. print(myTable[1]["amount"],"getRemainder")
  61. end
  62. end
  63. -- Changing MilkTrans to fluid
  64. fluid.transferFluid(sides.north, sides.south, order)
  65. os.sleep(5)
  66. cartRelease()
  67. loaderCheck()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement