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


Joined: 01 May 2002
Posts: 188
Location: USA

PostPosted: Wed May 22, 2002 2:10 pm   

Need help with Import Database?
 
Ok, I'm not really sure how I can go about doing this but I would like to import a database of "EQ" from a mud that is listed on a certain website. However, instead of me going to the website to find out what the stats are for an object, I can resort to the powerful ZMUD database incorporated within ZMUD.

My problem is that I don't want to import every object in zmud line by line. I'm not an expert in using zmud but if you could help me on figuring this out it would be greatly helpful.

The following are 5 objects for example that are listed on the website:

Cl 'a black hooded cloak' 1.000kg 1H 2B 0A 0L +5Hide +5Sneak
Cl 'a blue embroided cloak' 3.000kg 1H 3B 1A 1L +2Svs +10Hp +2Hit glow magic !store
Cl 'a cloak of blackflame' 1.500kg 0H 2B 0A 2L +15Hp glow
Cl 'a cloak of echo's' 2.000kg 0H 3B 0A 0L +3AC +1Svs hum !store
Cl 'a cloak of feathers' 1.500kg 0H 2B 1A 0L +2Svs glow magic

How would I be able to import this in zmud.

Respectively:
(cloth type) (object name) (weight) (head)(body)(arm)(leg)(special affects (+hit +dam, etc))

Sup
Reply with quote
dacheeba
Adept


Joined: 29 Oct 2001
Posts: 250

PostPosted: Wed May 22, 2002 5:10 pm   
 
The best way I can think of off the top of my head to this would be copy/paste all the eq into a text file(Notepad or Word) and then make a script using %read. Also, a good way to loop though all the lines is by using #WHILE or #UNTIL, and append a simple string to the end of the text file(like 'finished') so the loop knows when to stop reading the file. Sorry I dont exactly have the time to create the actual script for ya.

Good Luck!
Reply with quote
nutsnbolts
Apprentice


Joined: 01 May 2002
Posts: 188
Location: USA

PostPosted: Wed May 22, 2002 5:39 pm   
 
If anyone has the time, could they include the script...it would be greatly appreciated.

Sup
Reply with quote
nutsnbolts
Apprentice


Joined: 01 May 2002
Posts: 188
Location: USA

PostPosted: Wed May 22, 2002 9:09 pm   
 
Anyone?

Sup
Reply with quote
nutsnbolts
Apprentice


Joined: 01 May 2002
Posts: 188
Location: USA

PostPosted: Thu May 23, 2002 6:47 am   
 
??

Sup
Reply with quote
nutsnbolts
Apprentice


Joined: 01 May 2002
Posts: 188
Location: USA

PostPosted: Fri May 24, 2002 7:19 am   
 
No one has any idea? I would do it myself but I have no idea on how to even use the database?

Sup
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri May 24, 2002 1:25 pm   
 
#TR {(Cl) '(*)' (%d).(%d)kg (%d)H (%d)B (%d)A (%d)L (*)$} {#VAR Item %null;#ADDKEY Item cloth_type %1;#ADDK object_name {%2};#ADDKEY weight {%3.%4} #ADDK head %5;#ADDK body %6;#ADDK arm %7;#ADDK leg %8;#ADDK special_affects {%9};#NEW eq @Item}

If you "have no idea on how to even use the database" this isn't likely to be much use. Instead of begging for answers, you should be reading the helpfiles about the database.

LightBulb
Vague questions get vague answers
Reply with quote
nutsnbolts
Apprentice


Joined: 01 May 2002
Posts: 188
Location: USA

PostPosted: Fri May 24, 2002 10:23 pm   
 
Well the reason I'm asking is because I was wondering if anyone knew a better way of doing this and save me the trouble of reading the help files. If the information has already been given, maybe some "guru" would know the best way in approaching this.

As far as begging for answers, sorry I do have other things to do other than learning zmud inside and out.

Sup
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri May 24, 2002 11:41 pm   
 
Sorry, but the first step is to create the database layout. That is to decide what fields it will have, what type of field each will be, and what size it will be. This will require some idea of how to use the database. Whether you learn that from reading here or in the helpfiles, you will still have to learn it.

There's at least one, and probably several, good scripts for adding data to a database in the Finished Scripts forum. They are, however, specifically made to match the particular database used by the scriptwriter and to match the particular way his MUD output the data. In almost all cases, some modification will be needed to adapt them to your own use. Here, again, knowledge of how to use the database is pretty much essential.

I'm sorry there aren't any easy answers. The easiest methods are the ones you don't want to use (manual entry or line-by-line cut-and-paste).

LightBulb
Vague questions get vague answers
Reply with quote
nutsnbolts
Apprentice


Joined: 01 May 2002
Posts: 188
Location: USA

PostPosted: Sun May 26, 2002 11:18 pm   
 
I see...so in order to do this, I would have to create in-game triggers and cut n' paste the information so that it would populate the database. I was hoping that there was some file import ability that can do this. I'll read up on some database information to see what I can do.

Sup
Reply with quote
dacheeba
Adept


Joined: 29 Oct 2001
Posts: 250

PostPosted: Mon May 27, 2002 3:34 am   
 
quote:

I see...so in order to do this, I would have to create in-game triggers and cut n' paste the information so that it would populate the database. I was hoping that there was some file import ability that can do this. I'll read up on some database information to see what I can do.

Sup



There is an import ability, as I mentioned earlier. Cut and paste ALL the info you are wanting into NOTEPAD, make sure each 'peice of EQ' is on a seperate line. Then run a script to %read each line from that notepad file. The reason I cant provide you with a script to do just that is that I'm not good at making loop scripts, which is what you would require.If you want to make this script do something like:
#VAR eqname {}
#VAR eqnum {1}
#ALIAS populateDB {#FILE 1 eqdb.txt;#WHILE (@eqname !="finish") {eqname=%read(1,@eqnum);#IF (@eqname !="finish") {#SHOW {@eqname};#ADD eqnum 1}};#CLOSE 1}

THIS SCRIPT HAS NOT BEEN TESTED! IT WILL CREATE A LOOP, but the functionality hasnt been test. Use this in conjunction with Lightbulb's trigger, and make sure at the very end of the text file you put the word 'finish' on a line of its own(wouldnt hurt to put it a few times) Anyways that should give ya the basic idea.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon May 27, 2002 12:17 pm   
 
For LightBulb's trigger, a simple #READ filename.txt will work. However, as he posted, the different fields of the database need to be created first. Oh and also, all the #ADDKEY's except the first one are missing the first argument which is the name of the record variable.

Kjata
Reply with quote
dacheeba
Adept


Joined: 29 Oct 2001
Posts: 250

PostPosted: Mon May 27, 2002 3:24 pm   
 
quote:

For LightBulb's trigger, a simple #READ filename.txt will work.
Kjata


Oh, sweet, i didnt know the #read command would work like that. I thought each line would have to be saved to a variable and #SHOWed.Learn something new every day :P
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon May 27, 2002 4:14 pm   
 
quote:
Oh and also, all the #ADDKEY's except the first one are missing the first argument which is the name of the record variable.
Oops.
Thanks for catching that, Kjata.

LightBulb
Vague questions get vague answers
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