Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function printUsage()
- print( "Usages:" )
- print( "moon <location>" )
- print( "or" )
- print( "moon moon" )
- end
- local tArgs = { ... }
- if #tArgs ~= 1 then
- printUsage()
- return
- end
- if not http then
- print( "Requires http API" )
- print( "Set enableAPI_http to 1 in mod_ComputerCraft.cfg" )
- return
- end
- local url = "http://blink.lazytechsupport.co.uk:5000/moon/"
- local sLoc = tArgs[1]
- if sLoc ~= "help" then
- -- write( "Blinking " )
- local sPage = http.get(url .. sLoc)
- if sPage then
- term.clear()
- term.setCursorPos(1,1)
- for i = 1,26 do
- term.setCursorPos(1,i)
- term.write(sPage.readLine())
- -- sleep(2)
- end
- else
- print( "Failed to fetch data." )
- end
- sPage.close()
- else
- printUsage()
- return
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement