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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Fri Jun 06, 2008 12:34 am   

[2.26] Bug with @db.var in trigger patterns
 
EDIT: Fixed the trigger here. Tired, and didn't realize my mistake on the forum. Problem still stands, as this was a typo on my part here.

Prior to the upgrade, I had these triggers:

#TRIGGER {~({| }(%d)~) * @potdb.healpot} {#ADD potdb.healcount %1}
#TRIGGER {~({| }(%d)~) * @potdb.manapot} {#ADD potdb.manacount %1}

Prior to the upgrade, it worked flawlessly. It'd take:

(43) (M)(G) Jade elixir (60)
(24) (M)(G) Green Herbal Tea (60)

and store 43 in the healcount key of the potdb database, and 24 in the manacount key of the potdb. Now, running it, it adds the values together and stores 67 into both healcount and manacount db. I remedied it with %%db(@potdb, healpot), but this now means a lot of changing scripts because several of them use that format. Since it did work before, and wasn't a problem, I am assuming it is a bug, unless someone can point out an obvious flaw in my scripting or why it shouldn't work now.

Charneus


Last edited by charneus on Fri Jun 06, 2008 1:03 am; edited 1 time in total
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Fri Jun 06, 2008 12:48 am   
 
I don't understand how the @potdb.healpot and @potdb.manapot come into play when matching that pattern. I'm actually think that you DO have a flaw in your scripting, unless you can explain the logic (and values of the variables) in greater detail.


Last edited by Larkin on Fri Jun 06, 2008 8:34 am; edited 1 time in total
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Fri Jun 06, 2008 1:05 am   
 
Heh. Typo on my part. But yeah... this is what my potdb database shows:

Healpot=Jade Elixir
Manapot=Green Herbal Tea
Manacount=24
Healcount=43

I typo'd the trigger itself here. Wasn't a problem in the package - I had that correct. In fact, it was working prior to the upgrade. :P

Charneus
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Jun 06, 2008 1:16 am   
 
Yep, confirmed. Looks like a bug. The compiled pattern looks just fine, so I'm not sure what is going on here. Using %%db is a good workaround until I can get it fixed.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Jun 09, 2008 9:51 pm   
 
OK, I have this fixed for v2.27.

However, I should make a comment that your trigger is very inefficient. The problem is that you are modifying the @potdb.healcount or @potdb.manacount variable each time the trigger fires. This flags the @potdb database variable as "changed". So the trigger needs to be recompiled each time (since it depends upon the @potdb.healpot variable, which is part of the @potdb variable).

You should really separate the pattern for your trigger from your "count" variables to avoid having the trigger pattern recompiled each time.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Mon Jun 09, 2008 10:14 pm   
 
Oo... didn't think of that. I'll have to do that then. Thanks for the fix and the suggestion!

Charneus
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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