Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Pagan
Beginner


Joined: 23 Feb 2001
Posts: 21
Location: South Africa

PostPosted: Mon Apr 16, 2001 3:24 pm   

Capture/update
 
I is back ;)
Ive been trying to sort this out, but have been unable to
What im trying to do is take the following list, the 'who' list
and capture it to a separate window. Then, whenever someone
logs on, it is displayed on the second window, in a certain colour
and when someone logs off, their name is listed in another color
as having logged off.

Below is an example of the 'who' list :

EverDark
---
[Journey] Worr of the Worlds <Yes you do!>
---
Viscount Orobas Amrahly'nn, the Lost Romantic
Viscount Pagan Cruachan, Blade of Shatazar
Vicereine Natasha, the Ice Princess <Tell Your Dreams To Me>
Baroness Nina the Divine [1m42s] <OhDarknessIFeelLkLttingGo>
Lasadar Jones, Emperor of the Poppies [2m10s]
Astrial the Companion of Beasts [2m16s]
---
1 wizard and 6 players on.

Now, say Ragthar logs on, in the second window I want it to
send a message saying, for example -=> Ragthar has arrived.
#trigger {%w has arrived.} {#color 10}
and Lasadar logs off, in the second window i will get
a message saying, for example -=> Lasadar has logged off.
#trigger {%w has logged off} {#color 12}

I am not sure if this is possible, if it is, i would welcome
any suggestions.
Thanks
Pagan, He who knows nothing.

Pagan, Slave of Everdark
Reply with quote
Pagan
Beginner


Joined: 23 Feb 2001
Posts: 21
Location: South Africa

PostPosted: Thu Apr 19, 2001 7:22 pm   
 
hrm, ok
Ive been trying to solve this myself, but
without any success im afraid. I was thinking
start a capture as soon as the initial line
is shown, {Everdark (everdark.org)} and end
capture with the last line :
{%1 wizard and %2 players on.} That part i
have sort of figured out. The part im really
having trouble with is the updating. I have
no clue as to how i would go about updating
the names, let alone in different colors.
Might be a little bit hard to accomplish, as there are about 30 people on at any given
time and people leave and arrive all the time
Kjata, LightBulb? any help? It would be
apreciated muchly.

Pagan, Slave of Everdark
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Thu Apr 19, 2001 10:56 pm   
 
Ok, as I understand this, you want to type 'who' and, in a second window, receive a list of people who have otherwise joined or left the game since the last time you typed 'who'. If so, try this:


#TRIGGER {^EverDark$} {#T+ wholist}

#TRIGGER {^*$} {#IF (%1 <> "---") {#CAPTURE whoshere;#ADDITEM whoNow {%1}}} wholist

#TRIGGER {^%d wizar{d|ds} and %d playe{r|rs} on.$} {
#FORALL @whoNow {
#IF %ismember(%i,@whoThen) {#DELITEM @whoThen {%i}} {:whoshere: #ECHO %i has arrived.;#CO 10}}
#FORALL @whoThen {:whoshere: #ECHO %i has logged off.;#CO 12}
#VAR whoThen @whoNow
#VAR whoNow %null
#T- wholist
}

The first trigger enables the wholist class, which contains the second trigger. The second trigger captures each line to the window whoshere and sticks it in a string list @whoNow. (If you only want the name, you'll have to develop some rules for that, since the patterns varied a lot.) Anyway, when the third trigger fires, the names in @whoNow are compared to the names in @whoThen. If the name exists in both, it is deleted in @whoThen. If its only in @whoNow, a message is sent to the second window, whoshere, stating they've arrived. When the comparrison is over, the only names left in @whoThen will be those who have left. These messages are then sent to the whoshere window. The names in @whoNow are placed in @whoThen, @whoNow is cleared, and the wholist class is disabled.

Troubadour
Worship the comic.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Apr 19, 2001 11:11 pm   
 
The problem is how to identify when someone logs on/logs off. You can easily set an alarm to run the who list as often as you like, so it comes down to finding a way to put the names into a list (two lists, actually) and then compare the new list to the old one and report any newcomers as "logged on" while reporting any missing as "logged off". Any possibility of getting a 'who' list without all the titles? If you can figure out a way to capture the individual names and put them into list variables I think this routine will let you announce the logons/logoffs.

#TR {%d %w on} {#FORALL newlist {#IF (NOT %ismember(%i,@oldlist)) {:secondwindow:#SAY %i has arrived}};#FORALL oldlist {#IF (NOT %ismember(%i,newlist)) {:secondwindow:#SAY %i has logged off}};#VAR oldlist @newlist}

LightBulb
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Thu Apr 19, 2001 11:16 pm   
 
Ok, I was pondering this a little more. If the titles a player can have is restricted and published, then you can easily extract their first names from each line.

First make a list of possible titles:

#VAR titles {Viscount|Baroness|Viscountess|Baron|Count|Countess|etc}

Then change the second trigger to:

#TRIGGER {^*$} {#CAPTURE whoshere;#IF (%1 <> "---") {#ADDITEM whoNow %if(%ismember(%word(%1,1),@titles),%word(%1,2),%word(%1,1))}} wholist

That'll make your output much prettier. I also moved the #CAPTURE outside the #IF statement so that the "---" is captured.

Troubadour
Worship the comic.
Reply with quote
Pagan
Beginner


Joined: 23 Feb 2001
Posts: 21
Location: South Africa

PostPosted: Fri Apr 20, 2001 12:21 am   
 
OK
You guys ROCK!
thanks a bundle guys!
Worked beautifully
It isnt quite what i was looking for, but
it gets the job done very nicely

Pagan, Slave of Everdark
Reply with quote
Fishy5
Beginner


Joined: 13 Apr 2001
Posts: 11

PostPosted: Fri Apr 20, 2001 10:06 am   
 
EverDark (everdark.org 3000)
---
[Arch] Bax xaB, the real tyrant [9h54m58s] <accept no substitutes>
---
Margrave Khallen du Maris, Pontifex of Flames <SelfDestructAtMyCommand>
Countess Anais Dilynrae <PourYourMiseryDownOnMe>
Viceroy Talen mac Lir, Potentate of Blood <Seducer of Shadows>
Vicereine Jhessail Silverthorne
Viceroy Falcar Sul'Harai, Pontiff of Agrivar
Retired Count Camus, Bloody Limb of Grim Death [5m29s]
Baron Nicodemus [17m45s]
Sir Geo, Director of Harmonies <Melodious Murder>
Sir Valasjak the Enchanter [1m14s] <Black Hand of Aziir-Balar>
Lasadar Jones <Gold Chain - 20k>
Anaiya the Reverent Thaumaturge
---
1 wizard and 11 players on.
<282/282>
EverDark (everdark.org 3000)
---
Arches: Bax*
Players: Anais Anaiya Camus* Falcar Geo Jhessail Khallen Lasadar Nicodemus*
Talen Valasjak*
---
12 people on (4 idle).
<282/282>
twho
1 wizards: Bax*
11 players: Anais Anaiya Camus* Falcar Geo Jhessail Khallen Lasadar
Nicodemus* Talen Valasjak*

This was originaly my problem that I asked Pagan for help with. What I want is to be able to have an alarm that will do a 'who' every few seconds, then publish the names to another window, and compare the lists and tell me who has come and go. I have been looking through here and I think the best way to do it is to try to adapt it to work for twho. I'll start working on it, if anyone has an ideas *please* post them. Thank you Pagan and everybody whom has already posted, I really appreciate it!
Reply with quote
lera213
Beginner


Joined: 27 Nov 2001
Posts: 10
Location: USA

PostPosted: Tue Jan 01, 2002 2:33 am   
 
Pagan no fair, did you get this working? Can I have it please? I will give you my status bar which is cool, because it shows the exp you got from a kill, and it counts up and down ring uses, Please Pagan.
Email me hon

quote:

OK
You guys ROCK!
thanks a bundle guys!
Worked beautifully
It isnt quite what i was looking for, but
it gets the job done very nicely

Pagan, Slave of Everdark



Try Everdark!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net