VB Script logic
Posted: 22 May 2019, 13:36
Hello. I have HIDMacros and FSUIPC (FS9) working in a basic manner. I can individually send, using separate keys. For example:
To pause FS9: Using kbd2, 186(;)
HIDMacros.SetFSUIPCInt &H262, 2, 1 OK
To unpause FS9: Using kbd2, 222(')
HIDMacros.SetFSUIPCInt &H262, 2, 0 OK
Then I tried this:
Dim isPaused
' read
isPaused = HIDMacros.GetFSUIPCInt(&H262, 2) OK
' write string to verify reading is ok
HIDMacros.SetFSUIPCInt &H66C0, 2, isPaused OK
'
if isPaused = 0 then NOT OK
HIDMacros.SetFSUIPCInt &H262, 2, 1
end if
The script crashes when I try using the"if" statement. I get the message: "Variable uses an Automation type not supported in VBScript".
I would like to be able to use one key to pause and unpause instead of using two. Any ideas how to correct? Thanks.
To pause FS9: Using kbd2, 186(;)
HIDMacros.SetFSUIPCInt &H262, 2, 1 OK
To unpause FS9: Using kbd2, 222(')
HIDMacros.SetFSUIPCInt &H262, 2, 0 OK
Then I tried this:
Dim isPaused
' read
isPaused = HIDMacros.GetFSUIPCInt(&H262, 2) OK
' write string to verify reading is ok
HIDMacros.SetFSUIPCInt &H66C0, 2, isPaused OK
'
if isPaused = 0 then NOT OK
HIDMacros.SetFSUIPCInt &H262, 2, 1
end if
The script crashes when I try using the"if" statement. I get the message: "Variable uses an Automation type not supported in VBScript".
I would like to be able to use one key to pause and unpause instead of using two. Any ideas how to correct? Thanks.