Advertisement
Guest User

roulette.lua

a guest
May 28th, 2020
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.07 KB | None | 0 0
  1. rednet.open("front")
  2. rednet.broadcast("essasi")
  3. mon = peripheral.wrap("back")
  4.  
  5. shell.run("monitor back outil")
  6.  
  7. while close~=1 do
  8.     event, side, xpos, ypos = os.pullEvent("monitor_touch")
  9.    
  10.     print("xpos:"..xpos.." ypos:"..ypos)
  11.     if(((xpos>4) and (xpos<15) ) and ((ypos>1) and (ypos<5))) then
  12.         rednet.broadcast("jouer")
  13.         shell.run("monitor back go")
  14.         close = 1
  15.        
  16.        
  17.     end
  18. end
  19. mon.setCursorPos(18,1)
  20. mon.write("$")
  21. while true do
  22.    
  23.     event,side,xpos,ypos = os.pullEvent("monitor_touch")
  24.     print("xpos:"..xpos)
  25.     if(xpos == 18) then
  26.     print("envoie")
  27.     shell.run("monitor back money")
  28.     mon.setCursorPos(1,1)
  29.     mon.setBackgroundColor(colors.lime)
  30.     mon.write("Attente de credit")
  31.     mon.setCursorPos(1,2)
  32.     mon.setBackgroundColor(colors.red)
  33.     mon.write("l'ingot de fer +1")
  34.         rednet.send(44,"demande")
  35.         id,mess = rednet.receive()
  36.        
  37.         print("vous avez creditez de "..mess)
  38.         mon.setCursorPos(2,3)
  39.         mon.write("money :"..mess.." credits")
  40.     end
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement