Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #cs ----------------------------------------------------------------------------
- AutoIt Version: 3.3.12.0
- Author: myName
- Script Function:
- Template AutoIt script.
- #ce ----------------------------------------------------------------------------
- ; Script Start - Add your code below here
- ;Definimos, establecemos, que la tecla "d" comenzará nuestro BOT
- ;Indicamos, Señalamos que la funcion se va a llamar comenzar
- HotKeySet("{d}","comenzar")
- ;Definimos, establecemos, que la tecla "1" terminará nuestro BOT
- ;Indicamos, Señalamos que la funcion se va a llamar terminar
- HotKeySet("{1}","terminar")
- #region --- Au3Recorder generated code Start (v3.3.9.5 KeyboardLayout=0000040A) ---
- #region --- Internal functions Au3Recorder Start ---
- Func _Au3RecordSetup()
- Opt('WinWaitDelay',100)
- Opt('WinDetectHiddenText',1)
- Opt('MouseCoordMode',0)
- Local $aResult = DllCall('User32.dll', 'int', 'GetKeyboardLayoutNameW', 'wstr', '')
- If $aResult[1] <> '0000040A' Then
- MsgBox(64, 'Warning', 'Recording has been done under a different Keyboard layout' & @CRLF & '(0000040A->' & $aResult[1] & ')')
- EndIf
- EndFunc
- Func _WinWaitActivate($title,$text,$timeout=0)
- WinWait($title,$text,$timeout)
- If Not WinActive($title,$text) Then WinActivate($title,$text)
- WinWaitActive($title,$text,$timeout)
- EndFunc
- ;---------//////AQUÍ VA LA INTERFAZ GRÁFICA DEL PROGRAMA ALGO SENCILLO////------------
- ;Lo que dice include son simplemente librerías para poder
- ;comenzar a dibujar los botones, etc.
- #include <GUIConstantsEx.au3>
- #include <StaticConstants.au3>
- #include <WindowsConstants.au3>
- #Region ### START Koda GUI section ### Form=
- ;Aquí comenzamos a dibujar la interfaz, botones, labels(texto en el formulario, ventana)
- $TuBot = GUICreate("TuBot", 234, 166, 192, 124)
- ;Establecemos el color de fondo del formulario
- GUISetBkColor(0xA6CAF0)
- ;Creamos un label y elegimos su fuente
- $Label1 = GUICtrlCreateLabel("C: Comenzar BOT", 16, 32, 173, 28)
- GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
- ;Creamos otro label y elegimos su fuente
- $Label2 = GUICtrlCreateLabel("T:Terminar BOT", 16, 96, 155, 28)
- GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
- ;Con este estado indicamos que se mostraran todos los componentes en el formulario o ventana
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- EndSwitch
- WEnd
- ;--------//////AQUÍ TERMINA NUESTRA INTERFAZ GRÁFICA /////---------------------------
- ;Aquí nuestra función comenzar, es Activada, LLAMADA, cuando apretamos la tecla "c"
- Func comenzar()
- ;Aqui colocaremos todo lo grabado
- ;Invocamos la funcion definida arriba
- _AU3RecordSetup()
- #endregion --- Internal functions Au3Recorder End ---
- ;Invocamos esta otra definida arriba
- _WinWaitActivate("Reciente - Mi Taringa! - Google Chrome","")
- MouseClick("left",185,243,1)
- MouseClick("left",182,241,1)
- Send("{SHIFTDOWN}e{SHIFTUP}stamos{SPACE}shouteando.")
- MouseClick("left",654,295,1)
- MouseClick("left",337,361,1)
- MouseClick("left",270,256,1)
- MouseClick("left",270,256,1)
- #endregion --- Au3Recorder generated code End ---
- EndFunc
- ;Aquí nuestra función terminar, es Activada, LLAMADA, cuando apretamos la tecla "t"
- Func terminar()
- exit
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement