|
Articval Novice
Joined: 01 Jun 2005 Posts: 47
|
Posted: 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 :( |
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: 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.
|
|
|
|
Articval Novice
Joined: 01 Jun 2005 Posts: 47
|
Posted: Wed Apr 09, 2008 7:52 pm |
Mhm didnt work
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) |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: 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 |
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: 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. |
|
|
|
Articval Novice
Joined: 01 Jun 2005 Posts: 47
|
Posted: 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! |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: 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 |
|
|
|
|
|