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
Spawn animation ID (blue "port")
#1
Hello, if a GM spawns monsters on you, there is a blue spawn port on the monster that is spawned.

Is there anyway for the bot to recognize this and stop/auto talk?
Or is there anyway for the bot to realize a creep spawned and did not walk in on the screen?

Thank you in advance!
Reply

#2
Hello.

Yes... You can develop a LUA Script to try to guess whenever a monster was summoned, for example: if a monster suddenly show up 4 sqms or less from you (but may not work fine when monster that actually summon XD) and certainly possible to detect such "screen effects" like using one of the functions below, certainly gettileseffects.

1. Detect monster:
getcreatures(string filter) [table]: (p, m, n, f and s) - You can combine all as you like

p: The creature has to be player.
m: The creature has to be monster.
n: The creature has to be npc.
f: The creature must be on the same floor as you.
s: The creature must be on the same floor as you and visible on screen.
.id [number]
.name [string]:
.hppc [number]
.posx [number]
.posy [number]
.posz [number]
.dir [number] (0 = "n", 2 = "s", 1 = "e" or 3 = "w")
.speed [number]
.dist [number]
.outfitid [number]
.skull [number]
.party [number]
.visible [boolean]
.walking [boolean]
.ignored [boolean]
.isattackme [boolean]
.ismonster [boolean]
.isplayer [boolean]
.isshootable [boolean]
.isreachable [boolean]

2. Detect effects:
gettileeffects(number posx, number posy, number posz) [table]: Return a table with effects on this tile..
gettileseffects() [table]: Return a table with tiles that has at least one effect.
.posx [number]
.posy [number]
.posz [number]
.effects [table(number)] -> Table with effects ids
Reply

#3
Hello again, I am a bit confused. How do i get the effect ID of a spawned creature? I tried to search the forum, but couldn't find an answer.
Would very much like to make this work, but i am a novice when it comes to programming
|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="Sad" title="Sad" class="smilie smilie_8" />

Edit: I mean the table number for spawned creatures.
Reply

#4
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

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
I believe 11 is the id of blue ball that shows up, but i strongly recommend you to use the first script to verify.
Reply

#5
You are awesome, it works like a charm
|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" />
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016