HI! I thought it would be neat to have a little isolated version of the internet for the Picotron! This is a very rough start of what I think that might look like (I very limited knowledge of how web protocols or any of that stuff works).
Many of the known bugs are fixed but. There may still be a few here and there tho so lmk if you run into one
Anyway, to add a page to the browsing catalogue, you need to type a comment in this format, replacing the plus symbols with caret symbols:
+PICOSITE+ link + title + about +
Notice where the spaces are placed! this is actually important lol
an example:
^PICOSITE^ https://raw.githubusercontent.com/May0san/piconetdemo/refs/heads/main/home.lua ^ PicoNet Homepage ^ The homepage of the PicoNet! ^
Try to not make your "about" too long.
I apologize in advance for the messy disorganized code lmao. Upon downloading files the browser will create a downloads folder in the root folder if one doesn't already exist. If anyone wants to propose a better standard for this, feel free :)
As for writing the actual page, you can view my examples on this github repo:
https://github.com/May0san/piconetdemo/tree/main
Btw in previous versions of Picotron, the webplayer couldn't run PicoNet Explorer, so keep that in mind.
Most recently, I fixed the draw order issues and changed the browse page so that it should be able to read from multiple pages of sites. I'm also working on a major overhaul of how this "PicoNet" works! Hopefully you can look forward to a major update soon!
Features:
✅ visit and display hosted file with gui data (a "picosite")
✅ catalogue all the sites posted on this forum page into a browser list
✅ allows use of a "gif" which is really just an image with multiple sprites in one and is indexed with sspr to advance the animation. (subject to modification when sitebuilder is complete, will mostly still work the same though.)
☑️ create a "sitebuilder" site (and also corresponding cart) to graphically design and export websites as code
❌ PNTP (in progress)
^PICOSITE^ https://raw.githubusercontent.com/May0san/piconetdemo/main/games.lua ^ COOL GAMES ^ (DEMO SITE) ^
ah bummer, the page scanning isn't working rn. hold on a moment and hopefully it will work soon. It definitely is able to access the online pages tho! so paste the link I put above in the url bar to see my demo page
That is an awesome idea! Now I want webrings of picotron creators making cute gif!
Update! The browse is working! Feel free to add your own pages by posting a comment in the format like I described! don't worry if it goes over a page, I've got some ideas with how to deal with that :)
it also turns out the downloading is working, but you may need to first create a downloads folder in your system root
Uploaded a new version-- it should be less crashy as far as I'm aware (the web embed is still crashy tho)
If you can make a BBS viewer with download cart button for this that would be insane
This is awesome - excited to see where this might go. 👍
I had a similar concept years ago to use the PICO-8 "cartiverse" to make a mini internet (back around when remote cart loading was added to P8), where devs could have "home" cart (site) and link around.
Alas, the P8 resolution/resources didn't really make that feasible.
This however... might have some legs! 🤓
@Liquidream Oh that's sweet! It woulda been cool to see an internet thingy in pico-8! Yeah I think this program is inherently a lot more friendly to that sort of thing-- downloading webpages and getting web content and whatnot. The gui system is also super great for making standardization in web content and more generally, simplicity of making a page.
very nice! this gives me an idea about making a gemini protocol browser in Picotron. I believe most of the content is text or lightly marked up text.
here is a very nice example of a gemini browser
i'm sure something like that would be very involved and take a lot of time, but a simple reader should be easier..
Oh that's sweet! From what I understand after a quick skim, a system like that would be able to access and read from any Gemini-based Internet page? Again I don't really know anything about Web protocols.
For me it feels like a semi-isolated Internet where Picotron users create all the content is more true to the system... If that makes sense?
Idk, I'd be interested to hear thoughts about this; but if it's as simple a system as Wikipedia claims I'm sure it would not be too hard to make a viewer as you say. I don't think it's even currently natively possible to send data over the Web
Totally agree!! sorry I got sidetracked thinking of the possibilities :)
If there's one thing I'd love to see though, it would be some kind of dumbed down chatroom-- it would probably require quite some investment; maybe installing something into picotron to handle sending data? idk
^PICOSITE^ https://raw.githubusercontent.com/May0san/piconetdemo/main/coolgifs.lua ^ GIFs ^ Come see a catalogue of gifs you may want to use! ^
I'm working on a sitebuilder! I've only got the very basics of it done now and elements can't be edited, but it can place/move elements and export the page as a site file. You can find the sitebuilder site on the browse page (click browse on the homepage). note though that the pod file import/export isn't working rn.
There's also a new version of the base browser with some small fixes
Little cute explorer
I really like the idea of PicoNet, tryna create my own lil site rn
Also found a bug:
palt() needs a bool value as second argument, so the alpha color of gifs doesn't work
thank you!!
i thought I fixed that bug! do you have the latest version?
I just uploaded a small change to how gifs work in advance of the sitebuilder so that it's more compatible. the speed and alpha are now specified in the draw function, you no longer have to pass in the frame width and height to the new_gif function. additionally, the gifs now take raw pods (so if you're copying and pasting from the sprite editor, just remove the unpod() part)
looks like fetching a url no longer works in the newest version as far as I can tell (no idea if it's intentional or not), so this will stay in 0.1.0b for now
URL fetching still works, but it's asynchronous now, which means it won't work as expected unless you use it in a coroutine. A simple hack to make it work like it did before could work something like this:
local fetch_old = fetch function fetch(url) local result local co = cocreate(function() result = fetch_old(url) end) repeat coresume(co) until costatus(co) == "dead" return result end |
This starts a coroutine to fetch the target URL and doesn't return until fetch is finished.
That said, maybe you want to do something else in the meantime, like show a buffering icon - in that case, you'd want to create the coroutine yourself and do one coresume
on it per frame until it finishes (costatus(co) == "dead"
). Asynchronous flow is probably less important for a minimalist web browser though, so it's up to you how far you want to go on this aspect.
@Ulhar Thanks for the tip!! I had someone else mention this but I didn't really know how coroutines work in lua, so the code snippet really helps :D I'll be putting a pause on the pagebuilder and workin on fixing all this next
yay! piconet explorer works for the latest picotron version! I may do some kind of loading bar, maybe an hourglass icon for the mouse (hehe) in the future but I wanna get the sitebuilder out and done first
The sitebuilder is up!! should have enough functionality to make a site, but it does have its quirks... not to mention its code which I almost definitely could have generalized and finished way sooner, but I just pushed through (im still learning ok ;o;)
note:
It would be wise if you saved your site as a .pod frequently as you work because I've had picotron run out of memory a lot on me while I used PicoNet Explorer. Idk what causes it exactly (as far as I can tell it's kinda weird and inconsistent) but lmk if you know how I can fix that lol
Maybe add some kind of autosave? Store a file somewhere after every change or every minute etc
Little suggestion:
You may add
addressbar.key_callback={enter=function() notify("enter pressed") end} |
to the address bar to load a page using enter instead of manually clicking "go"
@Feyn Autosave is a great idea! and also that code snipped is super helpful, I was wondering if there was a way to do that!
@Maeve I did some research and found that creating new userdata every frame in piconetutil.lua > function load_page > return> draw > local bmp causes memory leak after several minutes of rendering page, cuz I think this userdata doesn't have enough time to be deleted, so you should reduce userdata creation.
I made a small fix that uses the same userdata until size of the page changes and seems like it helps
@Feyn Oh, thank you so much for the tip!! I was wondering where that was coming from! That's also really good to know for the future. I'll try to fix that, and there were a few other changes I was wanting to make too. To be honest I'm sure there's another memory leak somewhere else but it's good to plug at least one hole lol.
ok, I think I vaguely know the source of the problem causing buttons to appear over the top of the tab section, but I think it'll take me a while to figure that out, so in the meantime, here's an update with a back/fwd button, enter now visits the link in the address, and also I made the userdata not recreate itself each frame. Thanks @Feyn for the help and tips!!!!
Updated it to work a bit better with the newest version (changes in palt apparently messed it up)
Also changed the "download" function to automatically get the name of the download if no name is provided instead of downloading it as "untitled.pod" (lol)
made some fixes to the sitebuilder lua exporter, there were some things that were causing it to be syntactically incorrect. You may have to take a peek at the lua file and double check that it doesn't have any big issues. If you can't figure it out and the browser is still saying it can't load, then feel free to send me a link to the site page and I can try and find what's causing it to fail :)
also, here's a new site I made for fun!
^PICOSITE^ https://raw.githubusercontent.com/May0san/piconetdemo/main/meivuusite.lua ^ Meivuu's Site ^ A site where I'll post some stuff I've made :) ^
I made a picosite! Really wish there was a way to have nicer URLs in the browser.
^PICOSITE^ https://raw.githubusercontent.com/PixelDud/picosite/main/index.lua ^ PixelDud's Site ^ My little corner of the PicoNet. ^
Finally made my own picosite :O
^PICOSITE^ https://raw.githubusercontent.com/FrndlyFox/picosite/main/home.lua ^ Feyn's home ^ My first picosite with some text about me :D ^
I love the sites!! It makes me happy people are using this :))
@PixelDud nicer urls is a great idea! The full github url is excessively long, I agree. I think what I'll try and do is set up a custom url/domain system where you can provide the actual url under which all your subpages appear and the browser will substitute your custom url. It may be some time before I get to work on this tho
I’m hoping to learn more lua so I can make my own “Picosite” too!
@Maeve I’ve discovered that ”nekoweb” can easily host lua files with no problem :3
^PICOSITE^ https://widgetotaku.nekoweb.org/home.lua ^ WidgetOtaku's site ^ My first picosite on NekoWeb X3 ^
^PICOSITE^ https://raw.githubusercontent.com/dualmeower/Test-Picosite/main/test.lua ^ Test Site ^ This website tests every feature on PicoNet ^
^PICOSITE^ https://raw.githubusercontent.com/bouncyblock/firstpicosite/main/bouncy_blockssite.lua ^ Bouncy's Alcove ^ The location where all roads meet ^
Nice sites everyone!! Looks like I'm gonna have to upgrade mine soon lol!
@Bouncy_block on your page there's a link that directs to itch.io. Unfortunately, piconet explorer can't display typical internet webpages like itch.io, so I recommend setting the button code to direct to another page you make that has info about the jam, or make it set the clipboard to the webpage link (I also recommend using the notify([message]) function to tell the user that it has been added to clipboard or something) lmk if you want example code or something ^^
Ok, thanks! I'll change it! (thanks for making a sitebuilder. its awesome). Just wondering though, (haven't used the sitebuilder enough) how would I go about copying the link to clipboard?
yeah! in the code section while editing the button, you can put
set_clipboard([link as a string])
^PICOSITE^ https://raw.githubusercontent.com/voice-mail/dynacorp_picosite/main/home.lua ^ DYNACORP ^ Dynacorp Studios ^
^PICOSITE^ https://raw.githubusercontent.com/dualmeower/My-Picosites/main/zoot.lua ^ It's Zoot! ^ Look at this little guy!^
^PICOSITE^ https://raw.githubusercontent.com/dualmeower/My-Picosites/main/pico.lua ^ Pico Industries ^ The official website of Pico Industries ^
This project is so cute I can't wait to see the PicoNet grow!
^PICOSITE^ https://raw.githubusercontent.com/caar292/pppicosite/refs/heads/main/pottedplantsplace.lua ^ Pottedplant's Place ^ Hi PicoNet! ^
[Please log in to post a comment]