Jump to content

Zelek

Administrators
  • Posts

    669
  • Joined

  • Last visited

  • Days Won

    75

Everything posted by Zelek

  1. auto(100) if not g_game.isOnline() then return end local messagesToDetect = {"[English]", "msgheck", "bot"} -- which words should it look for? local respondToMessage = false -- should it respond if trigger word is found? local messageToRespond = "im here" -- what should it respond? local pauseBot = false -- should it pause the bot? local playAlarm = true -- should it play alarm? connect("g_game", "onTalkMessage", checkBotMessage) function checkBotMessage(name, level, mode, message, channelId, creaturePos) for _, messageToDetect in pairs(messagesToDetect) do if string.find(message, messageToDetect, 1, true) then if respondToMessage then g_game.talk(messageToRespond) end if pauseBot then setOption("Global/BotPaused", "true") end if playAlarm then for i = 1, 5 do playSound("alarm.wav") sleep(1000) end end return end end end
  2. You can download it here: OTClientBot-v2.0.0-beta15b Also please remember to install Visual C++ Redistributable for Visual Studio 2015 - 2019 x86 if you haven't already. Added in beta 15b: added possibility to change process name to look for while selecting the client optimization improvements for targeting updated lua version to 5.4.1 Known issues: creatures and containers aren't read properly -- fixed in beta 15a onTalkMessage and onTextMessage events can cause the application to crash -- fixed in beta 15b "Check only targeting creatures" also counts creatures that are disabled -- fixed in beta 15b List of changes: fixed a bug that occasionally caused targeting and cavebot to crash the application fixed a bug that prevented reading text and talk messages that contains special characters fixed a bug that prevented reading creature names that contains special characters removed TalkMessage and TextMessage userdata from lua interface (all of the scripts that you have used with those will stop to work) added two game events (usage example in the next point): g_game.onTextMessage(number mode, string message) g_game.onTalkMessage(string name, number level, number mode, string message, number channelId, Position creaturePos) added new lua functions: connect(string class, string event, function callback) -- connects specific event to the lua callback function: auto(100) connect("g_game", "onTextMessage", onTextMessage) function onTextMessage(mode, message) print("mode: " .. mode .. ", message: " .. message) end disconnect(string class, string event) -- disconnects every callback from the specified event updated "Anti Idle.lua" to respect above changes
  3. @lediv I've found the issue. It seems like any message that contains special characters isn't read properly right now. I'll try to fix it as soon as possible.
  4. if not g_game.isOnline() then return end local messageToDetect = {"msgheck", "bot"} local lastMessage = g_game.lastTextMessage().message if not lastMessage then return end for v, k in pairs(messageToDetect) do if string.find(lastMessage, k, 1, true) then g_game.talk("im here") -- message to talk in default chat setOption("Global/BotPaused", "true") g_game.lastTextMessage().message = "" for i = 1, 5 do playSound("alarm.wav") sleep(1000) end end end auto(50) It may be that they changed how things works, but I highly doubt that.
  5. @lediv you can easily change the color of any message, it isn't an indicator of anything.
  6. I've already confirmed few months ago with a friend of one of the GMs at DBL that it is indeed a normal message, just without a name. We have used this script to determine it: print(#getTalkMessages()) for v, k in pairs(getTalkMessages()) do if k.mode ~= 43 then print(v .. ": " .. k.sender .. ": " ..k.text) end end (Please mind that it's the previous api, but the internals didn't change) And we got this as a result: 34: : [English] GM XXX is checking if you are using a bot. Please answer him on msgheck chat, on default chat or by private message. 35: : [Polish] GM XXX sprawdza czy uzywasz bota. Prosimy abys odpowiedzial mu na msgcheck chacie, na default chacie lub w prywatnej wiadomosci. If it weren't a "talk message" it wouldn't appear in the logs.
  7. As far as I know the bot check at DBL isn’t a system message, it’s normal message on a channel. If you want to check for system messages use g_game.lastTextMessage() instead. Maybe you were just unlucky and someone send a message on one of the open channels you had or you have sent a spell in the 50 millisecond window it takes it to refresh the script which would cause the last talk message to get overwritten.
  8. Zelek

    Request Script

    It works fine for me, however I've made some changes so let me know if it still crashes the bot for you with beta14
  9. You can download it here: OTClientBot-v2.0.0-beta14b Also please remember to install Visual C++ Redistributable for Visual Studio 2015 - 2019 x86 if you haven't already. Known issues: Application can crash while "open next BP", "eat food from corpses" or "open BP at login" is enabled. -- fixed in beta 14a Application can crash while executing lua script with directly accessed Creatures/Items/Containers/Tiles iterator (for example: "for _, creature in pairs(g_game.getCreatures()) do" would trigger lua's garbage collector and could lead to a crash) -- it is your responsibility to avoid this type of usage g_game.moveItem doesn't work on map items -- fixed in beta 14a lua scripts are getting prepended with 'require "libs/main"' -- fixed in beta 14a Local Player information could not be read correctly in some rare cases -- fixed in beta 14a Application can crash while loading lua scripts from a save file -- fixed in beta 14a Item healer doesn't work with items that can be used with a crosshair -- fixed in beta 14b Added in beta 14b: getOption and setOption functions can now set/get persistent and cavebot specific script enabled value by name. Example below: if getOption("Scripts/Persistent/Change GPs/Enabled") == "true" then setOption("Scripts/Persistent/Change GPs/Enabled", "false") else setOption("Scripts/Persistent/Change GPs/Enabled", "true") end List of changes: fixed a bug that sometimes prevented application from starting up correctly fixed a bug that sometimes caused lua scripts to crash the application fixed a bug that sometimes caused targeting to crash the application added new lua functions: g_game.buyItem(number itemId, number count, [bool ignoreCapacity = false], [bool buyWithBackpack = false]) g_game.sellItem(number itemId, number count, [bool ignoreEquipped = false]) added default libs that are automatically loaded with each script: main.lua -- responsible for loading other default libs table.lua -- contains various helper functions to work on tables position.lua -- contains various helper functions to work on Position object string.lua -- contains various helper functions to work on strings added ability to select specific floor to read tiles from (Info & options tab)
  10. Zelek

    Request Script

    auto(100) local idsToFind = {3031, 3035} -- items ids to find local tiles = g_map.getTiles() for _, tile in pairs(tiles) do local topItem = tile:getTopItem() if topItem then for _, id in pairs(idsToFind) do if topItem:getId() == id then playSound("alarm.wav") sleep(1000) return end end end end Remember to enable "Read map tiles" in Info & options tab.
  11. Zelek

    Request Script

    auto(100) local corpseIds = {296, 4133} -- ids of bodies local itemIdToUse = 3456 -- id of the item to use on bodies function table.find(t, value) for k,v in pairs(t) do if v == value then return k end end end local tiles = g_map.getTiles() local corpses = {} for _, tile in pairs(tiles) do if tile:getPosition():getDistance(g_game.getLocalPlayer():getPosition()) <= 1 then local topItem = tile:getTopItem() if topItem and table.find(corpseIds, topItem:getId()) then table.insert(corpses, topItem) end end end if #corpses > 0 then for _, corpse in pairs(corpses) do setOption("Cavebot/Enabled", "false") g_game.stop() g_game.useItemOnPosition(itemIdToUse, corpse:getPosition()) sleep(1000) end else setOption("Cavebot/Enabled", "true") end Remember to enable "Read map tiles" in Info & options tab.
  12. Zelek

    Request Script

    @ledivdoes the body disappear after using specific item on it?
  13. Zelek

    Request Script

    Using hotkey at specified position is not supported. However you can use for example "g_game.useItemOnPosition(itemId, position)"
  14. Zelek

    Request Script

    function Position:isInRange(from, to) local zone = { nW = { x = (from.x < to.x and from.x or to.x), y = (from.y < to.y and from.y or to.y), z = (from.z < to.z and from.z or to.z) }, sE = { x = (to.x > from.x and to.x or from.x), y = (to.y > from.y and to.y or from.y), z = (to.z > from.z and to.z or from.z) } } if self.x >= zone.nW.x and self.x <= zone.sE.x and self.y >= zone.nW.y and self.y <= zone.sE.y and self.z >= zone.nW.z and self.z <= zone.sE.z then return true end return false end local fromPos = Position.new(123, 456, 7) -- top left corner local toPos = Position.new(321, 654, 7) -- bottom right corner local playerPos = g_game.getLocalPlayer():getPosition() if not playerPos:isInRange(fromPos, toPos) then playSound("alarm.wav") if getOption("Global/BotPaused") == "false" then setOption("Global/BotPaused", "true") sleep(300000) end if getOption("Global/BotPaused") == "true" then setOption("Global/BotPaused", "flase") end end auto(500)
  15. Zelek

    Request Script

    if g_game.getIdleTime() >= 20000 then gotolabel("Waypoints", "label") -- edit this end
  16. Zelek

    Request Script

    if getOption("Targeting/Enabled") == "true" then setOption("Targeting/Enabled", "false") else setOption("Targeting/Enabled", "true") end Above script will make the bot non responding, please don't use getOption and setOption in hotkeys until I fix that.
  17. It seems like it just doesn't work on that server then, I'll take a look at it though
  18. @BlokuJrHave you tried setting walking method to arrow keys instead of map clicks?
  19. I have no idea what WED Server is, could you link a website? Also alerts work if you don't load settings from beta12, I'm working on fixing that tho.
  20. Zelek

    Wono

    It works at wono without a problem, it must be an issue on your end.
  21. Zelek

    Request Script

    if g_game.isAttacking() then setOption("Cavebot/WalkDelay", "200") else setOption("Cavebot/WalkDelay", "25") end auto(100)
  22. Zelek

    Request Script

    if getOption("Targeting/Enabled") == "true" and getOption("Cavebot/Enabled") == "true" then setOption("Cavebot/WalkDelay", "200") elseif getOption("Targeting/Enabled") == "false" then setOption("Cavebot/WalkDelay", "25") end auto(100)
  23. @ledivrestart both client and bot and it will be fine
  24. @lediv I believe I've fixed the issue in beta13b, let me know if you still have problems
×
×
  • Create New...