Jayex_Designs

client

Jun 21st, 2021 (edited)
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 KB | None | 0 0
  1. args = {...}
  2. if not args[1] or not args[2] or not args[3] or not args[4] then
  3.     error("Set the id of the server, your username, your password and the quantity of potatoes you want to request")
  4. end
  5.  
  6. ServerId = tonumber(args[1])
  7. Username = args[2]
  8. Password = args[3]
  9. PotatoQuantity = tonumber(args[4])
  10.  
  11. rednet.open("left")
  12.  
  13.  
  14.  
  15. function SendLogin()
  16.     rednet.send(ServerId, Username .. " " .. Password, "clientLogin")
  17. end
  18.  
  19. function SendLocation()
  20.     local x, y, z = gps.locate()
  21.     rednet.send(ServerId, x .. " " .. y .. " " .. z, "clientLocation")
  22. end
  23.  
  24. function RequestPotatoes()
  25.     SendLogin()
  26.     SendLocation()
  27.     rednet.send(ServerId, PotatoQuantity, "requestPotatoes")
  28. end
  29.  
  30.  
  31.  
  32. RequestPotatoes()
Advertisement
Add Comment
Please, Sign In to add comment