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 ➜ General ➜ Matching on grey

Matching on grey

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


Posted by Heathen   (8 posts)  Bio
Date Tue 10 Aug 2004 12:01 PM (UTC)
Message
Right, I just finished up writing a simple set of triggers and functions to trigger when a line contains the town name and turn that one word into a hyperlink, not too bad, after reading through the problems other people had it wasn't too hard to adapt the concept for my own uses, however, I don't want this to trigger whenever it reads the town name in a line just anywhere, I'd prefer if it only sensed in room descriptions, which for my MUD come out in grey. If it were green I could sense on green, same for any other colour, but I want to sense on grey and I don't want to have to change my colour scheme over to help this one script.

So, my question is, is there any way to sense on 'grey'? since at the moment only standard colours such as black, white, green, cyan and red are listed.

Also, I'd rather not grab LineInfo and do IFs on each one.

Thanks

-Heathen.
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #1 on Wed 11 Aug 2004 08:19 AM (UTC)

Amended on Wed 11 Aug 2004 08:20 AM (UTC) by Flannel

Message
Is that grey the normal text grey (ie, default color)? or the ascii grey?

I agree nick, it would make sense to match any ansi color on any ansi color. And also maybe a "no change" or "default" or something as well so you can match more descriminately than "any color".

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Heathen   (8 posts)  Bio
Date Reply #2 on Wed 11 Aug 2004 02:10 PM (UTC)
Message
Yes, well I'm incredibly sorry to report that due to my not paying attention to what the mud was putting out, sensing on white was more sufficent.

I do, however, have a different problem.

The MUD prefixes each room you enter with a 'compass' representing the directions available to you and whether or not they are open or close.

It looks like this:

Market Street - N -
(-------------------------------------------------) - <---(M)---> #
- S -

What I was trying to do was to read that in, ommit it, then re-create it, replacing available directions with hyperlinks. I simple made a trigger to operate on '* * * *' and the put those values into world variables which are then passed to the following script:

Sub compass (a,b,wildcard)

Dim roomvar1
Dim roomvar2
Dim roomvar3
Dim roomvar4
roomvar1 = world.getvariable ("roomvar1")
roomvar2 = world.getvariable ("roomvar2")
roomvar3 = world.getvariable ("roomvar3")
roomvar4 = world.getvariable ("roomvar4")

world.colourtell "yellow", "black", " " & roomvar1

if roomvar2 = "NW" then
world.hyperlink "northwest", "NW", "Travel NorthWest", "yellow", "black", 0
elseif roomvar2 = "SW" then
world.hyperlink "southwest", "SW", "Travel SouthWest", "yellow", "black", 0
else
world.colourtell "#000080", "black", "-"
end if

world.tell " "

if roomvar3 = "N" then
world.hyperlink "north", "N", "Travel North", "yellow", "black", 0
elseif roomvar3 = "S" then
world.hyperlink "south", "S", "Travel South", "yellow", "black", 0
else
world.colourtell "#000080", "black", "-"
end if

world.tell " "

if roomvar4 = "NE" then
world.hyperlink "northeast", "NE", "Travel NorthEast", "yellow", "black", 0
elseif roomvar4 = "SE" then
world.hyperlink "southeast", "SE", "Travel SouthEast", "yellow", "black", 0
else
world.colourtell "#000080", "black", "-"
end if

end sub

I've posted an example of a room at:

http://heathen.1gb.se/exampleroom.html

If there's anything else you need to know to better understand my problem just ask and I'll post it.

Oh, and I'm aware that at present that trigger and script will only replace the upper and lower row of the compass, but if I can get this portion working the adaption will be simple.

Thanks,

-Heathen
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #3 on Wed 11 Aug 2004 07:20 PM (UTC)

Amended on Wed 11 Aug 2004 07:33 PM (UTC) by Flannel

Message
And whats your current problem?

You might try using regular expressions for your trigger, it'll let you structure your trigger better, rather than just matching on 'any four things'.

Also, there are at least two other posts in this forum (that I can remember) that have to do with this, you might be able to get some triggers/code off of them. Could probably search for compass, or something like that.

Edit:

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=3446
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=2716

Are the two posts. Some of it is relevant, some of it is less so. But both of them might show you other ways of looking at the trigger and what to do with it.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Heathen   (8 posts)  Bio
Date Reply #4 on Thu 12 Aug 2004 12:22 AM (UTC)
Message
Alright, I got it for the most part working, thanks to that advice about the use of Regex's, which now that I think about it was really quite obvious *doh*

My only problem is the sensitivity of the hyperlinks, it's very hard to click and since one of the major purposes I had in mind for this script was making it easier on people who find typing repetitively awkward (And yes, even on MUDs they do exist), so that really defies the point if they have to swing the pointer around in circles to get it to register.

Is this just me or is it a recognised problem?

(Yes I know I could just increase the font size)

Thanks,

-Heathen
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #5 on Thu 12 Aug 2004 01:06 AM (UTC)
Message
You could use the numpad.

Or, you could add some characters (space fillers, "x" or whatnot) to make the links themselves larger.

There really is no problem with the hyperlinks. Theyre as large as you want them to be. If youre just trying to click the N or whatnot, then yes, they would be a bit hard to click (especially if there is any scrolling), so you might try adding some extra characters.

But, if theyre moving, theyll have to move the mouse to move anyway right? Or were you just referencing trying to hover over the one character for the link?

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Heathen   (8 posts)  Bio
Date Reply #6 on Thu 12 Aug 2004 09:26 AM (UTC)
Message
Well, my original intention was to try and maintain as much of the original look of the game as possible, adding filler characters would work, and I did consider it, but I wanted to make sure there wasn't some other point I could look at before I went on to that.

Thanks,

-Heathen
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.


18,200 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.