Page 1 of 3

Name Highlighter v3

Posted: Thu Jan 21, 2010 12:38 am
by Vadi
Image Image
This script highlights names. For now, it just highlights city enemies, but in the future you will be able to add other groups too. Based on Heiko's demo script.

Features:
Very, very, very fast. With 1,800 names being highlighted in my case, there was no lag added.

Commands:
- city enemies: gets the list of city enemies.
- hlshow: shows some info about the scripts status.
- hlshow enemies: shows which enemies is it highlighting
- hlraid, hlraid on, hlraid off: toggles/enables/disabled raid mode. In raid mode, the names are more visible.
- hlpp, hlpause, hlunpause: toggles/pauses/unpauses the script.
- hlclear: resets all city enemies.

Upgrading
Before upgrading, delete the Name Highlighter alias, trigger and group folders.

API
This script provides the following functions you can use in your scripts:
- hl.isEnemy(name): returns true/false if the given name is a city enemy.

Download v3:
Achaea version:

Re: Name Highlighter

Posted: Thu Jan 21, 2010 12:44 am
by Vadi
An example of the hl.isEnemy use - http://www.ubuntu-pics.de/bild/39052/sc ... 2y7O26.png

Code: Select all

if hl.isEnemy(matches[2]) then
	echo(matches[2] .. ", an enemy, just came into our room!")
end

Re: Name Highlighter

Posted: Thu Jan 21, 2010 12:45 am
by Vadi
If you need to update any of the triggers for another MUD, please post the script back here - I'll add it to the list.

Re: Name Highlighter

Posted: Tue Feb 02, 2010 4:37 pm
by Vadi
Updated to v2, so that hl.isEnemy actually works.

Re: Name Highlighter

Posted: Fri Feb 19, 2010 2:46 am
by Lideron
Very handy script... I've run into one small issue though. When I do an hlclear, it echos the "Cleared all enemies", but all the enemies are still highlighted. It's supposed to go through all the pairs and delete the temp triggers. I know you mentioned, Vadi, there may be a bug in there, but I don't see it, looks pretty straightforward.

When I do 'city enemies' again, it will pull in the new enemies (most of the time, generally have to enter the command two or three times) and start highlighting them, but it still gives me all the unenemied people as well.

Usually exiting Mudlet and restarting gives me the correct highlighting. Any ideas on this one?

Re: Name Highlighter v3

Posted: Sun Apr 18, 2010 2:23 pm
by Vadi
Posted v3, fixes bug above

Re: Name Highlighter v3

Posted: Mon Apr 19, 2010 5:09 am
by Ricktava
I edited the script and changed it to Highlight Citizens of your city enjoy! I havent had it show any issues when thay are used togeather so just let me know if you find a issue.

works just the same but you use citizens insted of city enemies. Good for those who watch out for fellow citizens on deathsight in achaea.

EDIT: Also made one for city allies but im running into a issue between the citizen and allies packs Im working on it but Ill post here as I really have no clue waht to look for. Any help would be great thanks!

Second EDIT: well thay broke somehow and wont work at all now so Im turning this into a request for this type of thing thanks!

Fixed!: Have to use them in order of city enemies, city allies, and then citizens but thay are working togeather nicely the new Screenshot reflects the change also made the red a bit darker but you can always change that new package is working as fas as I know let me know if you have issues!

Re: Name Highlighter v3

Posted: Thu Jul 22, 2010 11:11 pm
by Parnakra
I've also fiddled a bit with this script. My version currently works for city enemies and citizens. The order in which you load them in does not matter. Also, I took into account the fact that CITIZENS outputs a . at the end, as opposed to enemies - which meant the last citizen name would not be highlighted as expected.

Because I wasn't too sure what was going on with the loading/saving/persistency of the tables, I left some spaghetticode behind, but if/when I come back to this, I'll be sure to fix that up and make it a bit more generic/abstract.

For now, if you want to add another list (your personal allies/enemies/clanmembers (not sure how this is outputted), you'll have to:
  • create a similar trigger chain to capture the names (make sure you take into account the trailing point)
  • create a similar alias that makes sure the trigger chain is disabled after x amount of time
  • in the hl.main script, add these functions/this code (all similar to the existing ones):
    • add the line to save your list (choose a filename and list variable) to hl.saveAll()
    • add the code to load from a file to hl.init() (name of the file should match that in hl.saveAll()
    • hl.readFoo(map)
    • hl.clearFooTriggers()
You pass the colours you wish to use to the highlightPerson() function - background colours are optional and will only be shown if raid mode is enabled.

Re: Name Highlighter v3

Posted: Thu Jul 22, 2010 11:32 pm
by Vadi
Glad to see it helping serve as a jumping board :)

Re: Name Highlighter v3

Posted: Thu Oct 07, 2010 3:30 pm
by Denex
Any chance of showing how to add additional cities citizens to the list? I have no idea where to even begin to code, it'd just be nice to be able to gather a list of CityX's citizens, to proc to the list as a seperate color. Hell, even a table listing you manually update would be great.