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
script that pauses bot if creature summoned near you or you get teleported
#1
would it be possible to make a script that reacts on certain events such as if a creature is created/spawned near you or if you get teleported more than X sqm?

for example if a creature is summoned near you pause bot and all actions
same with if you are moved more than what you can reasonably move in 1 second so like 4-5 sqms

if this is possible I would be grateful, and I am sorry if its hard to understand but I dont know any better way to explain. please ask further if anything is unclear and I hope that this is possible

also the pause bot if creature appears is not usable because I need this when cavebotting. thank you in advance
Reply

#2
Hello.

That's kinda complex.

Alerts -> GM Detect already detects when you changed your location X sqms always since last check. X = the value that you setup on it. It's "0" by default, which means disabled. It's not 100% on high lvl characters, since you would walk fast there as well.
You can could make your own alerts using Persitents, something like:
local DISTANCE_ALERT = 3 -- If your character went X sqms far from last check then trigger.

if LAST_X ~= nil and LAST_Y ~= nil and proximity(LAST_X, LAST_Y, posx(), posy()) >= DISTANCE_ALERT then
    playsound('default')
    flashclient()
    pausebot(true)
end

LAST_X = posx()
LAST_Y = posy()
I recommend you to use VERY VERY VERY LOW interval on persistents, like 50 ms or so.



I don't believe that there's a way to make 100% sure that a monster was summoned, because it could be respawn or even a creature summon (like orc shaman with snakes).
I can tell you two options that I have in my mind now that you could do to check that, but not sure if it's 100%. Both methods are not 100% accurate, but worth to try.
Please, redownload and reinstall Kasteria OTBot, because i've fixed small bug on gettileseffect().

1. gettileeffect(number posx, number posy, number posz) or gettileseffect(). You can use those functions to detect effects on sqm like healing effect (shinning stars), etc.
Example: This script will play sound, flash client whenever there's a effect in any tile in your screen.
local tilesEffects = gettileseffect()
for _, tile in ipairs(tilesEffects) do
    if tile.count > 0 then
        playsound('default')
        flashclient()
        pausebot(true)
    end
end

The script above would not be good, because healing would trigger that. So you could check for specific effects only:
local EFFECTS = { 11 } -- Effects ids

local tilesEffects = gettileseffect()
for _, tile in ipairs(tilesEffects) do
    for __, effect in ipairs(tile.effects) do
        if table.find(EFFECTS, effect) ~= nil then
            playsound('default')
            flashclient()
            pausebot(true)
        end
    end
end

How to find effect id? Simple. Just reproduce the effect, make it happen in your screen and run the script below. You must do it really fast (you can let the script running on a persistent with low intervals). For example: If you wanna find the blue ball effect (that shows up when you login and perhaps when you get teleported, not sure if when gm does that you get that effect) then let the script running on persistents and relog.
local tilesEffects = gettileseffect()
for _, tile in ipairs(tilesEffects) do
    for __, effect in ipairs(tile.effects) do
        print('effect id:', effect)
    end
end



2. Check how many creatures are around and if that creature already has been far.
Reply

#3
I cant believe how talented you are and how well you treat your supporters. I am extremely happy that I am a part of this. Thank you a thousand times, I will try this out as soon as possible and get back to you even if I am 100% certain that it is going to work. Your work here is immeasurable Arkilys!
Reply

#4
Hi

This script in the middle (local effects) doesent work on classic tibia bot, could you find a solution i would be so happy. Thanks alot
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016