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 Goto page 1, 2  Next
Droid
Novice


Joined: 28 Aug 2003
Posts: 49

PostPosted: Sun Aug 31, 2003 3:46 pm   

Zmud really usefull... just for programmers??
 
Hi, i have being searching on the posts for 5 hours at least,and i have read any help zmud provides for trying to fix that,but i didnt succed,and like me,i have seen in other posts,much other people...

Im having some issues with zmud 6.62 version,issues i didnt have with 6.16.

The main one,is that i cant use the button Find,on maps menu,or the command #find,suposed to teleport me to the room where i am.
This comand worked me perfectly on version 6.16,and i have all the maps stuff already well configured,it can create rooms perfectly,recognices all exits,and CANT use the command find,dunno why.(i think that can be a bug,look out that post:http://www.zuggsoft.com/forum/topic.asp?TOPIC_ID=12272)
Any way of fixing that? (like i have seen in posts,some others have that issue and no help is provided for them...)

The other thing,is,Mapquery seems to be a really great command,but,i didnt find any way on your database to use it in order to be able to find rooms and add theyr vnums into variables,the nearest thing i found is:
#ALIAS FindMap {#IF ("%-1"="") { #ECHO Roomname required.} {PossibleRooms="";#ECHO Searching...;#LOOP 1,%numrooms { #IF (%roomname(%mapvnum(%i))="%-1") {#ADDITEM PossibleRooms %mapvnum(%i)}}}}

but that is for older versions of zmud and doesnt work properly for me...

Thats why i say... if i cant find on your database how to use that command... i can just come to cry to this forum and hope someone helps me? Sad
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Sun Aug 31, 2003 6:25 pm   
 
The above script did not work because it was not complete.

check out #MAPQUERY in the help files.
#DESCRIBE
%roomname([any num of room])

These and more like it are just a few examples of how to get what you want done.

As for the problem, I do not have that problem
BUT I upgraded from 6.16ver to 6.5ver to 6.62ver

Tell me exactly what you would like to do and I will endever to create it for you.
Reply with quote
Droid
Novice


Joined: 28 Aug 2003
Posts: 49

PostPosted: Sun Aug 31, 2003 7:34 pm   
 
Ok,first of all,thanks for being so nice and for your help.
Second,i did already check out #MAPQUERY in the help files,but as i wanted to say,i found nothing about how to do what i want...

What i exactly want with mapquery is,when the questman says to me the room where the quest is,to find all the rooms which have same name (actually the command to do that is #MAPQUERY {[Name] LIKE '@roomname'}) and,instead of popping up a window with the rooms,just get into different variables the roomvnum of all thoose rooms :)
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Mon Sep 01, 2003 4:33 am   
 
well yes exactly. if you type "street" inplace of the @roomname it will bring back a list of all the streets with 'street' in them.
how is it supposed to know wich one.
But if your more spusific like 'hawk street' or even more to the point 'an intersection crossing hawk and falcon' the it will return that exact room in a list form.

My above examples where to lead you down the right path not to give you the answer.

What I take from you is that you would like to have a trigger for quest man telling you the room name and then it finds it on the map and brings it into view?
Reply with quote
Droid
Novice


Joined: 28 Aug 2003
Posts: 49

PostPosted: Mon Sep 01, 2003 11:05 am   
 
Actually,i did already know how to use that command,and @roomname is a variable,to which the room name of the quest goes whenever i ask for a quest ^^

But,lets say i wanted to do next:
#tr {The questmans tell you to search on "%1"} {#MAPQUERY {[Name] LIKE '%1'}}

I dont want zmud to bring results into view,what i want to get is a list of the room vnums on diferent variables,so i can use other tiggers to go searching on each room.
A view would only be usefull if i was gonna be there every time i ask for a quest,and i wanna get a robot to do that ;)

Thanks again for your help.
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Tue Sep 02, 2003 3:07 am   
 
#CLASS {find_room_num}
#VAR new {}
#VAR new2 {}
#TRIGGER {ml (*)} {#var new "";#var new2 "";#LOOP %numrooms {#addi new %roomname(%roomvnum(%i))~*%roomnum(%roomvnum(%i))};#loop %numitems(@new) {#if %begins(%item(@new,%i),"%1") {#addi new2 %i}}}
#CLASS 0

I believe this will do it
Reply with quote
Droid
Novice


Joined: 28 Aug 2003
Posts: 49

PostPosted: Tue Sep 02, 2003 10:06 am   
 
Actually,i dont really understand the full loop,but there is,at least,1 problem:
i use #echo %numrooms
and i get 4999 as this number,then i go to spreadsheet view,and i see over 5020 rooms,so the loop wont search them all,will it? :|

Another thing is,#mapquery comand is really faster than a loop,that loop we got we dont know whenever the loop has finished,and id really like to use this instead of loop,mapquery gives instant answers to requests,but it shows info in a way i dont wan to... :_|

Another thing,i did a search,used Ml La armeria,a room which i know i have 3 times,and @new got over 180 rooms :_(

Well hope someone helps me to understand and use mapquery comand...

Thanks Megamog for your help.
Reply with quote
Droid
Novice


Joined: 28 Aug 2003
Posts: 49

PostPosted: Tue Sep 02, 2003 12:30 pm   
 
http://www.zuggsoft.com/forum/topic.asp?TOPIC_ID=11388

What a topic!!

This is almost perfect... the only thing i need now is to get the found rooms into vnums,instead of showing it :)
Reply with quote
mj_cole
Wanderer


Joined: 19 Apr 2001
Posts: 59
Location: USA

PostPosted: Tue Sep 02, 2003 1:09 pm   
 
can you not replace "#ECHO @rs.GetString" with "#var ListOfRooms @rs.GetString" ?
Reply with quote
Droid
Novice


Joined: 28 Aug 2003
Posts: 49

PostPosted: Tue Sep 02, 2003 1:24 pm   
 
That will only save rooms to a variable,will do nothing with room vnums.

I think what i must thange is:
#VARIABLE rs @Conn.Execute( %concat( "SELECT z.name, o.name FROM ObjectTbl o, ZoneTbl z WHERE o.name LIKE '%", %-1, "%' and o.zoneid = z.zoneid ORDER BY z.name, o.name"))

so it gets the vnums,later,the job will be almost done,instead of echo,as you sayd,ill only have to use #var ListOfRooms @rs.GetString or perhaphs ill have to use additem and thoose comands.

But i dunno how to touch that command line :|
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue Sep 02, 2003 4:39 pm   
 
It's not as easy as you'd think. The script you mention doesn't care if more than one room matches the criteria, it will just get the name of the zone of the first room that matched and displays it. For what you want, you would have to iterate through all of the recordset and extract the vNum out of each record to build your list of vNums.

However, there is another way of doing what you want. There is a function in zMUD called %mapfilter that works in a similar way as #MAPQUERY. What you want to do is to first use the same query string that you use with #MAPQUERY, on %mapfilter. Example:
#CALL %mapfilter("Name LIKE '%temple%'")

What this does is to filter the rooms that the mapper functions "see" into only those rooms that match your criteria. Therefore, you can now do this:
#LOOP 1,%numrooms() {#SH %mapvnum(%i)}

And it should display the vNums of only those rooms that matched the criteria for the filter. After you are finished, you can clear the filter with:
#CALL %mapfilter("")

Note: I have not tested the script, but some playing with %roommode may be necessary.
Reply with quote
Droid
Novice


Joined: 28 Aug 2003
Posts: 49

PostPosted: Tue Sep 02, 2003 5:01 pm   
 
Actually the script i said did find all the rooms with same name,and show to me when the echo,including the rooms with name longer but with same starting than the one i tryed.
That way:
Roomname1 Roomzone name
Roomname2 Roomzone name
... ...

And that with all matches =)

Anyway,what you have given to me works too,so thanks for your help :)
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue Sep 02, 2003 5:15 pm   
 
Yes, it does find them all. However, extracting the vNum out of each one is not as simple.
Reply with quote
Droid
Novice


Joined: 28 Aug 2003
Posts: 49

PostPosted: Fri Sep 05, 2003 10:25 pm   
 
Mhm i try to write them all on an alias,and that alias doesnt work...
#alias {findroom} {#CALL %mapfilter("Name LIKE '%temple%'");#LOOP 1,%numrooms() {#SH %mapvnum(%i)};#CALL %mapfilter("")}
while that does work if i write line by line
I tryed with findroom XXX and changing temple by %1,and did same as trying just findroom,echos next:
-1
-1
and no more.
any ideas? :|
Reply with quote
Droid
Novice


Joined: 28 Aug 2003
Posts: 49

PostPosted: Sat Sep 06, 2003 1:46 am   
 
I did also try a tigger that way:
#trigger {findroom *} {#CALL %mapfilter("Name LIKE '%%1%'");#LOOP 1,%numrooms() {#SH %mapvnum(%i)};#CALL %mapfilter("")}

And then when i try:
findroom Any Room Name
it gives me wrong entryes :|
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Sep 06, 2003 5:41 am   
 
The reason it doesn't work when you changed "temple" to "%1" is you ended up with %%1 the parser can no longer tell that you want %1 expanded then sent within the string to the %mapfilter function. The proper way to control the expansion, in this case, is through the use of the %concat function (as shown in the %mapfilter help page).

#alias {findroom} {#CALL %mapfilter(%concat("Name LIKE '%",%-1,"%'"));#LOOP 1,%numrooms() {#SH %mapvnum(%i)};#CALL %mapfilter("")}

I also changed your choice of %1 to %-1 so more then 1 word can be matched on.
Reply with quote
Droid
Novice


Joined: 28 Aug 2003
Posts: 49

PostPosted: Sat Sep 06, 2003 9:45 am   
 
Yup,now works perfectly,thank you =)
Reply with quote
Droid
Novice


Joined: 28 Aug 2003
Posts: 49

PostPosted: Sat Sep 06, 2003 11:09 am   
 
Mhm now what i want to do is to get thoose results into different variables,so i can later use speedwalk with each,and zmud acts like a robot going to each one,and i have tryed next:
same alias,this value:
#CALL %mapfilter(%concat("Name LIKE '%",%-1,"%'"));#LOOP 1,%numrooms() {#sh %mapvnum(%i)};#LOOP 1,%numrooms() {#VAR salas {%replace( "%mapvnum(%i)", ", ", "|")}};#CALL %mapfilter("")
I think that must be a similar problem,shouldnt a list of rooms get into salas var?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sat Sep 06, 2003 11:54 am   
 
Use #ADDITEM instead:
#ADDITEM salas {%mapvnum(%i)}
Reply with quote
Droid
Novice


Joined: 28 Aug 2003
Posts: 49

PostPosted: Sat Sep 06, 2003 1:28 pm   
 
Oki,now there is 1 more thing for finishing my script... then ill have a full questmaker robot ready!!

I got @salas with a list of the possible rooms where the quest is.Id like to restrict them just to zone where they can be, i tryed to do that by changing that line on the alias:
#CALL %mapfilter(%concat("Name LIKE '%",%-1,"%'"))
with
#CALL %mapfilter(%concat("Name LIKE '%",%-1,"%'" and zone like '%",@questzone,"%'"))
but didnt get it :|
I want to walk 1st,to 1st of the rooms.
then using onwalkend,erase this last room,%delitem,and walk into second,and so on untill all rooms on the ZONE are visited or quest is reached.
What would happen if zmud doesnt find out how to reach that room,how to make it jumps to next?
What would happen if i dye during going to a room,and i got tiggers to get ready again,but,i go to recall... and then how to start walk again? (step wont do that because it will start from where i was when i dyed)

I understand if you dont wanna help me,im asking 2 mutch,but i did already try it for my self and think i will never reach that alone... this is just that last step for getting the whole robbot... thank you for all your help :_)
Reply with quote
Droid
Novice


Joined: 28 Aug 2003
Posts: 49

PostPosted: Sun Sep 07, 2003 12:59 am   
 
Ok,i got 2 things:
For starting to do the quest,i do next:
#stop;recall;#wait 5000;#walk %item(@salas,1) @questreino
(things before walk item are for stoping and preventing the rest of walkings to break the new important slowwalk)
it does go to the first room,and then is where i got 1st problem:
i try to use onwalkend alias,and,after quiting and reconnecting to that character,there are 2 onwalkend aliases,and i feel mine one is not listened =(
#alias onwalkend {#if (questsino 1) {#delnitem salas 1;#walk %item( @salas, 1) @questzone}}
questsino is a variable,which is 1 whenever im doing the quest.

Whats wrong with that? why there is a new and empty onwalkend everytime i go out and come back to zmud?

How could i get zmud go directly next on thoose 2 cases:
it doesnt find a walk way to the required room.
The room is on another zone,so i dont want to go there.

Thank you :)
Reply with quote
Droid
Novice


Joined: 28 Aug 2003
Posts: 49

PostPosted: Sun Sep 07, 2003 3:27 pm   
 
phew i have being studing more about that and now i got next:

#if (@questzone zone1) {#CALL %mapfilter(%concat("Name LIKE '%",%-1,"%'" AND [ZoneID] LIKE '57' ));#LOOP 1,%numrooms() {#ADDITEM salas {%mapvnum(%i)}};#CALL %mapfilter("")}
(the zone id,which i see by using #echo %zonenum,in case zone is zone1,is 57)
Shouldnt that search for all the matching rooms on that zone?? Why does it match with all rooms,doesnt mind the name matches or not? how to solve that? :|

The other problem i still have is,onwalkend doesnt work,while if i write down the command on the orders bar,thoose comands work.
How to get onwalkend being used as alias when i finish the walking?? i think that problem must be related to 2 same name aliases appearing,when i modify onwalkend,quit zmud,and come again,there are 2,one of them empty,and other full :(

Any ideas?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Sep 07, 2003 8:46 pm   
 
I'm not particularly knowledgeable about the mapper or SQL, so I hope other people can answer your questions regarding #MAPQUERY.

onwalkend is a system alias which is automatically called at the end of a walk. The system settings file contains a placeholder for it and also for all the other system aliases. These placeholders are inherited settings and consist of the alias name with no commands. This is so that when the system calls one of them, nothing will be done unless you've created an alias of your own.
ALTERNATE EXPLANATION: At the end of a walk, zMUD calls "onwalkend". zMUD has a default "onwalkend", with nothing in it, so nothing gets sent to the MUD. If there was no "onwalkend" alias, "onwalkend" would be sent to the MUD. The MUD would typically respond with "Huh?"

Character specific settings override default settings, so all you have to do is create your own alias. This will automatically replace the placeholder even though they both show up.
Reply with quote
MartokShiva
Beginner


Joined: 27 Aug 2003
Posts: 14
Location: United Kingdom

PostPosted: Fri Dec 05, 2003 4:44 pm   
 
quote:
Originally posted by Droid
#if (@questzone zone1) {#CALL %mapfilter(%concat("Name LIKE '%",%-1,"%'" AND [ZoneID] LIKE '57' ));#LOOP 1,%numrooms() {#ADDITEM salas {%mapvnum(%i)}};#CALL %mapfilter("")}


Ok.. this is an sql syntax error.. it should be

#if (@questzone zone1) {
#CALL %mapfilter(%concat("Name LIKE '%",%-1,"%' AND ZoneID = 57"))
#LOOP 1,%numrooms() {
#ADDITEM salas {%mapvnum(%i)}
}
#CALL %mapfilter("")
}

You want an exact match so should use "=" not "like" on the ZoneId, also a ZoneId I think is numeric, not character data, so no quotes. Finally putting [] around a word is only needed if the word is an sql reserved word.

Note: I have not tested this code, but I do a lot of SQL at work, and this should do the job. LIKE matches are VERY slow, so should only be used where absolutally necessary.
Reply with quote
Smokabul
Novice


Joined: 27 Sep 2002
Posts: 37
Location: USA

PostPosted: Thu Mar 04, 2004 8:00 pm   
 
MY room names are always exactly right, so what would be the correct way to change the Like to = (i have tried for hours to figure it out)

#CALL %mapfilter(%concat("Name Like '%",%-1,"%'"))
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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