Hey,
all i did in the past had to to with php/sql, so im not sure if i did it right, pls take a look.
I thought to add a delay, after a nonwhitelisted pilot left system, until the bot start hunting again.
Changed the function ProcessState() in obj_Combat.
Added following on the top of the code, in the objectdef obj_Combat function:
New:
regards
all i did in the past had to to with php/sql, so im not sure if i did it right, pls take a look.
I thought to add a delay, after a nonwhitelisted pilot left system, until the bot start hunting again.
Changed the function ProcessState() in obj_Combat.
Added following on the top of the code, in the objectdef obj_Combat function:
Old code:variable bool wait_timex
function ProcessState()
{
This.Override:Set[FALSE]
if ${This.CurrentState.NotEqual["INSTATION"]}
{
if ${_Me.ToEntity.IsWarpScrambled}
{
; TODO - we need to quit if a red warps in while we're scrambled -- cybertech
UI:UpdateConsole["Warp Scrambled: Ignoring System Status"]
}
elseif !${Social.IsSafe}
{
call This.Flee
This.Override:Set[TRUE]
}
if (!${Ship.IsAmmoAvailable} && ${Config.Combat.RunOnLowAmmo})
{
; TODO - what to do about being warp scrambled in this case?
call This.Flee
This.Override:Set[TRUE]
}
call This.ManageTank
}
switch ${This.CurrentState}
{
case INSTATION
if ${Social.IsSafe}
{
call Station.Undock
}
break
case IDLE
break
case FLEE
call This.Flee
This.Override:Set[TRUE]
break
case FIGHT
call This.Fight
break
}
}
New:
If im right the bot is running the loop again and again. So as long as there is a non listed pilot in system, the variable wait_time will always be set to TRUE, so when the last neutral left system the bot would wait 10 more minutes. Am i right or totaly wrong, or just wrong synthaxes?function ProcessState()
{
This.Override:Set[FALSE]
if ${This.CurrentState.NotEqual["INSTATION"]}
{
if ${_Me.ToEntity.IsWarpScrambled}
{
; TODO - we need to quit if a red warps in while we're scrambled -- cybertech
UI:UpdateConsole["Warp Scrambled: Ignoring System Status"]
}
elseif !${Social.IsSafe}
{
call This.Flee
This.Override:Set[TRUE]
This.wait_timex:Set[TRUE]
}
elseif ${wait_timex} == TRUE
{
wait 6000
This.wait_timex:Set[FALSE]
}
if (!${Ship.IsAmmoAvailable} && ${Config.Combat.RunOnLowAmmo})
{
; TODO - what to do about being warp scrambled in this case?
call This.Flee
This.Override:Set[TRUE]
}
call This.ManageTank
}
switch ${This.CurrentState}
{
case INSTATION
if ${Social.IsSafe}
{
call Station.Undock
}
break
case IDLE
break
case FLEE
call This.Flee
This.Override:Set[TRUE]
break
case FIGHT
call This.Fight
break
}
}
regards
Last edited: