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

TokenLock API - Remove chat message when a player attempts to move their token

As the title suggests, is there a way to disable the chat message from the TokenLock API? Sometimes players will have their token locked and then spam their keyboard or continually drag their token resulting in a mass of messages to the DM.
I would suggest using TokenMod for locking tokens now, instead of the TokenLock API script.  There is now functionality built directly into Roll20 for locking tokens (in the dropdown menu when you right-click on a token) that TokenMod can control . Unless there is some other reason for using TokenLock? I just updated my 'Lock' macro (previously using MapLock and TokenLock) to just use the new locking feature in TokenMod.  I have a version that directly locks and unlocks all the player tokens. Or here is a toggle version that is good for selected tokens: !token-mod --flip lockMovement --active-pages
1651707504
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Built-in Token Locking still allows transformations such as flipping, resizing or rotating. If you want the functionality of token-lock, use the maplock script. Same features, but does not announce.
Excellent, thanks for your help both of you. For now ill use the tokenmod command and play around with the maplock script later on. @Jarren Any way to change that toggle command to only apply to certain tokens ie PC tokens? 
Graham Z. said: @Jarren Any way to change that toggle command to only apply to certain tokens ie PC tokens?  Yep, in the link I posted I showed the command I use with my macro mule character where I simply input all the token IDs for my players’ characters. 
Jarren said: Graham Z. said: @Jarren Any way to change that toggle command to only apply to certain tokens ie PC tokens?  Yep, in the link I posted I showed the command I use with my macro mule character where I simply input all the token IDs for my players’ characters.  Awesome, problem solved thanks Jarren.
1651755812
The Aaron
Roll20 Production Team
API Scripter
Note: you can use character ids with TokenMod and it will find all the tokens for that character. Combine that with --active-pages or --current-page to toggle just the tokens currently available to players. 
The Aaron said: Note: you can use character ids with TokenMod and it will find all the tokens for that character. Combine that with --active-pages or --current-page to toggle just the tokens currently available to players.  That's exactly what I did. Currently this is my macro for locking just the player tokens: !token-mod --flip lockMovement --ids -N1BTckpJiw1vstpCE7e -N162idV-ELmGZrJV7Dc -N15o2X9ZVc4Hbb8-0WE -N162j6YxzXv9ZPbIN8x -N162kMJjHxqIoFi-Rja If there is a better way to do this im all ears. Not a programmer by any means, just took Jarren's macro and changed the last bit.  What's the benefit of having the --active-pages / --current-page segment?
1651788530

Edited 1651788957
Graham Z. said: That's exactly what I did. Currently this is my macro for locking just the player tokens: !token-mod --flip lockMovement --ids -N1BTckpJiw1vstpCE7e -N162idV-ELmGZrJV7Dc -N15o2X9ZVc4Hbb8-0WE -N162j6YxzXv9ZPbIN8x -N162kMJjHxqIoFi-Rja If there is a better way to do this im all ears. Not a programmer by any means, just took Jarren's macro and changed the last bit.  What's the benefit of having the --active-pages / --current-page segment? The example I linked to was using my macro mule as a repository for all the character IDs, instead of having to update the macro.  It means that I can reuse the same linked attribute in several macros, and I only have to update the attribute once to adjust for all player character IDs if there are any changes.  E.g. when I have a new player who joins the campaign, or a player switches characters and I need to add a new character ID, I only change the single attribute and every macro that targets all PCs is updated automatically. ?{Lock or Unlock | Lock,!token-mod --on lockMovement | Unlock,!token-mod --off lockMovement | Lock Players,!token-mod --ids @{MacroMule|AllPlayersIDList} --on lockMovement| Unlock Players,!token-mod --ids @{MacroMule|AllPlayersIDList} --off lockMovement} AllPlayersIDList @{CHARACTER1|character_id} @{CHARACTER2|character_id} @{CHARACTER3|character_id} ... Graham Z.  said: What's the benefit of having the --active-pages / --current-page segment? Because I'm using the 'character_id', it is pulling ID from the character sheet, not a single token, and affecting all tokens that are linked to that character sheet.  But you may not want to lock all tokens  linked to the character sheet, for example if you have character tokens on a City Map page that they can move around freely, but while they are in a dungeon you need to lock them.  If you don't include the --active-pages / --current-page argument, then all tokens that are linked to that character sheet will be locked on every page in the game. --current-page will only lock the tokens linked to the character sheet on the page you are currently on, while --active-pages will only lock the tokens linked to the character sheet on any page that any player is currently on.