[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Item Identifier

Item Identifier

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Xandler   (47 posts)  [Biography] bio
Date Thu 07 Dec 2017 09:39 PM (UTC)
Message
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?
[Go to top] top

Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Reply #1 on Thu 07 Dec 2017 11:35 PM (UTC)

Amended on Thu 07 Dec 2017 11:37 PM (UTC) by Fiendish

Message
Quote:
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.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Fri 08 Dec 2017 12:22 AM (UTC)
Message
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 ...


Almost anything is possible, but it is unclear what you are trying to do. Can you explain more clearly, with examples?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Xandler   (47 posts)  [Biography] bio
Date Reply #3 on Fri 08 Dec 2017 01:20 AM (UTC)
Message
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.
[Go to top] top

Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Reply #4 on Fri 08 Dec 2017 03:32 AM (UTC)

Amended on Fri 08 Dec 2017 11:10 PM (UTC) by Fiendish

Message
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
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Fri 08 Dec 2017 06:20 AM (UTC)
Message
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).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Xandler   (47 posts)  [Biography] bio
Date Reply #6 on Thu 28 Dec 2017 10:24 PM (UTC)

Amended on Thu 28 Dec 2017 10:25 PM (UTC) by Xandler

Message
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?
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #7 on Fri 29 Dec 2017 05:06 AM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


18,905 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]