Создание несложного бота для WoW, программирование маршрутов
Введение
Предупреждение
Я отлично понимаю, что использование ботов запрещено лицензионным соглашением Blizzard. Это может привести к перманентному бану аккаунта. Я бы расстроился, узнав, что кто-то, воспользовавшись материалами данного поста, стал наживаться, ухудшая экономику игры и вызывая неодобрение других игроков. И да, я понимаю, то, что делаю я, нечестно.
Цель поста — рассказать о моем опыте и описать сложности, с которыми я столкнулся, узнать у вас, что можно было сделать лучше.
Предыстория
Коллекционирование
Люди, далекие от индустрии игр, могут без ущерба пропустить этот раздел. В игре WoW есть такой аспект — коллекционирование. Как и в нумизматике/филателии, чем больше у вас, например, верховых животных, тем вам приятнее. Точно так же важен процесс получения. Какие-то драконы требуют для получения выполнения десятка задач («ачивок»), какие-то — войти в лучшие 2% игроков в мире по навыку управления персонажем (сражения на арене), что-то можно просто купить за игровую валюту, что-то — за реальные деньги в магазине. Подробности можно почитать в другом источнике, речь не об этом. Так вот, некоторые из коллекционируемых предметов падают в подземелье с шансом около 0,5%. Если шанс выпадения дается игроку лишь раз в день (иногда в неделю), вам потребуется время, соизмеримое с годом, для забегов. И все ради того мгновения получения заветного выстраданного предмета. Чем больше вы потратили времени и сил на «фарм» предмета, тем приятнее вам его в итоге получить. По моему опыту радость очень мимолетна.
Зависимость шанса выпадения от количества попыток
Небольшое отступление. Какова вероятность того, что за шесть бросков игральной кости выпадет «6»? Очевидно, что . То есть, наше событие является противоположным событием к невыпадению «6» за все шесть попыток.
Используя второй замечательный предел, нетрудно показать, что .
А вероятность получения коня с шансом «дропа» в 1% за 100 попыток примерно равна 63%.
Некоторые игроки, сделав триста попыток считают, что вот-вот повезет — ведь вероятность облома за такое большое число попыток мала. Их ждет разочарование, ведь за следующие 100 им повезет снова лишь на 63%. А старые труды не дают ничего.
Задача
Карта подземелья и маршрут:
Задача максимум. Запустил и ушел на пол часа. Процесс полностью автоматический.
Задача минимум. Запустить и сидеть рядом, читать или играть на гитаре, поглядывая на монитор. При необходимости изредка помогать персонажу выбраться из непредвиденной ситуации.
Важно иметь возможность при желании описать маршрут другого подземелья, не залезая в код.
Подход
Движение и позиционирование
Это отрывок из списка команд робота по перемещению. Указаны координаты x, y и угол поворота в пространстве в радианах.
Клавиши и команды
По пути надо нажимать кнопки и кликать мышкой, открывать двери, где-то нужно ждать. Не хотелось бы выписывать это все вручную. Да и искать среди команд с координатами (в примере выше), куда же что вписать, не очень приятно. Поэтому единовременные нажатия на кнопки и клики мы будем писать параллельно с записью координат.
Отдельно упомяну про «pitch» (наклон). Если персонаж смотрит в горизонт, он равен нулю. Если под ноги, наклон отрицателен. А в небо — положителен. Измеряется в радианах. Его пришлось добавить, как только персонажу захотелось летать.
Модули
Addon для WoW на Lua
Аддон для WoW это скрипт на языке Lua. Язык полноценный, гибкий, эффективный. Делать с системой ничего нельзя. Делать с игрой можно все, но только в рамках того API, которое предоставляет вам игра. Так как Blizzard не хочет, а точнее, запрещает игрокам и предпринимателям писать ботов, то и API кроме упомянутых выше координат почти ничего полезного и не предоставляет. Разумеется, полезного для наших нужд. Неплохой гайд по написанию аддонов сразу с описанием Lua можно найти здесь. Ну а я опишу свой вариант.
Манифест и GUI
Подробности и источник. В папке World of Warcraft\Interface\AddOns\ создаете папку HelloWorld. В нее кладете HelloWorld.toc с содержимым
Если бы я хотел понарисовать формочек и кнопочек (а для этого обычно и нужны аддоны), последней строчкой я бы вписал еще HelloWorld.xml с описанием этих кнопочек. В дизайне и написании такого GUI-аддона хорошо помогает AddOn Studio. Мощный инструмент на базе MS Visual Studio.
Но так как я минималист, рисовать мы в этот раз не будем. Кроме того, это даст мне возможность показать, что создавать формы можно динамически из самого скрипта без использования дизайнера. Рассмотрим же HelloWorld.lua. Редактировал я его в Notepad++. Чтобы игра подключила изменения в HelloWorld.toc, надо перезапустить ее целиком. А вот изменения в HelloWorld.lua можно подхватить, написав в консоли команду /reload. Поэтому процесс программирования и отладки не такой болезненный.
Слеш-команды
Кстати, об отладке. Советую сразу добавить обработчик слеш-команд:
Для этого определим переменную вида SLASH_ИМЯn. Где ИМЯ уникально для всех аддонов, а n либо пусто, либо порядковое число с 1. И добавим функцию с именем ИМЯ в некий объект. Может показаться странным для программиста на C++, что мы эту функцию-обработчик нигде явно не регистрируем. Да и со строковой переменной связываем чисто по имени переменной. Но вот такая она, мощь и магия Lua.
Теперь команда в WoW-консоли /helloworld выполнит требуемые вам действия: позволит вывести отладочную информацию, а для простейших аддонов, собственно, произведет все то, ради чего вы их писали.
Ну и тут же я показал WoW API, которое достает требуемую информацию.
Обработчик событий
Система работы с GUI в аддоне похожа на работу Windows со своими сообщениями и их обработкой.
Мы создаем фрейм типа «Frame» и подключаемся на действия «OnEvent» и «OnUpdate» командами
Обработчик OnUpdate будет вызываться после каждого кадра — то, что нам нужно для обновления координат. А OnEvent будет вызываться при других желаемых событиях. Из него будем дергать соответствующие функции:
Что еще удобнее в Lua, это то, что вот такой конструкцией можно вызвать уникальные обработчики вида
Здесь PLAYER_LOGIN — это событие, которое рассылается во все фреймы при входе в мир и перезапуске пользовательского интерфейса. Другие события: PLAYER_LEAVE_COMBAT, QUEST_FINISHED, PLAYER_EQUIPMENT_CHANGED, PLAYER_DEAD, — и еще очень много. С полным списком можно ознакомиться тут. Зарегистрируем то событие, которое мы хотим обрабатывать, командой
Передача информации
Так как в аддоне нельзя ничего делать с системой, информацию из WoW другой части бота мы будем передавать при помощи изменения цвета пикселей. Как это делал rednaxi в своем посте. Но только мы будем передавать цветом не один бит информации, а будем сериализовать данные и передавать их больше.
Рисование
Так как для рисования тоже нужны фреймы, создадим их
Думаю, тут все понятно и без комментариев. Подробности по каждому методу ищите сами.
Сериализация
У нас есть две координаты и два угла. Все — числа с плавающей запятой. Компоненты цветов пикселей в аддоне тоже числа с плавающей запятой, но от 0.0 до 1.0. Кроме того, известно, что сохранится компонента цвета в одном байте. Поначалу я каждую координату сохранял в одну компоненту цвета. В итоге точность позиционирования в локации составляла 1/255 от размера карты. Получалось как в GPS: вроде координаты есть, но вести машину на автомате (управление компьютером без человека) по дороге по навигатору не выйдет. Так что пришлось давать два байта. Как повыгоднее сохранить одно дробное число в два байта? Я сделал так
Функция modf возвращает целую и дробную часть числа через запятую. Здесь используется параллельное присваивание — еще одна полезная фишечка Lua.
При таком подходе я использую полную мощность каждого из двух байтов, в которые сохраняется координата. Ну а азимут и наклон не так требовательны к точности, лишь бы укладывались в отрезок 0.0-1.0. Получается вот так:
Теперь при перемещении по миру в левом верхнем углу два квадратика 10 на 10 будут хаотично менять свой цвет.
Заключение первой части
Thread Tools
Search Thread
Actually, not much, I’ve included a simple fishing and morpher script, and a «debug view» aswell for developers.
The scripts are automatically updated and you can freely modify them, or make your own scripts.
Because I’m having much more fun doing making an API and implementing new features to it than actually playing the game.
I’ve seen many talented lua developers here, and I’m excited to see what people could eventually do with it.
Attempt to keep it undetected as long as possible haha.
If you are a pro raider and can’t afford losing your account don’t use it, that’s a third party tool.

These ads disappear when you log in.
(15 members gave Thanks to LuaBox for this useful post)
Very good initiative! Looking forwards to seeing you improve your project with help from the amazing OC community!
Nice tool.anywhere to see the api document?
I’m going to write a documentation as soon as the API will be in a «stable» state, however most of the api is used in «debugview» scripts and is always up to date, so feel free to use that as a reference for now.
Pushed a new build with a simple rotation engine, I’ve incldued sample rotation for ret/prot paladin
Nice Tool. Keep up the good work
I’d like to contribute some addons / rotations to this project. Where can I find the documentation. Also, the discord invite has expired.
However the discord got banned already 😐
I’ve made a new one for now: Discord
the LuaBox.rar from #1 can’t be extracted.
Nice Tool. Keep up the good work
Actually, not much, I’ve included a simple fishing and morpher script, and a «debug view» aswell for developers.
The scripts are automatically updated and you can freely modify them, or make your own scripts.
Because I’m having much more fun doing making an API and implementing new features to it than actually playing the game.
I’ve seen many talented lua developers here, and I’m excited to see what people could eventually do with it.
Attempt to keep it undetected as long as possible haha.
If you are a pro raider and can’t afford losing your account don’t use it, that’s a third party tool.

I made a druid rotation (based off your paladin.lua) for this and i am having a problem loading the cr, I tried to upload the druid.lua but for some reason I can’t attach any files? Any Ideas would be appreciated. Thank you for this, it is a lot of fun!
Feel free to contact me on the new Discord then : Discord
It got deleted again, I’ll setup something else soon
The application war unable to start corectly (0xc000007b) why
Thread Tools
Search Thread
Recovered my account here just to share a cautionary tale regarding LuaBox.
I started using LuaBox 30 days ago exactly now.
Here’s a screenshot of my LB account status page for proof:
6B0fSWg.png
The only products I’ve employed with this tool are the Rotation Engine, and a 3rd party product called GHF (Go Hands Free), now ScriptVirt. Both of which are simply Rotation Automation engines.
I woke up today with a 6-month ban notification. Note: LuaBox is the only «botting» utility I’ve employed on this account, I’ve always played manually until now. Furthermore, the only thing I used with this solution is rotation scripts for lazy raiding and mythic+ in a non-competitive setting.
Now I’m not here to complain about the ban. I totally get it, I used a lua unlocker, I’m responsible for repercussions should they come.
What I AM here to put out to the rest of the folks here, is the ridiculous reactions from the admin staff.
Following my ban, in the LuaBox support channel I posted the following:
The message was deleted and I was told to stop spreading misinformation. I posted something similar again, and was told blatantly what I said was false. Not true at all, absolutely ridiculous. I was subsequently banned from Slack with no further warning, my guess is to protect their other customers from being made aware the product is not as safe as they tout it to be, but I really don’t know.
The reason I began using LuaBox was due to the original developer’s notoriety, Julian Bosch, known as JuJuBuSc, the legendary code breaker. I had been advertised this product as it had never received a ban wave, and was lightyears ahead of other lua unlockers, then following me posting a benign statement highlighting that I was banned, I was kicked from Slack. So now I own a product, that I’m unable to obtain support for, my account is banned, and the reaction from the admin staff (specifically Emu) was to say I was full of shit and ban me from Slack.
I can provide more proof of anything I’ve said at request. The only thing I can’t provide is Slack messages because again, my account has been banned, otherwise I’d be able to post private messages from a legitimate developer of the product claiming point blank they’ve never had a banwave and it’s the safest product available.
I plan to look into other lua unlocker options moving forward. If you’ve used LuaBox for an extended period of time and enjoy it, don’t let me dissuade you, just wanted to share my experience.
Thread Tools
Search Thread
My account got banned
I started using LuaBox 21 days ago And I use tool the Rotation Engine.
I was playing on Wednesday. on 1:15 am i m logout Of from a game
In the morning in an hour 7:00 I opened (++++) app And it started Download patch 8.3 After downloading has finished
I m login in games and I got a message ( account has been closed)
messages from (++++++++) Sent from 1:30 am 6-month ban
«Sorry For My Bad English
lol FAKE NEWS, brand new owned core user account and just happens to come to ownedcore and see this post and post about his false victimhood. that’s a cool story.
These ads disappear when you log in.
I call bullshit on this, either you got banned for being a complete moron while botting, or you simply just trying to make a smear campaign out of pure saltiness. I’ve used LUABOX for 1.5 years and never once have I EVER been banned PERIOD.
But we all know this is just pure salt and a fake post, no one wastes their complete day to go out and make a full post on owned core for a simple ban especially when you use a bot knowing damn well there is a chance to get banned, it’s obviously clear that you have other intentions with this post and it’s not to bring awareness, we know it’s you, Larry. You’ve been on OC since 2014 and this is your first posts..lol get real.
ANYONE that uses LUABOX knows very well there is no bans from detection. Thanks for coming out.
Better luck next time.
I’m gonna go ahead and call into question your ability to comprehend the things you read. The overarching point of my original post was to highlight the absolute shit show of customer service I was greeted with when I mentioned the fact that I was banned within the LuaBox community.
Thread Tools
Search Thread
This is getting really awkward!
Not that it matters but I am also a customer of LB. Subbed for over a year now, raiding in 2 different guilds at Top 500-1000 level. Nothing fancy but pretty solid.
Used their rotations at first to try out and gear alts easily (when it became a thing to level a few for raids).
Not only do these rotations perform really really well, but I also have never been banned using them.
Now, don’t get me wrong, it’s an Unlocker you can find bots for it, pvp rotations for it and all other things that can get you banned pretty easily. Up to each and everyone to make that decision.
But let’s be honest here, you will NEVER get for that price an undetected unlocker for years now, with top notch pve rotations, with devs actually playing the game at a high level (so you don’t need to wait for people telling them what to do), fishing, pet battle and a good community. NEVER. It doesn’t even exist out there. Not gonna happen. You know why? Because all the others just do it for the money.
That’s the simple truth. Go and see for yourself. I won’t comment on the fate of other unlockers, we all know what happened and will happen. LB still here.
Oh and about them deleting comments or lying? What are you talking about? They are the only ones that said recent classic patch has detections and therefore stopped supporting it to find a solution. Others just went ahead and we know the rest. And when you get banned for some reason they just tell you to stop. Unlike others who said come again I’ll give you a discount.
I like it a lot there and don’t get these comments. I know for a fact that many friends have never been banned with LB only using it in PvE and happy to keep going. It’s sad to lose accs but at the end of the day LB at least told us it’s not safe to hack!
Oh and last but not least to Lanze123, Emu is a great guy. Cannot relate to what you are saying. He is always open to feedback, very knowledgeable, always there, and for sure has a temper. It’s his style and has the right to do whatever he wants.
I hope LB will last for a long time! As well as other dev’s and products. After all it’s really nice for us customers to have those guys, isn’t it?








