Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- local function usage()
- print("Usage:")
- print("bomber command <hostname>")
- print("bomber target <hostname>")
- end
- local function waitForMessage()
- if args[2] == nil then
- usage()
- return
- end
- rednet.host("xyz",args[2])
- local senderId, message, protocol = rednet.receive()
- if message[1] == nil then
- waitForMessage()
- end
- print(message[1])
- commands.exec("summon tnt "..message[1].." "..message[2].." "..message[3].."")
- end
- if args[1] == "command" then
- waitForMessage()
- elseif args[1] == "target" then
- if args[2] == nil then
- usage()
- return
- end
- local computerId = {rednet.lookup("xyz",args[2])}
- local x,y,z = gps.locate()
- if x == nil then
- print("its nil")
- return
- end
- local pos = {x,y,z}
- print(pos[1])
- print(pos[2])
- print(pos[3])
- rednet.send(computerId[1],pos)
- return
- else
- usage()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement