scripting 101! plz:)

Share your scripts and packages with other Mudlet users.
Post Reply
mecurial
Posts: 2
Joined: Mon Jan 25, 2016 5:48 am

scripting 101! plz:)

Post by mecurial »

I am playing on an older mud and was trying to make my own mapping script. I have made some progress using triggers to grab some information, but would really like to know if there is a better way than going through the input buffer with getLines and the getLineNumber methods?

Is there a way to see the output stream from the mud before it has had the formatting interpreted? what does that look like? Html or xml ish? Would the information I am looking for like room name and such be identified by those formatting tags possibly?

Anyway I am trying to build something that will map as I explore (not some sort of auto explore, but me typing:)) I like playing so I don't want this done for me, but I would like to be able to have a db of info about rooms/mobs in areas I have been to. Maybe even items I have collected in those areas. Is there a good approach to this or an example? Parsing each line through the buffer feels very heavy handed.

Thanks a million
me

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

Re: scripting 101! plz:)

Post by SlySven »

Not exactly, but the "Record Replay" system will capture the incoming data from a Mud server (The "tape cassette" one of the small icons next to the search box at the bottom of the main console) which, if you file the resulting file away for later, you can then disconnect from the Server (you will have to use the Lua "disconnect" command or the "Disconnect" item on the Main Menu bar as there is not currently a button on the Main Toolbar for this - I am tweaking that as I type :) ) and then (repeatedly) replay the same text through your scripts to test how they respond to that text and to edit them; you can also change the server name to "localhost" temporarily so that a connection is not made to the server if you want to start a new session of script editing with an existing replay (.dat) file.

N.B. The current replay code is very clunky (possibly un-usably so, if the version I have in front of me is representative of the 3.0 preview *sigh*) and did have some outstanding defects that might prove awkward (the elapsed time display only updates when some text comes along and the reply speed control can only go faster but not slower than real-time and a speed change also only takes effect when some text comes along - oh and the buttons to change the speed may be invisible in some versions - but the Replay toolbar appears added onto the beginning of the Main one when it is active)...

Oh, and I just found that I made a typo in the code, so that when you stop the recording, the file name that gets reported to you on the console is wrong (but the name given when you start recording is right).

Post Reply