Hacker boxes - Medical box

I only dabble in server code / fsm slighty...
To make sense of it, need to use fsm editor really
http://community.bistudio.com/wiki/BI_Tools_2

U can try out http://pastebin.com/Gtjnnch0
Its based off https://github.com/fred41/DayzPerformanceUpgrades server_cleanup.fsm

If u want to test it to see if it working... find a medical box & drop a gun into it. Box should disappear & u will get a log entry in RPT about it


I'm using your code. Tested it. Doesn't work.
 
Check your server RPT for an error msg.
Prob a typo mistake...

I had the code working on server before, already maintaining to much as is, and its a simple code really...
 
Check your server RPT for an error msg.
Prob a typo mistake...

I had the code working on server before, already maintaining to much as is, and its a simple code really...

Could it be how we are editing it? I got it working, but I had to clean up a lot of stuff to make it work in my FSM editor. Double quotes, those commented fsm references, etc.

I'll post mine when I get back to my computer in a bit. All I was missing was the nearentities class you added - I wound up using man and getting zombies and players.
 
Here's my server_cleanup.fsm (change extension) and the "General Cleanup" section. Works well, other than reporting players & zombies nearby. I'll try changing back to AllPlayers later tonight, looks like that will be an easy fix (Thanks Torndeco!)

Code:
{
//diag_log ("CLEANUP: CHECKING GROUP WITH " + str(count units _x) + " UNITS");
if (count units _x==0) then {
deleteGroup _x;
//diag_log ("CLEANUP: DELETING A GROUP");
};
} forEach allGroups;
 
//Check for hackers
{
          if(vehicle _x != _x) then {
              if  (!(vehicle _x in _safety) && ((typeOf vehicle _x) != "ParachuteWest")) then {
                  diag_log ("CLEANUP: KILLING A HACKER " + (name _x) + " " + str(_x) + " IN " + (typeOf vehicle _x));
                  (vehicle _x) setDamage 1;
                  _x setDamage 1;
              };
          } else {
              if (isPlayer _x) then {
                  _boxes = nearestObjects [_x, ["MedBox0", "AmmoBoxBig", "USBasicWeapons_EP1", "USBasicAmmunitionBox_EP1", "UNBasicWeapons_EP1", "UNBasicAmmunitionBox_EP1", "USLaunchers_EP1", "USVehicleBox_EP1", "USSpecialWeapons_EP1", "LocalBasicAmmunitionBox", "Gunrack2", "Gunrack1", "RULaunchersBox", "RUBasicWeaponsBox", "RUBasicAmmunitionBox", "LocalBasicWeaponsBox", "RUSpecialWeaponsBox", "USBasicWeaponsBox", "USVehicleBox", "RUVehicleBox", "USSpecialWeaponsBox", "SpecialWeaponsBox", "USLaunchersBox", "TKVehicleBox_EP1", "TKSpecialWeapons_EP1", "TKOrdnanceBox_EP1", "TKLaunchers_EP1", "TKBasicWeapons_EP1", "TKBasicAmmunitionBox_EP1", "GunrackUS_EP1", "GunrackTK_EP1", "GuerillaCacheBox_EP1", "GERBasicWeapons_EP1", "CZBasicWeapons_EP1", "AmmoCrates_NoInteractive_Small", "AmmoCrates_NoInteractive_Medium", "AmmoCrate_NoInteractive_", "GuerillaCacheBox", "USBasicAmmunitionBox", "USOrdnanceBox_EP1", "RUOrdnanceBox", "AmmoBoxSmall_556", "AmmoBoxSmall_762", "ItemMatchbox", "ItemToolbox", "CardBoardBox", "FoodBox1", "FoodBox2","FoodBox3"], 50];
                  {
                      _box = _x;
                      _weap =  getWeaponCargo _box;
                      _players_nearby = _box nearEntities ["Man", 50];
                      if (str(_weap) != '[[],[]]') then {
                          diag_log("pyBEscanner -  Hack Box - " + str(_players_nearby));
                          {
                              diag_log("pyBEscanner - Hack Box - " + str(_box distance _x) + " - " + str(_x));
                          } forEach _players_nearby;
                          deleteVehicle _box;
                          diag_log ("pyBEscanner -  Hack Box - Weapons list is " + str(_box) + " " + str(_weap));
                          diag_log("pyBEscanner -  Hack Box - Deleting cheat box");
                          diag_log("pyBEscanner - Hack Box - End");
                      };
                  } forEach _boxes;
              };
          };
      } forEach allUnits;
 
dayz_serverObjectMonitor = _safety;

I forget who first posted this, but thanks - excited to get this on my live server tonight, should be a help.
 

Attachments

  • server_cleanup.txt
    16.9 KB · Views: 27
none of these seem to work for me it shows the pyBEscanner - Hack Box with errors in the logs
could someone upload there whole server_cleanup.fsm the one above doesnt work for me i tried it in my local server
 
Rename server_cleanup.txt -> server_cleanup.fsm

Mission fix
\dayz_code\init\variables.sqf

Add the following lines @ the top of file under player model entries in file add

Code:
AllPlayers = ["Soldier_Crew_PMC","Sniper1_DZ","Camo1_DZ","Soldier1_DZ","Rocket_DZ"];
AllPlayersVehicles = ["Soldier_Crew_PMC","Sniper1_DZ","Camo1_DZ","Soldier1_DZ","Rocket_DZ","AllVehicles"];

Note:-
This is from my old server files... really don't have time for this... goodluck + its really not that hard
Fsm is based off new dayz 1.7.5 code & fred41 fsm..
 

Attachments

  • server_cleanup.txt
    17.9 KB · Views: 20
If Torndeco's latest still doesn't work feel free to post back even though he's busy. I may not know nearly as much of the code but I do have it working on a live server so I'll do my best to help.

One thing that kept getting me was PBO Manager messing up my dayz_server.pbo - it took very careful work to get the file replaced without it missing something else. I opened with PBO manager, dragged the fsm out, hit ok on the signature prompt (if the PBO was still signed) then dragged the edited one back in. Whenever I deviated from that process I would usually get various errors.
 
anyway to just put this in a sqf i tried doing this
Code:
//hackerbox
    [] spawn
    {
    while {true} do
    {
    _boxes = nearestObjects [_x, [""MedBox0"", ""AmmoBoxBig"", ""USBasicWeapons_EP1"", ""USBasicAmmunitionBox_EP1"", ""UNBasicWeapons_EP1"", ""UNBasicAmmunitionBox_EP1"", ""USLaunchers_EP1"", ""USVehicleBox_EP1"", ""USSpecialWeapons_EP1"", ""LocalBasicAmmunitionBox"", ""Gunrack2"", ""Gunrack1"", ""RULaunchersBox"", ""RUBasicWeaponsBox"", ""RUBasicAmmunitionBox"", ""LocalBasicWeaponsBox"", ""RUSpecialWeaponsBox"", ""USBasicWeaponsBox"", ""USVehicleBox"", ""RUVehicleBox"", ""USSpecialWeaponsBox"", ""SpecialWeaponsBox"", ""USLaunchersBox"", ""TKVehicleBox_EP1"", ""TKSpecialWeapons_EP1"", ""TKOrdnanceBox_EP1"", ""TKLaunchers_EP1"", ""TKBasicWeapons_EP1"", ""TKBasicAmmunitionBox_EP1"", ""GunrackUS_EP1"", ""GunrackTK_EP1"", ""GuerillaCacheBox_EP1"", ""GERBasicWeapons_EP1"", ""CZBasicWeapons_EP1"", ""AmmoCrates_NoInteractive_Small"", ""AmmoCrates_NoInteractive_Medium"", ""AmmoCrate_NoInteractive_"", ""GuerillaCacheBox"", ""USBasicAmmunitionBox"", ""USOrdnanceBox_EP1"", ""RUOrdnanceBox"", ""AmmoBoxSmall_556"", ""AmmoBoxSmall_762"", ""ItemMatchbox"", ""ItemToolbox"", ""CardBoardBox"", ""FoodBox1"", ""FoodBox2"",""FoodBox3""], 50];"
    {"
          _box = _x;"
          _weap =  getWeaponCargo _box;"
          _players_nearby = _box nearEntities [AllPlayers, 50];"
          if (str(_weap) != '[[],[]]') then {"
          diag_log(""Hacker Box - "" + str(_players_nearby));"
          {"
          diag_log(""Hacker Box - "" + str(_box distance _x) + "" - "" + str(_x));"
          } forEach _players_nearby;"
          deleteVehicle _box;"
          diag_log (""Hacker Box - Weapons list is "" + str(_weap));"
          diag_log(""Hacker Box - Deleting hacker box"");"
          };"
          } forEach _boxes;"
    };
didnt want to work
 
I don't know about doing it as anything but the FSM. I did have trouble setting up that variable - didn't want to take for some reason for me. So, I made the _players_nearby line like this:

Code:
                       _players_nearby = _box nearEntities [["Soldier_Crew_PMC","Sniper1_DZ","Camo1_DZ","Soldier1_DZ","Rocket_DZ"], 50];

And that made it work. If it doesn't work for you -- Is it deleting the box at all? What's showing up in your RPT?
 
I don't know about doing it as anything but the FSM. I did have trouble setting up that variable - didn't want to take for some reason for me. So, I made the _players_nearby line like this:

Code:
                      _players_nearby = _box nearEntities [["Soldier_Crew_PMC","Sniper1_DZ","Camo1_DZ","Soldier1_DZ","Rocket_DZ"], 50];

And that made it work. If it doesn't work for you -- Is it deleting the box at all? What's showing up in your RPT?

the code Torndeco posted works but i just wanted it to be in a sqf
 
Can someone tell me if i can make this work on dayz .st server? I only have acesss to pbo so which code posted can i put in there and repack?
 
This is working great as far as deleting the box but the logging portion isn't going quite right.

Code:
/*%FSM</STATE>*/
    /*%FSM<STATE "check_for_hacker">*/
    class check_for_hacker
    {
      name = "check_for_hacker";
      init = /*%FSM<STATEINIT""">*/"//Check for hackers" \n
      " {" \n
      "    if(vehicle _x != _x) then {" \n
      "        if  (!(vehicle _x in _safety) && ((typeOf vehicle _x) != ""ParachuteWest"")) then {" \n
      "            diag_log (""CLEANUP: KILLING A HACKER "" + (name _x) + "" "" + str(_x) + "" IN "" + (typeOf vehicle _x));" \n
      "            (vehicle _x) setDamage 1;" \n
      "            _x setDamage 1;" \n
      "        };" \n
      "    } else {" \n
      "        if (isPlayer _x) then {" \n
      "            _boxes = nearestObjects [_x, [""MedBox0"", ""AmmoBoxBig"", ""USBasicWeapons_EP1"", ""USBasicAmmunitionBox_EP1"", ""UNBasicWeapons_EP1"", ""UNBasicAmmunitionBox_EP1"", ""USLaunchers_EP1"", ""USVehicleBox_EP1"", ""USSpecialWeapons_EP1"", ""LocalBasicAmmunitionBox"", ""Gunrack2"", ""Gunrack1"", ""RULaunchersBox"", ""RUBasicWeaponsBox"", ""RUBasicAmmunitionBox"", ""LocalBasicWeaponsBox"", ""RUSpecialWeaponsBox"", ""USBasicWeaponsBox"", ""USVehicleBox"", ""RUVehicleBox"", ""USSpecialWeaponsBox"", ""SpecialWeaponsBox"", ""USLaunchersBox"", ""TKVehicleBox_EP1"", ""TKSpecialWeapons_EP1"", ""TKOrdnanceBox_EP1"", ""TKLaunchers_EP1"", ""TKBasicWeapons_EP1"", ""TKBasicAmmunitionBox_EP1"", ""GunrackUS_EP1"", ""GunrackTK_EP1"", ""GuerillaCacheBox_EP1"", ""GERBasicWeapons_EP1"", ""CZBasicWeapons_EP1"", ""AmmoCrates_NoInteractive_Small"", ""AmmoCrates_NoInteractive_Medium"", ""AmmoCrate_NoInteractive_"", ""GuerillaCacheBox"", ""USBasicAmmunitionBox"", ""USOrdnanceBox_EP1"", ""RUOrdnanceBox"", ""AmmoBoxSmall_556"", ""AmmoBoxSmall_762"", ""ItemMatchbox"", ""ItemToolbox"", ""CardBoardBox"", ""FoodBox1"", ""FoodBox2"",""FoodBox3""], 50];" \n
      "            {" \n
      "                _box = _x;" \n
      "                _weap =  getWeaponCargo _box;" \n
      "                _players_nearby = _box nearEntities [AllPlayers, 50];" \n
      "                if (str(_weap) != '[[],[]]') then {" \n
      "                    diag_log(""pyBE -  Hack Box - "" + str(_players_nearby));" \n
      "                    {" \n
      "                        diag_log(""pyBE - Hack Box - "" + str(_box distance _x) + "" - "" + str(_x));" \n
      "                    } forEach _players_nearby;" \n
      "                    deleteVehicle _box;" \n
      "                    diag_log (""pyBE -  Hack Box - Weapons list is "" + str(_box) + "" "" + str(_weap));" \n
      "                    diag_log(""pyBE -  Hack Box - Deleting cheat box"");" \n
      "                    diag_log(""pyBE - Hack Box - End"");" \n
      "                };" \n
      "            } forEach _boxes;" \n
      "        };" \n
      "    };" \n
      " } forEach allUnits;"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "true">*/
        class true
        {
          priority = 0.000000;
          to="waiting";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
  };
  initState="init";
  finalStates[] =
  {
  };
};

This is what I have in my cleanup.fsm

My rpt shows this in abundance after testing the hack box cleanup;
Code:
16:03:09  Error position: <AllPlayers, 50];
if (str(_weap) != '[[],>
 
U havent assigned the variable AllPlayers i.e using a mission fix &
Code:
AllPlayers = ["Soldier_Crew_PMC","Sniper1_DZ","Camo1_DZ","Soldier1_DZ","Rocket_DZ"];
AllPlayersVehicles = ["Soldier_Crew_PMC","Sniper1_DZ","Camo1_DZ","Soldier1_DZ","Rocket_DZ","AllVehicles"];
variables.sqf

So the cleanup code has no clue what u mean..


Or u could change all occurances of AllPlayers to (it is afew different spots in the code i believe + not just in the box dectection part...
AllPlayers -> ["Soldier_Crew_PMC","Sniper1_DZ","Camo1_DZ","Soldier1_DZ","Rocket_DZ"]
 
U havent assigned the variable AllPlayers i.e using a mission fix &
Code:
AllPlayers = ["Soldier_Crew_PMC","Sniper1_DZ","Camo1_DZ","Soldier1_DZ","Rocket_DZ"];
AllPlayersVehicles = ["Soldier_Crew_PMC","Sniper1_DZ","Camo1_DZ","Soldier1_DZ","Rocket_DZ","AllVehicles"];
variables.sqf

So the cleanup code has no clue what u mean..


Or u could change all occurances of AllPlayers to (it is afew different spots in the code i believe + not just in the box dectection part...
AllPlayers -> ["Soldier_Crew_PMC","Sniper1_DZ","Camo1_DZ","Soldier1_DZ","Rocket_DZ"]

I see what you mean, I am using the DayZ CC that crosire made; in my mission file nor server pbo I don't have a variables.sqf so I'll try your second suggestion, only one occurrence of "AllPlayers" so just swap that with the models array?
 
The variables u can extract from whichever mod u are using...
Then add it to the mission file & alter the init.sqf to load the variables from the mission file...

Or u could just replace the AllPlayers with the models array
 
same here just got this working last night and now my custom pbo's are not working with the new update :s I will try again with the new updated pbo's later and post results.
 
Anyone been able to get this working on 1.7.5.1
Had it working on 1.7.4.4 but now I get this -

Code:
14:14:30 Error in expression <earby)));
{
diag_log("pyBE: Ammo Box: " str(_box) + ": Distance: " + str(_box di>
14:14:30  Error position: <str(_box) + ": Distance: " + str(_box di>
14:14:30  Error Missing )
14:14:30 Error in expression <earby)));
{
diag_log("pyBE: Ammo Box: " str(_box) + ": Distance: " + str(_box di>
14:14:30  Error position: <str(_box) + ": Distance: " + str(_box di>
14:14:30  Error Missing )
 
Back
Top