I have mentioned it a few times when I was trying to do some things, but was always given a different/better way to do it. Now the time has come in my programming where in order to do what I want, I have to access something outside of maptool. We want a text file (or any other type of file really) that lists the treasure we rolled. That requires getting maptool to write to a file.
In addition I will be setting up my game table to perform specific actions with the built in lights depending on occurrences. The easiest way I have read to do this is with (at least in this case) I think would be with webhooks.
So, is there a way to get maptool to write to a file?
And second question, is there a way to get maptool to access a specific webpage?
Get information out of maptool.
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
Re: Get information out of maptool.
MT is designed to block external access for security reasons, but you can set up a data directory in Preferences which may allow direct access. Then there are the RESTful functions. I've only dabbled with the REST functions but you may need a server and some API running. I know there is some built in stuff for Google drive and Github, but I haven't messed with those.
I am working on a project that involves some kind of external file saving and reading but I haven't gotten that far yet. I'll let you know how it goes.
I am working on a project that involves some kind of external file saving and reading but I haven't gotten that far yet. I'll let you know how it goes.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Get information out of maptool.
I just figured out how to get a text file from google drive. Once you make the file public do this.
I will be only using the REST.get in my code, for now, and not trying to update the files in MT. I did enable the "Google Drive API" but just disabled it and it still works. I would probably need it enabled to upload or modify files.
Google Drive API: https://console.cloud.google.com/apis/l ... leapis.com
Code: Select all
[H: body = REST.get("https://drive.google.com/uc?id=[FILE ID]&export=download")]
Google Drive API: https://console.cloud.google.com/apis/l ... leapis.com
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
-
- Giant
- Posts: 192
- Joined: Mon Apr 11, 2011 8:11 pm
Re: Get information out of maptool.
So, I ended up putting this part of the project on hold for a bit, but I am bac to it. I have looked at the "file sync" directory, but can't find any information on how to use it.aliasmask wrote: ↑Sun Nov 06, 2022 5:40 pmMT is designed to block external access for security reasons, but you can set up a data directory in Preferences which may allow direct access. Then there are the RESTful functions. I've only dabbled with the REST functions but you may need a server and some API running. I know there is some built in stuff for Google drive and Github, but I haven't messed with those.
I am working on a project that involves some kind of external file saving and reading but I haven't gotten that far yet. I'll let you know how it goes.
Basically I want to store things such as party treasure, etc someplace that can be pulled in without having to remember to save a token with the data on it each time.
-
- Giant
- Posts: 192
- Joined: Mon Apr 11, 2011 8:11 pm
Re: Get information out of maptool.
Oh wow. I don't remember how I came across it, but I ended up finding the exportData() function! And it works! Thats 3/4 the battle! If I have to manually copy and paste the data back in when I switch maps, its a pain, but doable!
Now I just need an importData() function! (I tried.. No dice.)) That solves ALL the problems, lol
Now I just need an importData() function! (I tried.. No dice.)) That solves ALL the problems, lol