|
Borbarad Newbie
Joined: 10 Feb 2005 Posts: 9
|
Posted: Wed Apr 13, 2005 6:11 pm
#SHOWDB %dbget(%query --> multiple outputs |
I have a mob database. When i stand in a room i type rinfo which executes the alias on the bottom. The alias should give me the information
of the mobs who are in the current room. It works apart from the fact:
If there are more than one mob assoziated with the room then it will just show one mob, but i want that all mobs (assoziated with the room) are displayed. Any ideas?
#SHOW %crlf-------------------
#SHOW %roomname (%roomkey)
#DBLOAD mobs
#SHOWDB %dbget( %query( (&Room=%roomkey), currentroom))
#SHOW -------------------
Thx a lot,
Marcel Honstraß |
|
|
|
Private Adept
Joined: 10 Jan 2002 Posts: 264 Location: USA
|
Posted: Thu Apr 14, 2005 7:05 am |
#ALIAS mobfindroom {data = %query( &mob_roomname=%roomname)
numitems = ""
@numitems = %numitems( @data)
#IF (%numitems( @data) = 0) {
#SHOW %crlf-------------------
#show %ansi( high, white) Not found in database or bad spelling
#SHOW %crlf-------------------
} {
#FORALL @data {
#SHOW %crlf-------------------
#SAY %ansi( high, white) %replace( %replace( %replace( %replace( %replace( %replace( %replace( %replace( %stripansi( %dbget( %i)), mob_level, "' Lvl: "), mob_name, " Name: '"), mob_zone, " Area: "), mob_align, " Align: "), mob_speedwalk, " Speedwalk: "), mob_roomname, " Room: "), "mo ", " "), Notes, " Notes: ")
}
}
}
the basic part of my show is:
#SAY %ansi( high, white) %stripansi( %dbget( %i))
youll need to add your own %replace's like mine above with your db field names to make it look pretty. |
|
|
|
Borbarad Newbie
Joined: 10 Feb 2005 Posts: 9
|
Posted: Thu Apr 14, 2005 10:16 pm |
Cool, thank you! Your post helped me alot!
Here is my outcome:
#DBLOAD mobs
#DBRESET
data = %query( &Room=%roomkey, All)
#SHOW %crlf%roomname (%roomkey) --- Inhalt:%numitems( @data)
#SHOW ----------------------------
#IF (%numitems( %trim( @data)) <= 0) {
#show %ansi( high, white) Mob: Not found in database
#SHOW ----------------------------
} {
#FORALL @data {
#SHOWDB %dbget( %i)
#SHOW ----------------------------
}
} |
|
|
|
|
|
|
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
|
|