Advertisement
Guest User

startup

a guest
Jul 18th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | None | 0 0
  1. local stop
  2. local ID
  3. local amount
  4. local protocol
  5.  
  6. stop = 0
  7. rednet.open("right")
  8. repeat
  9.   ID, amount, protocol = rednet.receive()
  10.   print([[ATM: ]] .. ID .. [[ | AMOUNT: ]] .. amount .. [[ | PROTOCOL: ]] .. protocol)
  11.   if protocol == "atm.buy" then
  12.     commands.exec([[paidcommand @p[x=-21,y=4,z=0,r=1] ]] .. amount .. [[ give @p[x=-21,y=4,z=0,r=1] 4269 ]] .. amount)
  13.   elseif protocol == "atm.sell" then
  14.     commands.exec([[sellcommand @p[x=-21,y=4,z=0,r=1] 4269 ]] .. amount .. [[ 0 wallet @p[x=-21,y=4,z=0,r=1] add ]] .. amount)
  15.   elseif protocol == "atm.stop" then
  16.     if amount == "andromeda25" then
  17.       rednet.send(ID,"OKAY","atm.stop")
  18.     else
  19.       rednet.send(ID,"NO","atm.stop")
  20.       commands.exec("say [SERVER] @p[x=-21,y=4,z=0,r=1] HAS ATTEMPTED TO BREACH AN ATM ON THE NETWORK.")
  21.       commands.exec("tp @p[x=-21,y=4,z=0,r=1] 0 255 0")
  22.     end
  23.   else
  24.     print("Protocol error!")
  25.     rednet.send(ID,"Incorrect ATM protocol!","atm")
  26.   end
  27. until stop == 1
  28. rednet.close("right")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement