Page 1 of 1
Focus Agent script
Posted: Thu Mar 23, 2017 2:48 pm
by cooco
Code: Select all
function CheckFocusAgent()
if self._iFocusAgentDelay == nil or self._iFocusAgentDelay < Time() then
-- Check if we have a positive match and set cooldown.
if PlayerInput:Inventory( "Fine Focus Agent") then
self._iFocusAgentDelay = Time() + 900000;
return false;
elseif PlayerInput:Inventory( "Focus Agent") then
self._iFocusAgentDelay = Time() + 900000;
return false;
elseif PlayerInput:Inventory( "Greater Focus Agent") then
self._iFocusAgentDelay = Time() + 900000;
return false;
elseif PlayerInput:Inventory( "Lesser Focus Agent") then
self._iFocusAgentDelay = Time() + 900000;
return false;
elseif PlayerInput:Inventory( "Major Focus Agent") then
self._iFocusAgentDelay = Time() + 900000;
return false;
elseif PlayerInput:Inventory( "Minor Focus Agent") then
self._iFocusAgentDelay = Time() + 900000;
return false;
end
end
return true;
end
An Helper function. I hope be usefull

Re: Focus Agent script
Posted: Fri Jul 21, 2017 9:08 pm
by ewerson2
This code is OK
Code: Select all
function Pause()
if Player:GetState():GetState( 10051 ) == nil then
if Helper:CheckAvailableInventory( "Fine Focus Agent" ) then
PlayerInput:Inventory( "Fine Focus Agent" );
return false;
elseif Helper:CheckAvailableInventory( "Major Focus Agent" ) then
PlayerInput:Inventory( "Major Focus Agent" );
return false;
elseif Helper:CheckAvailableInventory( "Greater Focus Agent" ) then
PlayerInput:Inventory( "Greater Focus Agent" );
return false;
elseif Helper:CheckAvailableInventory( "Focus Agent" ) then
PlayerInput:Inventory( "Focus Agent" );
return false;
elseif Helper:CheckAvailableInventory( "Lesser Focus Agent" ) then
PlayerInput:Inventory( "Lesser Focus Agent" );
return false;
elseif Helper:CheckAvailableInventory( "Minor Focus Agent" ) then
PlayerInput:Inventory( "Minor Focus Agent" );
return false;
end
end
if Player:GetState():GetState( 10044 ) == nil then
if Helper:CheckAvailableInventory( "Fine Rally Serum" ) then
PlayerInput:Inventory( "Fine Rally Serum" );
return false;
elseif Helper:CheckAvailableInventory( "Major Rally Serum" ) then
PlayerInput:Inventory( "Major Rally Serum" );
return false;
elseif Helper:CheckAvailableInventory( "Greater Rally Serum" ) then
PlayerInput:Inventory( "Greater Rally Serum" );
return false;
elseif Helper:CheckAvailableInventory( "Rally Serum" ) then
PlayerInput:Inventory( "Rally Serum" );
return false;
elseif Helper:CheckAvailableInventory( "Lesser Rally Serum" ) then
PlayerInput:Inventory( "Lesser Rally Serum" );
return false;
elseif Helper:CheckAvailableInventory( "Minor Rally Serum" ) then
PlayerInput:Inventory( "Minor Rally Serum" );
return false;
end
end
-- Nothing was executed, continue with other functions.
return true;
end
Re: Focus Agent script
Posted: Mon Jul 24, 2017 4:49 pm
by agonic
This easy way ?
Code: Select all
function AttackFood()
stateID = {10740,10051,10064,10224,10225,9976,9989};
foodName = {"Minor Focus Agent","Lesser Focus Agent","Focus Agent","Greater Focus Agent","Major Focus Agent","Fine Focus Agent","Fried fresh Plumbo with Cheese"};
flag = 0;
for _,v in ipairs(stateID) do
if Player:GetState():GetState( v ) ~= nil then
flag = flag + 1;
end
end
if flag == 0 then
for a,b in ipairs(foodName) do
if Helper:CheckAvailableInventory( b ) then
PlayerInput:Inventory( b );
break;
end
end
end
return true;
end