SHOW:
|
|
- or go back to the newest paste.
1 | function broadcast(message) | |
2 | if(turtleId==nil) then | |
3 | turtleId = os.getComputerLabel() | |
4 | end | |
5 | ||
6 | -- if(turtleId==nil) then | |
7 | - | http.post("http://rwind.tk:3000/print","msg=[no id] "..message) |
7 | + | -- http.post("http://rwind.tk:3000/print","msg=[no id] "..message) |
8 | - | else |
8 | + | -- else |
9 | - | http.post("http://rwind.tk:3000/print","msg=".."[".. turtleId.."] "..message) |
9 | + | -- http.post("http://rwind.tk:3000/print","msg=".."[".. turtleId.."] "..message) |
10 | -- end | |
11 | ||
12 | - | if (isWirelessTurtle == true) then |
12 | + | |
13 | if (turtleId == nil) then | |
14 | rednet.broadcast(message) | |
15 | else | |
16 | -- Broadcast the message (prefixed with the turtle's id) | |
17 | rednet.broadcast("[".. turtleId.."] "..message) | |
18 | end | |
19 | ||
20 | end | |
21 | ||
22 | term.clear() | |
23 | term.setCursorPos(1,1) | |
24 | io.write("Message: ") | |
25 | message = io.read() | |
26 | broadcast(message) |