Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ MUSHclient ➜ VBscript ➜ Help on Scripts

Help on Scripts

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


Posted by Bainz   (5 posts)  Bio
Date Fri 05 May 2006 02:09 AM (UTC)
Message
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?
Top

Posted by Rakon   USA  (123 posts)  Bio
Date Reply #1 on Sat 06 May 2006 03:47 PM (UTC)
Message
Its sort of reaaaallly difficult to extract a meaning from that. Are you able to be more specific, and/or provide examples??

Thanks

Yes, I am a criminal.
My crime is that of curiosity.
My crime is that of judging people by what they say and think, not what they look like.
My crime is that of outsmarting you, something that you will never forgive me for.
Top

Posted by Bainz   (5 posts)  Bio
Date Reply #2 on Sun 07 May 2006 01:31 AM (UTC)
Message
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
Top

Posted by Nick Gammon   Australia  (23,120 posts)  Bio   Forum Administrator
Date Reply #3 on Mon 08 May 2006 10:52 AM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


16,246 views.

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

Go to topic:           Search the forum


[Go to top] top

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