Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Chris_3413
Novice


Joined: 22 Mar 2004
Posts: 46
Location: Australia

PostPosted: 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!
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: 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.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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