|
Chris_3413 Novice
Joined: 22 Mar 2004 Posts: 46 Location: Australia
|
Posted: Tue Feb 23, 2010 10:58 am
Mapper and Teleporting |
I'm sure there must be hundreds of threads similar, but I just can seem to find them.
What I want to be able to do is make the mapper teleport me to my new room whenever I go through some form of Portal with a non-fixed destination eg rifts in midkemia online.
I can capturing the new room name into a variable and had thought to use %MAPQUERY to get the rooms number and then use that in the #TELEPORT command but I know next to nothing about SQL and cant seem to use a variable in an SQL statement (I can make %MAPQUERY work fin by itself with a normal string, just not a variable)
Am I going about this the wrong way and if so what solutions are out there?
EDIT: sorry, meant %mapquery not #mapquery.. modified |
|
_________________ What do you mean, Fatal Error! |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Tue Feb 23, 2010 2:30 pm |
The trick is that the %mapquery argument needs to be a string. If the variable is inside the quotes, it won't be evaluated. The best way to produce a string like this is with the %concat() function, like this, from one of my scripts:
Code: |
$zonerooms = %mapquery(%concat("ZoneID = ", $zone)) |
Sometimes you can get away with _implicit_ concatenation, such as: "test"@testvar. But the best way to be sure your string is being put together the way you intend is using the %concat() function. |
|
|
|
|
|
|
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
|
|