About Us
Products
Purchase
Downloads
Support
Forums
Contact Us
Site
 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
Einder
Novice


Joined: 03 Jan 2008
Posts: 48

PostPosted: Fri Dec 30, 2011 8:44 am   

Maps To Variable Database Script
 
I'm currently working on a script to convert maps to variable databases, so that I can add to it later with minimal effort. The script seems right, however it doesn't work. Can anyone help me with this?

Code:
#LOOP %numrooms {
  MVnum = %mapvnum( %i)
  #if (!%null( %roomname( @mvnum)) & %roomcost( @mvnum)<1000) {
    QResult = %query( &RoomName = %roomname( @mvnum), All)
    #if (!%null( @QResult)) {
      MapDB = @QResult
      #DBGet @mapdb ""
      #DBPut @mapdb RoomName %roomname( @mvnum) {RoomVnum %additem( @mvnum, &RoomVnum)}
      } {#NEW "" RoomName=%roomname( @mvnum) {RoomVnum=@mvnum}}
    }
  }


It seems as if there is an error in parsing the null check, I'm not understanding what the issue could be or how to fix it.
Reply with quote
Einder
Novice


Joined: 03 Jan 2008
Posts: 48

PostPosted: Wed Jan 04, 2012 3:32 pm   
 
So I took out the first null check, and the script now looks like this:

Code:
#LOOP %numrooms {
  MVnum = %mapvnum( %i)
  #if (%roomname( @mvnum) & %roomcost( @mvnum)<1000) {
    QResult = %query( &RoomName=%roomname( @mvnum), All)
    #if (!%null( @QResult)) {
      MapDB = @QResult
      #DBGet @mapdb ""
      #DBPut @mapdb RoomName=%additem( %roomname( @mvnum)) {RoomVnum=%additem( @mvnum)}
      } {#NEW "" RoomName=%roomname( @mvnum) {RoomVnum=@mvnum}}
    }
  }


Taking out the first null check got it to run till it gets to the %query, at which point it doesn't do anything. Any ideas as to why or how to fix it perhaps?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Jan 04, 2012 8:21 pm   
 
Why are you converting to the DB module format instead of sticking with SQL? SQL is far faster, and the mapfile is already in SQL format.
_________________
EDIT: I didn't like my old signature
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Wed Jan 04, 2012 8:51 pm   
 
Unless he mis-posted, I think he means it for ZMud, not CMud.
_________________
The Proud new owner of CMud.

--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
--------------------------------
Reply with quote
Einder
Novice


Joined: 03 Jan 2008
Posts: 48

PostPosted: Wed Jan 04, 2012 11:28 pm   
 
When running multiple searches it's easier to search the database then it is my maps.

and yes Progonoi, this is zMud not 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