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
(Basic) Attack creature in TibiaAPI
Results 1 to 5 of 5

Thread: (Basic) Attack creature in TibiaAPI

  1. #1
    Member
    Join Date
    Nov 2007
    Location
    Downunder
    Posts
    96

    (Basic) Attack creature in TibiaAPI

    Hello,

    I have been trying to get this working for a while now and i cant figure it out It works and theres no debug errors but it only attacks the creature thats "FIRST" in my battlelist...

    Here is my code:
    [code=vbnet]
    Dim AtkCreature As Creature
    [/code]
    [code=vbnet]
    Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button16.Click
    AtkCreature = Client.BattleList.GetCreatures().FirstOrDefault(Fu nction(c) Not c.IsSelf And c.IsReachable And MonsterNameAttackList.Text = "Rat" = True)
    If AtkCreature Is Nothing Then
    Client.Console.Say("Cannot attack the creature")
    Else
    AtkCreature.Attack()
    End If
    End Sub
    [/code]

    Can someone please tell me what i have done wrong and what i can do to fix this problem?

    TiX.

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

    RE: (Basic) Attack creature in TibiaAPI

    What exactly is the problem?

  3. #3
    Member
    Join Date
    Nov 2007
    Location
    Downunder
    Posts
    96

    RE: (Basic) Attack creature in TibiaAPI

    It doesnt attack the right creature Only the first in my battlelist.. I want it to attack a rat :S

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

    RE: (Basic) Attack creature in TibiaAPI

    c.Name = "Rat"?

  5. #5
    Member
    Join Date
    Nov 2007
    Location
    Downunder
    Posts
    96

    RE: (Basic) Attack creature in TibiaAPI

    Ah, Thank you!
    That helped heaps..

    Um now i need help finding the closest rat to me....Is it
    [code=vbnet]
    c.DistanceTo(Location?)
    [/code]

    EDIT:
    Never mind about that one...Hehe i got i working perfect now
    Thank you again

    TiX.

    (PROBLEM SOLVED)

Posting Permissions

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