dr3w1792 Posted April 25, 2015 Share Posted April 25, 2015 Hi guys,I'm pretty new to AutoIt. I use an android emulator to play Clash of Clans on my pc. I am trying to add enter key functionality to the app so it will hit the send button in game when i hit enter.Anyways this is the script im having trouble with #include <MsgBoxConstants.au3>HotKeySet( "{F1}", "start")HotKeySet( "{F2}", "terminate")HotKeySet( "{Enter}", "sendStuff")While 1 sleep(10)WEndFunc start() While 1 ControlClick("BlueStacks App Player", "", "", "left", "1", 1194, 905) Sleep(290000) WEndEndFuncFunc sendStuff() Local $color=PixelGetColor(548,143) if WinActive("BlueStacks App Player") Then if($color == 0xF8FCFF) Then ControlClick("BlueStacks App Player", "", "", "left", "1", 554, 149) else ControlClick("BlueStacks App Player", "", "", "left", "1", 554, 100) endif Else Send("{Enter}") endifEndFuncFunc terminate() Exit EndFuncEverything works, except when BlueStacks is not my active window, it does not send the enter key as it should. Any input will be greatly appreciated Link to comment Share on other sites More sharing options...
JohnOne Posted April 25, 2015 Share Posted April 25, 2015 Can I ask you a personal question?What made you think of AutoIt when making a bot for a game? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Developers Jos Posted April 25, 2015 Developers Share Posted April 25, 2015 Please read our forum rules.Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
dr3w1792 Posted April 25, 2015 Author Share Posted April 25, 2015 (edited) To answer your question as why I would use AutoIt to make a "Bot"First of all it wasnt a bot, it simply helps me play a game not made for a computer, on a computerand 2. There is a full bot written in Autoit for this game, should check it out. clashbot.org Edited April 25, 2015 by Melba23 Post merged from separate thread Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 25, 2015 Moderators Share Posted April 25, 2015 dr3w1792,Read the as you were told and do not start any other stupid threads like this one which I have no merged with the original.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts