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.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ VBscript ➜ Help needed

Help needed

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


Posted by Metsuro   USA  (389 posts)  Bio
Date Tue 20 Jul 2004 07:59 AM (UTC)
Message
I am trying to make a trigger or series of triggers to to change color of a line depending on distance

So and so, is 1.2 miles to the east.

what i want to do is make a trigger to have that in green and if they come closer to say 1.0- .5 another color and .1 - .4 a different color wondering if this is possible at all.

Everything turns around in the end
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #1 on Tue 20 Jul 2004 09:00 AM (UTC)
Message
Just In general, Try and make your forum topics a bit more descriptive, We assume that youll end up needing help/clarification/etc or are just feeling lonely if youre posting here. But it makes it a LOT easier to backreference (and search for) old topics (so we dont have to answer the same question eighteen times) years down the road if we have topics that actually describe the problem at hand.

If its only one decimal place, then you could easily do it without any coding at all, with three triggers.

Next time try and copy/paste exact examples from the mud. It'll make things much easier.
I'll assume there is no comma, since it doesnt seem to me like there should be.

First Trigger: (Change color to green, Regexp, Keep Evaluating, Sequence:100)
^(.*?) is (.*?) miles to the east\.$

Second Trigger (Change Color To Blue(?), Regexp, Keep Evaluating, Sequence:100):
^(.*?) is (1\.0|0\.[56789]) miles to the east\.$

Third Trigger (Change Color To Red, RegExp, Keep Evaluating, Sequence:100):
^(.*?) is (0\.[1234]) miles to the east\.$

You could do it with a script, I'll bet you can do some searching and find a script version of here (search the forums) since I seem to remember something like that in the past. But for something with that few things, this should do the trick. Of course, if you were only giving examples, and in reality you want something huge, then you might need a more complicated solution.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Metsuro   USA  (389 posts)  Bio
Date Reply #2 on Tue 20 Jul 2004 09:21 AM (UTC)
Message
My bad. the exact thing that is displayed is

You see Bob to the east 1.60 miles away.

and using what you gave me, i couldn't figure it out hehe

Everything turns around in the end
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #3 on Tue 20 Jul 2004 10:44 AM (UTC)
Message
First trigger, it needs to be sequence 99 or lower. (and make SURE keep evaluating is checked)
^You see (.*?) to the (east|west|north|south) (.*?) miles away\.$

Trigger2:
^You see (.*) to the (east|west|north|south) (1\.0|0\.[5-9][0-9]) miles away\.$

Trigger3:
^You see (.*) to the (east|west|north|south) (0\.[0-4][0-9]) miles away\.$

Reason trigger 1 is lower sequence, is because it will match on EVERYTHING (or rather, any distance), and change it, then if its a lower distance, it'll catch on either of the second two triggers, and change again (to the appropriate color).

Same flags apply for all of them, only change the triggers is the match text, and the sequence for the first.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
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.


12,768 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.