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.