Hopefully this is possible, but I don't know...basically I made an item identifier that brings the stats of certain item, throws it in a variable based off a trigger match then an alias calls that variable(s) into a say string...but one little caveat is, I want it to copy the color code of whatever the item is. I'm also using the copy color output (with the colors switched to match the colors of the mud). Is there a way to call the copy color plugin into this?
Item Identifier
Posted by Xandler on Thu 07 Dec 2017 09:39 PM — 8 posts, 31,483 views.
Quote:
Is there a way to call the copy color plugin into this?
Is there a way to call the copy color plugin into this?
Yes, but that kind of contamination is generally a bad idea. It's better to move color handling code out of that plugin and into a lua module and then use it in both places.
Xandler said:
Hopefully this is possible, but I don't know...basically I made an item identifier that brings the stats of certain item, throws it in a variable ...
Hopefully this is possible, but I don't know...basically I made an item identifier that brings the stats of certain item, throws it in a variable ...
Almost anything is possible, but it is unclear what you are trying to do. Can you explain more clearly, with examples?
Hard to show examples but basically when I identify an item it throws it into the variable (but its just plain with no color codes), I want to throw it into the variable with the full color code.
What it currently does: Truffle Armor
What I want: &14T&06ruffl&14e&15 A&16rmor&07&07
This would return the said item into whatever the color code it's set to within the mud.
What it currently does: Truffle Armor
What I want: &14T&06ruffl&14e&15 A&16rmor&07&07
This would return the said item into whatever the color code it's set to within the mud.
It sounds like Xandler wants something like
https://github.com/fiendish/aardwolfclientpackage/blob/b700ea3228ebbd12da514b3db63530fbe23a281d/MUSHclient/worlds/plugins/aardwolf_colors.lua#L160
https://github.com/fiendish/aardwolfclientpackage/blob/b700ea3228ebbd12da514b3db63530fbe23a281d/MUSHclient/worlds/plugins/aardwolf_colors.lua#L160
See the forum post: http://www.gammon.com.au/forum/?id=7818
That lets you find the colour of an item in a style run, given its column. So if you make the trigger call a script (and not just send-to-script) then you have access to the style runs which includes the colour information.
So as suggested in the above thread, if you searched for "Truffle Armor" you can find what column that starts, and then use the "getstyle" module to find the colour at that column. If the colour changes during the name you could increment the column by one to find the next colour and so on.
Then you could save those colours along with the name. That would give you RGB colour codes, which you could interpret back into the colours used by the MUD (if wanted).
That lets you find the colour of an item in a style run, given its column. So if you make the trigger call a script (and not just send-to-script) then you have access to the style runs which includes the colour information.
So as suggested in the above thread, if you searched for "Truffle Armor" you can find what column that starts, and then use the "getstyle" module to find the colour at that column. If the colour changes during the name you could increment the column by one to find the next colour and so on.
Then you could save those colours along with the name. That would give you RGB colour codes, which you could interpret back into the colours used by the MUD (if wanted).
Sorry I went MIA there for a bit, got busy during the holidays, but anyway, I think Fiendish is correct, I need something along the lines of the code he posted in that link (I copied and pasted it, made it into an xml file), but I'm a complete newbie at how to make the alias I created read that plugin information (to copy the item in the mud's color output), is it rather simple?
It's reasonably simple if you are used to coding. :)
To give you some hints it would help to have more details about what you are attempting, such as example output, and preferably a "packet debug" of such output as well. That way we can see what sort of colour information is part of the output.
To give you some hints it would help to have more details about what you are attempting, such as example output, and preferably a "packet debug" of such output as well. That way we can see what sort of colour information is part of the output.