Jump to content




Web Browser in CC


  • You cannot reply to this topic
11 replies to this topic

#1 hego555

  • Members
  • 89 posts

Posted 19 September 2012 - 08:18 AM

You guys think it is possible to make a small web browser in Lua?

Like text based basically...

Ideas/Comments welcome!

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 19 September 2012 - 02:45 PM

Yes, it is definitely possible. It's going to be fairly time-consuming, though. Even if you just make a browser that can handle HTML 4.0, no JavaScript etc., you're looking at having to put together a full parser for HTML (unless you can find one and adapt it--unlikely) that can create text on the screen that bears some resemblance to the actual web page.

This is not any easy one, but it most certainly is possible.

#3 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 19 September 2012 - 03:56 PM

I know some people have made a miniature web browser already in CC. It does not use the HTTP API, but you can probably make something with the HTTP if you wanted.

#4 Noodle

  • Members
  • 989 posts
  • LocationSometime.

Posted 19 September 2012 - 09:06 PM

Lua is good for this stuff! Get the xml reader and it'll operate just like it. It'll take the tags out of them and css won't be much of use, but surely you could make one.
Spoiler


From the LuaXml place

#5 hego555

  • Members
  • 89 posts

Posted 19 September 2012 - 10:44 PM

I was thinking creating a new semi-language for the web browser, so the websites and computers can interact and send and receive commands or really anything!

#6 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 19 September 2012 - 10:46 PM

If you feel like creating that language, yes. If you want to create a new "rednet standard protocol", then by all means, do so. That is the magic of Lua, it can work with ANYTHING.

#7 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 19 September 2012 - 10:52 PM

Just make sure you include THIS.

#8 hego555

  • Members
  • 89 posts

Posted 19 September 2012 - 11:08 PM

View PostCranium, on 19 September 2012 - 10:46 PM, said:

If you feel like creating that language, yes. If you want to create a new "rednet standard protocol", then by all means, do so. That is the magic of Lua, it can work with ANYTHING.

Only problem I can think of is styling!!!

See the problem is, I cant really think of a way to lets say move text to the right side of the screen, or the middle, or both!

Like this

------------------------------------------------------------------
LEFT SIDE MIDDLE RIGHT SIDE
------------------------------------------------------------------

#9 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 19 September 2012 - 11:19 PM

*Ahem*
I'll just leave this shameless self plug here..... :)/>

#10 hego555

  • Members
  • 89 posts

Posted 20 September 2012 - 02:13 AM

Hmm, I will install that on the server!!!

All is falling into place, but I frankly dont want dependencies!
aw well!

#11 Jan

  • Members
  • 141 posts
  • Locationthe Netherlands

Posted 20 September 2012 - 09:12 AM

View PostCranium, on 19 September 2012 - 10:52 PM, said:

Just make sure you include THIS.
That' s not a bad idea:
When you have industrialcraft (which has coffee now), you can warm your coffee via rednet! HAYO!

#12 Noodle

  • Members
  • 989 posts
  • LocationSometime.

Posted 20 September 2012 - 10:14 PM

Styling is easy with tags..
x, y = term.getSize()
If tag == "<center>" then
  (x/2) - (string.len(INNERTEXT)/2)
  print(INNERTEXT)
end






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users