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
Scan screen for item
#1
I struggled a bit with it and didn't get anywhere, so I figured i'd bring it to the professional
|Only Registered members can see download links. | Click here to buy subscription or here to register.
|Only Registered members can see download links. | Click here to buy subscription or here to register.alt="Tongue" title="Tongue" class="smilie smilie_5" />

The idea is simple: I need a script that will scan all tiles (or walkable tiles), onĀ  the screen, and if there is an item at the top of any tileĀ that is NOT in my ID list, it will fire off an alarm. I tried messing with gettiles, gettile, topitem,finditemonground but the sintax is difficult for me, I hope the issue is clear enough! Thanks in advance
Reply

#2
This script will search for items that are not on list on top of tiles on screen. Notice ground is also an item, so it would trigger as well. If you don't wanna to trigger with ground then use second script.
local LIST = { 1234, 1235, 1236 } -- If find an item not on that list then play sound.

local tiles = gettiles()
for _, tile in ipairs(tiles) do
  if tile.topitem ~= nil and table.find(LIST, tile.topitem.id) == nil then
    playsound('default')
    flashclient()
    print('Item id: ' .. tile.topitem.id .. ' found on x/y/z: ' .. tile.posx .. ', ' .. tile.posy .. ', ' .. tile.posz)
  end
end


local LIST = { 1234, 1235, 1236 } -- If find an item not on that list then play sound.

local tiles = gettiles()
for _, tile in ipairs(tiles) do
  if tile.itemcount > 1 and tile.topitem ~= nil and table.find(LIST, tile.topitem.id) == nil and itemhasflags(tile.topitem.id, 0) == false and itemhasflags(tile.topitem.id, 1) == false then
    playsound('default')
    flashclient()
    print('Item id: ' .. tile.topitem.id .. ' found on x/y/z: ' .. tile.posx .. ', ' .. tile.posy .. ', ' .. tile.posz)
  end
end
Reply

#3
Hello! Thanks for the quick responde! It works partially, for some reason I get this output:

17:01:36 - Item id: 1155 found on x/y/z: 32321, 31761, 5
17:01:36 - Item id: 1154 found on x/y/z: 32321, 31762, 5
17:01:36 - Item id: 1154 found on x/y/z: 32321, 31763, 5
17:01:36 - Item id: 1154 found on x/y/z: 32321, 31764, 5
17:01:36 - Item id: 1154 found on x/y/z: 32321, 31765, 5
17:01:36 - Item id: 1154 found on x/y/z: 32321, 31766, 5
17:01:36 - Core:Lua:ExecuteScript
|Only Registered members can see download links. | Click here to buy subscription or here to register.
|Only Registered members can see download links. | Click here to buy subscription or here to register.alt="Big Grin" title="Big Grin" class="smilie smilie_4" />oString
|Only Registered members can see download links. | Click here to buy subscription or here to register.
|Only Registered members can see download links. | Click here to buy subscription or here to register.alt="Tongue" title="Tongue" class="smilie smilie_5" />ersistent01: 5: attempt to index field 'topitem' (a nil value)

Here is the code:

local LIST = { 1152, 1153, 1154, 1155, 1156 } -- If find an item not on that list then play sound.

local tiles = gettiles()
for _, tile in ipairs(tiles) do
if table.find(IDS_TO_FIND, tile.topitem.id) == nil then
playsound('default')
flashclient()
print('Item id: ' .. tile.topitem.id .. ' found on x/y/z: ' .. tile.posx .. ', ' .. tile.posy .. ', ' .. tile.posz)
end
end



could you please double check the code? It seems to trigger even though the items are in the list
Reply

#4
Which Bot are you using?

Yeah, my bad, i changed variables names and didn't updated code. I think that i also fixed the error "attempt to index field 'topitem' (a nil value)".
Reply

#5
Works perfect!
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016