Help on Scripts

Posted by Bainz on Fri 05 May 2006 02:09 AM — 4 posts, 21,824 views.

#0
I am trying to make a list of people, then have a trigger match from this list and do something or not do something depending on if they are on the list or not. I am having trouble matching from a list of names though.. any suggestions?
USA #1
Its sort of reaaaallly difficult to extract a meaning from that. Are you able to be more specific, and/or provide examples??

Thanks
#2
Sure! sorry, i wasnt really all there when i started writing it.

I am trying to compile a list of enemies. I know how to do that useing the | thingy. Anyways, In the Mud i play, Achaea, I can heal other people by using the command DIAG. right now i use like..

<triggers>
<trigger
enabled="y"
expand_variables="y"
match="afflicted by a crippled right arm."
sequence="15"
>
<send>heal @Heal arms</send>
</trigger>
</triggers>

using the @Heal to heal the person i am trying to heal, it can be me, or any other person, which it captures from the DIAG line which looks like this:

Arithorn is:
deaf.


The problem is that i want to be able to heal my enemies nothing but a few things, and everyone else everything but those things. but what i cant get working is when i capture the name to compare it to the enemy list and see if they are on it, because so far i have only worked with 1's and 0's

Hope that helps.

Bainz
Australia Forum Administrator #3
There are quite a few ways you could do this. Basically you need to do some sort of table lookup to see if the person is in the list you want.

One approach is the inbuild "arrays" functions that MUSHclient provides:

http://www.gammon.com.au/scripts/doc.php?general=Arrays

If you used Lua it has tables that do a keyed lookup. With VBscript, I'm not so sure, you may need to use the Arrays functions or do a linear scan. Perhaps you can do a keyed lookup, I'm not certain.