Schneeflocke Posted July 25, 2018 Share Posted July 25, 2018 Hello guys i would like to Create a little easy BoT but i have a Tiny Problem. I just want to Create a bot if i Press and Hold key x Down then search for a Pixel and if the Pixel dosn't found he take the next one for 8 Times Iam a AutoIT Beginner i hope i dont Blame me Link to comment Share on other sites More sharing options...
Developers Jos Posted July 26, 2018 Developers Share Posted July 26, 2018 Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. The Moderation team 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...
Schneeflocke Posted July 26, 2018 Author Share Posted July 26, 2018 Hi people, how can I use the pixelsearch multiple times, for example, if you can not find pixelsearch to look for another pixel, whenever I test it I get errors. Link to comment Share on other sites More sharing options...
Schneeflocke Posted July 26, 2018 Author Share Posted July 26, 2018 HotKeySet ("{ENTER}", "Start") HotKeySet ("{ESC}", "_Exit") While 1 Sleep(250) WEnd Func Start() $Color1 = 0xFF0000;Red $Color2 = 0x00FF00;Green While 1 Sleep(100) $Search1 = Pixelsearch(0,0,@DesktopWidth,@DesktopHeight,$Color1) $Search2 = Pixelsearch(0,0,@DesktopWidth,@DesktopHeight,$Color2) If IsArray($Search1) AND Isarray($Search2) Then Exit EndIf WEnd EndFunc Func _Exit() Exit EndFunc I wanted to do so, if color 1 then a different function should be performed as if color 2 is active. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 26, 2018 Moderators Share Posted July 26, 2018 Moved to the appropriate forum, as the Developer General Discussion forum very clearly states: Quote General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here. Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums. Moderation Team 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...
Schneeflocke Posted July 26, 2018 Author Share Posted July 26, 2018 Thanks Buddy Link to comment Share on other sites More sharing options...
careca Posted July 26, 2018 Share Posted July 26, 2018 AND Isarray($Search2) Just remove that, if color 1 present it just continues. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
Schneeflocke Posted July 26, 2018 Author Share Posted July 26, 2018 I would like if the Color is Green Press # 10 TImes and if it is Red press # 4 Times and if it is Orange Press # 12 Times Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 26, 2018 Moderators Share Posted July 26, 2018 @Schneeflocke this is the second time you have posted something regarding game automation. You have been pointed to the forum rules already; do not post such a question again; our patience has its limits. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Developers Jos Posted July 27, 2018 Developers Share Posted July 27, 2018 (edited) @Schneeflocke, I will reopen this thread as you indicated in PM that is is not related to Game automation. It wasn't too smart to simply reopen a new topic on the same subject as that is clearly prohibited by our forum rules and doesn't contribute to your credibility. So lets restart all of this and ensure we stick to our rules. Jos Edited July 27, 2018 by 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...
Trystian Posted July 27, 2018 Share Posted July 27, 2018 Hey Snowflake and everyone else, I don't know if this will work, being that PixelSearch refuses to work for me. My implementation must be off (perhaps someone more qualified can point out my mistake). Here's the code I threw together. It may give you a starting point. expandcollapse popupHotKeySet ("{ENTER}", "Start") HotKeySet ("{ESC}", "_Exit") Global $iStartX = 0 Global $iStartY = 0 Global $iEndX = @DesktopWidth Global $iEndY = @DesktopHeight ; Make sure the following arrays have the same amount of elements Global $aKeyColor = [0x0000FF,0xFF0000,0xFFA500] ; Colors to check for: Green,Red,Orange (in hexadecimal) Global $aKeyPress = ["#","#","#"] ; Keys to Press Global $aKeyRepeat = [10,4,12] ; How many times to repeat Key Presses Global $iMatch = UBound($aKeyColor) If ($iMatch = UBound($aKeyPress) And $iMatch = UBound($aKeyRepeat)) Then ; Make sure all Key arrays match element counts While 1 Sleep(50) ;Sleep Loop WEnd Else MsgBox(16,"PixelTest","Key Arrays don't have same amount of elements!") EndIf Func Start() Local $iLoop While 1 For $iCount = 0 To $iMatch-1 Sleep(20) $aSearch = PixelSearch($iStartX,$iStartY,$iEndX,$iEndY,$aKeyColor[$iCount]) If UBound($aSearch) = 2 Then For $iKeyRepeat = 1 To $aKeyRepeat[$iCount] Send($aKeyPress[$iCount]) ; Send Keys to current window. You can also use ControlSend Sleep(20) ; Pause in between key presses Next EndIf Next WEnd EndFunc Func _Exit() Exit 0 EndFunc I truly hope it ISN'T used for game automation. Keep in mind I haven't touched AutoIt in three+ years, so I'm rusty. Peace, -Trystian Schneeflocke 1 Link to comment Share on other sites More sharing options...
Bert Posted July 27, 2018 Share Posted July 27, 2018 There may be a much simpler way to do this. What is the name of the application you want to automate? I ask for many reasons: There may be a script all ready to go for you to use in the forum. Pixel searching is the worst way to automate and should ONLY be used as a last resort. Pixel searching is slower. Pixel searching can easily fail due to things like losing window focus, slight changes to the GUI and so forth. Happy to help The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Schneeflocke Posted July 28, 2018 Author Share Posted July 28, 2018 (edited) Hello people I wanted to thank you for all the advice and currently test Trystians script. How can you insert the individual sleep values? On 27.7.2018 at 12:05 PM, Trystian said: I truly hope it ISN'T used for game automation. Keep in mind I haven't touched AutoIt in three+ years, so I'm rusty. and you can trust me i dont use it for games Edited July 28, 2018 by Schneeflocke Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now