Forum in READ ONLY mode! All questions and discussions on Discord official server, invite link: https://discord.gg/VxsGzJ7

Provocation for bards

Only working scripts
Post Reply
diGriZzZ
Posts: 4
Joined: 14.04.2005 11:07

Provocation for bards

Post by diGriZzZ »

Code: Select all

Program UseProvocation;
Var i : Integer; b : TDateTime;
{Author of hungry modul: Miralex, Authors of script: Miralex, diGriZzZ}
   
procedure Hungry(NeededLevel : Integer);
var HArray : array [0..10] of String;
    CurrentLevel : Integer;
    HasError : Boolean;
    TimeSayHungry : TDateTime;
    FoodID : Cardinal;
    i,c,difference : Integer;
begin
if (NeededLevel < 0) or (NeededLevel > 10) then Exit;
   HArray[0] := 'You are absolutely stuffed!';
   HArray[1] := 'You are stuffed';
   HArray[2] := 'hungry at all';
   HArray[3] := 'You are a little hungry';
   HArray[4] := 'You are somewhat hungry';
   HArray[5] := 'You are REALLY hungry';
   HArray[6] := 'Your stomash hurts';
   HArray[7] := 'Your stomash hurts and you feel dizzy';
   HArray[8] := 'You are starving';
   HArray[9] := 'You are almost dying of hunger';
   HArray[10] := 'You are DYING of hunger...';
HasError := true;
TimeSayHungry := Now;
UOSay('.hungry');
wait(100);
i:=0;
while i < 100 do
   begin
   for c := 0 to 10 do
   if InJournalBetweenTimes(HArray[c],TimeSayHungry,Now) >= 0 then
   begin
   CurrentLevel := c;
   HasError := false;
   i := 100;
   end;
   wait(100);
   i := i + 1;
   end;
if HasError then
   begin
   AddToSystemJournal('Error with Hungry: Lag? Conection error? Something else?');
   Exit;
   end;
difference := CurrentLevel - NeededLevel;
if difference > 0 then for i := 1 to difference do
   begin
   FoodID := FindType($097B,BackPack);
   if FoodID <> $00 then UseObject(FoodID)
   else AddToSystemJournal('No Food');
   wait(200);
   end;
end; 


Begin
while true do
begin

i:=0;
while i < 50 do
   begin
   repeat	
   b:=Now;
   WaitTargetObject($0113DC1E); //ID of your pet which is provoked
   wait(1000);
   UseSkill('Provocation');
   until WaitJournalLine(b, 'Select a target to provoke this onto|You enrage|I am already',5000); //serching in journal
   WaitForTarget(1000);
   if TargetPresent then TargetToObject($0113DD97); //ID of pet which is a target for the first one
   wait (1500);
   i := i + 1;
   end;

Hungry(1);

end; {end while}

End. 
еда естессно в паке должна быть...
первый Id - ид той твари, на которой вы качаете провоук, второй Id - ид той твари/чара на которую/которого вы натравливаете свою животину...
diGriZzZ
Posts: 4
Joined: 14.04.2005 11:07

Post by diGriZzZ »

по просьбам трудящихся... вроде защитились от зависания таргета, но т.к. мы оба не знаем из-за чего и при каких условиях происходит такая бяка, мы не гарантируем, что устранили эту проблему

Code: Select all

Program Prov;
var 
t:Integer;
b:TDateTime;

{$Include 'all.inc'}

Begin 
SetARStatus(true);
Hungry(1,backpack);
while not dead do 
begin 
for t:= 0 to 30 do
begin 
 Checktargeterror(2,2);
 CheckSave;
 repeat     
   b:=Now; 
   WaitTargetObject($0113DC1E); //ID of your pet which is provoked 
   wait(1000); 
   UseSkill('Provocation'); 
 until WaitJournalLine(b, 'Select a target to provoke this onto|You enrage|I am already',5000); //serching in journal 
   WaitForTarget(5000); 
   if TargetPresent then TargetToObject($0113DD97); //ID of pet which is a target for the first one 
   wait (1500); 
end;
Hungry(1,backpack); 
end; {end while} 
End.
St.Buch
Posts: 1
Joined: 26.12.2005 23:26

Post by St.Buch »

Честно говоря всё равно каждую минуту зависает таргет...
Могу предложить свой вариант не такой красивый зато без зависаний таргета и без Ай эм префё эназе экшн...

Code: Select all

Program Prov; 
var 
t:Integer; 


{$Include 'all.inc'} 

Begin 
SetARStatus(true); 
Hungry(1,backpack); 
while not dead do 
begin 
for t:= 0 to 30 do 
begin 
if targetPresent then canceltarget;
 Checktargeterror(2,2); 
 CheckSave; 
   UseSkill('Provocation'); 
   WaitTargetObject($013622B3); //ID of your pet which is provoked 
   wait(5000); 
   WaitTargetObject(self); //ID of your pet which is provoked 
   wait (10000); 
end; 
Hungry(1,backpack); 
end; {end while} 
End.
Post Reply