background
Välkommen till mina flygsimulatorsidor!
Home > Mina projekt > FS9 and HidMacro with FSUIPC > The macro script

The macro script


About macro script ”HIDMacros.SetFSUIPCInt &H3110, 4, 66240”

At the HID macros website you will find http://www.hidmacros.eu/scripting.php#fsuipc section. This section descibes the commands for FUIPC interface.

HIDmacros bring several functions to read and write variables through FSUIPC. To use these functions FSUIPC of course must be installed.

  1. HIDMacros.GetFSUIPCInt (offset, size)

  2. HIDMacros.GetFSUIPCFloat (offset, size)

  3. HIDMacros.GetFSUIPCString (offset, size)

  4. HIDMacros.GetFSUIPCRaw (offset, size)

  5. HIDMacros.SetFSUIPCInt offset, size, value

  6. HIDMacros.SetFSUIPCFloat offset, size, value

  7. HIDMacros.SetFSUIPCString offset, size, value

Parameters are:

offset  variable's memory offset from FSUIPC SDK.
size size of variable in bytes, also mentioned in SDK
value  value to be set

 

Note the brackets around the parameters in the GetFSUIPC commands. They are not showed at the website, it's an error at the page.

The offset value is a hexadecimal value, therefore you should set '&H' in the front of the offset value when use the value in this command.

The script command:

HIDMacros.SetFSUIPCInt &H3110, 4, 66240

'HIDMacros.SetFSUIPCInt' is he command found at http://www.hidmacros.eu/scripting.php#fsuipc . We use this command as we will send an integer to FSUIPC.

'&H3110, 4, 66240 ' are the parameters for the command.

&H3110 is the offset value to the command för sending commands to FS9 via FSUIPC. This value is found in the document 'FSUIPC for Programmers.pdf'. This document contains lots of other offsets for sending or receiving values to or from FSUIPC according to the description for each offset value.

4 is the number of byte used, explained in the previous document at the offset value &H3110

66240 is the number for the control TOGGLE_TAXI_LIGHTS. These numbers are found in the document 'List of FS2004 controls.pdf'. You can change this number to other controls you want to send.


As '4' and '66240' are normal decimal numbers they should be written as they are.

When this simple example is working you may now create more macros for other functions in similar way.