kondra
Excellent OT User
Hey,
I'm creating the most powerful bot tibia community has even seen. Personally, I don't like bots, but many players and server owners asked me for it, so there it is.
OTClientV8 bot is included in OTClientV8 project, but has separate github repository with documentation and examples.
Github: OTCv8/otclientv8_bot (https://github.com/OTCv8/otclientv8_bot)
It should be possible to port this bot to classic otclient, but I don't have time for that.
This bot allows you to create whatever you want with lua and otclient otml language. It gives you access to all otclient lua functions and has a lot of functions and tools to make development easier. I don't plan to create an advanced UI for this bot, you can do it yourself by using setupUI function and then share it =)
If you want to contribure, add more functions, some scripts or even UI join otclientv8 discord channel and contact with me - Join the OTClientV8 Discord Server! (https://discord.gg/feySup6) . Or just make a github pull request.
Main bot functions:
For more functions tools and shortcuts please visit bot github repo, don't want to make this post too long.
Example bot script:
For more examples visit bot github repository.
An example, why this bot will be much more powerful than others is data synchronization between players. In this example, two players are able to share information when magic wall is going to disappear.
The script I used:
If you want new functions or functionality - let me know in this thread
I'm creating the most powerful bot tibia community has even seen. Personally, I don't like bots, but many players and server owners asked me for it, so there it is.
OTClientV8 bot is included in OTClientV8 project, but has separate github repository with documentation and examples.
Github: OTCv8/otclientv8_bot (https://github.com/OTCv8/otclientv8_bot)
It should be possible to port this bot to classic otclient, but I don't have time for that.
This bot allows you to create whatever you want with lua and otclient otml language. It gives you access to all otclient lua functions and has a lot of functions and tools to make development easier. I don't plan to create an advanced UI for this bot, you can do it yourself by using setupUI function and then share it =)
If you want to contribure, add more functions, some scripts or even UI join otclientv8 discord channel and contact with me - Join the OTClientV8 Discord Server! (https://discord.gg/feySup6) . Or just make a github pull request.
Main bot functions:
Code:
-- better description will be added later
info(text)
warn(text)
error(text)
setupUI(text)
setupUI(text, parent)
addLabel(id, text)
addSwitch(id, text, onClickCallback)
addButton(id, text, onClickCallback)
addSeparator(id)
macro(timeout, callback)
macro(timeout, name, callback)
macro(timeout, name, hotkey, callback) -- hotkey is used to turn on/off macro
hotkey(keys, callback)
hotkey(keys, name, callback)
singlehotkey(keys, callback) -- works like hotkey, but will be executed only once after key press
singlehotkey(keys, name, callback)
schedule(timeout, callback)
onKeyDown(callback) -- callback = function(keys)
onKeyPress(callback) -- callback = function(keys)
onKeyUp(callback) -- callback = function(keys)
onTalk(callback) -- callback = function(name, level, mode, text, channelId, pos)
onAddThing(callback) -- callback = function(tile, thing)
onRemoveThing(callback) -- callback = function(tile, thing)
listen(name, callback) -- callback = function(text, channelId, pos)
delay(duration) -- can be only used inside callback function, blocks execution of current macro/hotkey/callback for x milliseconds
Example bot script:
Code:
--#Example config
--#main
local widget = setupUI([[
Panel
id: redPanel
background: red
margin-top: 10
margin-bottom: 10
height: 100
Label
anchors.fill: parent
text: custom ui, otml based
text-align: center
]])
--#macros
macro(5000, "macro send link", "f5", function()
g_game.talk("macro test - https://github.com/OTCv8/otclient_bot")
g_game.talk("bot is hiding 50% of effects as example, say exevo gran mas vis")
end)
macro(1000, "flag tiles", function()
tile:setText("Hello =)", "red")
end)
macro(25, "auto healing", function()
if hppercent() < 80 then
say("exura")
delay(1000) -- not calling this macro for next 1s
end
end)
addSeparator("spe0")
--#hotkeys
hotkey('y', 'test hotkey', function() g_game.talk('hotkey elo') end)
singlehotkey('x', 'single hotkey', function() g_game.talk('single hotkey') end)
singlehotkey('=', "Zoom in map", function () zoomIn() end)
singlehotkey('-', "Zoom out map", function () zoomOut() end)
--#callbacks
onAddThing(function(tile, thing)
if thing:isItem() and thing:getId() == 2129 then
local pos = tile:getPosition().x .. "," .. tile:getPosition().y .. "," .. tile:getPosition().z
if not storage[pos] or storage[pos] < now then
storage[pos] = now + 20000
end
tile:setTimer(storage[pos] - now)
end
end)
-- hide 50% of effects
onAddThing(function(tile, thing)
if thing:isEffect() and math.random(1, 2) == 1 then
thing:hide()
end
end)
listen(player:getName(), function(text)
info("you said: " .. text)
end)
--#other
addLabel("label1", "Test label 1")
addSeparator("sep1")
addLabel("label2", "Test label 2")
storage.clicks = 0
addButton("button1", "Click me", function()
storage.clicks = storage.clicks + 1
ui.button1:setText("Clicks: " .. storage.clicks)
end)
HTTP.getJSON("https://api.ipify.org/?format=json", function(data, err)
if err then
warn("Whoops! Error occured: " .. err)
return
end
info("HTTP: My IP is: " .. tostring(data['ip']))
end)
For more examples visit bot github repository.
An example, why this bot will be much more powerful than others is data synchronization between players. In this example, two players are able to share information when magic wall is going to disappear.
The script I used:
Code:
-- sync mwall
-- tested on 1099
local secondPlayer = "Player1"
if name() == "Player1" then
secondPlayer = "Player2"
end
info("Syncing mwalls with player: " .. secondPlayer)
onAddThing(function(tile, thing)
if thing:isItem() and thing:getId() == 2129 then
local pos = tile:getPosition().x .. "," .. tile:getPosition().y .. "," .. tile:getPosition().z
if not storage[pos] or storage[pos] < now then
storage[pos] = now + 20000
talkPrivate(5, secondPlayer, encode({type = "mwall", pos = pos, ping = ping()}))
end
tile:setTimer(storage[pos] - now)
end
end)
listen(secondPlayer, function(text)
local data = decode(text)
if data and data.type == "mwall" then
storage[data.pos] = now + 20000 - data.ping - ping()
end
end)
If you want new functions or functionality - let me know in this thread
Last edited: