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 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 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 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
Problem with healer
Results 1 to 10 of 10

Thread: Problem with healer

  1. #1
    Junior Member
    Join Date
    Feb 2012
    Posts
    23

    Problem with healer

    I used LaptrotBot Thread Timer its work perfect but when char die its ignore sited hp and manas and Execute spells and potion always so I have to close programe and open it again ...... how to slove it ?

    this is codes :

    Code:
     Dim c As Client
        Dim p As Player
    dim healspell as string
    Code:
    Public WithEvents healspell1 As ThreadTimer
     Public Sub New()
    
            InitializeComponent()
            healspell1 = New ThreadTimer(800)
    end sub
    Thread timer :
    Code:
    Private Sub healspell1_OnExecute() Handles healspell1.OnExecute
            On Error Resume Next
            If p.HPBar <= txtheal1.Value Then
                Select Case healspell
                    Case "exura"
                        If p.Mana >= Tibia.Constants.Spells.LightHealing.ManaPoints Then
                            c.Console.Say("exura")
                            System.Threading.Thread.Sleep(800)
                        End If
                              End Select
            End If
        End Sub
    check box :
    Code:
    Private Sub checkheal1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles checkheal1.CheckedChanged
            If checkheal1.Checked Then
                healspell = boxheal1.Text
                healspell1.StartTimer()
            Else
          
                healspell1.StopTimer()
            End If
        End Sub
    Can someone told me where problem ?

  2. #2
    Senior Member
    Join Date
    Aug 2010
    Posts
    532

    RE: Problem with healer

    You mean when the char die and you login again?

    Probably it's just your player in a different position in the Battle list, just get it again and should work.

  3. #3

    RE: Problem with healer

    If p.HPBar <= txtheal1.Value Then
    Select Case healspell
    Case "exura"
    If p.Mana >= Tibia.Constants.Spells.LightHealing.ManaPoints Then
    c.Console.Say("exura")
    System.Threading.Thread.Sleep(800)
    End If
    End Select
    End If

    ..... wut?

  4. #4
    Junior Member
    Join Date
    Feb 2012
    Posts
    23

    RE: Problem with healer

    Quote Originally Posted by maozao
    You mean when the char die and you login again?

    Probably it's just your player in a different position in the Battle list, just get it again and should work.
    I really dont know what u mean can explain plx
    thx for answer.

    Quote Originally Posted by DarkstaR
    If p.HPBar <= txtheal1.Value Then
    Select Case healspell
    Case "exura"
    If p.Mana >= Tibia.Constants.Spells.LightHealing.ManaPoints Then
    c.Console.Say("exura")
    System.Threading.Thread.Sleep(800)
    End If
    End Select
    End If

    ..... wut?
    so you don't know full code ?!!!

  5. #5
    Senior Member
    Join Date
    Aug 2010
    Posts
    532

    RE: Problem with healer

    Well, it was a simple question, that happen when you die/logout and login again ?

    If yes just get the player again in the memory, because probably it's in a different position in the battle list.

  6. #6
    Junior Member
    Join Date
    Feb 2012
    Posts
    23

    RE: Problem with healer

    Quote Originally Posted by maozao
    Well, it was a simple question, that happen when you die/logout and login again ?

    If yes just get the player again in the memory, because probably it's in a different position in the battle list.
    Yes i just didnt answer about ur first quest ( yes after die and login )
    i use tibiaapi.dll compiled

  7. #7
    Senior Member
    Join Date
    Apr 2008
    Posts
    689

    RE: Problem with healer

    maozao is correct. HPBar is a property that Player inherits from Creature, so it is dependant on its position in the battle list. Now for your options:

    i. Handle character death/relogin by using Client.GetPlayer() again
    ii. Use only PlayerHelper's properties. For example the HP percent is Math.Floor(100*Health/HealthMax).

  8. #8
    Senior Member
    Join Date
    Oct 2007
    Posts
    216

    RE: Problem with healer

    by the gods when i shared my bot source, i never figure out that you can use it.
    as you can read in previous answers if you die you need to get the player again
    there is a timer that show the player status and when its offline automatically it relog if you use the database or you write it on the code.

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

    RE: Problem with healer

    [code=vbnet]
    Private Sub CheckForlogin()
    While Client.LoggedIn = False
    Thread.Sleep(10)
    End While
    Thread.Sleep(500)
    Player = Client.GetPlayer
    IsOnline = True
    LoginCheckerThread = New Thread(AddressOf CheckForlogout)
    LoginCheckerThread.Start()
    End Sub
    Private Sub CheckForlogout()
    While Client.LoggedIn
    Thread.Sleep(10)
    End While
    IsOnline = False
    Player = Nothing
    LoginCheckerThread = New Thread(AddressOf CheckForlogin)
    LoginCheckerThread.Start()
    End Sub
    [/code]

    Start the loginchecker thread after getting a client.
    [code=vbnet]
    LoginCheckerThread = New Thread(AddressOf CheckForlogin)
    LoginCheckerThread.Start()
    [/code]

    [code=vbnet]
    If Online and player isnot nothing then Heal
    [/code]

  10. #10

    RE: Problem with healer

    Maybe the issue?
    http://code.google.com/p/tibiaapi/issues/detail?id=247&colspec=ID%20Type%20Status%20Priorit y%20Milestone%20Summary%20Owner

Posting Permissions

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