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
Opencorpse Fuction
Results 1 to 2 of 2

Thread: Opencorpse Fuction

  1. #1
    Junior Member
    Join Date
    Oct 2011
    Posts
    1

    Cool Opencorpse Fuction

    hello'm one small problem in my function opening body likes one helps code and this.




    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    client = Tibia.Util.ClientChooser.ShowBox
    Timer1.Start()
    hook = New HookProxy(client)

    AddHandler hook.ReceivedTileAddThingIncomingPacket, AddressOf CorpseOpener
    End Sub

    Public Function CorpseOpener(ByVal packet As Packets.Incoming.TileAddThingPacket) As Boolean
    Dim player As Objects.Player = client.GetPlayer()
    Dim p As Tibia.Packets.Incoming.TileAddThingPacket = DirectCast(packet, Tibia.Packets.Incoming.TileAddThingPacket)

    If p.Item IsNot Nothing AndAlso p.Position.DistanceTo(player.Location) < 6 Then
    If p.Item.GetFlag(Tibia.Addresses.DatItem.Flag.IsCont ainer) AndAlso p.Item.GetFlag(Tibia.Addresses.DatItem.Flag.IsImmo vable) Then
    Thread.Sleep(1000)
    p.Item.OpenAsContainer(CByte(client.Inventory.GetC ontainers().Count()))
    End If
    End If
    Return True
    End Function



    my problem and he so opens 3/1 monsters thereafter function to and not opens foremost.

    -sorry for bad english

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

    RE: Opencorpse Fuction

    Not sure what's wrong, but I just want to point out that you're calling this method incorrectly
    [code=vb.net]
    p.Item.OpenAsContainer(CByte(client.Inventory.GetC ontainers().Count()))
    [/code]

    When you open a container in the client manually, the client will use the first closed container in memory to open the new container in.
    It might be easier to understand this if you picture a list of container objects, and the client iterates through the list to find the first container with the IsOpen property set to false.

Posting Permissions

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