Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
George Programmer
1 discussion post
Hi, I've been wondering when writing a Macro Script if there is a way to know what was the last macro or even key pressed before running the Macro Script.

For example:
"run" macro tells character to run forward for 500ms

"custom" macro (which would be a macro script) would use the previous history of macros used to make a decision which action to take. So if character previously ran then "custom" macro will decide to crouch. However if the character didn't just run then "custom" macro will decide to make him crawl.

Can you know such information in a Macro Script? Can you access the history of executed macros? Or can you access the previous pressed keys? I know that you can see if a key is currently pressed but I haven't found something like "last_key_pressed".

Anything would be helpful. Thank you!
Mar 9, 2021  • #1
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Hi George,

You can use bfs.scriptsettings.writevalue at the start of all the macros to write each input to a log, and then use bfs.scriptsettings.readvalue any time you would like to know what has been input last.

You can find more information on those functions here:

https://www.voicebot.net/ScriptedFunctions/Help#bfs_scriptsettings_writevalue
https://www.voicebot.net/ScriptedFunctions/Help#bfs_scriptsettings_readvalue

Hope that helps!
Mar 12, 2021 (modified Mar 14, 2021)  • #2
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)