generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Possible to print website source with Lua?

Previous Thread :: Next Thread 
HatHelper is not online. HatHelper
Top 25 Poster
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
JulienDethurensb is not online. JulienDethurensb
Joined: 13 Jul 2010
Total Posts: 155
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 is not online. HatHelper
Top 25 Poster
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
JulienDethurensb is not online. JulienDethurensb
Joined: 13 Jul 2010
Total Posts: 155
17 Jul 2011 09:18 PM
There's a module that lets you access the web? ;o
Report Abuse
HatHelper is not online. HatHelper
Top 25 Poster
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
eyeontheprizeREBOOT is not online. eyeontheprizeREBOOT
Joined: 30 Jan 2011
Total Posts: 1555
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 is not online. HatHelper
Top 25 Poster
Joined: 02 Mar 2009
Total Posts: 46305
17 Jul 2011 09:28 PM
I saw that before. I don't understand.
Report Abuse
LocalChum is not online. 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 is not online. HatHelper
Top 25 Poster
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 is not online. HatHelper
Top 25 Poster
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
eyeontheprizeREBOOT is not online. eyeontheprizeREBOOT
Joined: 30 Jan 2011
Total Posts: 1555
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 is not online. HatHelper
Top 25 Poster
Joined: 02 Mar 2009
Total Posts: 46305
17 Jul 2011 09:54 PM
Thanks. I shall make my helper thing now.
Report Abuse
HatHelper is not online. HatHelper
Top 25 Poster
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 is online. LPGhatguy
Forum Moderator
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 is not online. HatHelper
Top 25 Poster
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 is not online. HatHelper
Top 25 Poster
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 is not online. 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 is not online. HatHelper
Top 25 Poster
Joined: 02 Mar 2009
Total Posts: 46305
18 Jul 2011 03:17 AM
ORLY
..any way to speed that up?
Report Abuse
LPGhatguy is online. LPGhatguy
Forum Moderator
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 is not online. 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 is not online. HatHelper
Top 25 Poster
Joined: 02 Mar 2009
Total Posts: 46305
18 Jul 2011 03:19 AM
What's the 80 after roblox.com for?
Report Abuse
bombpaw is not online. bombpaw
Joined: 15 Mar 2009
Total Posts: 3484
18 Jul 2011 03:20 AM
That's the port number.
Report Abuse
HatHelper is not online. HatHelper
Top 25 Poster
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 is not online. cymru72
Joined: 26 Jan 2008
Total Posts: 4362
18 Jul 2011 04:27 AM
What IDE are you using?
Report Abuse
HatHelper is not online. HatHelper
Top 25 Poster
Joined: 02 Mar 2009
Total Posts: 46305
18 Jul 2011 04:33 AM
What's IDE?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image