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 »

юзаю это...

Code: Select all

procedure IsCurMessages; 
var i,count : Integer; 
    s : String; 

begin 
count := 0; 
for i := HighJournal downto HighJournal - 50 do 
   begin 
   S := Journal(i); 
   if S = 'System: You must wait to perform another action' then count := count + 1; 
   end; 
if count >= 10 then Disconnect; 
end;
вот только месаги обычно исходят не от System а от GetName(self)... причем именно оно из всего списка не пашет :cry: :cry: :cry:
сделайте хотяб для селф...
Miralex
Developer
Developer
Posts: 656
Joined: 11.03.2005 19:12
Contact:

Post by Miralex »

Code: Select all

procedure CheckTargetError;
var D : TDateTime;
begin
{5 minutes in DateTime = 5 / 1440 = 0.00347}
D := Now - (0.00347);
InJournalBetweenTimes('I am already performing another action',D,Now);

if LineCount > 15 then
   begin
   AddToSystemJournal('Error with target. Disconnected');
   Disconnect;
   end;

end;
ParadoX
Apprentice
Apprentice
Posts: 256
Joined: 17.03.2005 16:06

Post by ParadoX »

Miralex wrote:

Code: Select all

procedure CheckTargetError;
var D : TDateTime;
begin
{5 minutes in DateTime = 5 / 1440 = 0.00347}
D := Now - (0.00347);
InJournalBetweenTimes('I am already performing another action',D,Now);

if LineCount > 15 then
   begin
   AddToSystemJournal('Error with target. Disconnected');
   Disconnect;
   end;

end;

ну это через поиск.. но было бы красивенько через гетнейм :twisted:
Miralex
Developer
Developer
Posts: 656
Joined: 11.03.2005 19:12
Contact:

Post by Miralex »

исходят не от System а от GetName(self)

Code: Select all

procedure CheckTargetError; 
var D : TDateTime; 
begin 
{5 minutes in DateTime = 5 / 1440 = 0.00347} 
D := Now - (0.00347); 
InJournalBetweenTimes(CharName + ': You must wait to perform another action',D,Now); 

if LineCount > 15 then 
   begin 
   AddToSystemJournal('Error with target. Disconnected'); 
   Disconnect; 
   end; 

end;
Post Reply