|
tbone235 Apprentice
Joined: 02 Nov 2002 Posts: 107 Location: Australia
|
Posted: Tue Feb 04, 2003 1:16 pm
#Mapquery problem/question |
ok... a few quetions on this... firstly
can something be done to make a query where you can search with more paramaters then just the roomname .. eg
#MAPQUERY {[Name] LIKE '@roomname' AND [Zone] LIKE '@zonename'}
If so... how is it done cause that doesn't work for me.
and Secondly is there a way to access the results of this query... I'll try explain what i mean.
I want to be able to search for a room then with the results run the speedwalk that corrisponds to the area that that room was found in... is this possible or am i wasting my time?
Last but not least (and it has nothing to do with mapquery :P) but with the speedwalk section is there a way i can search the sw section using some function or something then if found run the speedwalk.. so for instance when i ask for a quest and it says,
"Go kill mob in room in area" if i store area in a variable can i then use it to search my speedwalks i have saved and run it if it is found in there?
Thanks for all your help :) |
|
|
|
tbone235 Apprentice
Joined: 02 Nov 2002 Posts: 107 Location: Australia
|
Posted: Wed Apr 09, 2003 10:23 am |
Ok, i have worked out how to this part of it...
#MAPQUERY {[Name] LIKE '@roomname' AND [ZoneID] LIKE '@zonename'}
But I still need to know if i can access the results from the search?
Does anyone know if that's possible. IE. The search may return say 5 rooms with that name in that zone, I want to assign the roomnumbers of each of those rooms to 5 different variables or.. add them all to a list i really dont care, but I can't access the results it seems :( |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Wed Apr 09, 2003 1:35 pm |
You can't do that through the #MAPQUERY command. You are going to have to use ADO to connect to the map database directly.
Take a look ADO Programming in zMUD, to get an idea of how to go about this using zScript.
Another alternative is to create a script that loops through all of the rooms in the map checking to see if it meets your conditions. This solution does not require ADO.
Kjata |
|
|
|
tbone235 Apprentice
Joined: 02 Nov 2002 Posts: 107 Location: Australia
|
Posted: Wed Apr 09, 2003 1:36 pm |
thanks heaps :)
|
|
|
|
Charbal GURU
Joined: 15 Jun 2001 Posts: 654 Location: USA
|
Posted: Wed Apr 09, 2003 5:50 pm |
You can avoid having to manually create a connection by using the one zMUD has already. Just use the %mapfilter function with your query.
However, one thing to note is that ZoneID is a number, not a name so the variable @zonename might be a little misleading.
If you want to get the number of the current zone, you can use the %zonenum function.
- Charbal |
|
|
|
tbone235 Apprentice
Joined: 02 Nov 2002 Posts: 107 Location: Australia
|
Posted: Thu Apr 10, 2003 12:56 am |
Yep, already using the zonenum not the zonename sorry, I just wrote the wrong thing there. But thanks for the tip :)
|
|
|
|
tbone235 Apprentice
Joined: 02 Nov 2002 Posts: 107 Location: Australia
|
Posted: Thu Apr 10, 2003 2:26 am |
ok new problem
The query only works every second time.
I have an alias that i use to search for the roomname and it only works every second time.
Any ideas? |
|
|
|
tbone235 Apprentice
Joined: 02 Nov 2002 Posts: 107 Location: Australia
|
Posted: Sun Apr 13, 2003 10:05 am |
so anyone understand why the query only returns results sometimes?
|
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sun Apr 13, 2003 1:09 pm |
Not really. Try posting the script you already have.
Kjata |
|
|
|
tbone235 Apprentice
Joined: 02 Nov 2002 Posts: 107 Location: Australia
|
Posted: Sun Apr 13, 2003 2:01 pm |
ok here's the script... some variables are in there from last use, but I think you'll be able to see what i'm trying to do.
#CLASS {Quests}
#ALIAS fake {#show You inform Toby that you have completed your quest.;#show Toby tells you 'Congratulations Kragoth on completing your quest!';#show Toby tells you 'As a reward, I am giving you 19 quest points and 388 gold.';#show You gain an extra 2 quest points 'MCCP Bonus'.}
#ALIAS qd {rem second;hold can;enter;s;home;q complete}
#ALIAS dos {#MAPQUERY {[Name] LIKE '%@rname%' AND [ZoneID] LIKE @znum}}
#ALIAS goa {#Exec .@zone}
#VAR rname {The Sitting Room}
#VAR znum {206}
#VAR zone {Winterfell}
#TRIGGER {^QUEST: You may now quest again.$} {#play f:ZmudaardwolfmudSoundsquest.wav}
#TRIGGER {^You inform (*) that you have completed your quest.$} {#T+ "Quests|Complete"}
#TRIGGER {^You gain an extra 2 quest points 'MCCP Bonus'.$} {#T- "Quests|Complete"}
#TRIGGER {^~*~[NOEXP~]~* You inform (*) that you have completed your quest.} {#T+ "Quests|Complete"}
#TRIGGER {^You ask (*) for a quest.$} {#T+ Roomname}
#CLASS 0
#CLASS {Quests|Complete}
#TRIGGER {^(*) tells you 'As a reward, I am giving you &qp quest points and &gp gold.'$} {gt "@B"Quest complete: "@G"@qp+2 "@M"qp ~@Wand "@R"@gp "@Y"gold;#unvar qp;#gag;#unvar gp;#gag}
#TRIGGER {You get lucky and gain an extra (*) quest points.} {gt "@R"Whee! bonus "@W"%1 "@R"qp :)}
#TRIGGER {^~*~* You gain a bonus trivia point! ~*~*} {gt "@RW00t bonus @WT@BR@MI@GV@CI@YA@w!!"}
#CLASS 0
#CLASS {Quests|roomName}
#TRIGGER {^(*) tells you 'of (*) which is in the general area'} {rname = %trimright( %trimleft( %2));rname = %replace( @rname, "'", "''");#T+ zoneName;#T- roomName}
#CLASS 0
#CLASS {Quests|zoneName}
#TRIGGER {^(*) tells you 'of (*).'} {zone = %2;#if %begins( @zone, The) {zone = %remove( {The}, @zone)} {zone = @zone};#if %begins( @zone, A) {zone = %remove( {A}, @zone)} {zone = @zone};zone = %trim( @zone);znum = %zonenum( @zone);#T- zoneName}
#CLASS 0 |
|
|
|
|
|