Everyone who has never used our Bots before, can test each one for 2 days without any limitation.
The trial is given automatically when you login on the Bot, but in some cases it wouldn't work (security reasons).
If this happens, send me a private message and i will be checking the failed trials manually and adding it for those who didn't get it.
We are looking for resellers who may accept payment methods different from ours, including classictibia's cash, realesta's cash, mastercores' cash, etc. Interested? Click here at anytime.



Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Buy up to X (10, 20,...) items with NPC & Soulpoints checker?
#1
Hello!

1. Question number 1:
I need to have the bot check how many spears I have in my hand and then buy enough spears to fullfill 20 spears, for example.

Let's say I'm leaving from my hunt and I currently have 6 spears.

During the talk with the NPC that sells spear, I want the boat to recognize I already have 6 spears and only buy 14 spears, to reach the total ammount of 20 spears.



I have already searched for different terms and haven't found anything related. I was able to see a way to identify items to SELL, but not to buy.

2. Question number 2:
Does the bot have a function to check how many soulpoints the character has remaining? Instead of checking the cap, to check the soulpoints.


Please help me!
Thanks in advance!
Reply

#2
Hello.

1.
local Ammo = {
  Name = 'spear', -- item name.
  MaxAmount = 20, -- Max amount to carry.
  Price = 10, -- unit price.
  Weight = 20.0, -- unit weight.
}

if windowcount() > 0 then

  local firstLoop = true
  
  local MaxAmount = cap() / Ammo.Weight
  if MaxAmount > Ammo.MaxAmount then
    MaxAmount = Ammo.MaxAmount
  end

  repeat
    local AmountToBuy = (MaxAmount - itemcount(Ammo.Name, '', true))
    if AmountToBuy > 0 then
      if AmountToBuy > 100 then
        AmountToBuy = 100
      end


      local currentMoney = itemcount(3031) + (itemcount(3035) * 100) + (itemcount(3043) * 10000)
      local moneyNeeded = math.ceil(Ammo.Price * AmountToBuy)

      if currentMoney > moneyNeeded then
        if firstLoop then
          say('hi')
          wait(800)
          firstLoop = false
        end
        say('buy ' .. AmountToBuy .. ' ' .. Ammo.Name)
        wait(800)
        say('yes')
        wait(800)
        stackitems(Ammo.Name)
        wait(800)
      else
        AmountToBuy = 0
        break
      end
    end
  until AmountToBuy <= 0
end


2. soul() function.
if soul() <= 10 then
  -- do something
end
Reply

#3
GG thanks a lot!

I haven't tested  n. 1 yet, because I have been taking the spears from my depot as a workaround, to even avoid getting PKed at the shop... but I will test it in the future.

As for number 2, it works like a charm! Thank you!
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016