Friday, September 20, 2024 12:04:42 AM
> settings

Customize


Authenticate

> fn_ADT.fsm
/*%FSM<COMPILE "scriptedFSM.cfg, ADT">*/
/*%FSM<HEAD>*/
/*
item0[] = {"wait",2,250,-75.000000,-350.000000,25.000000,-300.000000,0.000000,"wait"};
item1[] = {"frequence",4,218,50.000000,-350.000000,150.000000,-300.000000,0.000000,"frequence"};
item2[] = {"init",0,4346,-75.000000,-500.000000,25.000000,-450.000000,0.000000,"init"};
item3[] = {"first",4,218,-75.000000,-425.000000,25.000000,-375.000000,0.000000,"first"};
item4[] = {"requests",4,218,-75.000000,-275.000000,25.000000,-225.000000,1.000000,"requests"};
item5[] = {"finit",1,250,-75.000000,-650.000000,25.000000,-600.000000,0.000000,"finit"};
item6[] = {"already",4,218,-75.000000,-575.000000,25.000000,-525.000000,1.000000,"already"};
link0[] = {0,1};
link1[] = {0,4};
link2[] = {1,0};
link3[] = {2,3};
link4[] = {2,6};
link5[] = {3,0};
link6[] = {4,0};
link7[] = {6,5};
globals[] = {0.000000,0,0,0,0,640,480,1,15,6316128,1,-257.920135,247.574890,-187.630585,-705.426208,863,884,1};
window[] = {2,-1,-1,-32000,-32000,896,104,1544,104,3,881};
*//*%FSM</HEAD>*/
class FSM
{
        fsmName = "ADT";
        class States
        {
                /*%FSM<STATE "wait">*/
                class wait
                {
                        name = "wait";
                        itemno = 0;
                        init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
                        precondition = /*%FSM<STATEPRECONDITION""">*/"_c = _c + 1;" \n
                         ""/*%FSM</STATEPRECONDITION""">*/;
                        class Links
                        {
                                /*%FSM<LINK "requests">*/
                                class requests
                                {
                                        itemno = 4;
                                        priority = 1.000000;
                                        to="wait";
                                        precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
                                        condition=/*%FSM<CONDITION""">*/"(diag_tickTime >= _NextReq)"/*%FSM</CONDITION""">*/;
                                        action=/*%FSM<ACTION""">*/"_return = parseSimpleArray(""arcas_dev_tools"" callExtension ""1"");" \n
                                         "" \n
                                         "if ((_return select 0) && {!(((_return select 1) select 0) isEqualTo """")}) then" \n
                                         "{" \n
                                         "	[] spawn compile ((_return select 1) select 0);" \n
                                         "};" \n
                                         "" \n
                                         "_NextReq = diag_TickTime + _INTERVAL_REQ;"/*%FSM</ACTION""">*/;
                                };
                                /*%FSM</LINK>*/
                                /*%FSM<LINK "frequence">*/
                                class frequence
                                {
                                        itemno = 1;
                                        priority = 0.000000;
                                        to="wait";
                                        precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
                                        condition=/*%FSM<CONDITION""">*/"(diag_tickTime >= _NextFreq)"/*%FSM</CONDITION""">*/;
                                        action=/*%FSM<ACTION""">*/"""arcas_dev_tools"" callExtension format [""3:%1:%2:%3"", diag_fps, 0, count(diag_activeSQFScripts)];" \n
                                         "_NextFreq = diag_TickTime +  _INTERVAL_FREQ;"/*%FSM</ACTION""">*/;
                                };
                                /*%FSM</LINK>*/
                        };
                };
                /*%FSM</STATE>*/
                /*%FSM<STATE "init">*/
                class init
                {
                        name = "init";
                        itemno = 2;
                        init = /*%FSM<STATEINIT""">*/"diag_log (""ADT.fsm started"");" \n
                         "" \n
                         "// variable for counting the number of condition evaluations" \n
                         "_c = 0;" \n
                         "" \n
                         "// define the minimal time interval in seconds (_INTERVAL_FEQ < _INTERVAL_GEN < _INTERVAL_MISS)" \n
                         "_INTERVAL_FREQ = 5;" \n
                         "_INTERVAL_REQ = 0.1;" \n
                         "" \n
                         "_NextFreq = diag_TickTime;" \n
                         "_NextReq 	= diag_TickTime;"/*%FSM</STATEINIT""">*/;
                        precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
                        class Links
                        {
                                /*%FSM<LINK "already">*/
                                class already
                                {
                                        itemno = 6;
                                        priority = 1.000000;
                                        to="finit";
                                        precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
                                        condition=/*%FSM<CONDITION""">*/"(!isnil (""ADTRunning""))"/*%FSM</CONDITION""">*/;
                                        action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
                                };
                                /*%FSM</LINK>*/
                                /*%FSM<LINK "first">*/
                                class first
                                {
                                        itemno = 3;
                                        priority = 0.000000;
                                        to="wait";
                                        precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
                                        condition=/*%FSM<CONDITION""">*/"(isnil (""ADTRunning""))"/*%FSM</CONDITION""">*/;
                                        action=/*%FSM<ACTION""">*/"// Initialize the dll" \n
                                         "_return = parseSimpleArray(""arcas_dev_tools"" callExtension format [""0:%1:%2:%3"", 1, _c, diag_FrameNo]);" \n
                                         "" \n
                                         "if !(_return select 0) exitWith " \n
                                         "{" \n
                                         "	diag_log format[""ADT.fsm | Failed to initialize the DLL. Reason: %1"",(_return select 1) select 0];" \n
                                         "};" \n
                                         "" \n
                                         "ADTRunning = true;" \n
                                         "diag_log format[""ADT.fsm | DLL initialized | %1"", (_return select 1) select 0];" \n
                                         ""/*%FSM</ACTION""">*/;
                                };
                                /*%FSM</LINK>*/
                        };
                };
                /*%FSM</STATE>*/
                /*%FSM<STATE "finit">*/
                class finit
                {
                        name = "finit";
                        itemno = 5;
                        init = /*%FSM<STATEINIT""">*/"diag_log (""ADT.fsm already started"");" \n
                         ""/*%FSM</STATEINIT""">*/;
                        precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
                        class Links
                        {
                        };
                };
                /*%FSM</STATE>*/
        };
        initState="init";
        finalStates[] =
        {
                "finit",
        };
};
/*%FSM</COMPILE>*/
All opinions represented herein are my own
- © 2024 itsthedevman
- build 3c15a1b