Sign up
Login
New
Trending
Archive
English
English
Sign up
Login
New Paste
Add Image
-- Location Broadcaster Script -- This script gets your GPS position and broadcasts it over a modem -- Find and wrap the modem peripheral local modem = peripheral.find("modem") if not modem then error("No modem found! Please attach a wireless modem.") end -- Open a channel for broadcasting (channel 1 in this case) -- The turtle listening must also be on channel 1 modem. open(1) print("Location Broadcaster Started") print("Broadcasting on channel 1...") print("Press Ctrl+T to stop") -- Main loop - broadcasts position every 2 seconds while true do -- Get current GPS coordinates -- Requires GPS satellites to be set up in your world local x, y, z = gps. locate(5) -- 5 second timeout if x then -- Successfully got position print(string.format("Position: X=%.1f, Y=%.1f, Z=%.1f", x, y, z)) -- Broadcast the coordinates as a table -- Channel 1 = broadcast channel -- Channel 1 = reply channel (not used here, but required) modem.transmit(1, 1, {x = x, y = y, z = z}) print("Broadcasted position!") else -- GPS lookup failed print("Unable to get GPS position. Are GPS satellites set up?") end -- Wait 2 seconds before next broadcast sleep(2) end
Settings
Title :
[Optional]
Paste Folder :
[Optional]
Select
Syntax :
[Optional]
Select
Markup
CSS
JavaScript
Bash
C
C#
C++
Java
JSON
Lua
Plaintext
C-like
ABAP
ActionScript
Ada
Apache Configuration
APL
AppleScript
Arduino
ARFF
AsciiDoc
6502 Assembly
ASP.NET (C#)
AutoHotKey
AutoIt
Basic
Batch
Bison
Brainfuck
Bro
CoffeeScript
Clojure
Crystal
Content-Security-Policy
CSS Extras
D
Dart
Diff
Django/Jinja2
Docker
Eiffel
Elixir
Elm
ERB
Erlang
F#
Flow
Fortran
GEDCOM
Gherkin
Git
GLSL
GameMaker Language
Go
GraphQL
Groovy
Haml
Handlebars
Haskell
Haxe
HTTP
HTTP Public-Key-Pins
HTTP Strict-Transport-Security
IchigoJam
Icon
Inform 7
INI
IO
J
Jolie
Julia
Keyman
Kotlin
LaTeX
Less
Liquid
Lisp
LiveScript
LOLCODE
Makefile
Markdown
Markup templating
MATLAB
MEL
Mizar
Monkey
N4JS
NASM
nginx
Nim
Nix
NSIS
Objective-C
OCaml
OpenCL
Oz
PARI/GP
Parser
Pascal
Perl
PHP
PHP Extras
PL/SQL
PowerShell
Processing
Prolog
.properties
Protocol Buffers
Pug
Puppet
Pure
Python
Q (kdb+ database)
Qore
R
React JSX
React TSX
Ren'py
Reason
reST (reStructuredText)
Rip
Roboconf
Ruby
Rust
SAS
Sass (Sass)
Sass (Scss)
Scala
Scheme
Smalltalk
Smarty
SQL
Soy (Closure Template)
Stylus
Swift
TAP
Tcl
Textile
Template Toolkit 2
Twig
TypeScript
VB.Net
Velocity
Verilog
VHDL
vim
Visual Basic
WebAssembly
Wiki markup
Xeora
Xojo (REALbasic)
XQuery
YAML
HTML
Expiration :
[Optional]
Never
Self Destroy
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Status :
[Optional]
Public
Unlisted
Private (members only)
Password :
[Optional]
Description:
[Optional]
Tags:
[Optional]
Encrypt Paste
(
?
)
Create Paste
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Site Languages
×
English