Page 1 of 2

Websocket/Api

Posted: Mon Sep 30, 2019 8:44 pm
by BearFather
So I have been gone for a long time, my last version was 1.3.94. So was curious what has changed since 1.3. And was looking thru some release notes. And saw a blurb about experimental web/api socket, I forget the exact details but it was for 1.4. Is this a thing still?

Now been a long time since I have been thru the code, so before I spend the time to relearn it so maybe i could add my class I was hoping that became something. If not ohh well maybe I will spend some hours pouring thru the code again to relearn how it works again.

Re: Websocket/Api

Posted: Mon Sep 30, 2019 9:16 pm
by Full Bleed
BearFather wrote:
Mon Sep 30, 2019 8:44 pm
So I have been gone for a long time, my last version was 1.3.94. So was curious what has changed since 1.3.
I'd suggest that you look at the announcement posts for each version since then to get an overview of what's been added: viewforum.php?f=1

Re: Websocket/Api

Posted: Mon Sep 30, 2019 10:03 pm
by Phergus
Welcome back BearFather.

We recently added some RESTful api macro functions. See this page: RESTful_Functions_Overview

Re: Websocket/Api

Posted: Tue Oct 01, 2019 10:02 pm
by BearFather
Full Bleed:
I did go thru some of those to get a basic idea of new features and the like. Where I read about the api in the first place.

Phergus:
Thanks, I did find the restAPI part, but couldn't find what port or how to enabled it. I also found in the code a websocket class, and was looking into that. But didn't go far, ended up reading thru other stuff to remember how the code worked and what to call if I do get it figured out.

EDIT:
Reading the restAPI page again, is this a api for inside macro's to pull data and push data and the like? If so that might work...I'm looking to make a webpage with some of the player stats and allow to change a few things and update hps as we go. And this would allow them to run a simple page on their phones while we play that would update stuff on the game field.

Re: Websocket/Api

Posted: Wed Oct 02, 2019 7:34 am
by Phergus
BearFather wrote:
Tue Oct 01, 2019 10:02 pm
Reading the restAPI page again, is this a api for inside macro's to pull data and push data and the like? If so that might work...I'm looking to make a webpage with some of the player stats and allow to change a few things and update hps as we go.
That should be totally doable.

Re: Websocket/Api

Posted: Sun Oct 06, 2019 3:07 pm
by BearFather
Want to say thanks, the RestApi worked great. Spent a day and wrote some macros and a webapi to do exactly what I needed.

Now got a webpage that the players can bring up on their phone/tablet. And see the health percentage of their party and mobs on the battlefield. Players can adjust only party members health, but the GM can also adjust the mobs form the website. And with a health bar the main screen will also reflect these numbers.

Images:
https://imgur.com/a/cqPhVod

Re: Websocket/Api

Posted: Mon Oct 07, 2019 9:59 am
by Phergus
Very cool!

More cool would be if you could write up an article or something on what you did that could go on the wiki or a blog post here. :wink:

Re: Websocket/Api

Posted: Mon Oct 07, 2019 10:17 am
by BearFather
I can work on something for that. I'm willing to share all the code for this. I will write something up this week and see if I can figure out the wiki part.

Re: Websocket/Api

Posted: Mon Oct 07, 2019 10:30 am
by RPTroll
That would be awesome!

Re: Websocket/Api

Posted: Mon Oct 07, 2019 11:44 am
by Phergus
We'll have to create an account for you on the wiki if you want to put it there. Or you can just put something together in some doc/html format and we can translate it to the wiki.

Re: Websocket/Api

Posted: Tue Oct 08, 2019 10:14 pm
by BearFather
It's what ever works for you. My wiki writing experience is lacking, I know how to do very limited stuff on it. But starting to work on it tonight, so it doesn't get lost in the pile of things I plan to do.

Re: Websocket/Api

Posted: Wed Oct 09, 2019 8:54 am
by Phergus
Very good. Put it together however your comfortable with and we'll get it up on the wiki or blog.

Re: Websocket/Api

Posted: Wed Oct 09, 2019 10:10 pm
by BearFather
Okay I wrote a quick tutorial for this system. Your welcome to take the text and format how ever you like. I'm no poet with the words so I hope it all makes sense on how to use it. If not let me know and I can try to explain those sections better. There is a link to the files but I have also uploaded the file pack here.

http://bearfather.net/maptools-hp-webpage/

Re: Websocket/Api

Posted: Thu Oct 10, 2019 9:08 am
by Phergus
Awesome. I'll see if I can't get it posted in the next few days.

Re: Websocket/Api

Posted: Thu Oct 10, 2019 3:28 pm
by Full Bleed
Looking forward to checking this out as this is the first time I've seen someone do something like this.

To BearFather, thanks for sharing.

To Phergus, thanks for getting it up on the wiki.

:)