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 ➜ Funky who list clearer up thing needed

Funky who list clearer up thing needed

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


Posted by David   USA  (49 posts)  Bio
Date Tue 05 Mar 2002 07:00 AM (UTC)

Amended on Tue 05 Mar 2002 08:32 AM (UTC) by Nick Gammon

Message
Ok... Its been a while since I scripted anything. However I was thinking the other day, how convient it would be for me to re-work how the wholist on a mud I play looks.

This is far more complicated than anything I have done in the past. I could really use a hand with this, I will be checking the posts on a daily basis to see if anyone has responded. Or you can email me at Morpheus@bit-net.com to see if you have a few ideas on how you go about changing the wholist to the way I want.

First things first, let me show you a sample of the wholsit... Mind you there is no ansi involved in this representation, but it will give you a general idea of what the wholist looks like


[  Minotaur  ] * General Kroog IsenHeart - FleshReaver
[   Aghar    ] * Fnock knock
[            ] * Warrik warrior of Sirrion
[ Silvanesti ]   [ Conclave ] [White] Mistress Cloreana, Prophet of Solinari, [Guardian]
[            ] * Ansiau the Bard
[   Human    ] * [ Solamnic ] [Rose] <L> Ranadiel the Great Saiyaman NEEDs to talk to Ziv
[   Human    ]   Silver.
[            ] * Tjaiden windblade of nature
[   Kender   ]   <Helper> Brim HappyTrailzzz the 1 an ONLY
[ Sick Puppy ] * Morgion says 'What a cute Canadian, does it bite?
[   Human    ] * [ Solamnic ] [Crown] Lady Solera RuneBlade
[            ] * Ketrid
[   Human    ]   [ Solamnic ] [Crown] Teldor Rosenguard,Squire to Lord Kadith Gridolm
[   Aghar    ] * [7 Kingdoms] Inkblot Mumblebelly
[  HeadNacho ] * <Helper> [ Conclave ] [Red] <L> [Player Relations] Lunitari is waxing.
[            ] * Nokahoup wrote Gullyfur's Travels
[  Superman  ] * <Helper> [ Solamnic ] <L> Kiri is on BP
[   Human    ] * Axz, Hydra's Dragon Mage.


Ok there are several things I need to explain if your not familiar with this mud

On the far left you have your Race, note that some are blank, that is because they have not togled their race on. If you are in the same room as someoen then their race is automatically shown on the wholist.

The next thing to note is the *, which signifies PK, the lack of a * means Non-PK... NOPK for short

The <Helper> is a flag that people can toggle on and off at will.

Now the next thing you will see is the clan names they are in Brakets, if they are in a subclan, then it is followed by another set of brakets I.E. [ Solamnic ] [Rose]

Following the clan, and/or subclan, there is the pretitle option, I.E. General Kroog Isenheart - FleshReaver

Then you finally get to the actual name of the person, I.E. Kroog

Followed by your title.

More to follow in the next posting...

(modified by Nick to add [code] tag to make it easier to read).

My code(with a LOT of Nicks help) to fame:

sub OnAutoCombo (TriggerName, TriggerLine, arrWildCards)
dim AutoCombo
AutoCombo = split (arrWildCards (1))
Dim i, attack
for i=lbound (AutoCombo ) to ubound (AutoCombo )
Select Case AutoCombo (i)
case "rp" attack = "punch right"
case "lp" attack = "punch left"
case "s" attack = "sweep"
case "r" attack = "roundhouse"
case else attack = "" ' unknown attack type
End Select
if i = ubound (AutoCombo ) then
world.send "throw " + world.getvariable ("attacker") + " down"
else
world.send attack + " " + world.GetVariable ("attacker")
end if
next
end sub
Top

Posted by David   USA  (49 posts)  Bio
Date Reply #1 on Tue 05 Mar 2002 07:10 AM (UTC)
Message
My plan, is to help organize/clearup annoying things I dislike about the wholist as it stands.

A couple of the things I wish to do is add a little who command

whopk: This command will show the wholist without nopk indivuals.

Of course: whonopk
The opposite of the above named command

Now for the REALLY hard part...

I want to beable to re-organize the wholist so that when I type who it groups the clanned people next to each other.

I.E

Conclave members Online:
[ Silvanesti ] [ Conclave ] [White] Mistress Cloreana, Prophet of Solinari, [Guardian]
[ HeadNacho ] * <Helper> [ Conclave ] [Red] <L> [Player Relations] Lunitari is waxing.

Solamnic members Online:
[ Human ] * [ Solamnic ] [Rose] <L> Ranadiel the Great Saiyaman NEEDs to talk to Ziv
[ Human ] * [ Solamnic ] [Crown] Lady Solera RuneBlade
[ Human ] [ Solamnic ] [Crown] Teldor Rosenguard,Squire to Lord Kadith Gridolm

7th Kindom members Online:
[ Aghar ] * [7 Kingdoms] Inkblot Mumblebelly

Non-Clanned players Online:
blah blah

I also HOPE that when I re-omit this it keeps all ANSI colors the same(doesn't think that that is possible but hopes it is).

My code(with a LOT of Nicks help) to fame:

sub OnAutoCombo (TriggerName, TriggerLine, arrWildCards)
dim AutoCombo
AutoCombo = split (arrWildCards (1))
Dim i, attack
for i=lbound (AutoCombo ) to ubound (AutoCombo )
Select Case AutoCombo (i)
case "rp" attack = "punch right"
case "lp" attack = "punch left"
case "s" attack = "sweep"
case "r" attack = "roundhouse"
case else attack = "" ' unknown attack type
End Select
if i = ubound (AutoCombo ) then
world.send "throw " + world.getvariable ("attacker") + " down"
else
world.send attack + " " + world.GetVariable ("attacker")
end if
next
end sub
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #2 on Tue 05 Mar 2002 08:45 PM (UTC)
Message
This sounds like a really interesting project. I did something similar a while ago, when I did a script and some triggers that - between them - captured my inventory list and displayed it in a separate window (a notepad window).

It is certainly achievable, I will give you some ideas to get you started ...

One thing seems obvious, you need to capture each "who" line as it arrives and save it somewhere, so you can later list the ones you want, in the order you want. For instance, saving them into an array would seem a simple way of doing this.

Next, you need to know when then the list starts (so you can clear out the array), and when it ends (so you can display the results).

If you are lucky the who list will display something at the start that a trigger can match on, otherwise you might have to force it by sending a special line (eg. think $%I$@@) that you can match on when it arrives.

Usually a who list will end with something you could trigger on, like "42 players", so finding the end of the list should be simple enough.

Thus, I would make three triggers, like this:


  1. Match start of "who" list - either something that already arrives, or something you provide. When you get this you "clear out" your internal array - eg. by setting a counter to zero. You would also enable trigger (2).
  2. A trigger that matches each "who" line. By using regular expressions you could make quite fancy matches, as regular expressions can match on "zero or one" of something. Thus you could match on "zero or one" of text like "<helper>".
    In this case you might make a trigger like this:


    ^\[(.*)\] (\*)? (\<helper\> )?(\[.*\] )?(\[.*\] )?(.*)$


    The above is just an example to get you started, but shows the general idea.

    It matches on the square brackets (by preceding them with a "\") and then whatever is in the brackets (ie. your race). This will be wildcard 1.

    Then it looks for the optional PK asterisk (again, escaped by "\" because an asterisk has a special meaning in regular expressions). The "?" means "zero or one of the preceding thing". This will be wildcard 2.

    Then the world <helper> is put in brackets (including the space following the word), and followed by a "?" - so we can match on whether or not we have <helper>. This will be wildcard 3.

    Then we do a similar thing for the clan and subclan (wildcards 4 and 5).

    Naturally you would set the trigger as "omit from output" so it doesn't show the who list as it arrives.

    You would then store the resulting trigger line, including all the wildcards, into an array.

  3. Finally you have a trigger that matches on the end of the who list. It would disable trigger (2), and then display the resulting array in whatever you wanted it.



Hope this gives you some ideas for getting started. :)




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


11,422 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.