psyko Posted May 22, 2017 Share Posted May 22, 2017 (edited) Hola soy nuevo en el foro y tengo un proyecto que consiste en hacer un bot que reconoce imágenes y lo que yo quise hacer es que cuando se activen las casillas solo funcionen si el programa esta activado Codigo: expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <ImageSearch.au3> #include <AutoItConstants.au3> HotKeySet("{f2}", "iniciar") HotKeySet("{ESC}", "salir") Global $X = 0 Global $Y = 0 #Region ### START Koda GUI section ### Form= $Form1_1 = GUICreate("CaltaBot v0.01", 242, 186, 228, 156) $Group1 = GUICtrlCreateGroup("Boxes", 8, 96, 97, 81) $bbox = GUICtrlCreateCheckbox("Normales", 16, 120, 65, 17) $ebox = GUICtrlCreateCheckbox("Eventos", 16, 144, 65, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("P.E.T", 112, 96, 121, 81) $activpetcaj = GUICtrlCreateCheckbox("Activar Pet Cajero", 120, 120, 105, 17) $reppet = GUICtrlCreateCheckbox("Reparar Pet", 120, 144, 81, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group3 = GUICtrlCreateGroup("Anti-Ban", 112, 8, 121, 81) $camunav = GUICtrlCreateCheckbox("Camuflar nave", 120, 32, 97, 17) $offbot = GUICtrlCreateCheckbox("Desc. en 6h", 120, 56, 97, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group4 = GUICtrlCreateGroup("Teclas", 8, 8, 97, 81) $Label1 = GUICtrlCreateLabel("F2 - Iniciar", 16, 32, 77, 17) GUICtrlSetFont(-1, 8, 800, 0, "Verdana") $Label2 = GUICtrlCreateLabel("ESC - Salir", 16, 56, 64, 17) GUICtrlSetFont(-1, 8, 800, 0, "Verdana") GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func iniciar() $rX = 180 $rY = 110 Global $m_pos = MouseGetPos() $Search = _ImageSearch('minimap.bmp', 1, $X, $Y, 0) While 1 If $Search = 1 Then MouseClick("left", $X + (Random(0, $rX, 1)), $Y + (Random(0, $rY, 1))) MouseMove($m_pos[0], $m_pos[0], 0) Sleep(6000) Else MsgBox(0, "Error", "No se encontro el minimapa") ExitLoop EndIf ;--------------------Según yo el problema esta aquí----------------------- yo lo que quiero es que luego de que se precione la tecla F2 lea esta secuencia y si alguna casilla esta activada que ejecute la funcion de dicho caso Switch $Group2 Case $activpetcaj ;=====> casilla de verificación activarpetcaj() ;====> función que de debe activar en caso de que la casilla este activada Case $camunav camunave() EndSwitch ;---------------------------------------------------------------------------------------------- WEnd EndFunc ;==>iniciar Func activarpetcaj() $onpet_x = 0 $onpet_y = 0 $search_onpet = _ImageSearch('on_pet.bmp', 1, $onpet_x, $onpet_y, 0) If $search_onpet = 1 Then MouseClick($MOUSE_CLICK_LEFT, $onpet_x, $onpet_y, 1) EndIf selectmodul() EndFunc ;==>activarpetcaj Func selectmodul() $selectmodul_x = 0 $selectmodul_y = 0 $search_modul = _ImageSearch('selecmodul.bmp', 1, $selectmodul_x, $selectmodul_y, 0) If $search_modul = 1 Then MouseClick($MOUSE_CLICK_LEFT, $selectmodul_x, $selectmodul_y, 1) colectbox() EndIf EndFunc ;==>selectmodul Func colectbox() $colectbox_x = 0 $colectbox_y = 0 $search_colectbox = _ImageSearch('colectbox.bmp', 1, $colectbox_x, $colectbox_y, 0) If $search_colectbox = 1 Then MouseClick($MOUSE_CLICK_LEFT, $colectbox_x, $colectbox_y, 1) EndIf EndFunc ;==>colectbox Func camunave() $camu_x = 0 $camu_y = 0 $search_camu1 = _ImageSearch('camu1.bmp', 1, $camu_x, $camu_y, 0) $search_camu2 = _ImageSearch('camu2.bmp', 1, $camu_x, $camu_y, 0) If $search_camu1 = 1 Then MouseClick($MOUSE_CLICK_LEFT, $camu_x, $camu_y, 1) ElseIf $search_camu2 = 1 Then MouseClick($MOUSE_CLICK_LEFT, $camu_x, $camu_y, 1) EndIf EndFunc ;==>camunave Func salir() Exit EndFunc ;==>salir Si me pueden ayudar en esto se los agradecería de todos corazón ya es un proyecto sin fines de lucro. Saludos! Edited May 22, 2017 by Melba23 Added code tags Link to comment Share on other sites More sharing options...
Danyfirex Posted May 22, 2017 Share Posted May 22, 2017 Hola. En este foro no se brinda ayuda para crear Bots para juegos. Pasate a leer las reglas. Saludos Skysnake 1 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 22, 2017 Moderators Share Posted May 22, 2017 psyko, Welcome to the AutoIt forums. This is an English-speaking forum and, although some of us are fluent in other languages, we prefer you to post in that language using Google Translate or a similar site if your English is not that good. And when you post code please use Code tags - see here how to do it. Then you get a scrolling box and syntax colouring as you can see above now I have added the tags. 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...
Moderators Melba23 Posted May 22, 2017 Moderators Share Posted May 22, 2017 psyko, And now I have translated your post in its entirety I see that Danyfirex is correct. You appear not to have read the Forum rules since your arrival. Please do read them - particularly the bit about not discussing game automation - before you post again and then you will understand why you will get no help and this thread will now be locked. M23 Skysnake 1 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