Showing posts with label Bots. Show all posts
Showing posts with label Bots. Show all posts

Tuesday, January 10, 2017

Bots for Gaming and Ethical Questions

by Dax Bradley
For the most part, the discussion of bots in gaming revolves around those that fall within uses of morally and legally acceptable standards. Bots and macros that are widely regarded as legal appear to be distinguished by the factor of a human operator being present. However, the question persists as to what happens if an intrepid programmer creates a bot capable of playing an online game. This topic is a hot-button issue in the gaming community, and partly rests about intent. A player may program a bot to carry out commands in sequence for the game’s avatar. For example, suppose a player in a game can score a large amount of points by attacking an enemy with a hack-slash-slash-jump back sequence, but the keyboard commands are complex and difficult to execute. A bot could be created to carry out the keyboard combination automatically if the user simply presses ALT-1.
One argument for this scenario is that the bot is merely an extension of the player. The human must be present to initiate the command, and is thus not fully relying on an AI tool to play for him. However, users can (and already have) created routines that fully control a character’s actions, including searching an environment, taking up resources and “killing off” other players to win the game. This brings to the front a concern in the gaming community. A player in one forum expresses it in this way (User Aceboy1993, 2015, June 23):

This question has been on my mind for a while...mainly because I see bots for all sorts of games like WoW and others. My question is; how do the bots know what is appearing on the screen? I don't play WoW so my example may be wrong but if for example there is a monster, how does the bot know where that monster is on the screen and how does it know how to interact with it?Can you apply this to any game or is it specific for each game? I'm sorry if the question isn't clear...and I'm not asking how to make a bot, more asking how they detect things on the screen as its quite fascinating to me! Thanks in advance :)
The question also points out an interesting angle: the applications are available that play the games such as the above-mentioned World of Warcraft, but how? How do they perceive the environment well enough to interact? One answer is the software Netshark, which reads encrypted net code and “announces” loot to the bot, triggering whatever actions are wanted to acquire the loot (Nilly, 2013). Besides gobbling up the loot and other rewards, bots have created a dilemma for online gamers by clogging up networks with drones, creating trouble for humans who pay monthly fees for the gaming service.
Game developer Blizzard responded to bots on their World of Warcraft server by aggressively flagging and banning suspected bots, resulting in the removal of over 100,000 accounts (Grayson, 2015). Bot makers have responded by coming up with tools to avoid being flagged, ranging from highly complex algorithms to simple techniques. One such project, RsBot, manages to copy the contents of the game client to its own memory, check the state locally, and make decisions there without risk of detection (Kaslai, 2015).
Another reason bot makers draw the ire of game makers is in how they profit off of a game they had no hand in developing. Developer Josh Phillips of Kapersky Lab, claims to have sold 100,000 copies of his creation, which gives users invulnerability in online games (David, 2012). The industry has even taken a bite out of online gambling. Ray Bornert developed an AI program capable of counting cards on an online Poker site, allowing users to play Poker and Blackjack with the precision of a computer (Kushner, 2005). Gambling sites have caught on to the nonhuman players, however, and responded by including a chat feature, allowing players to chat in a sidebar. The feature has been used successfully to flush out bots incapable of human conversation.

References
Aceboy1993. (2015, June 23). Bots in WoW. [Discussion forum]. Retrieved January 4, 2017 from https://github.com/PokemonGoF/PokemonGo-Bot/issues/2578
David, B. (2012). Hacking online games: Josh Phillips and Michael Donnelly at Defcon 19. Retrieved January 4, 2017 from http://privacy-pc.com/news/hacking-online-games-josh-phillips-and-michael-donnelly.html
Grayson, N. (2015). World of Warcraft bot maker calls it quits after massive ban wave. Retrieved January 4, 2017 from http://kotaku.com/world-of-warcraft-bot-maker-calls-it-quits-after-massiv-1704809117
Kaslai. (2015). How do gamebots perceive the game world & other entities? [Discussion forum]. Retrieved January 4, 2017 from http://gamedev.stackexchange.com/questions/102849/how-do-game-bots-perceive-the-game-world-other-entities/102853
Kushner, D. (2005, September 1). On the internet, nobody knows you are a bot. Wired.
Nilly. (2015). How to read packet data using Wireshark? [Discussion forum]. Retrieved January 4, 2017 from http://www.mpgh.net/forum/showthread.php?t=700530

Bots and AI

The legality of using bots in programming is a grey area presently. While it is open to some legal interpretation, it is generally accepted that bots used to save time on a task that is 100% in control of a human is perfectly reasonable. Used as an advanced macro, a bot can make a complex task more efficient, saving time. The most basic example is a simple mouse and keyboard recorder application. Essentially, the user would load the application, and then allow it to record whatever actions are needed to achieve the desired result. Ideally, the goal is to begin at the home screen, record the action, and return to the same screen in order to make the sequence loopable.
The ideal bot recorder includes an editor to facilitate custom scripts (Zhang, 2016). One such application is Auto Hotkey, and is unique among other script programs as it requires some coding knowledge. The tradeoff is that besides being a simple recorder, it is customizable. Users have shared scripts to perform such tasks as instantly turning off a PC monitor, changing the function of the accent key above the TAB to a backspace, or even automatically clean up an email account on a daily basis (Glenn, 2013). Bots and other recorders are highly useful in making mundane tasks more efficient. There are certain pitfalls to avoid when using macro recorders, however.
A dedicated PC is highly recommended for customized scripts. If any settings are different, such as window size or resolution, the results will likely be undesirable (McCreath, 2016). Open source tools such as Slash allow users to write custom bots capable of performing an almost limitless number of mundane tasks, such as following a GPS tracking web site and instructing the bot to report back coordinates to the user at regular intervals (Haughley, 2015). Bots of this variety are examples of basic artificial intelligence programs designed to mimic human responses, and are widely used by troubleshooting sites and other businesses.
Bots that are legal are also built into established services, as an optional feature. Customizable news and notifications are available that can report content as soon as it becomes available via products like Forbes Bot, and Tech Crunch Bot (Bridgewater, 2016, November 22). Chat bots assist travel companies to help consumers narrow down their travel needs in an automated process, eliminating the need to pore through thousands of options. Similarly, news agencies use bots to help users consolidate their consumption, citing how readers don’t like to load multiple apps. Readers on average have only one or two news apps installed on their devices (Upbin, 2016).

References
Bridgewater, A. (2016, November 22). Come fly with AI, IBM cloud builds ‘chatbot’ virtual travel agent. Forbes. Retrieved January 4, 2017 from http://www.forbes.com/sites/adrianbridgwater/2016/11/22/come-fly-with-ai-ibm-cloud-builds-chatbot-virtual-travel-agent/#5ceb7d671f39+
Glenn, W. (2013). Show us your best Autohotkey script. Retrieved January 4, 2017 from http://lifehacker.com/show-us-your-best-autohotkey-script-507227185
Haughley, M. (2015). A beginner’s guide to your first bot. Retrieved January 4, 2017 from https://slackhq.com/a-beginner-s-guide-to-your-first-bot-97e5b0b7843d#.nvclmr6pb
McCreath, D. (2016). Your first custom slash command for Slack. Retrieved January 4, 2017 from https://github.com/mccreath/isitup-for-slack/blob/master/docs/TUTORIAL.md
Upbin, B. (2016). Introducing the Forbes newsbot on Telegram. Retrieved January 4, 2017 from http://www.forbes.com/sites/bruceupbin/2016/02/23/introducing-the-forbes-newsbot-on-telegram/#64b8ee03117c
Zhang, G. (2016). 8 free macro recorder that automate your traditional mouse and keyboard. Prohavit. Retrieved January 4, 2017 from https://www.prohavit.com/blog/8-free-macro-recorder-automate-traditional-mouse-keyboard/

Bots!

The advancement of artificial intelligence has fostered many tools designed to both mimic human behavior and make mundane tasks easier. One area which has seen an explosion of innovation in online interaction is the development of “bots”. Put simply, bots are applications designed to respond within another program to automatically achieve some result. They come in a variety of styles. There are telegram bots, game bots, and telegram bots, to name a few. Each bot performs unique functions. For example, telegram bots autonomously answer inline queries in HTML5-based games (Martin, 2016, October 17).

Using the software available through a company called The Botfather, users are able to automatically follow a game’s lifecycle through the following process:
1.The user requests a game through the /play prompt
2.A sendgame function is remotely sent in response by the API setting the buttons
3.The user taps the play solo button, and the game bot responds by sending the game’s URL and sets parameters
4.When the player scores in the game a setScore function is established in the cache

The tool in the above example allows players to remotely handle many games and gather resources, points, and other rewards. The performance of bots is based on a machine-state flow process. Bots are designed to “read” the screen (pixels, text, packets or memory) to discover the state, and then respond per the programming (Mai, 2009). This is where the key distinction between bots and macros lies. A macro has been defined on Tech Target in terms of programming as (Griffen & Lowery, 2015):

“…in Microsoft Word and other programs, a macro is a saved sequence of commands or keyboard strokes that can be stored and then recalled with a single command or keyboard stroke.”

In other words, a macro performs when it is instructed to do so by a human. It is merely a shortcut command designed as a time-saver. A bot takes the concept to the next step; performing autonomously. In games and other online applications, it uses artificial intelligence to read a state and respond. Still, users tend to use the terms interchangeably. In C++ programming, developers have devised a method for automating a basic process such as a send key.

Effectively, developing a macro (or bot as many programmers will call it) allows the user to send a virtual key, defined in winuser.h as VK_XXX and a flag noting whether the key is up or down to express whether the virtual key is expressed. The ALT-TAB sequence could be set up in this manner (Bachaalany, 2004):

//press down Alt-Tab
Keybd_event (VK_MENU, 0, 0, 0);
Keybd_event (VK_TAB, 0, 0, 0);
::Sleep (1000);
//stop pressing Alt-Tab
Keybd_event
(VK_MENU, 0, KEYEVENTF_KEYUP, 0);
Keybd_event
(VK_TAB, 0, KEYEVENTF_KEYUP, 0);

As shown above, the event requires four lines of code. The mac o simplifies the process through simply calling a library: #include “Sendkeys.h”

References

Bachaalany, E. (2004). How to do ‘send’ keys in C++. Retrieved January 3, 2017 from https://www.codeproject.com/kb/cpp/sendkeys_cpp_article.aspx

Griffen, T. & Lowery, P. (2005). Definit-ion: Macro. Techtarget. Retrieved January 4, 2017 from http://whatis.techtarget.com/definition/macro

Mai, S. (2009). 10 tips for writing game bots. [Bog post]. Krypted. Retrieved January 2, 2017 from http://krypted.com/sites/5-rules-for-writing-bots-in-games/

Martin, A. (2016, October 17). How to create a game bot and publish your html5 games on Telegram. [Blog post]. Retrieved January 2, 2017 from https://blog.ludei.com/how-to-create-a-game-bot-and-publish-your-html5-games-on-telegram/