Page 1 of 1

VB Script logic

Posted: 22 May 2019, 13:36
by gr8guitar
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.

Re: VB Script logic

Posted: 23 May 2019, 18:19
by gr8guitar
Okay. I solved my own issue. It is:

isPaused = HIDMacros.GetFSUIPCInt(&H262, 2)

HexPause = Hex(isPaused)

if HexPause = 0 then
HIDMacros.SetFSUIPCInt &H262, 2, 1
end if

if HexPause = 1 then
HIDMacros.SetFSUIPCInt &H262, 2, 0
end if