|
Reddytedy Apprentice
Joined: 13 Oct 2000 Posts: 114 Location: USA
|
Posted: Thu Feb 26, 2004 2:21 am
Can't figure this one out, need help |
Okay I play in Dragonrealms and I am trying to extract info from a gsl tag %gsl(w) Now I can capture the data alright but am running into problems with it.
%gsl(w) contains alot of stuff, weather (which I will try to do later as it is some sort of code, date (which I am trying to get), and font style(which I can get later), along with some other sundries.
Now here is the data that comes up for the date tag.
<panelData id="weather"><lineone>1st day of Shorka the Cobra</lineone><linetwo>Year of the Iron Toad</linetwo><linethree>375 A.V.</linethree></panelData>>
Now what I want to do is to strip everything but 1st day of Shorka the Cobra...Year of the Iron Toad and 375 A.V. and place them into the variables @day,@year,@date
I for the life of me cannot figure out how to do this any help would be appreciated, I have mulled over the help topics but nothing seems to fit just right.
Alan |
|
|
|
Timas Novice
Joined: 05 Jan 2003 Posts: 39 Location: Netherlands
|
Posted: Thu Feb 26, 2004 9:06 am |
Have you tried something like this?
#TRIGGER {~<panelData id~=~"weather~"~>~<lineone~>(%x)~<~/lineone~>~<linetwo~>(%x)~<~/linetwo~>~<linethree~>(%x)~<~/linethree~>~<~/panelData~>~>} {#VAR day {%1};#VAR year {%2};#VAR date {%3}}
I've never played Dragonrealms so I'm not sure wether these tags change or not. If they don't this aught to work |
|
|
|
Reddytedy Apprentice
Joined: 13 Oct 2000 Posts: 114 Location: USA
|
Posted: Thu Feb 26, 2004 8:01 pm |
They do change constantly and are not usually seen by the user, instead they are placed into a function %gsl(w) Easy enough to get the info out of %gsl(w) by having something like data=%gsl(w) the problem comes in trying to strip out all the garbage I don't want and saving the three variables I do want. Still mulling it over.
Alan |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Thu Feb 26, 2004 11:52 pm |
try this...
#TR {w} {temp = %gsl(w);%replace(@temp, "<panelData id="weather"><lineone>", "");%replace(@temp, "</lineone><linetwo>", "|");%replace(@temp, "</linetwo><linethree>", "|");%replace(@temp, "</linethree></panelData>>", "");day = %item(@temp, 1);year = %item(@temp, 2);date = %item(@temp, 3)} "" {gsl} |
|
|
|
|
|
|
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
|
|