SHOW:
|
|
- or go back to the newest paste.
| 1 | - | local name = "joey_" -- ascii only |
| 1 | + | local name = "joey" -- ascii only |
| 2 | - | local uri = "https://discor" |
| 2 | + | local uri = "https://discor" |
| 3 | - | -- This program ensures that we |
| 3 | + | |
| 4 | - | -- don't crash into any asteroids |
| 4 | + | |
| 5 | - | |
| 5 | + | local p = peripheral.find("warpdriveAirGenerator")
|
| 6 | local x,y,z = p.getLocalPosition() | |
| 7 | - | |
| 7 | + | |
| 8 | local oldText = "" | |
| 9 | - | local p = peripheral.find("warpdriveShipCore")
|
| 9 | + | if fs.exists(".lastpos") then
|
| 10 | local f = fs.open(".lastpos","r")
| |
| 11 | - | |
| 11 | + | |
| 12 | f.close() | |
| 13 | - | |
| 13 | + | |
| 14 | if oldText ~= text then | |
| 15 | - | if fs.exists("lastpos") then
|
| 15 | + | local f2 = fs.open(".lastpos","w")
|
| 16 | - | local f = fs.open("lastpos","r")
|
| 16 | + | |
| 17 | http.post(uri,"{\"content\":\""..name..": "..text.."\"}",{['content-type']="application/json"})
| |
| 18 | f2.close() | |
| 19 | end | |
| 20 | - | |
| 20 | + | |
| 21 | end |