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
Aiesha
Beginner


Joined: 09 Jan 2002
Posts: 29
Location: USA

PostPosted: Sat Feb 15, 2003 4:37 am   

More Trigger Help Please
 
I have 5 databases L1, L2, L3, L4, and L5. Each one has 3 columns and 8 rows…
Column1 "wearloc"    Column2 "color"    Column3 "name"

Sample Database
    wearloc    color    name
0   Body       &x       L1 Body
1   About      &x       L1 About
2   Over       &x       L1 Over
3   Arms      &x       L1 Arms
4   Hands     &x       L1 Hands
5   Legs       &x       L1 Legs
6   Feet        &x       L1 Feet
7   Waist      &x       L1 Waist

Taking the information from this database it should be sent out to the mud in this way.

Makearmor Body &xL1 Body <---- Would make a piece of black armor called L1 Body
Makearmor About &xL1About
Makearmor Over &xL1 Over
Makearmor Arms &xL1 Arms
Makearmor Hands &xL1 Hands
Makearmor Legs &xL1 Legs
Makearmor Feet &xL1 Feet
Makearmor Waist &xL1 Waist

I need a few variables, I need them to be called curloc, curcolor, curname
curloc should call wearloc from the database, curcolor should call color from the database and, curname should call name from the database

once the armor is done being made i need it to try and repair the peice of armor *repairarmor* incase its broken and then set into a phase that will enhance the armor till it cant be enhanced anymore *enhancearmor*... then i need it to put that enhanced peice of armor into a specified container

After the first piece of armor is created I need it to make the next piece listed in the database and keep going thereafter untill the database has been cycled through completely

These are the actions that must be made to make armor *anything bold is to be sent to the mud and anything italics is what it sends once it receives said text* *anything with single quotes around it only 'curname' must be sent like that to the mud... inorder for it to recognize the curname functioon at a certain time it need those quotes i didnt put it on all the curnames because not all of them need it the ones i put it on MUST have it*

MAKEARMOR
get felt felt
You get a sheet of felt from Felt
get durasteel durasteel
You get a piece of Durasteel from Durasteel Case
makearmor *curloc* *curcolor* *curname*
You begin the long process of creating some armor.
You finish your work and hold up your newly created armor.

REPAIRARMOR
repairarmor *'curname'*
You set to work repairing the damaged armor.
You finish your work and hold up the fully repaired armor. <-- i get this and procede to enhance the armor
It doesn’t look very damaged at all! <-- this is what tells me the armor isnt damaged ... if i get this i procede to enhance the armor


****continued on the first reply as there wasnt enough space to put it all on this one****
Reply with quote
Aiesha
Beginner


Joined: 09 Jan 2002
Posts: 29
Location: USA

PostPosted: Sat Feb 15, 2003 4:39 am   
 
ENHANCEARMOR
get duraplast duraplast
You get some duraplast tubing from Duraplast Case
enhancearmor *'curname'*
You set to work enhancing the armor.
You finish your work and hold up the enhanced armor. <-- Loop back to the top of enhancearmor and begin again
I doubt if you could make that armor any better! <-- this is for when the peice of armor is done being enhanced
put duraplast 2.duraplast
You put some duraplast tubing in Duraplast Case.
put *'curname'* 1
You put *curname* in Layer 1 EQ.


I must have the variables called curloc curcolor and curname and the databases must be called L1, L2, L3, L4, L5

i hope this dosent hinder in any way... if it does please say so and i will try to find a way to work around it.

I also need to have an alias to enter the information into the database..

something like addarmor *wearloc* *color**name*

seeing as how i cant seem to have anymore than one databse open at a time just have it add it to whatever databse is currently open... if thats possible... if not then put something in the alias to ask me to specify the name of the databse ... please

please and thank you
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Feb 15, 2003 10:10 am   
 
First of all, you can indeed have more than one database open. Just use "Open" from the File menu in the database window. You can switch between the open databases using the pulldown menu to the left of the View tabs. There are also some scripting commands which can change the current database.

#AL Makearmor {#IF (%numparam() <> 1) {#SAY Please supply the name of the database only} {#DBLOAD %1;#DBFIRST;doarmor}}
#AL doarmor {#IF %null( %rec) {#SAY Finished} {#VAR curloc {%db( %rec, wearloc)};#VAR curcolor {%db( %rec, color)};#VAR curname {%db( %rec, name)};get felt felt;get durasteel durasteel;~makearmor @curloc %quote( @curcolor)@curname}}
#TR {You finish your work and hold up your newly created armor.} {repairarmor '@curname'}
#TR {You finish your work and hold up the fully repaired armor} {get duraplast duraplast;enhancearmor '@curname'}
#TR {It doesn't look very damaged at all} {get duraplast duraplast;enhancearmor '@curname'}
#TR {You finish your work and hold up the enhanced armor} {get duraplast duraplast;enhancearmor '@curname'}
#TR {I doubt if you could make that armor any better!} {put duraplast 2.duraplast;put '@curname' %copy( @curname, 2, 1);#DBNEXT;doarmor}

USAGE:
makearmor database
Example: makearmor L1

NOTES:
You may have trouble with the & in the color.
This script depends on controlling the current database and record. LEAVE THE DATABASES ALONE WHILE IT'S RUNNING.

LightBulb
Advanced Member
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Feb 15, 2003 10:28 am   
 
#AL addarmor {#PROMPT database "Enter the name of the database";#PROMPT db.wearloc "Enter the wearlocation";#PROMPT db.color "Enter the colorcode";#PROMPT db.name "Enter the equipment's name";#DBLOAD @database;#NEW All @db}

USAGE: addarmor
NOTES: Don't use while you have the makearmor script running.

LightBulb
Advanced Member
Reply with quote
Aiesha
Beginner


Joined: 09 Jan 2002
Posts: 29
Location: USA

PostPosted: Sun Feb 16, 2003 2:30 am   
 
well i used to have another complint here but i took the inititive to try and fix it and whadda ya know i did it... thanks alot LightBulb everything works great i really appreciate it
Reply with quote
Aiesha
Beginner


Joined: 09 Jan 2002
Posts: 29
Location: USA

PostPosted: Sun Feb 16, 2003 3:57 am   
 
well ok iver run into a problem now.... each of the different 5 layers us a different material...

layer 1 uses felt *the triggers work great for this right now*
layer 2 uses cloth
layer 3 uses soft leather
layer 4 uses hard leather
layer 5 uses canvas

can you change it somehow so it will ask me what type of cloth to make it out of and with then go into the appropritate container to get said material

Container ----- Material Inside
Felt ------------ felt
Cloth ---------- cloth
Soft Leather -- soft leather
Hard Leather -- hard leather
Canvas -------- canvas

i suggest changing the makearmor alias to this or something like it

makearmor *database* *curmaterial* ... this ofcourse requires changing the get felt felt thing around to get @curmaterial @curmaterial and then to put it away put @curmaterial 2.@curmaterial other than that thats all i can think of on how to change things to make them work... lemme know what ya thing


oh yes on a side note... i have 5 containers to put the finished armor in... L1's go into 1 ... L2 - 2, L3 - 3, L4 - 4, L5 - 5 can you also perhaps help me making that possible... please and thanks...
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Feb 17, 2003 7:19 am   
 
Since your example included the database in the name column, I already wrote a routine to separate out the container's number from the name field. (This is why real examples are preferred to made-up ones). If it's not working, I'd have to guess you have something else for your real names.
quote:
put '@curname' %copy( @curname, 2, 1)


Are you allowed to have multi-word containers (soft leather, hard leather)? Do they need to be enclosed in single-quotes?

The simplest solution would be to just add a few columns to the database. These should all be Text fields and you should fill in the default value since they will all be identical for any particular database.

Material
MatContainer
FinishContainer




#AL Makearmor {#IF (%numparam() <> 1) {#SAY Please supply the name of the database only} {#DBLOAD %1;#DBFIRST;doarmor}}
#AL doarmor {#IF %null( %rec) {#SAY Finished} {#VAR curloc {%db( %rec, wearloc)};#VAR curcolor {%db( %rec, color)};#VAR curname {%db( %rec, name)};#VAR curmaterial {%db( %rec, Material)};#VAR curMcontainer {%db( %rec, MatContainer)};#VAR curFcontainer {%db( %rec, FinishContainer)};get '@curmaterial' '@curMcontainer';~makearmor @curloc %quote( @curcolor)@curname}}
#TR {You finish your work and hold up your newly created armor.} {repairarmor '@curname'}
#TR {You finish your work and hold up the fully repaired armor} {get '@curmaterial' '@curMcontainer';enhancearmor '@curname'}
#TR {It doesn't look very damaged at all} {get '@curmaterial' '@curMcontainer';enhancearmor '@curname'}
#TR {You finish your work and hold up the enhanced armor} {get '@curmaterial' '@curMcontainer';enhancearmor '@curname'}
#TR {I doubt if you could make that armor any better!} {put '@curmaterial' '2.curMcontainer';put '@curname' @curFcontainer;#DBNEXT;doarmor}

LightBulb
Advanced Member
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