VB Script logic

Show everyone your special keyboard. Tell us how do you use HIDmacros.
Post Reply
gr8guitar
Posts: 4
Joined: 21 Feb 2016, 22:25

VB Script logic

Post by gr8guitar » 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.

gr8guitar
Posts: 4
Joined: 21 Feb 2016, 22:25

Re: VB Script logic

Post by gr8guitar » 23 May 2019, 18:19

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

Post Reply