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


Joined: 20 Jan 2002
Posts: 15

PostPosted: Sat Aug 03, 2002 9:01 pm   

Storing variables from a line.
 
Hihi... I'm trying to store this line into different variables.. I gotten so far as to do some successfully, but it seems to not be able to each one with the same trigger..



76. [36577] [26] [Non] [ ] 13-27 [ 260] Huge Anima a large rhino
77. [36578] [14] [Non] [ ] 7-15 [ 140] Faerie a jungle faerie
78. [36579] [11] [Non] [ ] 5-12 [ 110] Medium Ani a Hopparoo
79. [36580] [21] [Unu] [x] 10-22 [ 210] Medium Mon a bloodied ape man
80. [36581] [26] [Ama] [ ] 13-27 [ 260] Human an amazon guard
45. [36545] [10] [Unu] [x] 5-11 [ 100] Large Rept a scaly alligator
46. [36546] [23] [Fig] [x] 11-24 [ 230] Raukburhru an insane raukburhrum
47. [36547] [23] [Fig] [x] 11-24 [ 230] Elf an insane elf
48. [36548] [28] [Fig] [x] 14-29 [ 280] Deep Dwarf an insane dwarf


I want it to store each in a variable:

%1 = 48
%2 = 36548
%3 = 28
%4 = Fig
%5 = 280
%6 = Deep Dwarf
%7 = an insane dwarf

So far my trigger looks like:
^%1~. ~[%2~] ~[%3~] ~[%4~] ~[?~] %5 ~[ %6~] (%7) (%8) (%w) (*)

But for some it doesn't work for the %7 and %8 variables storing more than it's supposed to such as
%7 = Animated P a
%8 = flesh

when I want it to look like
%7 = Animated P
%8 = a flesh eating plant

I'm thinking maybe the &nn variable might help but I don't know how to use it... any help will be appreciated! ^_^

(I need it to store these so I can write a script that will automatically check to see if it's a faerie, then change the size to small and so on... it's hard to change 100 faeries manually. ^_^;;)
Reply with quote
Belmyrddyn
Magician


Joined: 17 Oct 2001
Posts: 371
Location: USA

PostPosted: Sat Aug 03, 2002 9:49 pm   
 
Instead of doing %1, %2... Try using %d, %w, *, and those, and using () to capture them to variables %1...%99.

So try:
^(%d)~.%s~[(%d)~]%s~[(%d)~]%s~[(%w)~]%s~[?~]%s(%x)%s~[%s(%d)~]%s(*)%s{a|an}%s(*)

This should work. I haven't tested it, however.

Belmyrddyn
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