Metho Beginner
Joined: 10 Jul 2005 Posts: 28
|
Posted: Sun Jul 31, 2005 9:36 pm
So close, yet so far. WHILE AND ALARM |
I've been working on this, everything works except the very last part of it. I have this:
Code: |
#CLASS {readAllCrafts}
#TRIGGER {^&%dItem.ID%s%w%s&%wItem.ItemT%s*$} {
#DBLOAD crafts
#NEW All @Item
#VAR Item ""
}
#TRIGGER {Type MORE to continue reading. ~(%d~% shown~)} {more}
#TRIGGER {Total: &%dtotal} {
#DBFIRST
#DBNEXT
artisan &ItemT &ID
#WHILE (!%null( %rec)) {
#T+ blanklines
#ALARM +5 {
#DBNEXT
artisan &ItemT &ID
}
}
}
#TRIGGER "blanklines" {$} {
#ADDKEY {Org=@Item.Org|Comms=@Item.Comms|Space=@Item.Space|FurType=@Item.FurType|Outdoors=@Item.Outdoors|Container=@Item.Container}
#ADDKEY {Lock=@Item.Lock|Appearance=@Item.Appearance|Dropped=@Item.Dropped|Examined=@Item.Examined|Comments=@Item.Comments}
#DBSAVE crafts
#SAY Item added to database.
#T- blanklines
}
#TRIGGER "tExaminedOutPut" {(*)} {#if ("%1" != "Comments:") {Item.Examined = %concat( @Item.Examined, "%1")} {#T- tExaminedOutput}}
#TRIGGER {Appearance:} {}
#COND {(*)} {Item.Appearance = "%1"}
#COND {Dropped:} {}
#COND {(*)} {Item.Dropped = "%1"}
#COND {Examined:} {
#T+ tExaminedOutput
Item.Examined = ""
}
#TRIGGER {Can Have Lock: &Item.Lock} {}
#TRIGGER {Comments:} {}
#COND {(*)} {Item.Comments = "%1"}
#TRIGGER {Container: &Item.Container} {}
#TRIGGER {Furniture Type: &Item.Furtype} {}
#TRIGGER {Org: &Item.Org} {}
#TRIGGER {Outdoors: &Item.Outdoors} {}
#TRIGGER {Outlay: &Item.Comms$} {}
#TRIGGER {Space: &%d{Item.Space}~%} {}
#CLASS 0 |
Basically, it calls the list of everything, gets the item number and category of each item and stores it in the DB. Then it's supposed to starting at number 1, go through each record and do <artisan *CAT *ID*> which sets off all my other triggers, which work fine. So, basically, the only thing I'm having trouble with is this trigger:
Code: |
#TRIGGER {Total: &%dtotal} {
#DBFIRST
#DBNEXT
artisan &ItemT &ID
#WHILE (!%null( %rec)) {
#T+ blanklines
#ALARM +5 {
#DBNEXT
artisan &ItemT &ID
}
}
}
|
Firstly, don't worry about the dbfirst and then next right away, it's intentional because my first record is a dummy one. I thought the WHILE statement would work good to loop through all the records, but when it goes off, it submits the first one in an endless loop for 5 seconds, then the next, and so on. Reason being is I just want a bit of a pause between each record so as not to overload the mud or db. So, I'm not sure how to create that pause and still loop the DB. I'm under the impression that WAIT will pause all other triggers, so that's out...
Any suggestions? |
|