HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 17 Jul 2011 09:07 PM |
| Like View Page Source. Is it possible to print a page's source(with original Lua)? |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2011 09:08 PM |
With original Lua? No. With ROBLOX Lua? Yes.
Surprising, but true.
Hoooooowever, it's locked.
game:HttpGet() |
|
|
| Report Abuse |
|
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 17 Jul 2011 09:08 PM |
http = require("socket.http") print(http.request("http://www.roblox.com/Sacred-Fighter-of-the-Ninth-Wonder-item?id=52558745/"))
This prints info, but useless stuff
|
|
|
| Report Abuse |
|
|
|
| 17 Jul 2011 09:18 PM |
| There's a module that lets you access the web? ;o |
|
|
| Report Abuse |
|
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 17 Jul 2011 09:19 PM |
Ozzypig gave me that. I'm asking if there is any value to that that will print what I wants.
|
|
|
| Report Abuse |
|
|
|
| 17 Jul 2011 09:25 PM |
http://w3.impa.br/~diego/software/luasocket/http.html
read the docs. it returns a list. |
|
|
| Report Abuse |
|
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 17 Jul 2011 09:28 PM |
I saw that before. I don't understand.
|
|
|
| Report Abuse |
|
|
LocalChum
|
  |
| Joined: 04 Mar 2011 |
| Total Posts: 6906 |
|
|
| 17 Jul 2011 09:41 PM |
require("socket") c = socket.connect("www.roblox.com",80); assert(c,"Can't connect"); c:send("GET / HTTP/1.1\r\nConnection: close\r\nHost: www.roblox.com\r\n\r\n"); print(c:receive(50000)) |
|
|
| Report Abuse |
|
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 17 Jul 2011 09:45 PM |
| That printed me some stuff that looked even more random than before :I |
|
|
| Report Abuse |
|
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 17 Jul 2011 09:49 PM |
Wait no it gave me something else.
Can you make it print to http://www.roblox.com/Sacred-Fighter-of-the-Ninth-Wonder-item?id=52558745 instead of roblox.com? |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2011 09:52 PM |
require("socket") c = socket.connect("www.roblox.com",80); assert(c,"Can't connect"); c:send("GET /Sacred-Fighter-of-the-Ninth-Wonder-item?id=52558745 HTTP/1.1\r\nConnection: close\r\nHost: www.roblox.com\r\n\r\n"); print(c:receive(50000)) |
|
|
| Report Abuse |
|
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 17 Jul 2011 09:54 PM |
Thanks. I shall make my helper thing now.
|
|
|
| Report Abuse |
|
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 18 Jul 2011 03:07 AM |
It works great. Made a cool bot with it.
require("socket") local c = socket.connect("www.roblox.com",80) assert(c,"Can't connect") c:send("GET /" .. Links[i][1] .. " HTTP/1.1\r\nConnection: close\r\nHost: www.roblox.com\r\n\r\n") local Info = c:receive(70000)
Can you explain what each line does? |
|
|
| Report Abuse |
|
|
LPGhatguy
|
  |
 |
| Joined: 27 Jun 2008 |
| Total Posts: 4725 |
|
|
| 18 Jul 2011 03:10 AM |
require("socket") --Loads the socket library. local c = socket.connect("www.roblox.com",80) --Creates a new socket instance assert(c,"Can't connect") --Assert to see if it worked. c:send("GET /" .. Links[i][1] .. " HTTP/1.1\r\nConnection: close\r\nHost: www.roblox.com\r\n\r\n") --Send the server some datas. local Info = c:receive(70000) --Get the datas the server sends back
I could be off, I've actually never used the Lua socket library. |
|
|
| Report Abuse |
|
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 18 Jul 2011 03:14 AM |
| I run a loop of about 50 items. Each time it runs through that. Can it be made any more efficient? Like only running some of those lines once at the top of the code? |
|
|
| Report Abuse |
|
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 18 Jul 2011 03:14 AM |
Also is there any way of making it run faster? It seems to take about .5 seconds per link.
|
|
|
| Report Abuse |
|
|
bombpaw
|
  |
| Joined: 15 Mar 2009 |
| Total Posts: 3484 |
|
|
| 18 Jul 2011 03:16 AM |
"It seems to take about .5 seconds per link."
That's a combination of your internet speed, the host's speed, and the time it takes to look up and get the data of a site. |
|
|
| Report Abuse |
|
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 18 Jul 2011 03:17 AM |
ORLY ..any way to speed that up? |
|
|
| Report Abuse |
|
|
LPGhatguy
|
  |
 |
| Joined: 27 Jun 2008 |
| Total Posts: 4725 |
|
|
| 18 Jul 2011 03:17 AM |
require("socket") local c = socket.connect("www.roblox.com",80) assert(c,"Can't connect")
--Try only looping the coding from this point onward. c:send("GET /" .. Links[i][1] .. " HTTP/1.1\r\nConnection: close\r\nHost: www.roblox.com\r\n\r\n") local Info = c:receive(70000) |
|
|
| Report Abuse |
|
|
bombpaw
|
  |
| Joined: 15 Mar 2009 |
| Total Posts: 3484 |
|
|
| 18 Jul 2011 03:17 AM |
| Not really, Considering some of the stress put on some servers, it's their fault... :P |
|
|
| Report Abuse |
|
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 18 Jul 2011 03:19 AM |
| What's the 80 after roblox.com for? |
|
|
| Report Abuse |
|
|
bombpaw
|
  |
| Joined: 15 Mar 2009 |
| Total Posts: 3484 |
|
| |
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 18 Jul 2011 04:22 AM |
| Is it possible to create an Alert box, or make a special beep sound with Lua (Command Line)? |
|
|
| Report Abuse |
|
|
cymru72
|
  |
| Joined: 26 Jan 2008 |
| Total Posts: 4362 |
|
| |
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
| |
|