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
tbone235
Apprentice


Joined: 02 Nov 2002
Posts: 107
Location: Australia

PostPosted: Thu Jun 19, 2003 12:37 am   

Database question
 
I am trying to write a fully portable script, so that all a person has to do is copy and paste this script into their zmud and it will work.
What i need to know is, Is there a way to 'script' the creation of a database, so that they dont have to download a database as well, which they would have to save to the correct spot etc?

Thanks
Reply with quote
geniusclown
Magician


Joined: 23 Apr 2003
Posts: 358
Location: USA

PostPosted: Thu Jun 19, 2003 3:05 am   
 
You can use the #DBLOAD filename command to create a new database, then #ADDKEY filename {field1=key|field2=key...} to create the fields at default.

If the initial values of the database come from the MUD, you can use
quote:
#TRIGGER {MUD output} {#ADDKEY filename {field1=%1|field2=%2...} TempClass
#TRIGGER {MUD output at end of data collection} {#DELCLASS TempClass} TempClass
commands to get MUD output


If you need more assistance, give more detail on the database you want to create, along with sample MUD output, if applicable.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Jun 19, 2003 6:15 am   
 
Where in the helpfile can I find this, GC? My version doesn't appear to mention anything about creating new databases via code, nor does it say anything about using #ADDKEY to populate said database with the needed fields for each record.

In the past, Zugg had made it quite clear that the only way to create new databases was to open the Database Window and manually creating it via menu/button, and then manually adding in the needed fields. Once created, one could then use the various DB-related commands to load/save/close databases, query the database, and add/modify/remove records.

li'l shmoe of Dragon's Gate MUD
Reply with quote
tbone235
Apprentice


Joined: 02 Nov 2002
Posts: 107
Location: Australia

PostPosted: Thu Jun 19, 2003 1:20 pm   
 
that's what i thought...
but if it works cool, but i think i tried that and it didn't...but lets hope :)
Reply with quote
geniusclown
Magician


Joined: 23 Apr 2003
Posts: 358
Location: USA

PostPosted: Thu Jun 19, 2003 2:26 pm   
 
You guys are right... it doesn't work like that. I thought that's how I had started one of my db's, but apparently not. The question is still open.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Jun 19, 2003 3:08 pm   
 
Yeah, like Matt said, there is no way to do this by code. The best way is, like you mentioned, to save an empty database file and distribute that too.

Kjata
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