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
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Sun Feb 04, 2007 9:03 pm   

Capturing/getting info from map db if needed
 
Hello,


I know i have already written a similar thread cpl days ago but figured I'll do it again while trying to give exactly what I need to be done.

First off, I'm capturing a line from MUD with a syntax:

Code:

You still have to kill (amount) * mobname (areaname or room name within an area)


I'm doing it simply by #capture'ing the 'You still have to kill' line together with given amount. Not smart enough to do it any other way, really. But thats not important atm, though.
What is important is that I'd like the given captured line to interact with Map DB *within* the captured window. The line itself is usually given twofold, it either gives area name (in which case I wouldn't need any interaction with Map DB) OR it given room name (within some area) in between those bracets. What I do need now, is that if that is the case, it'd run a loop through Map DB, preferrably with exact find option to find the correct Area to go together with that Room Name. First idea I could think of is that there could be some sort of level check for the character and based on the level it gives, it'd take the best possible choice for Area.
That being done, it should print that Area Name by the Room Name *into* captured window. It could look something like that:

Code:

You still have to kill 1 * mob (Room Name)
--->>>Area is:


One way to do it imo is to have a variable what'd kick in when the given line is with room name only, how to accomplish that, I don't know, though.

Anyway, I'm really really grateful if someone could help me out here.
Thanks in advance.

Prog
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Mon Feb 05, 2007 12:13 am   
 
if you want the window to respond to the text you send it... makes the DB triggers within the child window
just remember to save the settings for the child window from the Setting Menu, the window needs focus for that

#WIN windowname {your formatted text here.}
_________________
Discord: Shalimarwildcat
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Mon Feb 05, 2007 3:27 am   
 
ok....

But I still need help with doing those triggers, though.


Thanks


Prog
_________________
The Proud new owner of CMud.

--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
--------------------------------
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Wed Feb 07, 2007 2:02 pm   
 
figures no one will help then ?



Prog
_________________
The Proud new owner of CMud.

--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
--------------------------------
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Wed Feb 07, 2007 2:27 pm   
 
If nobody helps by the time I get in from work this evening I'll take a stab at it.

Can't promise anything yet though. I'll let you know something regardless. It could be tomorrow before you see the post one way or the other.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Wed Feb 07, 2007 7:46 pm   
 
OK, I'll wait for your reply then :)

And thanks a lot in advance.


Prog
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Thu Feb 08, 2007 1:03 am   
 
I stole and edited the stuff Vijilante wrote up for you in the other thread.

First delete your class named TargetCaptures if you still have it.
Then copy and paste the code from inside the code box into your command line and hit enter.

Code:
#ALIAS DisplayTargets {TempTargets = %mapquery( %concat( "Name LIKE '", %-1, "%'"));#noop %roommode( 1);#FORALL @TempTargets {#window Targets {%concat( "Zone: ", %zonename( %roomzone( %i)), ": Room: ", %roomname( %i), ":")}};#noop %roommode( 0)} "TargetCaptures"
#VAR TempTargets {} {_nodef} "TargetCaptures"
#TRIGGER "TargetCap" {^You still have to kill * ~((*)~)$} {:Targets:#CLR;#capture Targets 1;DisplayTargets %replace( "%1", "'", "''")} "TargetCaptures"


First this creates a window named Targets if there is not one already.
Then it clears the window of text if there was some in it already.
Then it puts a copy of the line telling you how many you have to hunt and where into it.
Finally if it finds any matching room names in the mapper it will give you a list of them.

continued in next post...
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Thu Feb 08, 2007 1:17 am   
 
Now, I do not know what mud you play on so I obviously don't have a map of it to test with. I used a map of Avalon for these results.
Also you did not explain or give examples of the trigger text showing you when the creature is in another area/zone. This made me unable to filter the results based on if the poor things ARE in another area/zone.

These and other limitations of information make it hard to know what you want without more input from you.
I tested this using the following line and got the results below.

Trigger text: You still have to kill 5 rats (Street)

Main window shows: You still have to kill 5 rats (Street)

Targets window shows:

You still have to kill 5 rats (Street)
Zone: Mercinea: Room: Street by pier.:
Zone: All: Room: Street by the apothecary.:
Zone: All: Room: Street by village mill.:
Zone: Mercinea: Room: Street outside a small house.:
Zone: Thakria.: Room: Street of the glorious dawn.:
Zone: Thakria.: Room: Street of the glorious dawn.:
Zone: All: Room: Street to Mercinae.:

You will notice that these are not EXACT matches. I added a wildcard to the query at the end.

%mapquery( %concat( "Name LIKE '", %-1, "%'"))

Without the wildcard it would look like this.

%mapquery( %concat( "Name LIKE '", %-1, "'"))

But I was not certain just WHAT your real output contained and wanted you to have the best possible chance of getting ANY output.

You stated in the other thread that you had some small working knowledge of how to use %mapquery etc. I think this would be a good starting point for you to try and alter the above to more suit you.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Thu Feb 08, 2007 2:49 pm   
 
Okay, going to try explaining more adequately then. First of all, I need the map DB search function to kick in together with captured line. Let me explain it, though. Atm, after I have done an alias, lets say 'gg', it captures all the lines with 'You still have to kill' from main window into a capture window, thats it. What I need to be done is that when the said lines gets captured into a subwindow, it would trigger the search for ma p DB. Basically, I don't need any more extra aliases. The way in which order the things are supposed to work (given that the info in 'You still have to kill' line's bracers () is that of a room name), should look like this:

Code:

Typing gg - > lines with 'you still have to kill' go into captured window -> every 'you still have to kill' line with different location triggers a search from map DB.


Now, there's 2 other issues. One's that of a case when given line has Area name in it. In that case I don't want it to issue any kind of search from map DB. Though, I have no idea how to accomplish that. Second thing is the one you mentioned as well, exactness problem. Basically, lets say there's a room name called Kitchen. With usual search, the way i see it, it'd give whole lot of answers because thats one of those room names that exists a lot out there. Now, I do know, however, that you can do an exact search for room name via map DB. That, however, is only doable in my case, when all that search thing knows my current level. Let me give you an another example just to be clear:

Code:

captured line: You still have to kill 2 * rat (Street)
1) with 'default' map search it would most likely give pageload of Streets or whatever else room names with word street in it, right
2) exact map search would give replies based on EXACT syntax of the word, thus it'd only returns 'Street'-s with different areas
3) Now, enormous amount of returns are no use to me, only the ones in my current level's vast vicinity are. Hence, I'm thinking
of following myself but as usual, have no idea how to accomplish that. Somehow, the exact map DB search should check my current
level first, I think it should be doable, I'm having a simple Variable for that which tracks my level and it could most likely just check that variable, its called @mylevel.


I'm really unable to be any more exact, heh. Thats exactly how I picture it in my mind's eye and maybe it isn't possible to do at all. As said earlier, I don't have much knowledge about scripting and even more so what concerns scripting with map stuff.
Hopefully though, you can help me out here, I'd really appreciate it a lot :)

Thanks in advance, again.

Prog
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Thu Feb 08, 2007 3:18 pm   
 
Ok, I started to play with the script you suggested for me in your most recent post. Forget almost everthing i was yapping about in my own last post :P Replaced the mapquery line without wildcard and exact search is working awesomely now :) anyway, there's still some stuff I can't get passed from myself. How to make script disable the search when I don't have room name between bracers () but an area name? Thats really the only thing that needs to be set that I can think of atm, other than that I think sadly checking my current level vs replies from map DB won't work because there's no way for it to work because map DB doesn't have info about what level the areas are etc. It shouldn't be all that bad though because there really aren't that many rooms which will be completely identical, heh.
Anyway, I think I'm pretty much set after we will be able to figure out how to exclude Area names from search somehow. I don't really know enough to give have an educated guess, though.
Really big thanks already for what you have done and thanks in advance.

Prog
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Thu Feb 08, 2007 3:50 pm   
 
Ran into a new problem now though, namely in your script, you're noop'ing roommode to 0 but I really can't have it because for another script of mine its crucial that 'use room name instead of Vnum' option stays checked. Have any way of leaving it untouched so that script could still work? I removed noops with 0 but now it doesn't work at all. Most likely true that just removing them isn't solving a thing but maybe there's a way to replace them with something so that my current 'setup' won't get disturbed by it.

Thanks :)



Prog
_________________
The Proud new owner of CMud.

--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
--------------------------------
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Thu Feb 08, 2007 3:56 pm   
 
As I mentioned above I can't do more without more information. Here is what I meant.

I need to have a line from your mud pasted in your post that you see when you only get an area name instead of a room name.

I need to have a line from your mud pasted in your post that you see when you only get a ROOM name.

I need a line from your mud that you get when you get both. IF you get both.

I need some explanation as to how I would know the difference.

It is strictly possible to do a search on levels based on your level. But you would have to create a database variable that lists what zones on your map can be safely used by what level persons.
I believe you did post the name of the variable you use to keep track of your own level.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Thu Feb 08, 2007 4:02 pm   
 
Hrm, if you just noop it back to 1 at the end of my script instead of removing the noop to 0 it should work.
I was thinking 0 was the default is the ONLY reason I changed modes at all. My scrip requires that it be in 1 mode to work.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Thu Feb 08, 2007 6:26 pm   
 
Yup, changed that other #noop to 1 as well and now its working without interfering with the setup I'm currently having. Line with Area name at the end of it and line with Room name are identical, btw, but just in case I'll give 'em once more then.

Code:

You still have to kill 2 * rat (Street)


Thats the example for ROOM NAME.

Now, example if its AREA NAME.

Code:

You still have to kill 2 * rat (Sewers)


There ya go. The thing is that syntax for both of them seems identical at least for me, they can both be more than one word etc, too, so I really don't know how to make a difference, but maybe you do. Though, maybe there's no need to do anything, meaning if I'm understanding it correctly the script won't give any replies back when it can't find the given 'room name' anyway, so if we'd think that it acts the same way with whatever else it needs to search DB for, maybe it just won't give any replies and thats it. Just a thought.

Now, there's one other thing I need to get working to have it more or less precicely as I need to.

The given 'You still have to kill' line can come threefold. The amount of mobs needed for killing are either 1, 2 or 3. What I want is, however, that it'd color the multiply amount mobs lines differently in captured window. To be more clear, let me give you example of how it works for me atm with simple capture trigs:

First captured line:
Code:

You still have to kill 1 -> #CW green;#CAP mobs


Second captured line:
Code:

You still have to kill 2 -> #CW yellow;#CAP mobs


Third captured line:
Code:

You still have to kill 3 -> #CW red;#CAP mobs


Basically, those 3 lines show up in different color in captured window. The thing with using your script, however, is that I'm unsure how to set them up in there. Help would be greatly appreciated :)

Thanks in advance.


Prog
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Sun Feb 18, 2007 4:16 pm   
 
well, seems I still haven't got any more feedback on the things i have formentioned in this thread so I figure I'll throw in another troublesome thing and perhaps someone will pick it up.

The script Arm made is working and doing everything I wish it'd do, with one exclusion. The "You still have to kill" line I need to have captured and map DB search made isn't just only one line per se, if you understand what I mean.Basically, Arm's script seems to do only one search through map DB per one line only. My problem is that generally I'm getting 10+ lines with "You still have to kill" at once and they all need to be captured and a search needs to be done for each of them. I retried several times with Arm's script and it still only makes a search for one line only so I guess its still missing something. But I know too little to figure it out myself....


Prog
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Tue Feb 20, 2007 6:08 am   
 
I'm sorry mate. I haven't been looking at every post because I have been busy and I didn't see that you had asked anything else.

I'll start with the one answer per kill problem.
Quote:

My problem is that generally I'm getting 10+ lines with "You still have to kill" at once and they all need to be captured and a search needs to be done for each of them.


I placed the
:Targets:#CLR
command in the script I gave you. Try removing it and see how you like the results.

Now for the colored text in the captured window.

Quote:
The given 'You still have to kill' line can come threefold. The amount of mobs needed for killing are either 1, 2 or 3. What I want is, however, that it'd color the multiply amount mobs lines differently in captured window. To be more clear, let me give you example of how it works for me atm with simple capture trigs


Create the color triggers in the capture windows mud file. Basically click on the captured windows output and hit the triggers button. Make your color triggers there.

Finally, If you have no idea how to tell the difference between a room name and a Zone/Area name. I cannot help more.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Tue Feb 20, 2007 9:08 pm   
 
Thanks a lot, deleting the :Targets:#CLR worked and its giving out all the info I need now.
Furthermore, did as you suggested and made #CW triggers into Target window setup itself and it works now as well :)

Thanks a lot for all the help, I really appreciate it.



Prog
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