Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home/iano/public_html/tpforums-vb5/forum/includes/class_core.php on line 5842

PHP Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NUM' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_ASSOC - assumed 'MYSQL_ASSOC' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_BOTH - assumed 'MYSQL_BOTH' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 588

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 612

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6
NEW Packet Structures - Page 13
Page 13 of 13 FirstFirst ... 3111213
Results 121 to 129 of 129

Thread: NEW Packet Structures

  1. #121

    RE: NEW Packet Structures

    Not working...
    I've made the class that you say, and have some errors to convert my old packets

    Hmmm, i'm tryng to convert this:
    [code=vbnet]

    public void UseItemInFloor(int x, int y, int z, int id)
    {
    byte[] packet = new byte[9];
    packet[0] = 0xA;
    packet[1] = 0x0;
    packet[2] = 0x82;
    packet[3] = (byte)Encoding.ASCII.GetBytes(x.ToString())[0];
    packet[4] = (byte)Encoding.ASCII.GetBytes(y.ToString())[0];
    packet[5] = (byte)z;
    packet[6] = (byte)Encoding.ASCII.GetBytes(id.ToString())[0];
    packet[7] = 0x1;
    packet[8] = 0x3;
    Send(packet);
    }
    [/code]

    But, with the conversion, it doesn't works..
    [code=vbnet]
    public void UseItemInFloor(int x, int y, int z, int id)
    {
    NetworkMessage p = new NetworkMessage();
    p.AddByte(0x82);
    p.AddUInt32((uint)x);
    p.AddUInt32((uint)y);
    p.AddUInt32((uint)z);
    p.AddUInt32((uint)id);
    p.AddUInt16(0x1);
    p.AddByte (0x3);
    Send(p);
    }
    [/code]

  2. #122
    Super Moderator
    Join Date
    May 2007
    Posts
    1,191

    RE: NEW Packet Structures

    [code=c#]
    NetworkMessage p = new NetworkMessage();
    p.AddByte(0x82);
    //you can use p.AddLocation if the class supports it
    p.AddUInt16((ushort)x);
    p.AddUInt16((ushort)y);
    p.AddByte((byte)z);
    p.AddUInt16((ushort)id);
    p.AddByte(1); // NOTE: this should be the item's stack index on the map
    p.AddByte(3); // NOTE: I'm not entirely sure, but I think this should be the first CLOSED container number (the internal function uses this argument)
    //don't forget to add length to the packet
    [/code]
    Did you copy-paste TibiaAPI's NetworkMessage class? If so, make sure you understand how it forms packets.
    For example, creating a new NetworkMessage object by using the constructor with no arguments, you'll end up with 8 empty bytes before your packet. See this to know what I'm talking about.

    edit: Before you attempt any more "conversions", please read up on data types and the first post in this thread.

  3. #123

    RE: NEW Packet Structures

    Hello, i trying to do a packet, for tibia 8.10 what use item by ID on item on ground by ID, not by X Y Z.

    I tried to many ways, changing packets from this topic, in example
    Code:
            Dim PacketBuffer(12) As Byte
            PacketBuffer(0) = &HD
            PacketBuffer(1) = &H0
            PacketBuffer(2) = &H84
            PacketBuffer(3) = &HFF
            PacketBuffer(4) = &HFF
            PacketBuffer(5) = &H0
            PacketBuffer(6) = &H0
            PacketBuffer(7) = &H0
            PacketBuffer(8) = LongToByte(3554, 1) 'ID of the Item wanna be used
            PacketBuffer(9) = LongToByte(3554, 2)
            PacketBuffer(10) = &H0
            PacketBuffer(11) = LongToByte(4029, 1) 'ID of the creature to be used with (your ID if wanna use on you)
            PacketBuffer(12) = LongToByte(4029, 2)
            SendPacket(Tibia_Hwnd, PacketBuffer(0))
    But it doesn't work.
    Can someone help me?

  4. #124

    RE: NEW Packet Structures

    /\ i have this same problem.
    Anyone help me? ;d

  5. #125
    Junior Member
    Join Date
    Aug 2010
    Posts
    23

    RE: NEW Packet Structures

    Solved

  6. #126
    aglasith
    Guest

    RE: NEW Packet Structures

    Packet structure for buying items at npc

    Code:
    07 00 7A 10 0E 00 01 00 00
       1  2  3     4? 5  6 ? 7?
    1) - header 2)Type 3)id of item 4)? 5)Count 6)? 7)?

    @EDIT: Sell is 7B

  7. #127
    Administrator
    Join Date
    Mar 2007
    Posts
    1,723

    RE: NEW Packet Structures

    Quote Originally Posted by aglasith
    Packet structure for buying items at npc

    Code:
    07 00 7A 10 0E 00 01 00 00
       1  2  3     4? 5  6 ? 7?
    1) - header 2)Type 3)id of item 4)? 5)Count 6)? 7)?

    @EDIT: Sell is 7B
    Note that a lot of these structures could be outdated since the original post hasn't been updated in 4 years...

    But, here's the structure for buying:

    BYTE - Packet Type (in this case 7A)
    SHORT - Item Id
    BYTE - Count
    BYTE - Amount
    BYTE (boolean) - Ignore Capacity
    BYTE (boolean) - Buy With Backpack

  8. #128
    Member
    Join Date
    Oct 2012
    Location
    brazil
    Posts
    36
    Where i download packet.dll? for 9.81?

  9. #129
    As far as I know there is no updated packet.dll for 9.81.
    Take a look on Darkstar's tibiasock instead.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •