• 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!

OTClient CandyBot

@BeniS
you are not planing to tell them how to right? cuz if you do then whats the point to add the condition for No Bots on sources? :/
 
@BeniS
you are not planing to tell them how to right? cuz if you do then whats the point to add the condition for No Bots on sources? :/
If OTClient BOT_PROTECTION flag is enabled you can't do much about that easily. That wasn't what I was talking about. This server that I was talking about doesn't use OTClient, it uses a modified cip client, modified so network protocol calls have +0x01 added to the opcode before it is sent out and also will interrupt server calls like this too. So I was saying if you want to get OTClient to work on that particular server you need to modify it so the packets can be interrupted properly (e.g. +0x01).
How can we mod otclient to do that? change the outgoing packet ?
You can manually change all the opcodes to +1 (server and client) that would be the easiest way to deal with it.
 
First, congratulations for this excellent work.

I have a question about usage. I was running an automatic hunt in a cave but bot was looting corpses even if I uncheck the option. So bot was not walking after backpack was full cuz keep trying loot. How do i prevent it?

Another point: is there a plan to add a "loot selector"? Bot was looting trash. And it couldnt group coins automaticaly, desirable for servers running new versions.

And a last point: autopath was only working while the auto explore feature was checked and cave was not explored. After that it stopped completely. Did i do something wrong?

Thanks a lot for the attention. Keep the good work.
 
Last edited:
First, congratulations for this excellent work.

I have a question about usage. I was running an automatic hunt in a cave but bot was looting corpses even if I uncheck the option. So bot was not walking after backpack was full cuz keep trying loot. How do i prevent it?

Another point: is there a plan to add a "loot selector"? Bot was looting trash. And it couldnt group coins automaticaly, desirable for servers running new versions.

And a last point: autopath was only working while the auto explore feature was checked and cave was not explored. After that it stopped completely. Did i do something wrong?

Thanks a lot for the attention. Keep the good work.

Yep these features are still very young. You can see a list of upcoming features I want implemented: https://github.com/BenDol/otclient-candybot/issues
There are many things still to come, like optimizations, fixes and features. Unfortunately I have very little time at the moment due to my paid work.

Regarding your question, the looter is still in need to updating for things like out of cap/bag space. Like I said it is still young and in need of some development.
 
Last edited:
Congrats on the most recent release, even though the Pathing and Targeting is still in its early stage it works well enough to run it for a long time (besides the pathing once the map is explored), would you be able to make a simple arrow/bolt refiler with a select window like for potions in the next release?
Also something like adding more than just one attack spell to use would be great but good work man, keep it up :)
 
Last edited:
Congrats on the most recent release, even though the Pathing and Targeting is still in its early stage it works well enough to run it for a long time (besides the pathing once the map is explored), would you be able to make a simple arrow/bolt refiler with a select window like for potions in the next release?
Also something like adding more than just one attack spell to use would be great but good work man, keep it up :)
Yeah I could add this next time I have the chance to work on CandyBot. Glad people are finding it useful even in these early stages :D (remember unload the client_terminal module when botting for long periods of time with auto pathing. This will fill up a lot and slow the client right down).
 
Last edited:
cheers for the tip :) and if the loot list was done by next release if you could put in changing gold to plat and crystal coins itd make it really useful for OT's :)
 
Why can not I use?
I click "Enable Bot" and yet does not activate the candybot: /
Can anyone help me? Please!

The version of the server I'm using is 9.83, got a problem?

13yjteg.png
 
Can
Why can not I use?
I click "Enable Bot" and yet does not activate the candybot: /
Can anyone help me? Please!

The version of the server I'm using is 9.83, got a problem?

Please open the terminal and copy the errors here (Ctrl + T) opens the terminal. You might have bot protection enabled in your client build.
 
I'm looking for the latest client than supports the latest of candybot.
Because your links are dead.
 
didn't know where to put this but i guess here is fine
whenever i click "Add Path" i get this error


ERROR: protected lua call failed: LUA ERROR:
/otclient-candybot/modules/05-paths/paths.lua:77: attempt to index global 'gameRootPanel' (a nil value)
stack traceback:
[C]: ?
/otclient-candybot/modules/05-paths/paths.lua:77: in function 'callback'
/game_interface/gameinterface.lua:593: in function 'optionCallback'
/corelib/ui/uipopupmenu.lua:61: in function </corelib/ui/uipopupmenu.lua:59>


paths.lua
Code:
--[[
  @Authors: Ben Dol (BeniS)
  @Details: Pathing bot module logic and main body.
]]

PathsModule = {}

-- load module events
dofiles('events')

local Panel = {}
local UI = {}

local NodeTypes = {
  Action = "action",
  Ladder = "ladder",
  Node = "node",
  Pick = "pick",
  Rope = "rope",
  Shovel = "shovel",
  Stand = "stand",
  Walk = "walk"
}

local pathsDir = CandyBot.getWriteDir().."/paths"

function PathsModule.getPanel() return Panel end
function PathsModule.setPanel(panel) Panel = panel end
function PathsModule.getUI() return UI end

function PathsModule.init()
  -- create tab
  local botTabBar = CandyBot.window:getChildById('botTabBar')
  local tab = botTabBar:addTab(tr('Paths'))

  local tabPanel = botTabBar:getTabPanel(tab)
  local tabBuffer = tabPanel:getChildById('tabBuffer')
  Panel = g_ui.loadUI('paths.otui', tabBuffer)

  PathsModule.loadUI(Panel)

  PathsModule.bindHandlers()

  PathsModule.parentUI = CandyBot.window

  -- setup resources
  if not g_resources.directoryExists(pathsDir) then
    g_resources.makeDir(pathsDir)
  end

  g_resources.addSearchPath(g_resources.getRealDir()..g_resources.resolvePath("images"))

  -- register module
  Modules.registerModule(PathsModule)

  --[[local gameRootPanel = modules.game_interface.getRootPanel()
  g_keyboard.bindKeyPress('Alt+Left', function() UI.PathMap:move(1,0) end, gameRootPanel)
  g_keyboard.bindKeyPress('Alt+Right', function() UI.PathMap:move(-1,0) end, gameRootPanel)
  g_keyboard.bindKeyPress('Alt+Up', function() UI.PathMap:move(0,1) end, gameRootPanel)
  g_keyboard.bindKeyPress('Alt+Down', function() UI.PathMap:move(0,-1) end, gameRootPanel)]]

  connect(g_game, {
    onGameStart = PathsModule.online,
    onGameEnd = PathsModule.offline,
  })

  connect(LocalPlayer, {
    onPositionChange = PathsModule.updateCameraPosition
  })

  if g_game.isOnline() then
    PathsModule.online()
  end

  modules.game_interface.addMenuHook("pathing", tr("Add Path"),
    function(menuPosition, lookThing, useThing, creatureThing)
      local gamemap = gameRootPanel:recursiveGetChildByPos(mousePosition, false)
      if gamemap:getClassName() == 'UIGameMap' then
        PathsModule.createPath(gamemap:getPosition(menuPosition))
      end
    end,
    function(menuPosition, lookThing, useThing, creatureThing)
      return lookThing ~= nil and lookThing:getTile() ~= nil
    end)

  -- event inits
  SmartPath.init()
end

function PathsModule.terminate()
  PathsModule.stop()

  if g_game.isOnline() then
    --save here
  end

  modules.game_interface.removeMenuHook("pathing", tr("Add Path"))

  disconnect(g_game, {
    onGameStart = PathsModule.online,
    onGameEnd = PathsModule.offline,
  })

  disconnect(LocalPlayer, {
    onPositionChange = PathsModule.updateCameraPosition
  })

  --[[local gameRootPanel = modules.game_interface.getRootPanel()
  g_keyboard.unbindKeyPress('Alt+Left', gameRootPanel)
  g_keyboard.unbindKeyPress('Alt+Right', gameRootPanel)
  g_keyboard.unbindKeyPress('Alt+Up', gameRootPanel)
  g_keyboard.unbindKeyPress('Alt+Down', gameRootPanel)]]

  -- event terminates
  SmartPath.terminate()

  PathsModule.unloadUI()
end

function PathsModule.loadUI(panel)
  UI = {
    AutoExplore = panel:recursiveGetChildById('AutoExplore'),
    PathMap = panel:recursiveGetChildById('PathMap')
  }

  -- Load image resources
  UI.Images = {
    g_ui.createWidget("NodeImage", UI.PathMap)
  }
end

function PathsModule.unloadUI()
  for k,_ in pairs(UI) do
    UI[k] = nil
  end

  Panel:destroy()
  Panel = nil
end

function PathsModule.bindHandlers()

end

function PathsModule.online()
  UI.PathMap:load()
  PathsModule.updateCameraPosition()
end

function PathsModule.offline()
  --save here
end

function PathsModule.updateCameraPosition()
  local player = g_game.getLocalPlayer()
  if not player then return end
  local pos = player:getPosition()
  if not pos then return end
  if not UI.PathMap:isDragging() then
    UI.PathMap:setCameraPosition(player:getPosition())
    UI.PathMap:setCrossPosition(player:getPosition())
  end
end

function PathsModule.onStopEvent(eventId)
  if eventId == PathsModule.smartPath then
    PathsModule.SmartPath.onStopped()
  end
end

return PathsModule


 
Where is compiled version for linux ? Any guide ?

You dont need to compile this because it is just an extension for OTClient. There are guides for compiling OTClient in the github wiki
 
Last edited:
Back
Top