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
FREE Detect different items on screen and do something
#1
Detect different items on screen and do something.

This script is actually splitted in two.

This script has two working options:
1. If the variable "IS_SAVING_ITEMS" is true then it will just read the items on your screen and save in the table "KNOWN_ITEMS".
2. If the "IS_SAVING_ITEMS" variable is FALSE, then it will check if the items that are on your screen are also in KNOWN_ITEMS. If any different items are found, then the script can play an alert, print a message to the console, use that item and grab that item.

The script was made to work like this:
1. You set the IS_SAVING_ITEMS variable to true and then run through your cave or something. If you are going to use this script while hunting, then take a trip or two around the cave and then disable the variable.
2. Set variable IS_SAVING_ITEMS to false, so that the script can check if there is a different item and alert you about it.

I will teach two different waypoints to use this after the code!

Code to make the script read all items in your screen and save to be checked later!
setglobal('IS_SAVING_ITEMS', true)

Code to make the script read items in your screen and check if you already found it before!
setglobal('IS_SAVING_ITEMS', false)

If you don't IS_SAVING_ITEMS as true or false then the script will consider "IS_SAVING_ITEMS = true" on its very first run



Script to use while making runes
Why? This script will read the items in your screen and save in its first turn... After the first turn then it will check for different items.
It's the perfect situation while making runes.
local IGNORE_ITEMS = { } -- Add item IDS that you don't want to trigger alarm.
local OPTIONS = {
    WorkWithPlayerOnScreen = true, -- If TRUE then script will work whenever there is a player or not. If FALSE then this script will only trigger if no player on screen.
    PlayAlert = true, -- Play sound and flash client?
    LogConsole = true, -- Log on console?
    UseItem = false, -- Use the item that you found on floor. This option will disable cavebot and targeting then enable again.
    PickupItem = false, -- Pickup the item that you found on floor.  This option will disable cavebot and targeting then enable again.
    PauseBot = true, -- Pause bot?
}


KNOWN_ITEMS = KNOWN_ITEMS or {}

local tiles = gettiles()
local player_x = posx()
local player_y = posy()
local player_z = posz()

if IS_SAVING_ITEMS == nil then
    IS_SAVING_ITEMS = true
end

local runemakerEnabled = false
for _, tile in ipairs(tiles) do
    if tile.posz == player_z and math.abs(player_x - tile.posx) <= 7 and math.abs(player_y - tile.posy) <= 5 and tile.itemcount > 1 then
        for __, item in ipairs(tile.items) do
            if item.id > 99 and table.find(KNOWN_ITEMS, item.id) == nil and table.find(IGNORE_ITEMS, item.id) == nil then
                if IS_SAVING_ITEMS then
                    table.insert(KNOWN_ITEMS, item.id)
                else
                    if (OPTIONS.PlayAlert or OPTIONS.LogConsole or OPTIONS.UseItem or OPTIONS.PickupItem) and (OPTIONS.WorkWithPlayerOnScreen or (OPTIONS.WorkWithPlayerOnScreen == false and paround() == 0)) then
                        if OPTIONS.PlayAlert then
                            flashclient()
                            playsound('default')
                        end
                        if OPTIONS.LogConsole then
                            print('New item found: ' .. item.id .. ' on x/y/z: ' .. tile.posx .. ', ' .. tile.posy .. ', ' .. tile.posz)
                        end

                        if OPTIONS.UseItem or OPTIONS.PickupItem then
                            runemakerEnabled = getsettings('Runemaker/Enabled')
                            if runemakerEnabled then
                                setsettings('Runemaker/Enabled', false)
                            end

                            if OPTIONS.UseItem then
                                useitem(item.id, tile.posx, tile.posy, tile.posz)
                                wait(400, 800)
                            end
                            if OPTIONS.PickupItem then
                                moveitems(item.id, '', ground(tile.posx, tile.posy, tile.posz))
                                wait(400, 800)
                            end
                        end

                        if OPTIONS.PauseBot then
                            pausebot(true)
                        end
                    end
                end
            end
        end
    end
end

if runemakerEnabled then
    setsettings('Runemaker/Enabled', true)
end

IS_SAVING_ITEMS = false


Script to use while hunting/cavebotting
Why? This script will keep reading the items in your screen and saving until you set "IS_SAVING_ITEMS = false".
So all you need to do is creating an Action waypoint after all your waypoints that walks around the cave with the code:
setglobal('IS_SAVING_ITEMS', false)

So once you enable the script below, it will start reading items and after walking on all waypoints around the cavebot, it will hit the Action waypoint that you created and run the code that set "IS_SAVING_ITEMS = false" then the script will start looking for different items and alert you!
local IGNORE_ITEMS = { } -- Add item IDS that you don't want to trigger alarm.
local OPTIONS = {
    WorkWithPlayerOnScreen = true, -- If TRUE then script will work whenever there is a player or not. If FALSE then this script will only trigger if no player on screen.
    PlayAlert = true, -- Play sound and flash client?
    LogConsole = true, -- Log on console?
    UseItem = false, -- Use the item that you found on floor. This option will disable cavebot and targeting then enable again.
    PickupItem = false, -- Pickup the item that you found on floor.  This option will disable cavebot and targeting then enable again.
    PauseBot = true, -- Pause bot?
}


KNOWN_ITEMS = KNOWN_ITEMS or {}

local tiles = gettiles()
local player_x = posx()
local player_y = posy()
local player_z = posz()

if IS_SAVING_ITEMS == nil then
    IS_SAVING_ITEMS = true
end

local cavebotEnabled = false
local targetingEnabled = false
for _, tile in ipairs(tiles) do
    if tile.posz == player_z and math.abs(player_x - tile.posx) <= 7 and math.abs(player_y - tile.posy) <= 5 and tile.itemcount > 1 then
        for __, item in ipairs(tile.items) do
            if item.id > 99 and table.find(KNOWN_ITEMS, item.id) == nil and table.find(IGNORE_ITEMS, item.id) == nil then
                if IS_SAVING_ITEMS then
                    table.insert(KNOWN_ITEMS, item.id)
                else
                    if (OPTIONS.PlayAlert or OPTIONS.LogConsole or OPTIONS.UseItem or OPTIONS.PickupItem) and (OPTIONS.WorkWithPlayerOnScreen or (OPTIONS.WorkWithPlayerOnScreen == false and paround() == 0)) then
                        if OPTIONS.PlayAlert then
                            flashclient()
                            playsound('default')
                        end
                        if OPTIONS.LogConsole then
                            print('New item found: ' .. item.id .. ' on x/y/z: ' .. tile.posx .. ', ' .. tile.posy .. ', ' .. tile.posz)
                        end

                        if OPTIONS.UseItem or OPTIONS.PickupItem then
                            cavebotEnabled = getsettings('Cavebot/Enabled')
                            if cavebotEnabled then
                                setsettings('Cavebot/Enabled', false)
                            end
                            targetingEnabled = getsettings('Targeting/Enabled')
                            if targetingEnabled then
                                setsettings('Targeting/Enabled', false)
                            end

                            if OPTIONS.UseItem then
                                useitem(item.id, tile.posx, tile.posy, tile.posz)
                                wait(400, 800)
                            end
                            if OPTIONS.PickupItem then
                                moveitems(item.id, '', ground(tile.posx, tile.posy, tile.posz))
                                wait(400, 800)
                            end

                            if OPTIONS.PauseBot then
                                pausebot(true)
                            end
                        end
                    end
                end
            end
        end
    end
end

if cavebotEnabled then
    setsettings('Cavebot/Enabled', true)
end
if targetingEnabled then
    setsettings('Targeting/Enabled', true)
end


Script to use while hunting/cavebotting (Saving items during specific time)
This script will keep reading the items in your screen and saving for a random time that you setup on DisableSavingStepAfterTime (for example 800 seconds after the script started running) OR until you set "IS_SAVING_ITEMS = false".

OPTIONS -> DisableSavingStepAfterTime will simply set "IS_SAVING_ITEMS = false" instead of you doing this by another LUA script, which let's this script to be used.

For most cases OPTIONS -> DisableSavingStepAfterTime is enough, but you have two options to play with depending on complexity of your cavebot script:
1. Setup enough time to walk few rounds or so on OPTIONS -> DisableSavingStepAfterTime. You are able to reset timer to read more items using this code:
setglobal('IS_SAVING_ITEMS', nil)
2. Create an Action waypoint after all your waypoints that walks around the cave few times or so, with the code:
setglobal('IS_SAVING_ITEMS', false)

So once you enable the script below, it will start reading and saving items for a random time that you setup on OPTIONS -> DisableSavingStepAfterTime then after that time, it will start playing alerts or whatever you setup when finding new items.
local IGNORE_ITEMS = { } -- Add item IDS that you don't want to trigger alarm.
local OPTIONS = {
    WorkWithPlayerOnScreen = true, -- If TRUE then script will work whenever there is a player or not. If FALSE then this script will only trigger if no player on screen.
    PlayAlert = true, -- Play sound and flash client?
    LogConsole = true, -- Log on console?
    UseItem = false, -- Use the item that you found on floor. This option will disable cavebot and targeting then enable again.
    PickupItem = false, -- Pickup the item that you found on floor.  This option will disable cavebot and targeting then enable again.
    PauseBot = true, -- Pause bot?
    DisableSavingStepAfterTime = { Min = 300, Max = 600 } -- In SECONDS. Stops reading and saving items after X seconds.
}


KNOWN_ITEMS = KNOWN_ITEMS or {}

local tiles = gettiles()
local player_x = posx()
local player_y = posy()
local player_z = posz()

if IS_SAVING_ITEMS == nil then
    IS_SAVING_ITEMS = true
    STOP_SAVING_TIME = runningtime() + random(OPTIONS.DisableSavingStepAfterTime.Min, OPTIONS.DisableSavingStepAfterTime.Max)
end

if IS_SAVING_ITEMS == true and runningtime() >= STOP_SAVING_TIME then
    IS_SAVING_ITEMS = false
end

local cavebotEnabled = false
local targetingEnabled = false
for _, tile in ipairs(tiles) do
    if tile.posz == player_z and math.abs(player_x - tile.posx) <= 7 and math.abs(player_y - tile.posy) <= 5 and tile.itemcount > 1 then
        for __, item in ipairs(tile.items) do
            if item.id > 99 and table.find(KNOWN_ITEMS, item.id) == nil and table.find(IGNORE_ITEMS, item.id) == nil then
                if IS_SAVING_ITEMS then
                    table.insert(KNOWN_ITEMS, item.id)
                else
                    if (OPTIONS.PlayAlert or OPTIONS.LogConsole or OPTIONS.UseItem or OPTIONS.PickupItem) and (OPTIONS.WorkWithPlayerOnScreen or (OPTIONS.WorkWithPlayerOnScreen == false and paround() == 0)) then
                        if OPTIONS.PlayAlert then
                            flashclient()
                            playsound('default')
                        end
                        if OPTIONS.LogConsole then
                            print('New item found: ' .. item.id .. ' on x/y/z: ' .. tile.posx .. ', ' .. tile.posy .. ', ' .. tile.posz)
                        end

                        if OPTIONS.UseItem or OPTIONS.PickupItem then
                            cavebotEnabled = getsettings('Cavebot/Enabled')
                            if cavebotEnabled then
                                pausewalking(10000)
                                setsettings('Cavebot/Enabled', false)
                            end
                            targetingEnabled = getsettings('Targeting/Enabled')
                            if targetingEnabled then
                                pausewalking(10000)
                                setsettings('Targeting/Enabled', false)
                            end

                            if iswalking() then
                                stop()
                                wait(200, 400)
                            end

                            if OPTIONS.UseItem then
                                useitem(item.id, tile.posx, tile.posy, tile.posz)
                                wait(400, 800)
                            end
                            if OPTIONS.PickupItem then
                                moveitems(item.id, '', ground(tile.posx, tile.posy, tile.posz))
                                wait(400, 800)
                            end

                            if OPTIONS.PauseBot then
                                pausebot(true)
                            end
                        end
                    end
                end
            end
        end
    end
end

if cavebotEnabled then
    pausewalking(0)
    setsettings('Cavebot/Enabled', true)
end
if targetingEnabled then
    pausewalking(0)
    setsettings('Targeting/Enabled', true)
end
Reply

#2
sorry for the bad english, let me see if i understand, to hunt i must create a waypoint with action "setglobal('IS_SAVING_ITEMS', false)" and then create the script in persistent?
Reply

#3
Hello.

You should the second script (Script to use while hunting/cavebotting) on Persistents then make an Action to run
setglobal('IS_SAVING_ITEMS', false)
whenever you believe the script read enough, because once you run that code on Action, the second script (that's running on Persistents) will start working to detect new items.

By default, IS_SAVING_ITEMS = true. That means, if you just paste the second script on Persistents and enable it then it will starting reading and saving items you.

I have few recommendations:
1. Never go to places where you didn't ran the script to read items. You can actually go, but ALWAYS disable the script on Persistents!
2. Monsters dead bodies are items as well, the body id also changes according to their state of decomposition (some have only 2 stages, others 3 stages, etc.). That is, the monster's body when it dies has an id, after a few minutes it may have another id and after few more minutes another. So make sure the script had enough time to read those bodies.

I also edited my post, i've added another script "Script to use while hunting/cavebotting (Saving items during specific time)", which automatically stops reading and saving items after a specific time, so you would not need to manually set "IS_SAVING_ITEMS = false", the script will do it for you after that time.
Reply

#4
friend has something wrong he doesn't sound the alarm, let's go one more time;
1st put the script in persistent, ok how do I leave IS_SAVING_ITEMS = false or true ?
2nd at the end of wpt I do action setglobal('IS_SAVING_ITEMS', false) do I leave false or true ? I didn't understand the order
Reply

#5
1st script.
You don't need to touch that option. It will run once to read and save items then the next rounds will be about alerting.

2nd script.
Start the script, round few times on cave and then run setglobal('IS_SAVING_ITEMS', false) on an Action or manually on Console. Once you run this, it will actually starting alerting when found a different item.

3rd script.
You don't need to touch that option, just DisableSavingStepAfterTime. It will save items for that a random time that you setup then after that the next rounds will be about alerting.
Reply

#6
good afternoon let's go there again, first I create my script and in the last I do this action "setglobal('IS_SAVING_ITEMS', false)" and let it run about 3x and then change it to true ? the persistent one I call her only after all this? or first of all do I have to turn on the persistent before the action?
Reply

#7
Hello.

You should create the persistent and start using it whenever you like, when you are inside the place that you will be.
"setglobal('IS_SAVING_ITEMS', false)" just must be called whenever you like to start checking for different items instead of just saving items in a list to be checked later.

So based on what you said I recommend you using only "Script to use while hunting/cavebotting (Saving items during specific time)", because it will automatically set setglobal('IS_SAVING_ITEMS', false) after X time... or make some ACTION wpt to calculate how many times you ran into it and if 3+ then run setglobal('IS_SAVING_ITEMS', false).
Reply

#8
Script to use while making runes

good night, can you fix this runar script, for example, it will read the screen, the sqm , everything around it, and then if something changes, or someone appears, or move something, or any item appears or change location, sqm, anything that is not identical to the screen does it pause the bot ?
Reply

#9
|Only Registered members can see download links. | Click here to buy subscription or here to register.

I will not modify how the script works, but i've added option to pause bot.
It will detect if a new item appears on screen (different item id that wasn't in your screen before!), but not if something gets moved, which could be triggered if runemaker drops a rune or backpack.
If you wanna pause bot when a player appears then use Alerts -> Player on Screen -> Pause Bot.
Reply

#10
thx ty
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016