Posts: 2,948
Threads: 492
Joined: Jul 2018
Reputation:
84
12-09-2020, 09:18 PM
(This post was last modified: 12-09-2020, 09:19 PM by Arkilys.)
Which server are you playing?
If Healer and Targeting are using it then it’s not a problem on Bot. I would guess that you setup it incorrectly OR some problem related to the backpack, but using index or id would fix it.
Posts: 85
Threads: 19
Joined: Nov 2020
Reputation:
0
12-09-2020, 09:41 PM
(This post was last modified: 12-09-2020, 10:24 PM by pillows.)
Playing Retrots an Aussie 7.72.
using the index didnt fix it, it just kept opening backpacks until everything was closed. Looting is using the index because otherwise it didnt loot anything.
Whats the common id for GFB rune? 3191 is the one i have been using and it doesnt see it at all no matter the attempts i made.
I cant index to gfb opening, otherwise nothing loots. See why im in a pickle
Below is what im using exactly (i have used it in a number of forms too but with no success)
I can say that the bot is definitely not recognising the red backpack, either in persistent or looting
local Backpack = '2867' -- specific container to check for runes.
local Rune = '3191' -- rune to check.
local OPEN_BACKPACK = true -- open next backpack for more runes?
local PLAY_ALERT = false -- Play alert on MinCount?
local ALERT_COUNT = 2 -- Min. count to play alert.
--[[ DON'T EDIT BELOW THIS LINE --]]
--[[ DON'T EDIT BELOW THIS LINE --]]
--[[ DON'T EDIT BELOW THIS LINE --]]
if connected() then
Rune = itemid(Rune)
local Containers = getcontainers()
for i = 1, #Containers do
local cont = Containers[i]
local ContainerSlot = -1
local RunesCount = 0
if (cont.name:lower() == Backpack:lower() or tostring(Backpack) == tostring(cont.index)) then
for j = 1, #cont.items do
local item = cont.items[j]
if itemhasflags(item.id, 4) then
ContainerSlot = item.index
elseif item.id == Rune then
RunesCount = RunesCount + item.count
end
end
if OPEN_BACKPACK and RunesCount == 0 and ContainerSlot >= 0 then
openitemslot(ContainerSlot, cont.index, false)
wait(1000)
elseif PLAY_ALERT and RunesCount <= ALERT_COUNT and ContainerSlot == -1 then
playsound('default')
flashclient()
wait(800)
end
end
end
end
Posts: 2,948
Threads: 492
Joined: Jul 2018
Reputation:
84
12-09-2020, 10:26 PM
(This post was last modified: 12-09-2020, 10:28 PM by Arkilys.)
Hello.
The script above will never work, because you are using ID but the script checks only for INDEX and NAME. I posted ANOTHER script in this thread which is based on container's id: |Only Registered members can see download links. | Click here to buy subscription or here to register.
Notice that the script on link above, the variable "BACKPACK_ID" should be a number and not string.
So it should be defined like BACKPACK_ID = 1234, BUT NOT BACKPACK_ID = '1234'
Anyway, open the red backpack and run this code on console:
for _, cont in ipairs(getcontainers()) do
print(cont)
end
Some stuff will be printed on console, just copy and paste it here.
Posts: 85
Threads: 19
Joined: Nov 2020
Reputation:
0
this is what was posted on the consol
09:33:23 - {hasparent = true, usedslots = 5, index = 1, items = {{id = 2874, name = "vial", count = 7, index = 0}, {id = 2874, name = "vial", count = 7, index = 1}, {id = 2874, name = "vial", count = 7, index = 2}, {id = 2874, name = "vial", count = 7, index = 3}, {id = 2868, name = "purple backpack", count = 1, index = 4}}, id = 2868, maxslots = 20, open = true, name = "Backpack"}
09:33:23 - {hasparent = true, usedslots = 9, index = 4, items = {{id = 3191, name = "great fireball rune", count = 1, index = 0}, {id = 3191, name = "great fireball rune", count = 1, index = 1}, {id = 3191, name = "great fireball rune", count = 1, index = 2}, {id = 3191, name = "great fireball rune", count = 1, index = 3}, {id = 3191, name = "great fireball rune", count = 1, index = 4}, {id = 3191, name = "great fireball rune", count = 1, index = 5}, {id = 3191, name = "great fireball rune", count = 1, index = 6}, {id = 3191, name = "great fireball rune", count = 1, index = 7}, {id = 2867, name = "red backpack", count = 1, index = 8}}, id = 2867, maxslots = 20, open = true, name = "Backpack"}
Posts: 2,948
Threads: 492
Joined: Jul 2018
Reputation:
84
Hello.
So there's no problem recognizing the backpack neither the runes.
local BACKPACK_ID = 2867 -- specific container to check for runes.
local Rune = 3191 -- rune to check.
local OPEN_BACKPACK = true -- open next backpack for more runes?
local PLAY_ALERT = true -- Play alert on MinCount?
local ALERT_COUNT = 2 -- Min. count to play alert.
--[[ DON'T EDIT BELOW THIS LINE --]]
--[[ DON'T EDIT BELOW THIS LINE --]]
--[[ DON'T EDIT BELOW THIS LINE --]]
if connected() then
Rune = itemid(Rune)
local Containers = getcontainers()
for i = 1, #Containers do
local cont = Containers[i]
local ContainerSlot = -1
local RunesCount = 0
if cont.id == BACKPACK_ID then
for j = 1, #cont.items do
local item = cont.items[j]
if itemhasflags(item.id, 4) then
ContainerSlot = item.index
elseif item.id == Rune then
RunesCount = RunesCount + item.count
end
end
if OPEN_BACKPACK and RunesCount == 0 and ContainerSlot >= 0 then
openitemslot(ContainerSlot, cont.index, false)
wait(1000)
elseif PLAY_ALERT and RunesCount <= ALERT_COUNT and ContainerSlot == -1 then
playsound('default')
flashclient()
wait(800)
end
end
end
end
Posts: 85
Threads: 19
Joined: Nov 2020
Reputation:
0
12-09-2020, 10:35 PM
(This post was last modified: 12-09-2020, 10:58 PM by pillows.)
you may be a genius. give me a minute to test the new link you said.
You son of a bitch your a genius!
will this work with life rings in the id? or will it ignore because it isnt a rune?
Posts: 2,948
Threads: 492
Joined: Jul 2018
Reputation:
84
Hello.
It works with any item as well.
Posts: 85
Threads: 19
Joined: Nov 2020
Reputation:
0
12-10-2020, 01:33 AM
(This post was last modified: 12-10-2020, 01:33 AM by pillows.)
Hmmm, cant get it working with life rings.
|Only Registered members can see download links. | Click here to buy subscription or here to register.
Posts: 2,948
Threads: 492
Joined: Jul 2018
Reputation:
84
local BACKPACK_ID = 2867 -- specific container to check for runes.
local ITEM_ID = 3191 -- item id to check.
local OPEN_BACKPACK = true -- open next backpack for more runes?
local PLAY_ALERT = true -- Play alert on MinCount?
local ALERT_COUNT = 2 -- Min. count to play alert.
--[[ DON'T EDIT BELOW THIS LINE --]]
--[[ DON'T EDIT BELOW THIS LINE --]]
--[[ DON'T EDIT BELOW THIS LINE --]]
if connected() then
local Containers = getcontainers()
for i = 1, #Containers do
local cont = Containers[i]
local ContainerSlot = -1
local RunesCount = 0
if cont.id == BACKPACK_ID then
for j = 1, #cont.items do
local item = cont.items[j]
if itemhasflags(item.id, 4) then
ContainerSlot = item.index
elseif item.id == ITEM_ID then
RunesCount = RunesCount + item.count
end
end
if OPEN_BACKPACK and RunesCount == 0 and ContainerSlot >= 0 then
openitemslot(ContainerSlot, cont.index, false)
wait(1000)
elseif PLAY_ALERT and RunesCount <= ALERT_COUNT and ContainerSlot == -1 then
playsound('default')
flashclient()
wait(800)
end
end
end
end
Posts: 12
Threads: 5
Joined: Jan 2021
Reputation:
0
02-09-2021, 02:09 PM
(This post was last modified: 02-09-2021, 02:10 PM by Glandq.)
Strange, but it wont work for me.
I have 2 problem:
So it either keeps opening bps till the end and gives a signal or just gives alert right away. I indicated bp id and item id. I think why it happens because I have all bps as normal backpacks on the server I play, so script cant understand which bp to open maybe
local BACKPACK_ID = 2854 -- specific container to check for runes.
local ITEM_ID = 3174 -- item id to check.
local OPEN_BACKPACK = true -- open next backpack for more runes?
local PLAY_ALERT = true -- Play alert on MinCount?
local ALERT_COUNT = 2 -- Min. count to play alert.
|