Color Detection for Room Mapping?

All and any discussion and development of the Mudlet Mapper.
Post Reply
Lightbender
Posts: 4
Joined: Fri Jul 24, 2020 7:37 pm

Color Detection for Room Mapping?

Post by Lightbender »

I was wondering if there are any example or tips on how to use ansi colors to help in detection for mapping. My mud doesn't provide room ID values, but it does allow me to customize my ANSI colors including foreground and background. I have mine set so the short desc, long desc, exits, objects, monsters, and players are all different colors. I'd like to find a way to set up the automapper so that it can collect information based on the colors.

Any tips would be greatly appreciated.
mudexample.png
mudexample.png (9.4 KiB) Viewed 171 times
Having trouble getting image to work so here's link to example:

https://drive.google.com/file/d/11O5U5c ... sp=sharing

chrio
Posts: 73
Joined: Mon Aug 22, 2016 11:34 am

Re: Color Detection for Room Mapping?

Post by chrio »

Ooh, that's from Nannymud, right? :)

I use these settings to get the ansi colors on room/exit:

Code: Select all

toggle ansi on
toggle oshort on
colour exit green
colour short boldwhite
If you use other colors, just change the initial trigger to pick up the 'oshort' color. The exit color can be whatever you want, since some rooms do not have any visible exits you want the ansi trigger to react on the short room color.


My room capture is on two lines.
1. an ansi trigger on the boldwhite color
2. perl regex

Code: Select all

^ *(?<roomname>[^.<]+)(?: <(?<exits>.*)>)?(?: \[h\])?\.$
lua code
Code: [show] | [select all] lua
local roomname = multimatches[2][2]
local exits = multimatches[2][3] or ''
raiseEvent("onRoomInfo", roomname, exits)
The trigger is a bit complex since it handles the possible 'help-here' tag aswell. Also, it allows for extra spaces at the start, since I sometimes had a space before the roomname when I moved around quickly.

Here is the trigger xml for copy-paste

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MudletPackage>
<MudletPackage version="1.001">
	<TriggerPackage>
		<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="yes" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="yes" isColorTriggerFg="no" isColorTriggerBg="no">
			<name>Room Capture</name>
			<script>local roomname = multimatches[2][2]
local exits = multimatches[2][3] or ''
raiseEvent("onRoomInfo", roomname, exits)
</script>
			<triggerType>0</triggerType>
			<conditonLineDelta>0</conditonLineDelta>
			<mStayOpen>0</mStayOpen>
			<mCommand></mCommand>
			<packageName></packageName>
			<mFgColor>#ff0000</mFgColor>
			<mBgColor>#ffff00</mBgColor>
			<mSoundFile></mSoundFile>
			<colorTriggerFgColor>#ffffff</colorTriggerFgColor>
			<colorTriggerBgColor>#000000</colorTriggerBgColor>
			<regexCodeList>
				<string>FG15BG-2</string>
				<string>^ *(?&lt;roomname&gt;[^.&lt;]+)(?: &lt;(?&lt;exits&gt;.*)&gt;)?(?: \[h\])?\.$</string>
			</regexCodeList>
			<regexCodePropertyList>
				<integer>6</integer>
				<integer>1</integer>
			</regexCodePropertyList>
		</Trigger>
	</TriggerPackage>
</MudletPackage>

Post Reply