TLO Request - MQ2AdvPath

HardOne

Rawk On!
Joined
Sep 27, 2008
Messages
344
Reaction score
1
Points
0
Would it be possible to add a TLO to check and see if you have a specific path recorded.

i.e.:
Code:
/if (${AdvPath.Path[PathName]}) {
   /play PathName
}

Or if someone can tell me how to do it currently, that would be awesome.
 
You could do it currently via:
/declare string outer pathname
/varset pathname whatever
...
...
/if (${Ini[c:/mq2/mq2advpath/${Zone.ShortName}.ini,${pathname},1].Length}) /play ${pathname}


obviously change the directory to whatever yours is.
 
Thank's Pete, but one last question.

Is there any way to have that file path be generic so it could work for anyone?

I know in the macro folder you can create a sub folder and use
Code:
#include \subfolder\filename.inc
Is there anyway to do that, but include something from the base MQ folder without the full path name.?

i.e.:
Code:
#include %MacroQuest2%\MQ2AdvPath\
 
Thank's Pete, but one last question.

Is there any way to have that file path be generic so it could work for anyone?

I know in the macro folder you can create a sub folder and use
Code:
#include \subfolder\filename.inc
Is there anyway to do that, but include something from the base MQ folder without the full path name.?

i.e.:
Code:
#include %MacroQuest2%\MQ2AdvPath\

By default the Macros is being ran from mq2folder/macros folder. So your working directory is the macros folder. If you do the path as "../MQ2AdvPath/" the ../ is telling it to go up one directory (or into the mq2folder) and then to the MQ2AdvPath folder there.

This will work for the majority of people, only ones that may have some problems with it are the ones that have change their Macros folder location in the Macroquest.ini to be somewhere different.

I don't know of any TLO object that gives the path to th MQ2folder currently.
 
Combining both of your responses got me what I needed.

Code:
/if (${Ini[..\MQ2AdvPath\${Zone.ShortName}.ini,${pathname},1].Length})

Thanks!