Processing Ajax...

Close Dialog


Close Dialog

Close Dialog

Can You Know What Was The Previous Macro Executed?

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
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:

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