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 85

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 85

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 85

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 85
Tile.Items stackorder
Results 1 to 6 of 6

Thread: Tile.Items stackorder

  1. #1
    Super Moderator klusbert's Avatar
    Join Date
    Dec 2007
    Posts
    1,201

    Tile.Items stackorder

    Hello I been away from this subject for a long time.

    I hope you can help me, I am working on a looter but I can't get the stackorder in order xD

    I have 2 diffrent functions that I've tried to read tileobjects. http://pastebin.com/6VDVBW96

    The problem with both is that sometimes it will open a corpse that is under the top one. And I am sure it is becouse the stackorder is not correct.


    Anyway thanks for your time
    How to find battlelist address --> http://tpforums.org/forum/thread-8146.html
    Updating addresses --> http://tpforums.org/forum/thread-8625.html
    DataReader --> http://tpforums.org/forum/thread-10387.html

  2. #2
    Senior Member
    Join Date
    Jan 2012
    Posts
    417
    If I'm not mistaken, you read the i-th stack order and it gives you the correct index within the Items array.

    Code:
    public TileObject[] Objects
    {
        get
        {
            int count = ObjectCount;
            TileObject[] res = new TileObject[count];
            
            uint pointerItems = address + 44;
            uint pointerOrder = address + 4;
            
            for (int i = 0; i < count; i++)
            {
                int stackOrder = client.Memory.ReadInt32(pointerOrder + i * 4);
                uint current = pointerItems + i * Addresses.Map.StepTileObject;
                
                res[i] = new TileObject(
                    client.Memory.ReadUInt32(current + 8),//itemId
                    client.Memory.ReadUInt32(current + 4), //Itemdata
                    client.Memory.ReadUInt32(current + 0),//itemdatex
                    stackOrder
                );
            }
            
            return res;   
        }
    }

  3. #3
    Super Moderator klusbert's Avatar
    Join Date
    Dec 2007
    Posts
    1,201
    That function is exactly as the first one of mine. I am playing on a ot that is 10.90 and it opens wrong corpse sometimes. Then I checked on "real" tibia and let the bot open a corpse and analyzed the outgoing packet.

    Sometimes the stackOrder was diffrent between the one the bot send and the one tibia creates when I click open in the client.


    But real tibia accept the packet everytime.
    How to find battlelist address --> http://tpforums.org/forum/thread-8146.html
    Updating addresses --> http://tpforums.org/forum/thread-8625.html
    DataReader --> http://tpforums.org/forum/thread-10387.html

  4. #4
    Senior Member
    Join Date
    Jan 2012
    Posts
    417
    Quote Originally Posted by klusbert View Post
    That function is exactly as the first one of mine. I am playing on a ot that is 10.90 and it opens wrong corpse sometimes. Then I checked on "real" tibia and let the bot open a corpse and analyzed the outgoing packet.

    Sometimes the stackOrder was diffrent between the one the bot send and the one tibia creates when I click open in the client.


    But real tibia accept the packet everytime.
    Oh yeah. I didn't notice a mistake, try that:

    Code:
    public TileObject[] Objects
    {
        get
        {
            int count = ObjectCount;
            TileObject[] res = new TileObject[count];
            
            uint pointerItems = address + 44;
            uint pointerOrder = address + 4;
            
            for (int i = 0; i < count; i++)
            {
                int stackOrder = client.Memory.ReadInt32(pointerOrder + i * 4);
                uint current = pointerItems + stackOrder * Addresses.Map.StepTileObject;
                
                res[i] = new TileObject(
                    client.Memory.ReadUInt32(current + 8),//itemId
                    client.Memory.ReadUInt32(current + 4), //Itemdata
                    client.Memory.ReadUInt32(current + 0),//itemdatex
                    stackOrder
                );
            }
            
            return res;   
        }
    }
    The difference is in "uint current = pointerItems + stackOrder * Addresses.Map.StepTileObject;" line

  5. #5
    Super Moderator klusbert's Avatar
    Join Date
    Dec 2007
    Posts
    1,201
    Thanks I will try tomorrow
    How to find battlelist address --> http://tpforums.org/forum/thread-8146.html
    Updating addresses --> http://tpforums.org/forum/thread-8625.html
    DataReader --> http://tpforums.org/forum/thread-10387.html

  6. #6
    Super Moderator klusbert's Avatar
    Join Date
    Dec 2007
    Posts
    1,201
    Seems to work, Thanks alot man.
    How to find battlelist address --> http://tpforums.org/forum/thread-8146.html
    Updating addresses --> http://tpforums.org/forum/thread-8625.html
    DataReader --> http://tpforums.org/forum/thread-10387.html

Posting Permissions

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