Advertisement
william200027

CompteurviaHttp

May 11th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.24 KB | None | 0 0
  1. Fusion = peripheral.wrap("top")
  2.  
  3. Mon_de_l_item = " Yellorium"
  4.  
  5.  local function r(...) return shell.run(...) end
  6. local function w(...) return write(...) end
  7.  
  8. if not fs.exists("Config") then
  9.  fs.makeDir("Config")
  10. end
  11.  
  12. if not fs.exists("Config/Production") then
  13.  createAcc1 = fs.open("Config/Production", "w")
  14.  createAcc1.write("0")
  15.  createAcc1.close()
  16. end
  17.  
  18. local function post(one)
  19.                 http.post(
  20.                                 "http://zaidal.96.lt/ComputerCraft/scorepost.php",
  21.                                 "one="..textutils.urlEncode(tostring(one))
  22.                 )
  23. end
  24.  
  25. function Compte()
  26.  
  27. Element = Fusion.getStackInSlot(3)
  28.  
  29.  if Element == nil then
  30.  else
  31.   if Element.display_name == "element.U" then
  32.     if Element.qty == 64 then
  33.      heure = fs.open("Config/Production","r")
  34.      Heure = heure.readLine()
  35.      heure.close()
  36.      Heure = Heure + 1
  37.      Production = fs.open("Config/Production","w")
  38.      Production.write(Heure)
  39.      Production.close()
  40.      Yolo = Heure*64
  41.      Nombre = Yolo/16
  42.      print("Stack: "..Heure.." = "..Nombre..Mon_de_l_item)
  43.      post("Stack: "..Heure.." = "..Nombre..Mon_de_l_item)
  44.      sleep(5)
  45.     end
  46.   end
  47.  end
  48. end
  49.  
  50. while true do
  51.  Compte()
  52.  sleep(0.1)
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement