Page 1 of 1

How to show web contents in Mudlet

Posted: Mon Apr 01, 2024 4:44 am
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.

Re: How to show web contents in Mudlet

Posted: Wed Apr 03, 2024 11:02 pm
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.

Re: How to show web contents in Mudlet

Posted: Tue Apr 16, 2024 6:56 am
by protectqiqi
Just one more stupid question:
While getting the URL, is there a way to open it in the system default browser automatically?

Re: How to show web contents in Mudlet

Posted: Tue Apr 16, 2024 8:50 pm
by SlySven
Yeah, see openWebPage(...) in the Wiki part that describes the Lua API.