• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Attack first/second Battle List OTClient

willdu

Active Member
Joined
Mar 11, 2017
Messages
91
Reaction score
25
Is anybody know how make otclient works like tibia 11:
When you press SPACE attack the first target in battle list, if have the first target attack next, next, next...

I know how to use a hotkey to call a function, but i don't have any idea how to do this function...

It's so usefull to who don't use bots
 
Get the first id from battleList (also you can check for isMonster if you dont want to attack players) and then call function g_game.attack(firstId). Just my thoughts, didin't tested.
 
When I saw the tile I thought you means you had 2 battle list on the client :p
And how cool wouldn't that be?
Imagen having 1 list of creatures on right side of screen, then another one of players on the left :)
 
Easy to do :d Copy module, set conditions and is done xd
 
Is anybody know how make otclient works like tibia 11:
When you press SPACE attack the first target in battle list, if have the first target attack next, next, next...

I know how to use a hotkey to call a function, but i don't have any idea how to do this function...

It's so usefull to who don't use bots

So nice idea, i'll implement this to my sister play, she is so slow to attack monsters XD (she is a kid)

Get the first id from battleList (also you can check for isMonster if you dont want to attack players) and then call function g_game.attack(firstId). Just my thoughts, didin't tested.

Is here to edit?
otclient/battle.lua at master · edubart/otclient · GitHub
 
You need to use the function getSpectators. 'Cause if you use the battlelist, it will stay opened when you're playing
 
I didn't finish this yet guys, idk how to do, i'm trying, but here is something maybe usefull i found on a mod:
Code:
function Creature:getTargetsInArea(targetList, pathableOnly)
--[[
TODO: Add flag operations for:
* Closest creature
* Furthest creature
* Least health creature
* Most health creature
* -Reserved-
]]
local targets = {}
if g_game.isOnline() then
creatures = g_map.getSpectators(self:getPosition(), false)
for i, creature in ipairs(creatures) do
if creature:isMonster() then
if table.contains(targetList, creature:getName():lower(), true) then
if not pathableOnly or creature:canStandBy(self) then
table.insert(targets, creature)
end
end
end
end
end
return targets
end

from: otclient-candybot/creature.lua at master · BenDol/otclient-candybot · GitHub
 
I have this working on my OTClient. (Where you can select a monster on the battlelist, and then choose whether to follow, or attack)

It was a while back, so I don't remember exactly how I did it, but it was not hard to do at all.
 
Back
Top