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
jed
Adept


Joined: 18 Dec 2005
Posts: 246

PostPosted: Tue Oct 03, 2006 1:27 am   

%find causing DB problems
 
I am making an EQ database, but having some problems. If I write multiple records with the same value in the name field (Same name item), then try to look at that item with a find using:

#show this is a find of the tempdb %find( @tempdb, all)
#show this is a find of the tempdb %find( @tempdb, all)

where tempdb has been assigned as the item Im looking for.
What the mud returns to me when I run this snippet of code is

this is a find of the tempdb 38fo|39fo|40fo
this is a find of the tempdb

Also, when this is completed, all of the name fields in the db turn to zeros...

I don't believe I am assigning anything to the database, however it looks like this is somehow changing the database... Any reason on why the find might be changing things? Bug?
Reply with quote
jed
Adept


Joined: 18 Dec 2005
Posts: 246

PostPosted: Tue Oct 03, 2006 3:38 am   
 
Ok, found some more info...
I've been testing this with %dbget.... The problem I describe above happens when I pass the returned string from the %find to %dbget by using a #forall command
Code:
#var tempdb ""
#var ttt2 ""
#var tempdb "%-1"
#var tempdb4 ""
#show this is the percent minus one %-1 end
#show this is normal tempdb @tempdb
#show this is tempdb %lower( @tempdb)
#var lowertempdb %lower( @tempdb)
#var itsecvar @tempdb
#show itsecvar @itsecvar
#show tempdb @tempdb
;#show this is a find of the tempdb %find( "mumma", all)
;#show this is a find of the tempdb %find( "mumma", all)
#show this is a find of the tempdb %find( @itsecvar, all)
#show itsecvar @itsecvar
#show tempdb @tempdb
#show this is a find of the tempdb %find( @itsecvar, all)
#show tempdb4 @tempdb4
#var tempdb4 %find( @tempdb, all)
#wa 100
#show this is tempdb4 @tempdb4
;#show this is the query %query( (&Name=%-1), All)
#forall @tempdb4 {
  #var ttt2 ""
  #var ttt2 {%dbget( %i)}
  #cr
  #wa 200
  #show ttt2 @ttt2
  #loopdb @ttt2 {#if ((%val != "") AND (%val != 0) AND (%key != "Weight") AND (%key != "GoldValue") AND (%key != "Num") AND (%key != "iddate")) {#SHOW %ansi( high, cyan)%key "=" %val}}
  }
#show this is a find of the tempdb %find( @itsecvar, all)
#show itsecvar @itsecvar
#show tempdb @tempdb
#show this is a find of the tempdb %find( @itsecvar, all)
#show itsecvar @itsecvar
#show tempdb @tempdb
;AND (%key != "whoid")

Sorry about all the extra #shows in here... usefull for debugging. Also I didnt want to delete them as I'm not sure that part of the problem isn't coming from functions within these #show commands...
I have the above code set up in an alias called "ff" when I run it the first time, it comes out beautifully. When I run it a second time, it returns the quote below where the name of the item has been changed to 0, when I run it a third time it returns nothing.
PLEASE HELP!!!! Very Happy
Quote:
this is the percent minus one strongbox end
this is normal tempdb strongbox
this is tempdb strongbox
itsecvar strongbox
tempdb strongbox
this is a find of the tempdb 44fo
itsecvar strongbox
tempdb strongbox
this is a find of the tempdb 44fo
tempdb4
this is tempdb4 44fo

ttt2 Num44foName0MinLevel1WearlocInventoryHit0Dam0AnticlassAlignmentWeight0GoldValue300AC0ZoneRoom0CommentDEX0INT0STR0CON0WIS0HP0MinDam0MaxDam0AveDam0MV0SaveVsSpell0Mana0ForgedBarsqtyForgedAffectsLightDurationNatureMagicalCpSpellPowerCpSpellCpDurationLockableyesSpell AffectsAge0Gold AffectSaveVsBreath0SaveVsParalysis0Scrolllevel0ScrollSpellAntialignBankableNoStealYesBSWeaponComposition0FillAmountFillTypeDoseQtyDoseLevelDoseSpellsDamTypeMobPopRate0Chargeqty0ChargeMax0ChargeLevel0ChargeSpellMinAmmoDam0MaxAmmoDam0iddate10/02/06whoidjedvisibilitydropablenodrophovershoversprecursorIdtypeItemOfDayLocationItemOfDayDescription
MinLevel = 1
Wearloc = Inventory
Nature = Magical
Lockable = yes
NoSteal = Yes
whoid = jed
dropable = nodrop
hovers = hovers

1115/1115H 450/470M 226/226V 3RV 112389620XP -9.3AC 408gp 9pm
this is a find of the tempdb
itsecvar strongbox
tempdb strongbox
this is a find of the tempdb
itsecvar strongbox
tempdb strongbox
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Tue Oct 03, 2006 10:30 am   
 
I would suggest using %query over %find. Also you should use #DBRESET after each query or find.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
jed
Adept


Joined: 18 Dec 2005
Posts: 246

PostPosted: Thu Oct 05, 2006 1:57 am   
 
I've added #dbreset to all of the locations where I use a %query, %find, #dbget, #dbput... it doesnt seem to help. The name field in the database keeps degrading to zero... Is there any chance this is a bug within 7.21? If so, any idea if any other zmuds will be released with bugfixes such as this one, or will all future improvements only go into Cmud???
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