Advertisement
william200027

CompteurviaHttp

May 11th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.06 KB | None | 0 0
  1. Fusion1 = peripheral.wrap("powered_tile_750")
  2. Fusion2 = peripheral.wrap("powered_tile_752")
  3. Fusion3 = peripheral.wrap("powered_tile_751")
  4. Fusion4 = peripheral.wrap("powered_tile_749")
  5.  
  6. Mon_de_l_item1 = " Yellorium"
  7. Mon_de_l_item2 = " Copper"
  8. Mon_de_l_item3 = " Tin"
  9. Mon_de_l_item4 = " Or"
  10.  
  11. Heure1 = 0
  12. Heure2 = 0
  13. Heure3 = 0
  14. Heure4 = 0
  15.  
  16. Nombre = 0
  17. Nombre = 0
  18. Nombre = 0
  19. Nombre = 0
  20.  
  21.  local function r(...) return shell.run(...) end
  22. local function w(...) return write(...) end
  23.  
  24. if not fs.exists("Config") then
  25.  fs.makeDir("Config")
  26. end
  27.  
  28. if not fs.exists("Config/Yellorium") then
  29.  createAcc1 = fs.open("Config/Yellorium", "w")
  30.  createAcc1.write("0")
  31.  createAcc1.close()
  32. end
  33.  
  34. if not fs.exists("Config/Copper") then
  35.  createAcc1 = fs.open("Config/Copper", "w")
  36.  createAcc1.write("0")
  37.  createAcc1.close()
  38. end
  39.  
  40. if not fs.exists("Config/Tin") then
  41.  createAcc1 = fs.open("Config/Tin", "w")
  42.  createAcc1.write("0")
  43.  createAcc1.close()
  44. end
  45.  
  46. if not fs.exists("Config/Or") then
  47.  createAcc1 = fs.open("Config/Or", "w")
  48.  createAcc1.write("0")
  49.  createAcc1.close()
  50. end
  51.  
  52. local function post(one,two,tree,four)
  53.                 http.post(
  54.                                 "http://zaidal.96.lt/ComputerCraft/scorepost.php",
  55.                                 "one="..textutils.urlEncode(tostring(one)).."&"..
  56.                                 "two="..textutils.urlEncode(tostring(two)).."&"..
  57.                                 "tree="..textutils.urlEncode(tostring(tree)).."&"..
  58.                                 "four="..textutils.urlEncode(tostring(four))
  59.                 )
  60. end
  61.  
  62. function Compte1()
  63.  
  64. Element1 = Fusion1.getStackInSlot(3)
  65.  
  66.  if Element1 == nil then
  67.  else
  68.   if Element1.display_name == "element.U" then
  69.     if Element1.qty == 64 then
  70.      heure1 = fs.open("Config/Yellorium","r")
  71.      Heure1 = heure1.readLine()
  72.      heure1.close()
  73.      Heure1 = Heure1 + 1
  74.      Production1 = fs.open("Config/Yellorium","w")
  75.      Production1.write(Heure1)
  76.      Production1.close()
  77.      Yolo1 = Heure1*64
  78.      Nombre1 = Yolo1/16
  79.      print("Stack: "..Heure1.." = "..Nombre1..Mon_de_l_item1)
  80.      sleep(1)
  81.     end
  82.   end
  83.  end
  84. end
  85.  
  86. function Compte2()
  87.  
  88. Element2 = Fusion2.getStackInSlot(3)
  89.  
  90.  if Element2 == nil then
  91.  else
  92.   if Element2.display_name == "element.Cu" then
  93.     if Element2.qty == 64 then
  94.      heure2 = fs.open("Config/Copper","r")
  95.      Heure2 = heure2.readLine()
  96.      heure2.close()
  97.      Heure2 = Heure + 1
  98.      Production2 = fs.open("Config/Copper","w")
  99.      Production2.write(Heure2)
  100.      Production2.close()
  101.      Yolo2 = Heure2*64
  102.      Nombre2 = Yolo2/16
  103.      print("Stack: "..Heure2.." = "..Nombre2..Mon_de_l_item2)
  104.      sleep(1)
  105.     end
  106.   end
  107.  end
  108. end
  109.  
  110. function Compte3()
  111.  
  112. Element3 = Fusion3.getStackInSlot(3)
  113.  
  114.  if Element3 == nil then
  115.  else
  116.   if Element3.display_name == "element.Sn" then
  117.     if Element3.qty == 64 then
  118.      heure3 = fs.open("Config/Tin","r")
  119.      Heure3 = heure3.readLine()
  120.      heure3.close()
  121.      Heure3 = Heure3 + 1
  122.      Production3 = fs.open("Config/Tin","w")
  123.      Production3.write(Heure3)
  124.      Production3.close()
  125.      Yolo3 = Heure3*64
  126.      Nombre3 = Yolo3/16
  127.      print("Stack: "..Heure3.." = "..Nombre3..Mon_de_l_item3)
  128.      sleep(1)
  129.     end
  130.   end
  131.  end
  132. end
  133.  
  134. function Compte4()
  135.  
  136. Element4 = Fusion4.getStackInSlot(3)
  137.  
  138.  if Element4 == nil then
  139.  else
  140.   if Element4.display_name == "element.Au" then
  141.     if Element4.qty == 64 then
  142.      heure4 = fs.open("Config/Or","r")
  143.      Heure4 = heure4.readLine()
  144.      heure4.close()
  145.      Heure4 = Heure4 + 1
  146.      Production4 = fs.open("Config/Or","w")
  147.      Production4.write(Heure4)
  148.      Production4.close()
  149.      Yolo4 = Heure4*64
  150.      Nombre4 = Yolo4/16
  151.      print("Stack: "..Heure4.." = "..Nombre4..Mon_de_l_item4)
  152.      sleep(1)
  153.     end
  154.   end
  155.  end
  156. end
  157.  
  158. while true do
  159.  Compte1()
  160.  Compte2()
  161.  Compte3()
  162.  Compte4()
  163.  
  164.  post("Stack: "..Heure1.." = "..Nombre1..Mon_de_l_item,"Stack: "..Heure2.." = "..Nombre2..Mon_de_l_item2,"Stack: "..Heure3.." = "..Nombre3..Mon_de_l_item3,"Stack: "..Heure4.." = "..Nombre4..Mon_de_l_item4)
  165.  
  166.  sleep(0.1)
  167. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement