кой чего добавил койчего убрал !!!
на данный момент у меня все прекрасно работает -
но чары слабый и постояяно друг другоа убевают при чем. у нас на шарде требуеться 120 хилинга что бы ресать - а у меня всего то 70.
поетому есть жосткая необходимость сделать остановку чаров дабызахиляться. Придумал делать ето по командам. вот что вышло.
procedure CheckStat;
var stime : TDateTime;
begin
WaitJournalLine (stime, 'Stop-now', 1000);
begin
SetWarMode (false);
Wait(1000);
AddToSystemJournal ('Пративнек атпизжен - бой остановлен ');
end;
WaitJournalLine (stime, 'Start-now',1000);
begin
SetWarMode (true);
AddToSystemJournal ('Правтивнек зализал сваи раны - бой продолжается');
Wait(1000);
end;
end;
procedure CheckHPM;
begin
if (HP = MaxHP) then
UOSay ('Start-now');
wait (1000);
CheckStat;
end;
procedure CheckHP;
begin
if (hp < 80) then
UOSay ('Stop-now');
Wait (1000);
CheckStat;
end;
но к сожалению оно не работает.
помогите с ответом.
ниже прилажываю весь скрипт
Code: Select all
Program fighter;
var HungryTime, HealTime : Cardinal;
EnemyID, ArmorBox : cardinal;
UseHeater ,UseGbinti: Boolean;
UseDagerTime, UseHandsTime, DT, HT : Cardinal;
Char : Array[1..2] of Cardinal;
Const
EnemyType1 = $0190;
EnemyType2 = $0191;
GhostType1 = $0192;
GhostType2 = $0193;
BandageType = $0E21;
GbintiType = $0E20;
DagerType = $0F51;
HeaterType = $1B76; {Need Setup}
ArmorBoxType = $0E75; {Need Setup}
CriticalHP = 70; {Need Setup}
{$Include 'all.inc'}
procedure FullDisconnect;
begin
SetARStatus(false);
Disconnect;
end;
function OpenArmorBox : Boolean;
begin
WaitConnection(2000);
CheckSave;
ArmorBox := FindType(ArmorBoxType, backpack);
if ArmorBox = 0 then
begin
AddToSystemJournal('Error: ArmorBox not finded');
FullDisconnect;
Result := false;
Exit;
end
else Result := true;
UseObject(ArmorBox);
wait(2000);
end;
procedure Heal(Enemy : Cardinal);
var Bandages : Cardinal;
stime : TDateTime;
begin
if GetType(Enemy) = 0 then Exit;
Bandages := FindType(BandageType, backpack);
if Bandages = 0 then
begin
AddToSystemJournal('Error: No bandages');
Wait(1000);
Exit;
end;
if TargetPresent then
begin
CancelTarget;
Wait(1000);
end;
stime := Now;
WaitTargetObject(Enemy);
UseObject(Bandages);
WaitJournalLine(stime, 'лПЗП ЧЩ ИПФЙФЕ ЧЩМЕЮЙФШ?|you have healed your patient|Your patient is at full heath|You have resurrected|You could not heal him', 15000);
Wait(1000);
end;
procedure CheckWeapon;
var WeaponID : Cardinal;
begin
if TargetPresent then
begin
CancelTarget;
Wait(1000);
end;
WaitConnection(2000);
CheckSave;
{уОБЮБМБ РТПЧЕТЙН ЭЙФ}
if (ObjAtLayer(LhandLayer) = 0) and UseHeater then
begin
UseObject(ArmorBox);
wait(3000);
if (findtype(HeaterType, Ground) = 0) then findtype(HeaterType, ArmorBox);
WeaponID := finditem;
if WeaponID = 0 then
begin
AddToSystemJournal('Error: Heater not finded');
end
else
begin
Equip(LhandLayer,WeaponID);
AddToSystemJournal('Heater is equiped');
end;
end;
if ObjAtLayer(RhandLayer) > 0 then Exit;
UseObject(ArmorBox);
wait(3000);
if ((DT + UseDagerTime > Timer) or (DT = 0)) and (UseDagerTime <> 0) then
begin
if DT = 0 then
begin
AddToSystemJournal('Begin of using Dager');
DT := Timer;
end;
if (findtype(DagerType, Ground) = 0) then findtype(DagerType, ArmorBox);
WeaponID := finditem;
if WeaponID = 0 then
begin
AddToSystemJournal('Error: Dager not finded');
DT := Timer - UseDagerTime;
Exit;
end;
Equip(RhandLayer,WeaponID);
AddToSystemJournal('Dager is equiped');
Exit;
end;
if ((HT + UseHandsTime > Timer) or (HT = 0)) and (UseHandsTime <> 0) then
begin
if HT = 0 then
begin
AddToSystemJournal('Begin of using Hands');
HT := Timer;
end;
Exit;
end;
DT := 0;
HT := 0;
end;
procedure CheckGbinti;
var Gbinti : Cardinal;
begin
if TargetPresent then
begin
CancelTarget;
Wait(1000);
end;
WaitConnection(2000);
CheckSave;
if (findtype(GbintiType,backpack) = 0) then findtype(GbintiType,ArmorBox);
Gbinti := finditem;
if Gbinti = 0 then Exit;
begin
UseObject(Gbinti);
WaitTargetTile(6039,2255,1050,251);
Wait(5000);
end;
end;
procedure CheckStat;
var stime : TDateTime;
begin
WaitJournalLine (stime, 'Stop-now', 1000);
begin
SetWarMode (false);
Wait(1000);
AddToSystemJournal ('Пративнек атпизжен - бой остановлен ');
end;
WaitJournalLine (stime, 'Start-now',1000);
begin
SetWarMode (true);
AddToSystemJournal ('Правтивнек зализал сваи раны - бой продолжается');
Wait(1000);
end;
end;
procedure CheckHPM;
begin
if (HP = MaxHP) then
UOSay ('Start-now');
wait (1000);
CheckStat;
end;
procedure CheckHP;
begin
if (hp < 80) then
UOSay ('Stop-now');
Wait (1000);
CheckStat;
end;
procedure CheckWar;
begin
if TargetPresent then
begin
CancelTarget;
Wait(1000);
end;
WaitConnection(2000);
CheckSave;
if (wartargetid <> EnemyID) or (iswarmode(self) = false) then attack(EnemyID);
if IsDead(EnemyID) then SetWarMode(false);
end;
procedure CheckDead;
var c : Integer;
begin
WaitConnection(2000);
CheckSave;
if Dead then
begin
AddToSystemJournal('I''m Dead. Waiting while anybody resurect me.');
SetWarMode(true);
WaitGump('1');
wait(5000);
while (Dead) do
begin
Wait (2000);
WaitGump('1');
end;
wait (2000);
WaitConnection(2000);
CheckSave;
Hungry(1, -1);
c := 0;
while (HP < MaxHP) and (c < 3) and (not Dead) do
begin
UOSay('heal');
Wait(3000);
c := c + 1;
end;
end;
end;
procedure CheckGhost;
var c : Integer;
begin
WaitConnection(2000);
CheckSave;
if (GetType(EnemyID) <> GhostType1) and (GetType(EnemyID) <> GhostType2) then Exit;
AddToSystemJournal('Detecting Ghost. Trying resurect him.');
SetWarMode(false);
Heal(EnemyID);
Wait(2000);
WaitConnection(2000);
CheckSave;
Heal(EnemyID);
Wait(1000);
c := 0;
if Dead then Exit;
while (WarTargetID = 0) or (c > 15) do
begin
Wait(1000);
c := c + 1;
end;
end;
Begin
{оБЮБМШОБС ЙОЙГЙМЙЪБГЙС}
HungryTime := 0;
HealTime := 0;
DT := 0;
HT := 0;
{Now Setup 3 times. 1 Hour = 60*60*1000}
UseDagerTime := 60 * 60 * 1000; {Need Setup} {Set 0 if you don't want use it}
UseHandsTime := 60 * 60 * 1000; {Need Setup} {Set 0 if you don't want use it}
UseHeater := true;
UseGbinti := true; {Need Setup}
Char[1] := $002A91B4; {Need Setup}
Char[2] := $002E2F38; {Need Setup}
FindDistance := 1;
WaitConnection(2000);
CheckSave;
CheckDead;
wait(5000);
if Self = 0 then
begin
AddToSystemJournal('Error : Self = 0.');
Exit;
end;
if (Char[1] <> Self) then EnemyID := Char[1]
else EnemyID := Char[2];
CheckGhost;
if not OpenArmorBox then Exit;
AddToSystemJournal('Open ArmorBox compete');
FindType(DagerType, ArmorBox);
AddToSystemJournal('There are ' + IntToStr(FindFullQuantity) + ' dagers');
FindType(HeaterType, ArmorBox);
AddToSystemJournal('There are ' + IntToStr(FindFullQuantity) + ' heaters');
FindType(GbintiType, backpack);
AddToSystemJournal('There are ' + IntToStr(FindFullQuantity) + ' stirka');
FindType(BandageType, backpack);
AddToSystemJournal('There are ' + IntToStr(FindFullQuantity) + ' bandages');
SetARStatus(true);
while true do
begin
WaitConnection(2000);
CheckSave;
CheckDead;
CheckGhost;
CheckHP;
CheckWar;
CheckWeapon;
CheckGbinti;
if (Count(BandageType) <= 0) then CheckGbinti;
{if UseGbinti then CheckGbinti;}
{Eat by timer}
if Timer > (HungryTime + (15 * 60 * 1000)) then
begin
WaitConnection(3000);
CheckSave;
CheckDead;
if TargetPresent then
begin
CancelTarget;
Wait(1000);
end;
Hungry(1, backpack);
HungryTime :=Timer;
end;
Heal(EnemyID);
wait(1000);
end;
End.
[/list][code]