Welcome to the Builder Academy

Question GUI for TBAmud

More
29 Jun 2016 01:11 #6043 by WhiskyTest
GUI for TBAmud was created by WhiskyTest
I've just found out that Graphical User Interfaces are a thing for MUDs!
That was super exciting until I looked into it further and found that the code to support these is already sitting in tbaMUD!!

There are lots of old forum posts around the place particularly from KaVir about implementing nice looking GUIs but being very new to the concept I am lacking some of the assumed knowledge that is required to get this working.

The steps seem simple enough:
[1] Use a client that supports MSDP
[2] Connect to tbaMUD and auto-negotiate will detect MSDP support
[3] invisible MDSP commands are sent from the server to the client and update elements of the GUI

I use Mudlet 2.1, which supports MSDP. But when connecting to my locally running copy of tbaMUD it sets MSDP to NO, so this is the first obstacle.

Logging into GodwarsII has an automatic Mudlet downloader which gives a nice map, health bars and so on. It seems to be using MXP - has this superseded MSDP?

What I am wanting to do is create a custom GUI that updates from tbaMUD server commands.
Reading through the forums and help files that came with the protocol plugins has been helpful, but there are some simple steps I'm clearly missing :D

Has anyone had any experience with creating GUI's that can point me in the right direction?

Please Log in or Create an account to join the conversation.

More
30 Jun 2016 01:24 #6045 by WhiskyTest
Replied by WhiskyTest on topic GUI for TBAmud
I'm further down the rabbit hole now..
You can actually read through all the GodwarsII scripts that Mudlet downloads and sort of reverse engineer how things fit together.

It appears to use ATCP instead of MSDP.
Upon login the Mud sends 'MSDPSERVER_ID' to the client. So what you do is build a script that triggers off this command. The script does something like this:
sendATCP("@REPORT", "CHARACTER_NAME HEALTH HEALTH_MAX MANA MANA_MAX WORLD_TIME WORLD_SUNRISE")
And the Mud will respond with the values requested.

In Mudlet there is a little 'Statistics' button on the left which reports all the ATCP values the client now has stored in local variable - ripe for the picking!

So it must just be a case of creating triggers/scripts to respond to these values as they update?..

Please Log in or Create an account to join the conversation.

More
02 Jul 2016 14:55 - 02 Jul 2016 15:02 #6056 by krell
Replied by krell on topic GUI for TBAmud
Actually Mudlet does support MSDP but you have to turn on some settings and make some scripts to capture and use the output. I don't recall the details but there should be information about MSDP in the Mudlet help pages or on the Mudlet website.

Addendum:
Yeah, Mudlet does support MSDP in addition to ATCP and GCMP. Hopefully this link can help get you started.

wiki.mudlet.org/w/Manual:Supported_Protocols#MSDP
Last edit: 02 Jul 2016 15:02 by krell. Reason: Adding Help Page link

Please Log in or Create an account to join the conversation.

More
02 Jul 2016 15:23 - 02 Jul 2016 22:13 #6057 by krell
Replied by krell on topic GUI for TBAmud
I think the reason you see ATCP on GodwarsII is because Mudlet enables ATCP by default. I think KaVir transmits the MSDP data in ATCP format for clients that request ATCP because I'm pretty sure KaVir's mud primarily supports MSDP.

godwars2.blogspot.ca/2011/01/mudlet-gui-20-jan-2011.html?m=1
Last edit: 02 Jul 2016 22:13 by krell. Reason: Damn autocorrect...

Please Log in or Create an account to join the conversation.

More
03 Jul 2016 02:02 #6075 by WhiskyTest
Replied by WhiskyTest on topic GUI for TBAmud
Thanks Krell, some good info there

Updated Mudlet to v 3.0.0 delta. This has an MSDP tickbox in settings - so with that out of the way...

I type: lua sendMSDP("REPORT", "HEALTH") and lua sendMSDP("REPORT", "HEALTH_MAX")

That gets the msdp values to Mudlet and I can now trigger off them thusly:
Code:
Script name: HEALTH Registered event handlers: msdp.HEALTH_MAX and msdp.HEALTH function HEALTH() GUI.Health:setValue(tonumber(msdp.HEALTH),tonumber(msdp.HEALTH_MAX)) GUI.Health.front:echo("Health: "..msdp.HEALTH.."/"..msdp.HEALTH_MAX) end

The GUI.Health it references is from this GUI template here: forums.mudlet.org/viewtopic.php?f=6&t=4098

And it updates the gauge in real time and jolly good show etc.

BUT
I receive a new line at each update, here is a screenshot:

cloudsync.cloud3.co.nz/index.php/s/A4jUFJ2WLmOdxJL

How does one stop this newline?..

Please Log in or Create an account to join the conversation.

More
04 Jul 2016 05:54 #6081 by WhiskyTest
Replied by WhiskyTest on topic GUI for TBAmud
Fear not, I have crushed it!

In comm.c there are things missing from the protocol snippet:
Code:
static int process_output(struct descriptor_data *t) { . . . /* add the extra CRLF if the person isn't in compact mode */ if (STATE(t) == CON_PLAYING && t->character && !IS_NPC(t->character) && !PRF_FLAGGED(t->character, PRF_COMPACT)) if ( !t->pProtocol->WriteOOB ) strcat(osb, "\r\n"); /* strcpy: OK (osb:MAX_SOCK_BUF-2 reserves space) */ if (!t->pProtocol->WriteOOB) /* add a prompt */ strcat(i, make_prompt(t)); /* strcpy: OK (i:MAX_SOCK_BUF reserves space) */ /* now, send the output. If this is an 'interruption', use the prepended * CRLF, otherwise send the straight output sans CRLF. */ if (t->has_prompt && !t->pProtocol->WriteOOB) { t->has_prompt = FALSE;

if ( !t->pProtocol->WriteOOB ) is missing then you get sent prompts and newlines
it looks like the snippet wasn't fully patched in, there are other files to check too but I haven't gone over them yet

Basing this off:
github.com/Xavious/MSDP_Protocol_Handler...ster/INSTALL_TBA.TXT
Hopefully it's the most up to date

Please Log in or Create an account to join the conversation.

Time to create page: 0.656 seconds