Jump to content

Adrenaline - Read Packets on Engine.WaitAction


Demonho

Recommended Posts

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
Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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)^;
Link to comment
Share on other sites

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
Link to comment
Share on other sites

^^ 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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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))

 

Link to comment
Share on other sites

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


  • Posts

    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/hood-services https://campsite.bio/utchihaamkt  
    • 📢 𝗦𝐭𝐚𝐫𝐭 𝐨𝐧 𝟐𝟲/𝟏𝟎/𝟐𝟎𝟐𝟒  𝟏6:𝟎𝟎 𝑳𝒐𝒏𝒅𝒐𝒏 𝑻𝒊𝒎𝒆 ⚔️ 𝗥𝗮𝘁𝗲𝘀: 𝗫𝗣 𝟐𝟱𝐗, 𝗔𝗱𝗲𝗻𝗮 𝟏𝟎𝐗, 𝗦𝗽𝗼𝗶𝗹 𝟏𝟎𝐗, 𝗗𝗿𝗼𝗽 7𝐗, 💬 𝗠𝗮𝘅 𝗲𝗻𝗰𝗵𝗮𝗻𝘁 +𝟭𝟲 𝘄𝗶𝘁𝗵 𝟱𝟎% 𝗻𝗼𝗿𝗺𝗮𝗹 𝗮𝗻𝗱 𝟲𝟎% 𝗯𝗹𝗲𝘀𝘀𝗲𝗱, 👉 𝗔𝘂𝘁𝗼 𝗲𝘃𝗲𝗻𝘁𝘀 🌍 𝗪𝗲𝗯𝗦𝗶𝘁𝗲: https://l2glorious.online/
    • Well, I'm looking for errors like the 1599 bug in attack speed bro Well, I'm looking for errors like the 1599 bug in attack speed bro
    • Hey! I’ve run into similar issues before. They usually track you through IPs, cookies, and sometimes even browser fingerprints, so just changing your MAC or IP probably won’t do the trick. I found that using a VPN really helps mask your IP, and clearing your cookies regularly makes a big difference. Also, browsing in incognito mode or using something like the Brave browser can help keep things private.
    • If you're trying to boost your attack speed in Interlude, I'd recommend focusing on optimizing your gear and skills instead of hunting for bugs. I’ve found that mixing up your equipment and looking for buffs that enhance attack speed can make a big difference. It’s also worth experimenting with different skill combos to maximize your damage output.
  • Topics

×
×
  • Create New...