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

Схожу с ума...

тут можно задать вопрос по скриптингу
Post Reply
ParadoX
Apprentice
Apprentice
Posts: 256
Joined: 17.03.2005 16:06

Схожу с ума...

Post by ParadoX »

program taming;
var

a : Integer;
b : TDateTime;
zver : array [1..2] of cardinal;
tmp : integer;
i : integer;
tim : integer;



procedure Hungry(NeededLevel : Integer);
var HArray : array [0..10] of String;
CurrentLevel : Integer;
HasError : Boolean;
TimeSayHungry : TDateTime;
FoodID : Cardinal;
i,c,difference : Integer;
begin
FoodID := $41D1CB09; {You must SET FoodID!}
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? No connect? Something else?');
Exit;
end;
difference := CurrentLevel - NeededLevel;
if difference > 0 then for i := 1 to difference do
begin
UseObject(FoodID);
wait(2000);
end;
end;



begin

zver[1]:=$0113494D;
zver[2]:=$01134934;

while 1=1 do
begin
i:=0;
while i < 10 do
begin
for tmp:=1 to 2 do
begin
UseSkill('Animal Taming');
WaitForTarget(5000);
b:=Now;
if TargetPresent then TargetToObject(zver[tmp]);

tim:=0;
repeat
wait(500);
tim := tim + 1;
until InJournalBetweenTimes('You successfully tame',b,Now)>0 or InJournalBetweenTimes('You fail',b,Now)>0 or tim > 24;


UOsay('all release')
i := i + 1;
end;
end;

Hungry(2);
End;
End.



что ему не нравица в or tim > 24; :?: :?: :?: :!: :!: :!:
Miralex
Developer
Developer
Posts: 656
Joined: 11.03.2005 19:12
Contact:

Post by Miralex »

until InJournalBetweenTimes('You successfully tame',b,Now)>0 or InJournalBetweenTimes('You fail',b,Now)>0 or tim > 24;
В скобки надо брать если сложное логическое выражение!

until (InJournalBetweenTimes('You successfully tame',b,Now)>0) or (InJournalBetweenTimes('You fail',b,Now)>0) or (tim > 24);
Miralex
Developer
Developer
Posts: 656
Joined: 11.03.2005 19:12
Contact:

Post by Miralex »

until (InJournalBetweenTimes('You successfully tame',b,Now)>0) or (InJournalBetweenTimes('You fail',b,Now)>0) or (tim > 24);
можно заменить на:

Code: Select all

until (InJournalBetweenTimes('You successfully tame|You fail',b,Now)>0) or (tim > 24);
ParadoX
Apprentice
Apprentice
Posts: 256
Joined: 17.03.2005 16:06

Post by ParadoX »

сенк приму на заметку.. щас буду реализовывать чтобы второй скрипт читал что что будет говорить первый.. точнее превращал в интегер..
Barsuello: 2 -> было просто 2
Post Reply