Code:
BUF_fnc_getCrap =
{
params ["_type"];
lbClear 1500;
_return = [];
switch (_type) do
{
case "wep":
{
_tmp = "getText (_x >> 'cursor') isEqualTo 'arifle' OR getText (_x >> 'cursor') isEqualTo 'srifle' OR getText (_x >> 'cursor') isEqualTo 'hgun' OR getText (_x >> 'cursor') isEqualTo 'smg' OR getText (_x >> 'cursor') isEqualTo 'mg' AND getNumber (_x >> 'scope') == 2" configClasses (configFile >> "cfgWeapons");
{
if !((getText (configFile >> "cfgWeapons" >> configName (_x) >> "displayname")) isEqualTo "Rifle") then
{
_return pushBack configName (_x);
};
} forEach _tmp;
BUF_action ctrlSetText "Get Weapon";
[_return, "wep"] call BUF_fnc_addToList;
};
case "veh":
{
_return = ("configname _x isKindOf 'Car' && getNumber (_x >> 'scope') == 2 " configClasses (configfile >> "CfgVehicles")) apply {configName _x};
BUF_action ctrlSetText "Spawn Vehicle";
[_return, "veh"] call BUF_fnc_addToList;
};
case "player":
{
{
lbAdd [1500, name _x];
lbSetData [1500, _forEachIndex, _x call BIS_fnc_netId];
} forEach allPlayers;//change to allPlayers outside of testing
BUF_action ctrlSetText "Teleport To Player";
};
};
};
BUF_fnc_addToList =
{
params ["_name", "_type"];
lbClear 1500;
switch (_type) do
{
case "wep":
{
_tmp = [];
{
_wep = getText (configFile >> "cfgWeapons" >> _x >> "baseweapon");//test this setup with mod weapons
_dev = getText (configFile >> "cfgWeapons" >> _x >> "author");
if !(_dev isEqualTo "Bohemia Interactive") then
{
_tmp pushBackUnique _x;
} else
{
_tmp pushBackUnique _wep;
};
} forEach _name;
{
_wepName = getText (configFile >> "cfgWeapons" >> _x >> "displayname");
lbAdd [1500, _wepName];
lbSetData [1500, _forEachIndex, _x];
} forEach _tmp;
};
case "veh":
{
{
_obName = getText (configFile >> "cfgVehicles" >> _x >> "displayname");
lbAdd [1500, _obName];
lbSetData [1500, _forEachIndex, _x];
} forEach _name;
};
case "self":
{
BUF_action ctrlSetText "Do to Self";
_actions = ["Heal", "Kill", "God Mode On", "God Mode Off", "Infinite Ammo On", "Infinite Ammo Off", "Teleport", "Give Magazine"];
{
lbAdd [1500, _x];
} forEach _actions;
};
case "misc":
{
BUF_action ctrlSetText "Do....The misc thing";
_actions = ["Box ESP On", "Box ESP Off", "Triggerbot On", "Triggerbot Off", "Map Markers On", "Map Markers Off", "Show Aimed At Enemy Range On", "Show Aimed At Enemy Range Off", "Add Wasteland cash + 10000"];
{
lbAdd [1500, _x];
} forEach _actions;
};
};
};
BUF_fnc_mapTeleport =
{
closeDialog 602;
openMap true;
onMapSingleClick "player setPos _pos; openMap false; ['Teleported', xOutput, yOutput, 3, 0, 0, outputLayer] spawn BIS_fnc_dynamicText; onMapSingleClick ''; true";
};
BUF_fnc_deBox =
{
onEachFrame
{
if (BUF_deBox_val isEqualTo false) exitWith {onEachFrame{}};
{
_distance = round (_x distance player);
if (_distance < 801 && _x != player) then
{
_color = [0,0,0,1];
switch ((side _x)) do
{
case WEST: {_color = [0,0,1,1]};
case EAST: {_color = [1,0,0,1]};
case INDEPENDENT: {_color = [0,1,0,1]};
case CIVILIAN: {_color = [0.4,0,1,1]};
};
_uStance = stance _x;
_stance = 0;
switch (_uStance) do
{
case "STAND": {_stance = 1.84};
case "CROUCH": {_stance = 1.18};
case "PRONE": {_stance = 0.5};
};
_distance = round (_x distance player);
_posID = _x modelToWorldVisual [0,0,0];
_posBase = getPosATL _x;
_posTL1 = [(_posBase select 0) - 0.35, _posBase select 1, (_posBase select 2) + _stance];
_posBL1 = [(_posBase select 0) - 0.35, _posBase select 1, _posBase select 2];
_posTR1 = [(_posBase select 0) + 0.35, _posBase select 1, (_posBase select 2) + _stance];
_posBR1 = [(_posBase select 0) + 0.35, _posBase select 1, _posBase select 2];
_posTL2 = [_posBase select 0, (_posBase select 1) - 0.35, (_posBase select 2) + _stance];
_posBL2 = [_posBase select 0, (_posBase select 1) - 0.35, _posBase select 2];
_posTR2 = [_posBase select 0, (_posBase select 1) + 0.35, (_posBase select 2) + _stance];
_posBR2 = [_posBase select 0, (_posBase select 1) + 0.35, _posBase select 2];
if (_distance < 101) then
{
drawIcon3D ["", _color, _posID, 0, 00, 45, format ["%1: %2m", name _x, _distance], 0, 0.023];
} else {drawIcon3D ["", _color, _posID, 0, 00, 45, format ["*%1m",_distance], 0, 0.023]};
drawLine3D [_posTL1, _posTR1, _color];
drawLine3D [_posTL1, _posBL1, _color];
drawLine3D [_posTR1, _posBR1, _color];
drawLine3D [_posBL1, _posBR1, _color];
drawLine3D [_posTL2, _posTR2, _color];
drawLine3D [_posTL2, _posBL2, _color];
drawLine3D [_posTR2, _posBR2, _color];
drawLine3D [_posBL2, _posBR2, _color];
};
} forEach allUnits;
_distCursor = round (player distance cursorTarget);
};
};
BUF_fnc_mapMarkers =
{
_continue = false;
while {BUF_showMapMarkers} do
{
_continue = true;
if (visibleMap) then
{
{
_data = [];
_markName = name _x;
_mrk = createMarkerLocal [_markName, position _x];
_markName setMarkerColorLocal ([side _x, true] call BIS_fnc_sideColor);
_markName setMarkerShapeLocal "ICON";
_markName setMarkerTypeLocal "mil_dot";
_data pushBack _x;
_data pushBack _markName;
BUF_markers pushBack _data;
} forEach allUnits;
while {_continue} do
{
if !(visibleMap) then{_continue = false;};
{
_marker = _x select 1; _unit = _x select 0;
_marker setMarkerPosLocal position _unit;
if (!isPlayer _unit) then {_marker setMarkerTextLocal "AI"} else {_marker setMarkerTextLocal name _unit};
} forEach BUF_markers;
};
};
sleep 0.03;
};
if !(BUF_showMapMarkers) then {{_mrker = _x select 1; deletemarker _mrker} forEach BUF_markers};
};
BUF_fnc_showDistance =
{
while {BUF_cursor_showRange} do
{
if (cursorTarget isKindOf "Man" && (side cursorTarget) != (side player) && alive cursorTarget && round (cursorTarget distance player) < 801) then
{
_str = format ["Enemy is %1m away", round (cursorTarget distance player)];
[_str, xOutput, yOutput, 5, 0, 0, outputLayer] spawn BIS_fnc_dynamicText
};
};
};
BUF_fnc_iAmo =
{
while {BUF_iAmo} do
{
_ammoC = player ammo currentWeapon player;
if (_ammoC <= 10) then
{
_magClass = currentMagazine player;
_amount = getNumber (configFile >> "cfgMagazines" >> _magClass >> "count");
player setAmmo [currentWeapon player, _amount];
};
sleep 0.03;
};
};
BUF_fnc_triggerbot =//FIX THIS WHERE COMMENT IS
{
onEachFrame
{
if (BUF_triggerbot_val isEqualTo false) exitWith {onEachFrame{}};
if (cursorTarget isKindOf "Man" && (side cursorTarget) != (side player) && alive cursorTarget) then
{
_distance = player distance cursorTarget;
if (round _distance >= (currentZeroing player) + 80 && round _distance < (currentZeroing player) - 80) then
{//condition not firing
player forceWeaponFire [currentWeapon player, "single"];
};
};
};
};
BUF_fnc_doAction =
{
_type = "";
_action = ctrlText 1501;
if ((_action find 'Weapon') >= 0) then {_type = "wep"};
if ((_action find 'Vehicle') >= 0) then {_type = "veh"};
if ((_action find 'Player') >= 0) then {_type = "player"};
if ((_action find 'Self') >= 0) then {_type = "self"};
if ((_action find 'misc') >= 0) then {_type = "misc"};
switch (_type) do
{
case "wep":
{
_slot = lbCurSel 1500;
_wep = lbData [1500, _slot];
[player, _wep, 3] call BIS_fnc_addWeapon;
};
case "veh":
{
_slot = lbCurSel 1500;
_veh = lbData [1500, _slot];
_v = _veh createVehicle position player;
};
case "player":
{
_slot = lbCurSel 1500;
_unit = lbData [1500, _slot] call BIS_fnc_objectFromNetId;
hint str _unit;
player setPos [getPos _unit select 0, getPos _unit select 1, getPos _unit select 2];
};
case "self":
{
_slot = lbCurSel 1500;
_action = lbText [1500, _slot];
switch (_action) do
{
case "Heal": {player setDammage 0; ["Player Healed", xOutput, yOutput, 3, 0, 0, outputLayer] spawn BIS_fnc_dynamicText};
case "Kill": {player setDammage 1};
case "God Mode On": {player allowDamage false; ["God Mode On", xOutput, yOutput, 3, 0, 0, outputLayer] spawn BIS_fnc_dynamicText};//call fnc on each frame to set dammage
case "God Mode Off": {player allowDamage true; ["God Mode Off", xOutput, yOutput, 3, 0, 0, outputLayer] spawn BIS_fnc_dynamicText};
case "Infinite Ammo On": {BUF_iAmo = true; []spawn BUF_fnc_iAmo; ["Infinite Ammo On", xOutput, yOutput, 3, 0, 0, outputLayer] spawn BIS_fnc_dynamicText};
case "Infinite Ammo Off": {BUF_iAmo = false; ["Infinite Ammo Off", xOutput, yOutput, 3, 0, 0, outputLayer] spawn BIS_fnc_dynamicText};
case "Teleport": {call BUF_fnc_mapTeleport; ["Click on the map to teleport", xOutput, yOutput, 3, 0, 0, outputLayer] spawn BIS_fnc_dynamicText};
case "Give Magazine": {if !(currentWeapon player isEqualTo "") then {_mag = currentMagazine player; player addMagazine _mag; _str = format["%1 Retrieved",getText (configFile >> "cfgMagazines" >> _mag >> "displayname")]; [_str, xOutput, yOutput, 3, 0, 0, outputLayer] spawn BIS_fnc_dynamicText;}
else {["No Weapon In Hand", xOutput, yOutput, 3, 0, 0, outputLayer] spawn BIS_fnc_dynamicText;}};
};
};
case "misc":
{
_slot = lbCurSel 1500;
_action = lbText [1500, _slot];
switch (_action) do
{
case "Box ESP On": {BUF_deBox_val = true; call BUF_fnc_deBox; ["ESP On", xOutput, yOutput, 3, 0, 0, outputLayer] spawn BIS_fnc_dynamicText};
case "Box ESP Off": {BUF_deBox_val = false; call BUF_fnc_deBox; ["ESP Off", xOutput, yOutput, 3, 0, 0, outputLayer] spawn BIS_fnc_dynamicText};
case "Triggerbot On": {BUF_triggerbot_val = true; call BUF_fnc_triggerbot};
case "Triggerbot Off": {BUF_triggerbot_val = false};
case "Map Markers On": {BUF_showMapMarkers = true; []spawn BUF_fnc_mapMarkers};
case "Map Markers Off": {BUF_showMapMarkers = false};
case "Show Aimed At Enemy Range On": {BUF_cursor_showRange = true; []spawn BUF_fnc_showDistance; ["Show Enemy Range On", xOutput, yOutput, 3, 0, 0, outputLayer] spawn BIS_fnc_dynamicText};
case "Show Aimed At Enemy Range Off": {BUF_cursor_showRange = false; ["Show Enemy Range Off", xOutput, yOutput, 3, 0, 0, outputLayer] spawn BIS_fnc_dynamicText};
case "Add Wasteland cash + 10000": {_v = player getVariable ["cmoney", 0]; _v = _v + 10000; player setVariable ["cmoney", _v, true]; _str = format ["Cash: %1", _v]; [_str, xOutput, yOutput, 3, 0, 0, outputLayer] spawn BIS_fnc_dynamicText};
};
};
};
};
BUF_cursor_showRange = false;
BUF_showMapMarkers = false;
BUF_iAmo = false;
BUF_markers = [];
xOutput = 0.29 * safezoneW + safezoneX;
yOutput = 0.95 * safezoneH + safezoneY;
outputLayer = "outputlyer" call BIS_fnc_rscLayer;
while{true} do
{
waitUntil{!isNull (findDisplay 602)};
disableSerialization;
BUF_listTxt = (findDisplay 602) ctrlCreate ["RscText", -1];
BUF_wep_button = (findDisplay 602) ctrlCreate ["RscButton",-1];
BUF_veh_button = (findDisplay 602) ctrlCreate ["RscButton",-1];
BUF_player_button = (findDisplay 602) ctrlCreate ["RscButton",-1];
BUF_self_button = (findDisplay 602) ctrlCreate ["RscButton",-1];
BUF_misc_button = (findDisplay 602) ctrlCreate ["RscButton",-1];
BUF_action = (findDisplay 602) ctrlCreate ["RscButton",1501];
BUF_listBox = (findDisplay 602) ctrlCreate ["RscListBox",1500];
_w = (safeZoneW/6);
_h = (safeZoneH/18);
_x = 0.098 * safezoneW + safezoneX - 0.2;
_y = 0.3 * safezoneH + safezoneY;
BUF_listTxt ctrlSetText "gogogokitty's first pos menu";
BUF_wep_button ctrlSetText "Weapons";
BUF_veh_button ctrlSetText "Vehicles";
BUF_player_button ctrlSetText "Players";
BUF_self_button ctrlSetText "Self";
BUF_misc_button ctrlSetText "Misc";
BUF_action ctrlSetText "Get Weapon";
BUF_listTxt ctrlSetPosition [_x,_y + 0.12,_w,_h];
BUF_listBox ctrlSetPosition [_x,_y + 0.3,_w + 0.2,_h + 0.2];
BUF_wep_button ctrlSetPosition [_x,_y + 0.2,_w - 0.31,_h];
BUF_wep_button buttonSetAction "['wep'] call BUF_fnc_getCrap";
BUF_veh_button ctrlSetPosition [_x + 0.098,_y + 0.2,_w - 0.31,_h];
BUF_veh_button buttonSetAction "['veh'] call BUF_fnc_getCrap";
BUF_player_button ctrlSetPosition [_x + 0.197,_y + 0.2,_w - 0.31,_h];
BUF_player_button buttonSetAction "['player'] call BUF_fnc_getCrap";
BUF_self_button ctrlSetPosition [_x + 0.295,_y + 0.2,_w - 0.31,_h];
BUF_self_button buttonSetAction "['', 'self'] call BUF_fnc_addToList";
BUF_misc_button ctrlSetPosition [_x + 0.393,_y + 0.2,_w - 0.31,_h];
BUF_misc_button buttonSetAction "['', 'misc'] call BUF_fnc_addToList";
BUF_action ctrlSetPosition [_x,_y + 0.6,_w + 0.2,_h];
BUF_action buttonSetAction "call BUF_fnc_doAction";
BUF_wep_button ctrlCommit 0;
BUF_veh_button ctrlCommit 0;
BUF_player_button ctrlCommit 0;
BUF_self_button ctrlCommit 0;
BUF_misc_button ctrlCommit 0;
BUF_action ctrlCommit 0;
BUF_listTxt ctrlCommit 0;
BUF_listBox ctrlCommit 0;
['wep'] call BUF_fnc_getCrap;
while{!isNull (findDisplay 602)} do
{
if(isNull (findDisplay 602)) exitWith {};
};
};