Advertisement
infiniteblock

Untitled

Oct 4th, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local name = "joey_" -- ascii only
  2. local uri = "https://discor"
  3. print("Warpdrive security active!")
  4.  
  5. while true do
  6.     local p = peripheral.find("warpdriveShipCore")
  7.     local x,y,z = p.getLocalPosition()
  8.     local text = x .. " "..y.." "..z
  9.  
  10.     local oldText = ""
  11.     if fs.exists("lastpos") then
  12.         local f = fs.open("lastpos","r")        
  13.         oldText = f.readAll()
  14.         f.close()
  15.     end
  16.  
  17.     if oldText ~= text then
  18.         local f2 = fs.open("lastpos","w")
  19.         f2.write(text)
  20. http.post(uri,"{\"content\":\""..name.."Is currently in "..(p.isInHyperspace() and "HYPERSPACE"or"SPACE").." at "..text.."\"}",{['content-type']="application/json"})
  21.         f2.close()                                                
  22.     end    
  23.    
  24.     sleep(10)
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement