Results 1 to 5 of 5

Thread: what is wrong with this IF instruction?

  1. #1
    Normal User
    Join Date
    Jun 2012
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    5

    what is wrong with this IF instruction?

    code:

    if (itemcount("spear")) >10 then
    gotolabel("hunt")
    end

    code:

    if (itemcount("spear")) >10 then
    gotolabel("hunt")

    code:

    if itemcount("spear") >10 then
    gotolabel("hunt")
    end

    code:

    if itemcount("spear") >10 then
    gotolabel("hunt")

    code:

    if weaponamount > 10 then
    gotolabel("hunt")


    I've tried everything - bot alwas skips this action wpt. i dont know why it does not work.

  2. #2
    Normal User pentos's Avatar
    Join Date
    Jul 2012
    Posts
    71
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    14
    Rep Power
    5
    if weaponamount >= 10 then
    gotolabel("hunt")
    end

    It should work

    Best Regards!
    << Best Quality of Scripts! Cheapest and best Scripts Ever!

  3. #3
    Banned
    Join Date
    May 2012
    Posts
    680
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    24
    Rep Power
    0
    What is wrong is that you don't put "end" to the if-statments, thus they run until the end of the script or first end is reached. If there's nothing else, it will think it's reached the end and that the script has, incorrectly, been executed.

  4. #4
    iBot User pink_panther's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    4,075
    Mentioned
    49 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    178 Post(s)
    Reputation
    309
    Rep Power
    10
    pentos is right. itemcount() only checks open containers, you need to use weaponamount of ammoamount for counting spears/ammo in your hand or ammo slot.

  5. #5
    Normal User dragonicevo's Avatar
    Join Date
    May 2012
    Location
    canada
    Posts
    1,600
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    3 Post(s)
    Reputation
    65
    Rep Power
    8
    ammoname = 'royal spear' in setup
    weaponamount < 15 then
    http://www.tibiaibot.com/forum/showt...2925#post42925 for basic setup for knight

    If i helped or you liked my scripts rep + me

    trusted free scripts by pink_panther and 3173654 and acid alchamy and marlhex and spens13

Posting Permissions

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