elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Únete al Grupo Steam elhacker.NET


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  Ayuda con Autohotkey para un bot
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Ayuda con Autohotkey para un bot  (Leído 1,955 veces)
Dital

Desconectado Desconectado

Mensajes: 1


Ver Perfil
Ayuda con Autohotkey para un bot
« en: 7 Febrero 2019, 17:54 pm »

la idea es un programa que presione una tecla cada cierto tiempo, presione otra tecla cierta cantidad de veces cada cierto tiempo y que haga click en una región especificada por el usuario.

Todo simultáneamente hasta que el usuario detenga el Script.

El problema es q no funciona correctamente y no encuentro el problema.

Código:
Gui, New
Gui, Add, Text, x35 y15, ID:
Gui, Add, Edit, xp30 yp-5 r1 vId w100
Gui, Add, Text, x35 yp30, Pass:
Gui, Add, Edit, xp30 yp-5 r1 vPass w100
Gui, Add, Button, w80 x60 yp30, Login
Gui, Add, Checkbox, vChb1 x80 yp35, Magia
Gui, Add, Text, x40 yp30, Slot:
Gui, Add, DropDownList, xp50 yp-5 w50 vSlot1, F1|F2|F3|F4|F5|F6|F7|F8|F9|F10|F11|F12
Gui, Add, Text, x40 yp30, Intervalo:
Gui, Add, Edit, w50 xp50 yp-4
Gui, Add, UpDown, vTime1 Range1-100, 1
Gui, Add, Text, xp55 yp5, Seg
Gui, Add, Checkbox, vChb2 x80 yp30, Comida
Gui, Add, Text, x15 yp30, Slot:
Gui, Add, DropDownList, w50 xp+30 yp-5 vSlot2, F1|F2|F3|F4|F5|F6|F7|F8|F9|F10|F11|F12
Gui, Add, Text,xp+60 yp+5, Cant:
Gui, Add, Edit, w50 xp+30 yp-5
Gui, Add, UpDown, xp+15 yp vCant Range1-100, 1
Gui, Add, Text,x15 yp+30, Intervalo:
Gui, Add, Edit, w50 xp+50 yp-4
Gui, Add, UpDown, xp+50 yp vTime2 Range1-100, 1
Gui, Add, Text, xp55 yp5, Seg
Gui, Add, Checkbox, vChb3 x80 yp30, Pesca
Gui, Add, Text, x45 yp30, Slot:
Gui, Add, DropDownList, w95 xp25 yp-5 vSlot3, F1|F2|F3|F4|F5|F6|F7|F8|F9|F10|F11|F12
Gui, Add, Text, x45 yp30, Pos. Inicial  X:
Gui, Add, Edit, xp+70 yp-5 r1 vPxi w50, 379
Gui, Add, Text, x101 yp30, Y:
Gui, Add, Edit, xp+14 yp-5 r1 vPyi w50, 426
Gui, Add, Text, x45 yp30, Pos. Final   X:
Gui, Add, Edit, xp+70 yp-5 r1 vPxf w50, 737
Gui, Add, Text, x101 yp30, Y:
Gui, Add, Edit, xp+14 yp-5 r1 vPyf w50, 515
Gui, Add, Text, x90 yp30, Nota:
Gui, Add, Text, x10 yp20, Press Ctrl+F para Obtener Valor
Gui, Add, Text, x10 yp20, Press Ctrl+A para Pausar el programa
Gui, Add, Text, w180 x10 yp20, Press Ctrl+S para Reanudar el programa
Gui, Add, Text, w180 x10 yp35, Press Shift para Detener el programa
Gui, Add, Button, Default w80 x60 yp25, Go
Gui, Show, w200 h580
Return

ButtonLogin:
GuiControlGet, Id
GuiControlGet, Pass
WinActivate, Tibia
Sleep, 1000
Send, %Id%
Send, {Tab}
Send, %Pass%
Send, {Enter}
Return

^f::
WinActivate, Tibia
    MouseGetPos, xpos, ypos
    Msgbox, Coordenada X=%xpos%. Coordenada Y=%ypos%.
Return

ButtonGo:
GuiControlGet, Chb1
GuiControlGet, Chb2
GuiControlGet, Chb3
GuiControlGet, Slot1
GuiControlGet, Slot2
GuiControlGet, Slot3
GuiControlGet, Time1
GuiControlGet, Time2
GuiControlGet, Cant
GuiControlGet, Pxi
GuiControlGet, Pyi
GuiControlGet, Pxf
GuiControlGet, Pyf
Time1 := Time1*1000
Time2 := Time2*1000
Pxi2 := Pxi
Pyi2 := Pyi
Pxf2 := Pxf+45
Pyf2 := Pyf+45
Cant2 := Cant
;WinSet, Transparent,150, Magia.ahk
WinMinimize, Magia.ahk
WinActivate, Tibia
Sleep, 1000
if (Chb1 = 1)
{
Send {%Slot1%}
Sleep, 500
StartTime1 := A_TickCount
}
if (Chb2 = 1)
{
While (Cant2 > 0)
{
Send {%Slot2%}
Sleep, 500
Cant2 := Cant2-1
}
StartTime2 := A_TickCount
Cant2 := Cant
}
BreakLoop := 1
While (BreakLoop = 1)
{
if GetKeyState("Shift")
{
WinRestore, Magia.ahk
Break  ; exits Loop

}
;-----> Inicio de Comprobacion
if (Chb1 = 1) ;Comprueba si Magia
{
ElapseTime1 := A_TickCount - StartTime1
if (ElapseTime1 > Time1)
{
Send {%Slot1%}
StartTime1 := A_TickCount
}
}
if (Chb2 = 1) ;Comprueba si Come
{
ElapseTime2 := A_TickCount - StartTime2
if (ElapseTime2 > Time2)
{
While (Cant2 > 0)
{
if GetKeyState("Shift")
{
WinRestore, TBotMagia.ahk
Break  ; exits Loop
}
Send {%Slot2%}
Sleep, 500
Cant2 := Cant2-1
}
StartTime2 := A_TickCount
Cant2 := Cant
}
}
;-----> Fin de Comprobacion
If (Chb3 =1) ;Comprueba si Pesca
{
While (Pyi2 < Pyf2)
{
if GetKeyState("Shift")
{
WinRestore, Magia.ahk
Break  ; exits Loop
}
While (Pxi2 < Pxf2)
{
if GetKeyState("Shift")
{
WinRestore, Magia.ahk
Break  ; exits Loop
}
Send, {%Slot3%}
Click %Pxi2%, %Pyi2%
Pxi2 := Pxi2+45
;-----> Inicio de Comprobacion
if (Chb1 = 1) ;Comprueba si Magia
{
ElapseTime1 := A_TickCount - StartTime1
if (ElapseTime1 > Time1)
{
Send {%Slot1%}
StartTime1 := A_TickCount
}
}
if (Chb2 = 1) ;Comprueba si Come
{
ElapseTime2 := A_TickCount - StartTime2
if (ElapseTime2 > Time2)
{
While (Cant2 > 0)
{
if GetKeyState("Shift")
{
WinRestore, Magia.ahk
Break  ; exits Loop
}
Send {%Slot2%}
Sleep, 500
Cant2 := Cant2-1
}
Cant2 := Cant
StartTime2 := A_TickCount
Sleep, 1000
}
} else {
        Sleep, 1000
}
;-----> Fin de Comprobacion
}
Pxi2 := Pxi
Pyi2 := Pyi2+45

}
Pyi2 := Pyi
}
}
Return

^a::
WinRestore, Magia.ahk
Pause, On
Return

^s::
WinMinimize, Magia.ahk
WinActivate, Tibia
Pause, Off
Return


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Necesito ayuda para DRIVER PARA TARJETA ATHEROS AR8132 para Backtrack4
Wireless en Linux
Califor90 0 3,975 Último mensaje 23 Octubre 2010, 19:00 pm
por Califor90
[PYTHON][AYUDA][ERROR] Necesito ayuda para instalar PyGTK 2 en windows 7
Scripting
Noxware 2 7,639 Último mensaje 20 Septiembre 2014, 00:05 am
por Noxware
[AYUDA] Necesito ayuda para crear un batch para emuladores de NES
Scripting
BeToX_ 2 2,583 Último mensaje 22 Agosto 2014, 15:51 pm
por BeToX_
AutoHotKey
Programación C/C++
Plap22 0 1,443 Último mensaje 4 Septiembre 2015, 23:25 pm
por Plap22
Autohotkey + Mobizen
Scripting
AngelFire 0 1,956 Último mensaje 17 Septiembre 2015, 05:46 am
por AngelFire
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines