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

    • Lineage 2 Interlude L2OFF Server Based on H5 Files   Are you looking to start your own Lineage 2 server? This is your chance! I’m selling a 100% functional server based on Official L2OFF H5 files, adapted to the Interlude version. Main Features: Based on official L2OFF H5 files, perfectly configured for Interlude. Includes the full source code, allowing you to fully customize the server to fit your needs. Fully working events, such as: TvT (Team vs. Team) CTF (Capture the Flag) Tons of custom content added, keeping the balance and original essence of the game. Why choose this project? The server is fully functional and optimized, ready to launch. You can test the server before purchasing, with access to a GM character to explore all features. Comes with everything you need to make your project a success, both technically and in terms of content. Interested? Feel free to contact me! If you need more information or would like to schedule a test, I’m happy to answer any questions.   Auto Create Accounts Client Test Server: DOWNLOAD Discord: Guytis#6760 Skype: gustavoorellano@hotmail.com  
    • Website: https://l2aurum.com/  Discord: https://discord.gg/l2aurum   Hello Everyone,  finally, the moment has arrived: I'm launching my own server, L2Aurum!   L2Aurum x300 Closed Beta Test - Start: 17.02.2025  [20:00 GMT+2] Grand Opening 21.02.2025 [20:00 GMT+2]     Experience Rates: x300 Skill Points Rates: x300 Adena Drop: x300 Premium Accounts: x2 Drop Rates: x1 Spoil Rates: x1 Quest Rates: x1 Only one account per player, no dualboxing allowed. Everything is earned through gameplay, no pay-to-win mechanics. No server wipes—your progress is permanent. Fair play is a priority, with no room for corruption. All players are treated equally, no special favors.     Buffs slots: 26+4, all buffs in NPC and Scheme System. Custom Armors: Aurum Apella Armor Custom Weapons: Aurum Weapon Custom Accessories: +300 P.Def & M.Def Tattoos: Mage & Fighter & Custom Shirts Custom Jewels: New Grand Bosses Auto Farm is FREE for everyone. Status Noblesse: Barakiel. Player Spawn Protection: 10 seconds. Geodata e Panthodes: ENABLED. All Commands are visible in .menu. System 2 Bishop Per Party: ENABLED. Boss Protect - Anti-Zerg: ENABLED.     Siege Duration: 2 hours (120 minutes). Siege Period: Every 7 days. Castle Reward: 100E Per Castle. Available Castles: Rune Aden Giran Giran Siege: Every Friday 20:00 GMT +2. Aden Siege: Every Saturday 20:00 GMT +2. Rune Siege: Every Sunday 20:00 GMT +2. Main Clan: 40 Members max. Royal Clan: 12 Members max. Knight Clan: 7 Members max. Alliance: You can have only 1.     Epic Boss Valakas: Monday 22:30 (GMT+2) Zaken: Tuesday | Thursday 22:30 (GMT+2) Queen Ant: Monday | Wednesday 22:30 (GMT+2) Baium: Friday 22:30 (GMT+2) Antharas: Saturday 22:30 (GMT+2) Orfen: Tuesday | Thursday | Saturday 18:30 (GMT+2) Core: Monday | Wednesday | Friday | Sunday 18:30 (GMT+2)   Raid Boss  Flame Of Splendor Barakiel Last Hit: Every Day Respawn 3-4 hours Ember: Every Day Respawn 3-4 hours Lilith: Every Day Respawn 3-4 hours Anakim: Every Day Respawn 3-4 hours Queen Shyeed: Every Day Respawn 3-4 hours Golkonda: Every Day Respawn 3-4 hours Shuriel: Every Day Respawn 3-4 hours Varka's Hero Shadith: Every Day Respawn 3-4 hours Ketra's Hero Hekaton: Every Day Respawn 3-4 hours Varka's Mos: Every Day Respawn 3-4 hours Chief Horus: Every Day Respawn 3-4 hours Ketra's Tayer: Every Day Respawn 3-4 hours Chief Brakki: Every Day Respawn 3-4 hours Sailren: Every Day Respawn 02:00   🥳🥳🥳🥳 I would like to chat personally with all of you over on our Discord and discuss any suggestions or feedback you might have.      Website: https://l2aurum.com/  Discord: https://discord.gg/l2aurum
    • DISCORD : https://discord.com/users/325653525793210378 utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/uthciha-services https://campsite.bio/utchihaamkt
    • DISCORD : https://discord.com/users/325653525793210378 utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/uthciha-services https://campsite.bio/utchihaamkt
    • DISCORD : https://discord.com/users/325653525793210378 utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/uthciha-services https://campsite.bio/utchihaamkt
  • Topics

×
×
  • Create New...