Junior Member
Join Date: Nov 2016
Posts: 13
|
Is there a way to trigger an external process with arguments from Hero Lab? Alternatively sending an HTTP GET or POST to a custom URL while passing selected arguments.
I use a simple virtual table top system I put together displayed on my TV as our game board, and I would like to have a Condition change to a hero in Hero Lab be reflected in my VTT. I can write either a Python script to send a SQL statement to my database server or an HTTP GET/POST to my web server to accomplish this; however I would need Hero Lab to trigger the action and pass some simple data like some sort of HeroID and the Condition(s) with selection state. Is something like this possible? I am sure it would be possible as a Custom Output of the whole portfolio, but that seems a bit much. I wouldn't want to have to output the whole portfolio every time a goblin dies, or a PC get nauseated. I just want a command to be issued when a condition changes. I have just purchased and started using Hero Lab so I am very novice. I have read through the manual and parts of the authoring kit Wiki, but I could not tell if this is possible. |
#1 |
Junior Member
Join Date: Nov 2016
Posts: 13
|
I was able to write a procedure (called from each Condition) to modify the pChkName.
It pulls a mapId (as stored in state.value[mapId] via a Mechanic), the heroname, and the condition then concatenates them into a custom URL. This is used to then wrap the pChkName with the {url} modifier. So now every time I click on a condition, it toggles the flag on my virtual table top. |
#2 |
Senior Member
Join Date: Aug 2005
Location: Chicagoland
Posts: 397
|
would you mind sharing the code? I did even know this was possible?
-Jamz RPTools.net | MapTool Discord Invite Download Latest MapTool Release | Download Latest TokenTool Release |
#3 |
Junior Member
Join Date: Nov 2016
Posts: 13
|
Here is my .user file with my code.
If whatever VTT you are using supports a method to change conditions directly via URL HTTP GET you should be able to make this work with some changes in the LinkCkName procedure. I use my own (DragonberryPi) which runs on a raspberry pi server on my LAN. The most kludgey part of this is that I have to define the mapID in the .user file so I have to change it and re-compile anytime I change maps. If anyone knows of a way to add a portfolio global (Like the publisher id) which I can set in the main window, save with the portfolio, and access from the procedure, let me know. I would like to be able to save mapIDs with the portfolios |
#4 |
|
|