Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function sendOutput( text )
- local response = http.get(output .. "?output=" .. textutils.urlEncode(text))
- print("Connecting to http for output.")
- if response then
- -- if page is reseved
- if response then
- print("Sending output.")
- local sResponse = response.readAll()
- response.close()
- end
- end
- end
- dir = "http:///mc/"
- input = dir .. "input.txt"
- output = dir .. "getOutput.php"
- while true do
- print("Connecting to http")
- local response = http.get(input)
- if response then
- print("Page found attepting to download.")
- -- if page is reseved
- while response do
- local sResponse = response.readAll()
- response.close()
- cache = shell.resolve( "temp" )
- local file = fs.open( cache, "w" )
- file.write( sResponse )
- file.close()
- response = nil
- print("Running input from http.")
- shell.run( "temp" )
- end
- text = "Finished Running Code."
- sendOutput("Finished Running Code.")
- else
- print("Page not found.")
- end
- print("Yileding befor loop.")
- os.sleep( 5 )
- shell.run( "clear" )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement