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
Articval
Novice


Joined: 01 Jun 2005
Posts: 47

PostPosted: Wed Apr 09, 2008 5:48 pm   

Find room trigger working till now :|
 
Hey!

I have been using this trigger to find my rooms with perfect results untill now, but the mud implemented some rooms with the high coma, so it does not work with them! im sure there must be an easy and fast correction to do...
Thankyou!!

Here is the trigger:

#CALL %mapfilter(%concat("(Name LIKE '",The wolf hiding place,"') AND (ZoneID = ",%zonenum( @zona ),")")))
#LOOP 1,%numrooms( ) {#ADDITEM salastestborrar {%mapvnum( %i)}}
#CALL %mapfilter("")

With that worked perfectly, but:

#CALL %mapfilter(%concat("(Name LIKE '",Somewhere'buggy,"') AND (ZoneID = ",%zonenum( @zona ),")")))
#LOOP 1,%numrooms( ) {#ADDITEM salastestborrar {%mapvnum( %i)}}
#CALL %mapfilter("")

With that qwerry for "Somewhere'buggy" it will return all the rooms on the list :(
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Wed Apr 09, 2008 6:23 pm   
 
Try replacing your ' with '' instead (two single quotes, not a double quote). I suspect the single quote is confusing the function's underlying search query statement.
Reply with quote
Articval
Novice


Joined: 01 Jun 2005
Posts: 47

PostPosted: Wed Apr 09, 2008 7:52 pm   
 
Mhm didnt work Sad

I simplified the problem, just being this one now:

#CALL %mapfilter(Name LIKE 'Al oeste de Miden'nir') AND (ZoneID = 62))))

There is the problem of the script.

I tryed several things, such as putting the room between {} , changing the initial and ending ' with '' as u suggested, but nothing...

Any ideas? (and thanks 4 the attention so far! :D)
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Wed Apr 09, 2008 7:55 pm   
 
You need to remove the ' completely What I do is %subchar("Al oeste de Miden'nir","'","%")

I THINK Vijilante found a way around this in his toolbox but if I remember correctly he hooked directly into the database...
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Wed Apr 09, 2008 8:15 pm   
 
Actually, I wasn't suggesting you change the initial or ending quote. I was suggesting you change the one in the middle. Most SQL systems (which this is) will work when your query uses two single quotes to represent one single quote in your search string.

Besides that, you've got your parentheses out of whack in your most recent example and you're using LIKE with no wildcard, which is no different from just using = instead (although perhaps less efficient).

Code:
#CALL %mapfilter("Name = 'Al oeste de Miden''nir' AND ZoneID = 62")


This method works when I test it in my zMUD, using one of my room names ("Eagle's Nest.") as the search.
Reply with quote
Articval
Novice


Joined: 01 Jun 2005
Posts: 47

PostPosted: Thu Apr 10, 2008 12:54 pm   
 
Phew, after some work i could addapt that, thankyou, worked perfectly!!

(the double single comma did the job)

Hope there r no future conflicts with possible doubled comma roomz... ^_^

Thanks again!
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Thu Apr 10, 2008 2:51 pm   
 
Sweet! Now I'm going to change my stuff too.

Thanks Larkin.
That was suggested somewhere else too but we didn't understand what was meant. Or at least I didn't.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
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