augitesoul 0 Posted March 25, 2018 Share Posted March 25, 2018 My code: local result == (internet.request("<url>")) term.write(result) returns (sorry for uploading the picture, it's just that I don't really know how to copy-paste from the in-game computer) How should I do it? Quote Link to post Share on other sites
0 CptMercury 6 Posted March 25, 2018 Share Posted March 25, 2018 The main problem here is that "==" is used to compare two values and it returns true or false: 4 == 4 -> true; 4 == 5 -> false The other thing is that the response is not a string, but an iterator that will return the next line whenever you call it. local internet = require'internet' local url = '...' local response = interent.request(url) if response then for line in response do io.write(line.."\n") end end -- # response is an iterator, each time it's called it returns the next line/chunk, this is then stored in the var "line" -- # then you can use the var and print/write it, store it in a table etc augitesoul 1 Quote Link to post Share on other sites
My code:
returns
(sorry for uploading the picture, it's just that I don't really know how to copy-paste from the in-game computer)
How should I do it?
Link to post
Share on other sites