Signup Now
Results 1 to 5 of 5
  1. #1
    Free User MenelZThais's Avatar
    Join Date
    Aug 2016
    Location
    Poland
    Posts
    253
    Reputation
    10
    Rep Power
    16

    Exclamation findcreature() doesn't work

    Code:
    if islocation() and findcreature('Sigurd') == true then
    gotolabel('BuyPotions', 'REFILL')
    elseif islocation() and findcreature('Sigurd') == false then
    gotolabel('FindSigurd', 'REFILL')
    end
    Any ideas why findcreature() doesn't work here?
    It always executes true condition, even if there's no NPC on the screen.

  2. #2
    Free User Cisco's Avatar
    Join Date
    Aug 2014
    Location
    Brazil
    Posts
    1,424
    Reputation
    119
    Rep Power
    23
    Quote Originally Posted by MenelZThais View Post
    Code:
    if islocation() and findcreature('Sigurd') == true then
    gotolabel('BuyPotions', 'REFILL')
    elseif islocation() and findcreature('Sigurd') == false then
    gotolabel('FindSigurd', 'REFILL')
    end
    Any ideas why findcreature() doesn't work here?
    It always executes true condition, even if there's no NPC on the screen.
    The function also considers difference of floors.

  3. #3
    Free User MenelZThais's Avatar
    Join Date
    Aug 2016
    Location
    Poland
    Posts
    253
    Reputation
    10
    Rep Power
    16
    @Cisco what do you mean?
    I don't see argument like this in documentation:
    https://github.com/Tibia-WindBot/Lib...dcreature.json

  4. #4
    Free User Cisco's Avatar
    Join Date
    Aug 2014
    Location
    Brazil
    Posts
    1,424
    Reputation
    119
    Rep Power
    23
    Quote Originally Posted by MenelZThais View Post
    @Cisco what do you mean?
    I don't see argument like this in documentation:
    https://github.com/Tibia-WindBot/Lib...dcreature.json
    example: Rafzan

    findcreature() --> check Lib Lucas

    PS: findcreature() also returns true if the port is closed

    Rafzan z == 6

    If you are near the rafzan but downstairs "(z == 7)" it will identify the rafzan

    You can use...getcreature()

    example:

    local cre = getcreature('Sigurd')
    if cre.dist > 3 then
    reachcreature(cre.name)waitping()
    end


    other example:

    local cre = getcreature('Sigurd')

    if cre.posx >= 11111 and
    cre.posy >= 11111 and
    cre.posx <= 22222 and
    cre.posy <= 22222 and
    cre.posz == 1 then
    reachcreature(cre.name)waitping()
    end


    other example:

    local cre = getcreature('Sigurd')
    local Door = 12345,23456

    while cre.posx >= 11111 and
    cre.posy >= 11111 and
    cre.posx <= 22222 and
    cre.posy <= 22222 and
    cre.posz == 1 do
    usedoor(Door,$wptz,'open')
    reachcreature(cre.name)waitping()
    end


    Check Docummentation > Types

    ***Read the documentation, but do not forget the Libs in the bot's folders, they are very important.***

  5. #5
    Moderator Josh's Avatar
    Join Date
    Dec 2013
    Posts
    1,395
    Reputation
    183
    Rep Power
    24
    Quote Originally Posted by MenelZThais View Post
    @Cisco what do you mean?
    I don't see argument like this in documentation:
    https://github.com/Tibia-WindBot/Lib...dcreature.json
    Probably a safer bet to try the primary documentation first.
    Interested in software development and/or programming for Tibia?
    Check out the new Tibia Programming Forums (TibiaPF) by clicking the image below.

    Looking for a bot for the MMORPG, Medivia?
    Check out MediviaBotter, a powerful, injected bot by clicking the link below.


 

 

Posting Permissions

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