I have a bunch of variables that get set and then display the new value by calling a VB script, like this one:
Sub Set_HP (thename, theoutput, arrWildcards)
World.SetVariable "hp", cint(arrWildcards(1))
Call Sub Get_HP
End Sub
And then use a script to only display the value by calling a script like this:
Sub Get_HP (thename, theoutput, arrWildcards)
World.Note " HP: " & World.GetVariable("hp")
End Sub
The first example script is activated by an alias "hp *" where * is an integer, and the second is activated by an alias "hp". I have upwards of a dozen such scripts for my variables, and the number is growing. I know there should be a way to simplify these all into a couple subroutines that will determine what is wanted by what is typed in. So if I want to set my hp variable, or my name variable, etc, they call the same sub(s) to set and/or display. By programing standards, it is a waste of resources to use multiple independant subroutines to display, basically, the same information.
I am a very inexperienced programmer, so please help me trim this down.
Thanks,
Mike
Sub Set_HP (thename, theoutput, arrWildcards)
World.SetVariable "hp", cint(arrWildcards(1))
Call Sub Get_HP
End Sub
And then use a script to only display the value by calling a script like this:
Sub Get_HP (thename, theoutput, arrWildcards)
World.Note " HP: " & World.GetVariable("hp")
End Sub
The first example script is activated by an alias "hp *" where * is an integer, and the second is activated by an alias "hp". I have upwards of a dozen such scripts for my variables, and the number is growing. I know there should be a way to simplify these all into a couple subroutines that will determine what is wanted by what is typed in. So if I want to set my hp variable, or my name variable, etc, they call the same sub(s) to set and/or display. By programing standards, it is a waste of resources to use multiple independant subroutines to display, basically, the same information.
I am a very inexperienced programmer, so please help me trim this down.
Thanks,
Mike