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

I need help, about injournalbetweentimes

Ask for help
Post Reply
Atida
Neophyte
Neophyte
Posts: 17
Joined: 15.08.2017 4:33

I need help, about injournalbetweentimes

Post by Atida »

Line:until ( findtype($FFFF,body)=0 ) or ( InJournalBetweenTimes('can not pick',Startime,Now)>0 )
the monster's body is not open, but stealth find somethine in body and can not pick it, system message is "you can not pick that up", fuction InJournalBetweenTimes's value is 0.

Code: Select all

Program New;
var
  body : integer;   
  Startime:TdateTime;
const
  cut_weapon = $4080CEB8 ; 
  BankCard = $4021B635 ;   
  bankbox = $40700F2E ;    
  monster1 = $0024 ;       
  monster2 = $0023 ;       
  body_type = $2006 ;      
procedure equip_weapon;
begin
if ObjAtLayer(lhandlayer)=0 then Equip(LhandLayer,cut_weapon);
end;  

procedure cut_body;
begin
equip_weapon;
FindDistance:=2;
repeat
   findtype(body_type,ground); 
   useobject(cut_weapon);
   WaitForTarget(1000);
   TargetToObject(finditem); 
   Ignore(finditem);
until findtype(body_type,ground) = 0
ignorereset;
ClearJournal;
repeat
  useobject(findtype(body_type,ground));  
  body := finditem;
  wait(1000);
  useobject(BankCard);
  wait(1000); 
  Startime:=now;
  repeat
    findtype($FFFF,body);
    MoveItem(finditem,FindQuantity,bankbox,0,0,0);
    wait(1000);        
  until ( findtype($FFFF,body)=0 ) or ( InJournalBetweenTimes('can not pick',Startime,Now)>0 )  
  ignore(body);   
       FindDistance:=2;
       if findtype(monster1,Ground)>0 then cast('Wither');
until findtype(body_type,ground)=0
ignorereset;
end;
  
procedure killmonster;
Label Kill;
begin
  Kill:           
  FindDistance:=10;
  if findtype(monster1,Ground)>0 then begin
     Attack(finditem);  
       FindDistance:=2;
       if findtype(monster1,Ground)>0 then cast('Wither');
     wait(2000);
     //addtosystemjournal(getname(finditem));
     goto Kill
  end;
  if findtype(monster2,Ground)>0 then begin
     Attack(finditem); 
       FindDistance:=2;
       if findtype(monster1,Ground)>0 then cast('Wither');
     cast('Wither');
     wait(2000);
     goto Kill
  end;
wait(1000);
end;


//==================Main=================
begin
while true do begin
movexy(5484,567,true,0,true);
movexy(5452,525,true,0,true);
killmonster;
cut_body; 
movexy(5411,533,true,0,true);
killmonster;
cut_body;  
movexy(5408,571,true,0,true);
killmonster;
cut_body;  
movexy(5410,608,true,0,true);
killmonster;
cut_body;   
movexy(5388,619,true,0,true);
killmonster;
cut_body;     
movexy(5436,587,true,0,true);
killmonster;
cut_body;    
movexy(5468,608,true,0,true);
killmonster;
cut_body;  
movexy(5503,595,true,0,true);
killmonster;
cut_body;    
end;
end.
Atida
Neophyte
Neophyte
Posts: 17
Joined: 15.08.2017 4:33

Re: I need help, about injournalbetweentimes

Post by Atida »

Stealth can not detect the system message "you can not pick that up"
User avatar
Vizit0r
Developer
Developer
Posts: 3958
Joined: 24.03.2005 17:05
Contact:

Re: I need help, about injournalbetweentimes

Post by Vizit0r »

normally should detect, its message from serverside.
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
GeeZeR
Apprentice
Apprentice
Posts: 226
Joined: 28.01.2012 19:48

Re: I need help, about injournalbetweentimes

Post by GeeZeR »

yea that's strange, try to test it with this code:

Code: Select all

PROGRAM New;
var
Start : TDateTime;

begin
	Start := now;
	UOSay('Hello');
	Wait(1000);
	AddToSystemJournal(IntToStr(InJournalBetweenTimes('Hello', Start, Now)));
end.
Stealth 8.10.2 | Клиент: 7.0.13.4
Post Reply