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
Brujah
Wanderer


Joined: 13 Nov 2002
Posts: 88
Location: USA

PostPosted: Fri Sep 19, 2003 5:59 am   

No Idea how to go about writing this script
 
Within my MUD there are certain clans that are allowed to PK freely but it is limited to those clans. Being a smaller member of one of these clans myself i need to watch out for these people. I have this alias

#AL {pkwho} {clan list 2;clan list 11;clan list 17;clan list 23;clan list 26;clan list 35;clan list 59;clan list 92;clan list 115}
and it gives me a readout like this.... (i will shorten it, its a long list)

Member Roster for Clan #2, Enigma (Cult):
No. Name Ranking
-----------------------------------------
[ 1] Shadowlight Justicar
[ 2] Zim Warlord
[ 3] Sabon Warlord
[ 4] Wildsoul Warlord
[ 5] *Pascal Justicar
[ 6] *Frixion Templar
[ 7] Phucilage Avenger
[ 8] Charmante Templar
[ 9] Mountainlion Templar
[ 10] Rado Avenger
[ 11] Coin Warlord
[ 12] Huln Justicar
[ 13] Jesterman Avenger
[ 14] Blaster Avatar
[ 15] Carlina Justicar
[ 16] Gattaca Squire
[ 17] Asphyx Templar
[ 18] Kizzel Avenger
[ 19] Leira Squire
[ 20] *Kodo Avenger
[ 21] Mythran Justicar
[ 22] *Miramos Squire
[ 23] Desolate Squire
[ 24] *Gustave Squire
[ 25] *Nelir Squire
[ 26] Alexia Justicar
[ 27] *Stolus Squire
[ 28] *Shiv Squire


this gives me a readout of all members in the game in a PK clan and also, irrelivantly, places a small asterick next to the ones who are online. what i need is this... when i type Where and get a readout like this....

You are currently in: Irda Isle Caverns
Visible player(s) near you:
Neit (A Long Corridor)
Zedacar (A Long Corridor)
Caillean (A Small Cell)
Zim (A Dusty Corridor)
Vassago (The Lounge)


i need zmud to recognize any of the names from the PK list (maybe if all their names are stored into a text file and all response from the mud within a few seconds of me typing PKwho is captures into the text file... then whenever i type Where it can be cross-referenced against that list.... Either way i would like for it to look something like this when i type where.

You are currently in: Irda Isle Caverns
Visible player(s) near you:
Neit (A Long Corridor)
Zedacar (A Long Corridor)
Caillean (A Small Cell) -DRAGON-
Zim (A Dusty Corridor) -ENIGMA-
Vassago (The Lounge)


This could very well be a long and complicated script and i understand the work involved in helping us with some of these complex posts. I would appreciate any help that would get me going in the right direction. Even if someone could suggest some plausable way for me to go about doing this, it doesnt need to be a seperate text file... i would be very much in debt. i apologize that this isnt aligned properly... when i cut/paste it looks good but gets all screwed up when i preview. thank you in advance. :)
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Fri Sep 19, 2003 6:48 am   
 
How I love a chalange, I'll take it.
In the mean time consider this:
how long is the list, beacuse a variable can hold alot of info
and also text files can be made to be a variable list

I got my list up to 3392 before zmud stalled out on me
#alias asd {#loop 1,4000 {#addi new %i}}
Reply with quote
Brujah
Wanderer


Joined: 13 Nov 2002
Posts: 88
Location: USA

PostPosted: Fri Sep 19, 2003 7:17 am   
 
thanks Mog... heres an exact cut/paste of the readout. approx 170 lines and 146 names.

Member Roster for Clan #2, Enigma (Cult):
No. Name Ranking
-----------------------------------------
[ 1] Shadowlight Justicar
[ 2] Zim Warlord
[ 3] Sabon Warlord
[ 4] Wildsoul Warlord
[ 5] *Pascal Justicar
[ 6] *Frixion Templar
[ 7] Phucilage Avenger
[ 8] Charmante Templar
[ 9] Mountainlion Templar
[ 10] Rado Avenger
[ 11] *Coin Warlord
[ 12] Huln Justicar
[ 13] Jesterman Avenger
[ 14] Blaster Avatar
[ 15] *Carlina Justicar
[ 16] Gattaca Squire
[ 17] Asphyx Templar
[ 18] Kizzel Avenger
[ 19] Leira Squire
[ 20] *Kodo Avenger
[ 21] Mythran Justicar
[ 22] *Miramos Squire
[ 23] Desolate Squire
[ 24] *Gustave Squire
[ 25] *Nelir Squire
[ 26] Alexia Justicar
[ 27] Stolus Squire
[ 28] *Shiv Squire
[Mail][*][SAFE]<1526hp 659sp 1315st> Member Roster for Clan #11, Knighthood (Order):
No. Name Ranking
-----------------------------------------
[ 1] Flyingnite High Priest
[ 2] Diablo High Priest
[ 3] Chemosh Judicator
[ 4] Yptalos Judicator
[ 5] Vlamcer High Priest
[ 6] Zar Matriarch
[ 7] Windforce Patriarch
[ 8] Ragate Patriarch
[ 9] Orfeus Judicator
[ 10] Panchee Apostle
[ 11] Kopaka Patriarch
[ 12] SanC Judicator
[ 13] Gatera Loyal Devotee
[ 14] Darrod High Priest
[ 15] Entreri Judicator
[ 16] *Snoogans Loyal Devotee
[Mail][*][SAFE]<1526hp 659sp 1315st> Member Roster for Clan #17, Avenger (Lodge):
No. Name Ranking
-----------------------------------------
[ 1] Hue Theoricus
[ 2] Jaden Magister
[ 3] Hikaru Theoricus
[ 4] Darkk Theoricus
[ 5] Melekai Theoricus
[ 6] Palen Adeptus Major
[ 7] Aeark Magister
[ 8] Lane Philosophus
[ 9] Aurian Philosophus
[ 10] Shadowling Theoricus
[ 11] Vampyr Theoricus
[ 12] Larke Theoricus
[ 13] *Vail Philosophus
[ 14] Stryfer Philosophus
[ 15] Sunflash Practicus
[ 16] *Taran Philosophus
[Mail][*][SAFE]<1526hp 659sp 1315st> Member Roster for Clan #23, Dragon (Tribe):
No. Name Ranking
-----------------------------------------
[ 1] *Enbringer Elder
[ 2] Lavan Aide
[ 3] Shizzle Chieftan
[ 4] Caillean Chieftan
[ 5] Reis Subordinate
[ 6] *Caramon Aide
[ 7] Valrow Servant
[ 8] Nakitta Subordinate
[ 9] Tabasco Aide
[ 10] Kyratha Aide
[ 11] Deathbyfire Servant
[ 12] Starflare Servant
[ 13] Kirouac Aide
[ 14] Vycyn Servant
[ 15] *Bostitch Subordinate
[ 16] Unbeliever Elder
[ 17] Elmador Servant
[ 18] Araphwael Servant
[ 19] Niamhe Servant
[ 20] Loman Chieftan
[ 21] *Brujah Servant
[ 22] Krypt Aide
[Mail][*][SAFE]<1526hp 659sp 1315st> Member Roster for Clan #26, Valhalla (Guild):
No. Name Ranking
-----------------------------------------
[ 1] Barracuda Adept
[ 2] Forge Journeyman
[ 3] Hoff Grandmaster
[ 4] Slump Expert
[ 5] Toffee Adept
[ 6] Ingen Grandmaster
[ 7] Duriel Expert
[ 8] Hopper Grandmaster
[ 9] Seraph Master
[ 10] Algojo Adept
[ 11] Eva Apprentice
[ 12] Sarge Expert
[ 13] Hydros Apprentice
[ 14] Siaolex Master
[ 15] Ryosho Adept
[ 16] Krusher Expert
[ 17] Natsuki Grandmistress
[Mail][*][SAFE]<1526hp 659sp 1315st> Member Roster for Clan #35, Avalanche (Court):
No. Name Ranking
-----------------------------------------
[ 1] Nonagon King
[ 2] Arcanepoet King
[ 3] *Paragon Duke
[ 4] Ascent Princess
[ 5] Shadowrider Duke
[ 6] *Nebula Princess
[ 7] Maverickn Courtier
[ 8] Brandtson Count
[ 9] Lysiria Baroness
[ 10] Dalamar Prince
[ 11] Aesir Duke
[ 12] Poppinfresh Duke
[ 13] Kote Duke
[ 14] Prophet Courtier
[ 15] Panzer Courtier
[Mail][*][SAFE]<1526hp 659sp 1315st> Member Roster for Clan #59, Empire (Tribe):
No. Name Ranking
-----------------------------------------
[ 1] Azmodan Chieftan
[ 2] Nick Chieftan
[ 3] Pyralis Chieftan
[ 4] Lysia Chieftan
[ 5] Deedlit Elder
[ 6] Throm Chieftan
[ 7] Cernix Chieftan
[ 8] Vedric Slave
[Mail][*][SAFE]<1526hp 659sp 1315st> Member Roster for Clan #92, The Cwn Annwn (Tribe):
No. Name Ranking
-----------------------------------------
[ 1] Katran Chieftan
[ 2] Indiyah Subordinate
[ 3] Khalid Chieftan
[ 4] Cyko Elder
[ 5] Grainne Subordinate
[ 6] Akyra Elder
[ 7] Lazarus Slave
[ 8] Tantrum Servant
[ 9] Wolfram Servant
[ 10] Lucie Slave
[ 11] Aldur Servant
[ 12] Zakainen Chieftan
[ 13] Datanyon Slave
[ 14] Brilon Slave
[ 15] Nizzische Slave
[ 16] Valiance Slave
[ 17] Umiren Slave
[ 18] Citadel Slave
[Mail][*][SAFE]<1526hp 659sp 1315st> Member Roster for Clan #115, The Dark Order (Order):
No. Name Ranking
-----------------------------------------
[ 1] Paradox High Priestess
[ 2] Spyro High Priest
[ 3] Jaydyn Acolyte
[ 4] Arkain Judicator
[ 5] Slyax Acolyte
[ 6] Synn Judicator
Reply with quote
Brujah
Wanderer


Joined: 13 Nov 2002
Posts: 88
Location: USA

PostPosted: Fri Sep 19, 2003 7:18 am   
 
i would also like to add that people are removed/added in these clans on a daily basis and the list would need to reevaluate itself. i can do a pkwho every time i log on and it wouldnt bother me...
Reply with quote
Brujah
Wanderer


Joined: 13 Nov 2002
Posts: 88
Location: USA

PostPosted: Fri Sep 19, 2003 7:23 am   
 
just to save you the trouble of figuring it out, i failed to mention that -DRAGON- and -ENIGMA- are the clans that individual is in.
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Fri Sep 19, 2003 8:08 am   
 
#CLASS {CLAN}
#ALIAS pkwho {#temp {^$} {#t- clan_trig;#close 1};#file 1 "pkwho.txt";#erase 1;#file 1 "pkwho.txt";#t+ clan_trig;clan list 2;clan list 11;clan list 17;clan list 23;clan list 26;clan list 35;clan list 59;clan list 92;clan list 115;}
#VAR ClanType {0}
#VAR foundpk {Carlina}
#TRIGGER {^Visible player~(s~) near you~:$} {#temp {^$} {#t- clan_where};#t+ clan_where}
#CLASS 0

#CLASS {CLAN|clan_trig}
#TRIGGER {^~[ %d~] (%w) %w$} {#write 1 {%1 ~-@ClanType~-}}
#TRIGGER {^Member Roster for Clan ~#%d~, (%w) ~(Cult~)~:$} {#var ClanType %1}
#TRIGGER {^~[ %d~] ~*(%w) %w$} {#write 1 {%1 ~-@ClanType~-}}
#CLASS 0

#CLASS {CLAN|clan_where}
#TRIGGER {(%w) ~((*)~)} {#gag;#file 1 "pkwho.txt";#gag;#if %grep(1,"^[%1]")="" {#say %ansi(high,yellow)%1 is in "~[%2~]"} {#var foundpk %grep(1,"^[%1]");#var foundpk %replace(@foundpk," ","|");#say %ansi(high,red)%item(@foundpk,1) is in "~[%2~]" %item(@foundpk,2)};#close 1;#gag}
#CLASS 0

______________________________________________________________________________
This should do the trick.
You might have to tweek this a bit since I can not test it on your mud.

Work off of your pkwho
Reply with quote
Brujah
Wanderer


Joined: 13 Nov 2002
Posts: 88
Location: USA

PostPosted: Fri Sep 19, 2003 5:55 pm   
 
it isnt working in any way shape or form and ive tried fiddling with it but for the most part it is composed of commands and concepts i dont know anything about... when i entered it in #CLASS containing | just went through to the mud like #CLASS wasnt a valid zmud script command.

PKwho doesnt appear to be writing to the text file. it did create it but its not writing anything to it. also, the auction channel is getting an echo from this script.

AUCTION: A cloth hat of magic: going twice (no bid received yet).
twice is in [no bid received yet] <----Echo.

:)
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Sat Sep 20, 2003 12:21 am   
 
Sorry about that it posted late.
But he above script should do this:
create a text file called pkwho add and capture all the names and clans then when you type where it should highlight all in red that are on the list.

You said it was not working?
It is just an example at best because I do not play your mud even if I knew wich one it was. so I could not get the triggers right.
You will have to tweek it. but sine you saaid you do not need it to capture more than 3000 names I will rewrite it give me a till tomarrow night I have to work tonight.
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Sat Sep 20, 2003 8:00 pm   
 

UNTESTED



#CLASS {CLAN}
#ALIAS pkwho {#temp {^$} {#t- clan_trig;#close 1};#var pkwho "";#var pktype "";#t+ clan_trig;clan list 2;clan list 11;clan list 17;clan list 23;clan list 26;clan list 35;clan list 59;clan list 92;clan list 115}
#ALIAS pktype {1}
#VAR ClanType {1}
#VAR pkwho {tard -dragon-|big|dog}
#VAR pktype {}
#VAR found {}
#TRIGGER {^Visible player~(s~) near you~:$} {#temp {^$} {#t- clan_where};#t+ clan_where}
#CLASS 0

#CLASS {CLAN|clan_trig}
#TRIGGER {^~[ %d~] (%w) %w$} {#addi pkwho %1;#var pktype %additem(~-@clantype~-,@pktype)}
#TRIGGER {Member Roster for Clan ~#%d~, (%w) ~(%w~)~:$} {#var ClanType %1}
#TRIGGER {^~[ %d~] ~*(%w) %w$} {#addi pkwho %1;#var pktype %additem(~-@clantype~-,@pktype)}
#CLASS 0

#CLASS {CLAN|clan_where}
#TRIGGER {^(%w) ~((*)~)} {#gag;#if %ismember(%1,@pkwho)=0 {#say %ansi(high,yellow)%1 is in "~[%2~]"} {#var found %ismember(%1,@pkwho);#say %ansi(high,red)%ismember(%1,@pkwho) is in "~[%2~]" ~-%item(@pktype,@found)~-}}
#CLASS 0

you may need to tweek this.

Also copy past to txt file then use IMPORT to bring it in
or past to command line and hit enter
Reply with quote
Brujah
Wanderer


Joined: 13 Nov 2002
Posts: 88
Location: USA

PostPosted: Mon Sep 22, 2003 3:53 am   
 
this seems to be a problem. when i enter the script these two are going through to the MUD and not creating, i am not familiar with it and im not sure whether the triggers following these are supposed to go into them or what.
#CLASS {CLAN|clan_trig}
#CLASS {CLAN|clan_where}

are these supposed to be subclasses inside CLAN? thanks for all the help, ill try fiddling around with it to see if i can figure it out. :)
Reply with quote
Brujah
Wanderer


Joined: 13 Nov 2002
Posts: 88
Location: USA

PostPosted: Mon Sep 22, 2003 4:05 am   
 
ok. i figured that out but its still not working. while i dont seem to be getting pointless echos that i dont want anymore, when i type Where its not working. the whole point doesnt seem to be functioning properly. i opened the PKwho.txt file and it appears to be empty. i dont know anything about how this script works or else i would try to figure out why its not writing. i also tried cut/pasting the readout from PKwho into the text file and saving it, i even tried deleting the astericks in from of the name but it doesnt appear to be working. maybe we are trying to go about this in the wrong way and there is a better way to accomplish the same results. not that it matters, im willing to work on it and if you tell me how to fiddle or what to work on i will. i appreciate the help.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Sep 22, 2003 4:40 pm   
 
quote:
what i need is...when i type Where...i need zmud to recognize any of the names from the PK list

You don't need a file. You need a list- or record-variable. Your triggers also have to account for all the spaces used on the MUD.
#CLASS Clan
#TR {%dhp %dsp %dst} {#T- pklist trigger;#VAR clan {}}
#TR {Member Roster for Clan ~#(%d), (*) ~(%w~):} {#IF (%ismember( "%1", "2|11|17|23|26|35|59|92|115")) {#VAR clan {%2} {};#T+ pklist}}
#TR pklist {%d~] ?(%w)} {#ADDK pkwho %1 {@clan}} {} {disable}
#TR {^({@pkwho}) %s ~(*~)} {#CO hi,red;#SUB {%trigger -%upper( %db( @pkwho, %1))-}}
#CLASS 0

NOTES:
1. The order of the first two triggers is significant.
2. Paste the script to the command line.
3. The CLASS is not essential. It just simplifies the process of finding the triggers involved in this script, in case you should later want to delete or modify it.
4. It's best if you don't have any other settings named "pklist".
5. This uses a record-variable because it needs to record two items per person. If you just wanted the names, you would use #ADDITEM to create a list-variable.
Reply with quote
Brujah
Wanderer


Joined: 13 Nov 2002
Posts: 88
Location: USA

PostPosted: Mon Sep 22, 2003 9:14 pm   
 
nifty. it appears to be working but i am very curious as to how. how does it know just from their names whether or not they are in a PK clan without checking it against any type of list? i would be much obliged if you told me how it worked.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Sep 22, 2003 10:39 pm   
 
It does check their names against a list.
@pkwho is a record variable. As per zMUD help for #ADDKEY, "Record variables are a list of key properties, each with a value." The "key properties" of @pkwho are the names.
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