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