Mudlet features and API requests

Caled
Posts: 403
Joined: Thu Apr 09, 2009 4:45 am

Re: Mudlet API requests

Post by Caled »

Vadi wrote: - functions to change the colour of a room (and optionally, within a mapper instance)

... this could be expanded upon, but it'd be a useful start to allowing users to create multi-displays that have various geographical data. Useful for group fights and etc.
Also a function to set an image instead of just a colour. Perhaps only on the 2d view if the 3d view is too difficult. I could draw some symbols in gimp with a transparent background, and overlay the rooms with these symbols. Symbols for people, rites, traps, guards, army divisions, shrines - anything at all.

Is it currently possible to list all rooms within a radius 'x' of room vnum 'y'?
If not, is the api there for me to write a function to do so?
If not, then could we please add that to the api? Some room effects have areas of influence (such as shrines in Aetolia) that are helpful to map.

User avatar
Vadi
Posts: 5050
Joined: Sat Mar 14, 2009 3:13 pm

Re: Mudlet API requests

Post by Vadi »

You can write one yourself already using getRoomExits(room id)

Caled
Posts: 403
Joined: Thu Apr 09, 2009 4:45 am

Re: Mudlet API requests

Post by Caled »

Not sure if this is an api request, a feature request or something that already exists.
I suspect that it is a feature request that cannot be implemented, but I figure it cannot hurt to mention...
You step in to strike Ehlana with your dhurive.
Your blade opens up a long wound across Ehlana's right arm as you move around for a second strike.
Balance Used: 1.93 seconds
In a fluid motion, you ready another blow at Ehlana.
As soon as you're in the right position, you quickly stab your blade into Ehlana's right arm.
Balance Used: 0.43 seconds
Time to recover: 2.36 seconds.
Ehlana shuffles her feet in boredom.
I would like to use triggers to replace blocks of text like that with a picture (label) with text printed onto it.
At the moment I can easy create a label, with an image, and then print text to the label. Cool stuff.

I would like to actually insert that label into the text display though, so that it scrolls up with the rest of the text.

Feasible?

Probably not. If not, I am experimenting with another idea. Does anyone remember a WoW addon that re-represented your combat summary (text thing) with thumbnail images that scrolled up. Your own stuff on the left, enemy stuff on the right, little +45hp! style numbers accompanying them.

I'm essentially trying to reproduce something like that for IRE mud combat. The scrolling part would be easiest if I could just insert labels to a console, but if that can never be possible then it will just require some creative geyser magic to build the framework.

User avatar
Vadi
Posts: 5050
Joined: Sat Mar 14, 2009 3:13 pm

Re: Mudlet API requests

Post by Vadi »

Can't embed, that'd slow down the display quite a bit. The latter would be feasible though, I think someone had screenshots of something similar.

User avatar
Rakon
Posts: 350
Joined: Tue Feb 16, 2010 7:41 pm
Contact:

Re: Mudlet API requests

Post by Rakon »

I do not know if this is a bug, or a feature request. Currently, when using minconsoles and copy(), not ALL the text formatting is copied over. I notice this happening on lines/words that I have a tempTrigger color matching with, AND copying from main/pasting to another window. That is, the word that I am highlighting with the tempTrigger in the main window, is not formatted in that color in the console window.

Example:
Image

Notice Carmain's name on the left, is highlighted in green.(Click the image for fullsize please). On the miniconsole on the upper right, his name is the standard text colour. Ideally, I'd like to see the same colouring on the miniconsole as I see on the main buffer.

Yetzederixx
Posts: 186
Joined: Sun Nov 14, 2010 5:57 am

Re: Mudlet API requests

Post by Yetzederixx »

copy and paste don't copy over custom colors I've noticed, you want to cecho that to keep the color

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Mudlet API requests

Post by Heiko »

No, copy() and paste() copy what is currently selected in the buffer. If you use selectString(line,1) you don't select your own additions to the line in the buffer, because the variable line doesn't contain that.

There is a special function to select the entire buffer line i.e. the complete content of the buffer at the current user cursor position: selectCurrentLine()

This is in fact a bug in Demonnic's YATCO tabbed chat plugin. The chat selection and copy trigger needs to be fixed and changed to:
Code: [show] | [select all] lua
selectCurrentLine()
copy()
ChatStuff.append("All")
deselect()

User avatar
Rakon
Posts: 350
Joined: Tue Feb 16, 2010 7:41 pm
Contact:

Re: Mudlet API requests

Post by Rakon »

Using the above amendments, the color from temporary triggers is still not copied over I'm afraid.

Trigger:
Match (Mhaldor): (Begin of line substring, change color foreground)
Code: [show] | [select all] lua
selectCurrentLine()
copy()
ChatStuff.append("City")
deselect()
Image

EDIT: This appears to be an issue only affecting Temp triggers, as they are parsed last out of all other triggers. Is there way we can re-order the execution of triggers, so that temporary triggers are executed before the stack of perm triggers? With my triggers sending to the chat console, those are perm triggers. My name highlighting triggers are populated into tempTriggers, based on the script demoed here on the Forums, and they are created at startup; effectively placing those highlight triggers last. So, the line (even with getCurrentLine() ) is sent to the miniconsole, before the highlight triggers have been applied to the line.

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: Mudlet API requests

Post by tsuujin »

I have this problem as well. I attempted to solve it by having the line from the mud create a new tempLineTrigger which triggers on the current line. Basically it becomes the last thing executed after triggers have done all of their work on the current line. The lineTrigger then moves the buffer to the beginning of the line, copies it, and appends that buffer to another miniconsole. This -does- work, but comes with a problem: if the line has been split into multiple lines by mudlet, you will only capture the first part of the line until the first linebreak. I havn't yet done the full parsing to continue down the buffer and capture the whole thing.

User avatar
Vadi
Posts: 5050
Joined: Sat Mar 14, 2009 3:13 pm

Re: Mudlet API requests

Post by Vadi »

I'd follow tsujinn's solution as well. And, there is no bug here either then.

Post Reply