enemy highlighter

Share your scripts and packages with other Mudlet users.
Post Reply
User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

enemy highlighter

Post by Heiko »

This script parses the output of a comma seperated enemy list and highlights all names on this list.

The alias "update enemies" sends the command to get the MUD to display the enemy list and then adds its content to the internal highlighter list.
Change the command to get the list to what you need.

Caveats: This highlighter is just a demo. Thus, it is not fool proof. Never ever click on the script item "enemy highlighter" after you have updated the list. Otherwise the internal enemy list gets cleared, but the triggers are not deleted, resulting in adding another 1600 or so triggers each time you update the list again. To do this properly, you'd need to store the trigger ids of the associated enemy temp triggers somewhere and delete the triggers, when you clear the enemy list. Anyways, this package works well if you don't click on the script.
Attachments
EnnemyHighlighterPackage.xml
(4.3 KiB) Downloaded 631 times

eraldo
Posts: 43
Joined: Sun Jul 12, 2009 1:25 am

Re: enemy highlighter

Post by eraldo »

Is this still the way to go?
Or is this deprecated due to newer version of mudlet?

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

Re: enemy highlighter

Post by Heiko »

This package is still valid. Of course there are other ways of achieving the same goals. This package is a special purpose package meant for IRE MUDs where players can have several thousand enemies due to clans, houses, cities and whatnot. It's optimized for a large amount of enemies.

rolly
Posts: 27
Joined: Sat Jul 03, 2010 9:51 pm

Re: enemy highlighter

Post by rolly »

This works very well as written but i think it could have other uses. Can you show a simple alias to remove a name from the list? I tried listRemove( hl.enemyList_ids, matches[2] ) with the proper alias and it didn't work. Often times city enemies help each other raid a 3rd party and its annoying to keep seeing your temporary ally as an enemy. Then simply rechecking your city enemies could restore the list after the raid is done.

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

Re: enemy highlighter

Post by Vadi »

Code: [show] | [select all] lua
killTrigger(hl.enemyList_ids[matches[2]])
hl.enemyList_ids[matches[2]] = nil
Should do it off the top of my head

rolly
Posts: 27
Joined: Sat Jul 03, 2010 9:51 pm

Re: enemy highlighter

Post by rolly »

It certainly did. Thanks.

If it isn't too much trouble is there an easy way to insert a name manually?

Post Reply