Yep variables. I did mention variables in my post but must've deleted that after editing to make it simpler to understand.
You'd probably have a setup like..
global constant variable TOOL_AXE = 1
global constant variable TOOL_SCROLL = 2
global variable toolSelected = TOOL_AXE
Then you can test with..
If toolSelected = TOOL_AXE ..
It's practically as simple as that ;)
EDIT> Although, I've simplified with just 2 "tools", you'd group tools together, like if you had a hammer, you'd probably set that to 2 and scroll to 3 or whatever.
The constant means the variable can't be changed at runtime and makes for easier reading.
And in the example above, toolSelected would actually just store the value of TOOL_AXE which is 1. It's much easier to read your code (as well as debug) that way rather than..
global variable toolSelected = 1
if toolSelected = 1...