#What BF to hook for background thread and possibility of querying endpoint?

17 messages · Page 1 of 1 (latest)

cursive turtle
#

Looking into developing a crowd control type mod for a plathrough I'm planning on doing. My plan right now is to develop a twitch bot which will run locally and monitor twitch for chat messages or channel point redeems and then either expose the current effect that needs to be run via a local endpoint or to press a button combination on keyboard/gamepad when an effect is run.

With that I have a few questions:

  • In flowscript is there a way to have a procedure that executes perpetually, kind of a tick function or like Update() in Unity. Or are there existing procedures in field BFs that do something similar that I could hook into.
  • Is there a way to query an endpoint within flowscript? I haven't seen any mods do this in the ones I've been looking through to learn flowscript and bf modding but I figured I'd ask.
  • Similar to the previous question, is there a way to check keyboard state if I need to just have the bot use a keyboard input to pass event information.

Any advice or examples you have would be much appreciated, hoping this isn't too far out of scope for what can be accomplished.

wheat wren
#

In my time using it I've sadly never found a way to have it running at the same time as gameplay itself, once called it will pause the game until it's finished running through its instructions, I've also not found any way for it to interact with anything outside it's own scope. It can read the local time on your system but that's the only way I've ever found that could theoretically communicate with it aside from outside sources like reloaded mods

faint warren
#

You'd definitely need to make a code mod to do any of that, no chance you could natively query web endpoints in flowscript.

For calling flowscript stuff p5r lib might be helpful although it is in a bit of an unfinished state rn. Some more fancy stuff like calling battles won't work with it but you can work around it by calling code from a bf in it (I could elaborate on that if needed)
https://github.com/AnimatedSwine37/p5rpc.lib

P5R input hook might also be useful, it can read and edit keyboard inputs to the game. https://github.com/AnimatedSwine37/p5rpc.inputhook

cursive turtle
cursive turtle
wheat wren
#

you can call compiled scripts with messages in them using SCRIPT_READ() and script SCRIPT_EXEC()

#

while i cant be 100% I would imagine this works with the library

cursive turtle
#

Awesome, I'll give it a go ty

wheat wren
#

writing up a quick example

#

so you would put the compiled .bf in the folder just called scripts

#

script\SCR0000_00_01.bf example one being that

#

the numbers in the file name are whats used by SCRIPT_READ it takes 3 ints with each just being the numbers in the filename you want to use

#

my example one is just an incredibly basic single message

#

then from there it would just be translating this to p5rlib

cursive turtle
#

Oh ok that makes sense, that's how I'd call other custom flowscript as well then right?

wheat wren
#

yea in theory this script could do anything that any other script can do (barring encounter/ai stuff)