How to show web contents in Mudlet

Post Reply
protectqiqi
Posts: 3
Joined: Mon Apr 01, 2024 3:43 am

How to show web contents in Mudlet

Post by protectqiqi »

The mud I play requires the player to input Chinese characters generated in a web every 15 minutes, as the anti-robot mechanism.

It works in the following steps(see picture 1 & 2):
1. The Player input "fullme" in the game.
2. A URL will be generated.
3. Access the URL in the browser, a picture will be shown.
4. Type in the characters in that picture.
Pciture 1
Pciture 1
Pciture 2
Pciture 2
MXP somehow doesn't work in this mud.

My question is how can I show the picture in Mudlet directly, so that I don't need to switch to the browser from time to time.

User avatar
demonnic
Posts: 886
Joined: Sat Dec 05, 2009 3:19 pm

Re: How to show web contents in Mudlet

Post by demonnic »

You would need to get the url for the image itself, use downloadFile to download it, and then handle the event for successful download to set it as the background image for a Label. Mudlet can't really just display web content directly like that.

protectqiqi
Posts: 3
Joined: Mon Apr 01, 2024 3:43 am

Re: How to show web contents in Mudlet

Post by protectqiqi »

Just one more stupid question:
While getting the URL, is there a way to open it in the system default browser automatically?

User avatar
SlySven
Posts: 1023
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: How to show web contents in Mudlet

Post by SlySven »

Yeah, see openWebPage(...) in the Wiki part that describes the Lua API.

Post Reply