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
yipfur
Beginner


Joined: 12 Jan 2003
Posts: 13
Location: Australia

PostPosted: Thu Dec 23, 2004 1:59 am   

what sort off trigger do I need to phase names into a db?
 
Hi everyone.

I would like to get the names of the player killers in my mud (discworld) and put them into a database, then when I run into them have the name colored and a button display some infomation about them, guild, age type thing. I am confident I can script what I want to do BUT (hehe) I can't get past the intial stage off phaseing? the infomation to put it into the database.

this is the output I need to get into the db

> killers

There are 27 player killers logged in:
AlkifroliC, Alwin, Astrin, Azraphael, Beale, Blaen, Bronx, Chivas, Cyrus, Dane, Ded, Dirk, Duzchip, Ferran, Iamoriginal, Kih, Lurker, Mandragola, McLeod, MrCrabbs, Nyarlathotep, Oren, Sala, Sonny, Vandin and Zsalt
>

I just need your help to get each off those names on there own and into a recored and I have no idea how to do this (never tryed this sort off thing). Once I can do this I think I can do the rest.

I have been using a #cw tringger to highlight the names but the amount off triggers you end up with slows zmud down and the time it takes to put in names or edit them this way is a real hassel.

thankyou
yipfur
Reply with quote
Aarlot
Adept


Joined: 30 Dec 2003
Posts: 226

PostPosted: Thu Dec 23, 2004 5:02 am   
 
Unless you have something else to attach to the names, it would probably be easier to use a stringlist variable. Something like:

#TR {There are %d player killers logged in} {#VAR PKlist "";#T+ PKcapture;#T+ PKcapturestop}
#TR "PKcapture" {(%w),} {#ADDI PKlist %1}
#TR "PKcapturestop" {(%w) and (%w)} {#ADDI PKlist %1;#ADDI PKlist %2;#T- PKcapture;#T- PKcapturestop}

This captures all of those into the stringlist @PKlist. Then you just make a trigger:

#TR {{@PKlist}} {#CW white}

Insert for "white" whatever color you want. Smile


Note: This would not work with just one pker on the list, but for 2+ it should be good.
_________________
Everyone is entitled to their beliefs - until they die. Then only the truth matters.
Reply with quote
yipfur
Beginner


Joined: 12 Jan 2003
Posts: 13
Location: Australia

PostPosted: Thu Dec 23, 2004 9:08 am   
 
Thankyou for the start
It sort off works which is nice.

The probelm is that it is only picking out the first word of each line and the two names for the PKcapturestop trigger.

So an out put off-

> killers

There are 27 player killers logged in:
AlkifroliC, Alwin, Astrin, Azraphael, Beale, Blaen, Bronx, Chivas, Cyrus, Dane, Ded, Dirk, Duzchip, Ferran, Iamoriginal, Kih, Lurker, Mandragola, McLeod, MrCrabbs, Nyarlathotep, Oren, Sala, Sonny, Vandin and Zsalt
>

-Would put the names ; AlkifroliC Duzchip Sala Vandin Zsalt into the PKlist variable.

How to fix this please :)

yipfur
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Dec 23, 2004 10:55 am   
 
#TR {There are %d player killers logged in} {#VAR PKlist "";#T+ PKcapture}
#TR "PKcapture" {(*)} {#IF ("%1"!="> ") {PKlist=%concat(@PKlist,"%1")} {PKlist=%subchar(@PKlist,", ","||");#DELITEM PKlist {and};#DELITEM PKlist {};#T- PKcapture}} "" {prompt}

Because this trigger is set to fire on both prompt and newline you may get duplicates in the list. This should not cause a problem, but if it does then you can add a duplicate remover.

This trigger should have additional wildcards to limit it to whole words and probably should be set to case-sensitive:
#TR {%q{@PKlist}%q} {#CW white} "" {case}
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
yipfur
Beginner


Joined: 12 Jan 2003
Posts: 13
Location: Australia

PostPosted: Thu Dec 23, 2004 12:28 pm   
 
Works beautifuly.
Very Happy

yipfur
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