Advertisement
Spirit13300

Untitled

May 27th, 2020
1,397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.52 KB | None | 0 0
  1. calc = 0
  2. while true do
  3.  
  4. id,mess = rednet.receive()
  5.  
  6. if (id ==43) and (mess == "demande")then
  7.    
  8.  
  9.     print("demande de credit")
  10.     rednet.send(43,calc)
  11.     print("credit envoyé")
  12.     calc = 0
  13. end
  14.  
  15.  
  16. turtle.suck()
  17. obj = turtle.getItemDetail(1)
  18. if (obj ~= nil) then
  19.     print(obj.name)
  20.     cpt = turtle.getItemCount(1)
  21.     print(cpt)
  22.     if(obj.name == "minecraft:iron_ingot" ) then
  23.        calc = calc + (cpt * 1)
  24.        print(calc.."credit")
  25.        turtle.dropDown()
  26.      end
  27. end
  28.  
  29. sleep(1)
  30.  
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement