Jump to content

Recommended Posts

Posted (edited)

Hello,

Need help with script, need capture info about olympiad in interlude (/olympiadstat)

How can read the system messages?

 

var
	p1, p2: pointer;
    matches, wins, loss, points : integer;
    OlyStat : integer;    
begin
	//1673	1	Your current record for this Grand Olympiad is $s1 match(es), $s2 win(s) and $s3 defeat(s). You have earned $s4 Olympiad Point(s).	0	79	9B	B0	FF			0	0	0	0	0		none
	OlyStat:=1673;
	while (true) do 
    begin
    	//laSysMsg - system message appeared. P1 - message identificator (cardinal), P2 - message data (TMemoryStream).
		Engine.WaitAction([laSysMsg], p1, p2);
        if(p1=OlyStat)then
        begin
        	//need read olympiad stat from p2 
            matches:=???
            wins:=???
			loss:=???
            points:=???
        end;
    end;
end;

 

Edited by Demonho
Posted
uses
  SysUtils;

var
  p1, p2: Pointer;
  Match, Win, Loss, Points: Cardinal;
begin
  while true do
  begin
    if Engine.WaitAction([laSysMsg], p1, p2) = laSysMsg then
    begin
      if Cardinal(p1) = 1673 then
      begin
        Match := PCardinal(Cardinal(p2) + 12)^;
        Win := PCardinal(Cardinal(p2) + 20)^;
        Loss := PCardinal(Cardinal(p2) + 28)^;
        Points := PCardinal(Cardinal(p2) + 36)^;
        print(format('Match: %d; Win: %d; Loss: %d; Points: %d', [Match, Win, Loss, Points]));
      end;
    end;
  end;
end.

 

Posted

Thanks adr.bot

 

On 4/11/2021 at 7:53 PM, adr.bot said:

Match := PCardinal(Cardinal(p2) + 12)^;

Win := PCardinal(Cardinal(p2) + 20)^;

Loss := PCardinal(Cardinal(p2) + 28)^;

Points := PCardinal(Cardinal(p2) + 36)^;

changed to find the correct values:
 

        Match := PCardinal(Cardinal(p2))^;
        Win := PCardinal(Cardinal(p2) + 8)^;
        Loss := PCardinal(Cardinal(p2) + 16)^;
        Points := PCardinal(Cardinal(p2) + 24)^;
Posted (edited)
25 minutes ago, Demonho said:

Thanks adr.bot

 

changed to find the correct values:
 





        Match := PCardinal(Cardinal(p2))^;
        Win := PCardinal(Cardinal(p2) + 8)^;
        Loss := PCardinal(Cardinal(p2) + 16)^;
        Points := PCardinal(Cardinal(p2) + 24)^;

np, but it is really correct values? for example when tested (interlude)
 

PCardinal(Cardinal(p2))^

gave me system message ID.

https://prnt.sc/11c67l2

Edited by adr.bot
  • Like 1
Posted
On 4/13/2021 at 11:24 AM, adr.bot said:

np, but it is really correct values? for example when tested (interlude)

I belive so
In all tests the correct value was returned
 

olystats.png

Posted
1 hour ago, Demonho said:

I belive so
In all tests the correct value was returned
 

olystats.png

thats interesting, anyways as long as it works then good, gl!

Posted

^^ yeah!!!

In another case, for relogin purposes i need check if char is online, my idea is send a invalid command to server. If receive the Command not found, char is online.

i made a test with:
 

uses
  SysUtils;

var
  p1, p2: Pointer;
  Match, Win, Loss, Points: Cardinal;
  i: integer;
  ret: string;
begin
  while true do
  begin
    if Engine.WaitAction([laSysMsg], p1, p2) = laSysMsg then
    begin
      if Cardinal(p1) = 1987 then
      begin
        for i:= 0 to 44 do
        begin
          if i mod 2 <> 0 then Continue;
          ret:=ret+PChar(Cardinal(p2)+i)^;
        end;
      end;
      Print(ret);
    end;
  end;
end.

its correct? give me result i am expecting: SYS: Command not found.

There is a better way to read p2 on this case?

Posted (edited)
28 minutes ago, Demonho said:

^^ yeah!!!

In another case, for relogin purposes i need check if char is online, my idea is send a invalid command to server. If receive the Command not found, char is online.

i made a test with:
 



uses
  SysUtils;

var
  p1, p2: Pointer;
  Match, Win, Loss, Points: Cardinal;
  i: integer;
  ret: string;
begin
  while true do
  begin
    if Engine.WaitAction([laSysMsg], p1, p2) = laSysMsg then
    begin
      if Cardinal(p1) = 1987 then
      begin
        for i:= 0 to 44 do
        begin
          if i mod 2 <> 0 then Continue;
          ret:=ret+PChar(Cardinal(p2)+i)^;
        end;
      end;
      Print(ret);
    end;
  end;
end.

its correct? give me result i am expecting: SYS: Command not found.

There is a better way to read p2 on this case?

i would recommend read this https://adrenalinebot.com/en/api/example/packetunit-ready-unit-working-packets-adrenaline-bot because how u read seems not right.
p2  should contain (in my case MessageID), Size, Type, and values by Type.

thats why i dont have answer for ur question in this case, because ur system message data seems odd to me xd

ps. u always can use move and check if u moved.

Edited by adr.bot
Posted
On 4/14/2021 at 4:36 PM, adr.bot said:

ps. u always can use move and check if u moved.

see a quite more easy to implement.

Tested the unitpacket, this operations os pointers is strange a lot for me, i cant see any logic here kkkkk
 

uses
  SysUtils, PacketUnit;

var
  p1, p2: Pointer;
  Match, Win, Loss, Points: Cardinal;
  i: integer;
  ret: string;
  p : TNetworkPacket;
begin
  while true do
  begin
   
    if Engine.WaitAction([laSysMsg], p1, p2) = laSysMsg then
    begin
      if Cardinal(p1) = 1987 then
      begin
        p:=TNetworkPacket.Create(p2,46);
        Print(p.ReadS);
        p:=nil;        
      end;

      if Cardinal(p1) = 1673 then
      begin
        p:=TNetworkPacket.Create(p2,24);
        Match := p.ReadD;
        Win := p.ReadD;
        Loss := p.ReadD;
        Points := p.ReadD;
        p:=nil;
        print(format('Match: %d; Win: %d; Loss: %d; Points: %d', [Match, Win, Loss, Points]));
      end;      
    end;
  end;
end.

 

Posted
10 minutes ago, Demonho said:

see a quite more easy to implement.

Tested the unitpacket, this operations os pointers is strange a lot for me, i cant see any logic here kkkkk
 


uses
  SysUtils, PacketUnit;

var
  p1, p2: Pointer;
  Match, Win, Loss, Points: Cardinal;
  i: integer;
  ret: string;
  p : TNetworkPacket;
begin
  while true do
  begin
   
    if Engine.WaitAction([laSysMsg], p1, p2) = laSysMsg then
    begin
      if Cardinal(p1) = 1987 then
      begin
        p:=TNetworkPacket.Create(p2,46);
        Print(p.ReadS);
        p:=nil;        
      end;

      if Cardinal(p1) = 1673 then
      begin
        p:=TNetworkPacket.Create(p2,24);
        Match := p.ReadD;
        Win := p.ReadD;
        Loss := p.ReadD;
        Points := p.ReadD;
        p:=nil;
        print(format('Match: %d; Win: %d; Loss: %d; Points: %d', [Match, Win, Loss, Points]));
      end;      
    end;
  end;
end.

 

well i mean to read to see idea how it getting read, and not actually use it.
anyways to read string (probably, should actually test), i cant tell "Position" number because ur server positions seems odd to me.

String(PChar(Cardinal(p2) + Position))

 

  • Vision locked this topic
Guest
This topic is now closed to further replies.


  • Posts

    • L2VikosMemory | User Manual 1. General Information L2VikosMemory is a memory optimization tool for Lineage II. It automatically clears the game cache, reducing RAM usage and improving stability. 2. Installation Extract L2VikosMemory.dll and ogg.dll into the game folder (where l2.exe is located). No additional steps are required. 3. Configuration L2VikosMemory settings can be adjusted in the L2VikosMemory.cfg file: CleanInterval=X – Cleanup interval (in minutes) TryElevate=true/false – Enable/disable privilege escalation AltClientGuard=true/false – Compatibility setting for STRIXGUARD Example Configuration: CleanInterval=3   TryElevate=false   AltClientGuard=false   4. Verification The log file L2VikosMemory.log contains: Connection status Cleanup results Freed memory 5. Troubleshooting If L2VikosMemory is not working: Check if the DLL files are in the correct folder. Try running the game as an administrator. Check the log file for errors. 6. Support For support, contact Artem on Telegram. 7. Additional Information Compatibility: Supports most Lineage II clients. Recommended Interval: 3-5 minutes. Gameplay Impact: No effect on gameplay performance. Price: $150
    • L2 LOKAGAMERS - WEBSITE DESIGN    
    • Then wtf do You even do there? That's the issue. You think I only have those customers with negative experiance. I don't beg my customers to "post positive review in my topic at MXC's". 80% of them don't even have an account here. I don't care. But for TIME TO TIME, someone post a bad experiance review, because he had to wait and got refunded becausae of that...oh...now no-lifers like Cuntw0lf have something to do with their life. None of You were my customer so...You can fuck off 😎✌️
    • Where did I mention that you scam people? I was mentioning that people have to wait every now and then and to be honest that shouldn't happen. And I am not talking about these cases when your city get flooded. However, do what u think is appropriate, I really can't care enough.
    • I sell 20-30 launchers and logo designs per every 1 report about DELAY. Not scamm. DELAY. I don't have to feed Your croocked curiosity. If You don't know what "custom" means, I won't waste more time on You. Go spread Your conspiracy theories in other topics.
  • Topics

×
×
  • Create New...