Results 1 to 5 of 5

Thread: Script Problem: Leaving hunt sooner

  1. #1
    iBot User
    Join Date
    Nov 2014
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    1 Post(s)
    Reputation
    10
    Rep Power
    3

    Script Problem: Leaving hunt sooner

    Hey
    I'm still pretty noob with the bot thing, and i'm having a little bit of trouble trying to figure it out why my character keep getting out of the cave even though i have more spears than the minimum.

    Here is the action with the problem:
    Code:
    if countitem(7378, "royal spear") < 6 then gotolabel ("leavehunt")
    else
    gotolabel("insidehunt")

    It's exactly like that, even the colors xD.
    It keeps going directly to the label "leavehunt" instead of going back to "insidehunt" and star the cave all over again.
    I do have the waypont "leavehunt" and "insidehunt"

    Aditional information: This script was made based on a tutorial on Youtube, it's from 2012... and maybe i thought that the coding was old or w/e so i decided to ask here.
    Last edited by minatow; 11-15-2014 at 01:47 AM.

  2. #2
    iScripter Eli's Avatar
    Join Date
    Mar 2012
    Posts
    3,764
    Mentioned
    492 Post(s)
    Tagged
    2 Thread(s)
    Quoted
    955 Post(s)
    Reputation
    586
    Rep Power
    10
    replace "countitem" with "itemcount". Nice you start making script yourself check this link, might be helpfull for you: http://www.tibiaibot.com/ibotplus/documentation

  3. #3
    Normal User blakw's Avatar
    Join Date
    Mar 2012
    Location
    www.blakw.com
    Posts
    815
    Mentioned
    221 Post(s)
    Tagged
    2 Thread(s)
    Quoted
    344 Post(s)
    Reputation
    462
    Rep Power
    10
    Your action fixed:

    Lua Code:
     
    if weaponamount < 6
    then 
        gotolabel("leavehunt")
    else
        gotolabel("insidehunt")
    end


    weaponamount return amount of items on weapon slot so you can count ammunition, itemcount is only used to count items on containers


    ------------------------------------Latest Releases:------------------------------------
    Vocations:
    Darashia Lions Rock
    Oramond Seacrest Serpents X1

    For a better iBot!

    (◣_◢)

  4. #4
    Normal User
    Join Date
    Nov 2014
    Location
    Poland - podlaskie
    Posts
    132
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    28 Post(s)
    Reputation
    47
    Rep Power
    3
    PHP Code:
    if (itemcount("royal spear") + weaponamount) < 6 then 
    setlooting
    ("off")
    setsettings("targeting\\monsters\\NAME_OF_MONSTER\\onlyiftrapped""yes")
    gotolabel ("leavehunt")
    else
    gotolabel("insidehunt")
    end 
    before entry to cave make action in wpt with this
    PHP Code:
    setlooting("on")
    setsettings("targeting\\monsters\\NAME_OF_MONSTER\\onlyiftrapped""no"

  5. #5
    iBot User
    Join Date
    Nov 2014
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    1 Post(s)
    Reputation
    10
    Rep Power
    3
    Thank you very much, guys! It's working perfectly now.
    Also, thank you JuicyScripts for the extra actions!

Posting Permissions

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