Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Drop Down Options for Teleport Mod/API

Hi,  I'm a complete idiot when it comes to figuring out how any sort of coding syntax works. It just won't stay in my brain... What I'm trying to do is create a macro that offers a drop down menu that allows players to select a location, and have the Teleport API trigger a move to a specific Teleport Pad. (We play a lot of Call of Cthulhu, and often the party will split, and players who aren't involved want to do things like look at maps together, check out exisitng locations that have points of interest that they can hover over for more information... with lots of nested/linked Handouts that they can check out while the active group is busy) There are a bunch of locations they have access to through MapChange API, but often there will be no Token on the Token layer when they get there so I want to create a nacro that makes sure their token is active on the page. What I want is a basic "Click on the Token, click on the Macro button" drop down menu where clicking on a location will send their Token (all the maps have copies of PC Tokens automatically on the GM layer when I build them because I use Teleport a lot.) to a specific pad. I get that I need to run a ?{Location1, action1|Location2, action2|Location3, action3} set up, but The command action for a teleport reads something like (on a selected token) "!teleport --teleporttoken|-OBWbNDvbYIbZryVqEEw" and I have no idea what to do with that command to make it work in the table, because that Pipe at the end of --teleporttoken| causes the next part to be a seperate query option. I imagine it involves some sort of isolation of the command that the Macro recognises as seperate? This is probably a very easy issue to solve, but my brain simply refuses to make sense of any type of coding syntax.  By the time I learn a third or fourth thing, the first thing has to make space by leaving my memory...  ANY help would be really appreciated.
1731588957

Edited 1731603180
I don't work with scripts, but I do know queries - replacing the pipe with a | sanitizes it for the query, and it's replaced with your usual pipe after, for when the script runs.
Thanks but I'm not sure what that means. Is it simply a case of replacing one of the pipes with an "&"? I don't know what the "vert:" bit means. Or do I literally swap out a Pipe with "&vert:"?
Apologies, I was writing on phone and had a typo - you replace the | in  teleporttoken|-OBWbNDvbYIbZryVqEEw with "|" (with semicolon), the query will first skip over it, and resolve that into a | as it completes a step in its own order of operations, so after the query is fully done, you're left with the functional script command. I assume.
Thank you, I see what you mean... I'll give that a try.
1731775386
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Tommy! If not having a token on the page is the central issue, you are aware that players can drop their own tokens on a page? You don't need the teleport script for this particular case. MapChange should be enough.
keithcurtis said: Hi Tommy! If not having a token on the page is the central issue, you are aware that players can drop their own tokens on a page? You don't need the teleport script for this particular case. MapChange should be enough. I think I'm probably going to have to go that route Keith thanks, it's something I hadn't considered, because if they know they can do that I know at least 1 of ,y pl;ayers who will end up with 15 tokens on every page... we're all old men, so it would be either due to infantile behaviour or simply being too senile to figure it out. I had to start locking all doors when he found out he could open them by "using the Force" when his token was at the other end of the room... it's like having another bloody kid...
1731859278
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Tommy said: we're all old men I hear you there. Fortunately, 4 out of 5 of my group are also GMs, so we don't get a lot of the disruptive behavior. Everyone knows how hard it is to sit in the Big Chair. But yeah, some of them are... technologically challenged.
God help me if the Ghost Token issue happened with my lot dropping their character on to a map... it would pretty quickly end up looking like the crowd scene from Ben Hur keithcurtis said: Tommy said: we're all old men I hear you there. Fortunately, 4 out of 5 of my group are also GMs, so we don't get a lot of the disruptive behavior. Everyone knows how hard it is to sit in the Big Chair. But yeah, some of them are... technologically challenged.