Foro de elhacker.net

Programación => Programación Visual Basic => Mensaje iniciado por: kakinets en 8 Diciembre 2005, 15:41 pm



Título: Ayuda con el codigo para apretar el click
Publicado por: kakinets en 8 Diciembre 2005, 15:41 pm
Código:
Const MOUSEEVENTF_MOVE = &H1 '  movimiento del mouse
Const MOUSEEVENTF_LEFTDOWN = &H2 '  botón izquierdo presionado
Const MOUSEEVENTF_LEFTUP = &H4 '  botón izquierdo soltado
Const MOUSEEVENTF_RIGHTDOWN = &H8 '  botón derecho presionado
Const MOUSEEVENTF_RIGHTUP = &H10 '  botón derecho soltado
Const MOUSEEVENTF_MIDDLEDOWN = &H20 '  botón central presionado
Const MOUSEEVENTF_MIDDLEUP = &H40 ' botón central soltado
Const MOUSEEVENTF_ABSOLUTE = &H8000 '  movimiento absoluto

Sub Simular_Pulsacion(X As Long, Y As Long)
    Dim Res As Long
   
    Res = SetCursorPos(X, Y)
    mouse_event MOUSEEVENTF_ABSOLUTE Or textt.Text, X, Y, 0, 0
    mouse_event MOUSEEVENTF_ABSOLUTE Or textt.Text, X, Y, 0, 0
End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
On Error Resume Next
Dim coordenadas As String
Picture1.Picture = LoadPicture("C:\verde.jpg")
Winsock1.GetData coordenadas, vbString
ok = Split(coordenadas, "-")
Textx.Text = ok(0)
Texty.Text = ok(1)

If Val(ok(2)) = 1 Then textt.Text = &H2
If Val(ok(2)) = 2 Then textt.Text = &H8
If Val(ok(2)) = 3 Then textt.Text = &H20
If Val(ok(2)) = 0 Then textt.Text = &H2

SetCursorPos Val(ok(0)), Val(ok(1))
Simular_Pulsacion Val(ok(0)), Val(ok(1))

If Val(ok(2)) = 1 Then textt.Text = &H4
If Val(ok(2)) = 2 Then textt.Text = &H10
If Val(ok(2)) = 3 Then textt.Text = &H40
If Val(ok(2)) = 0 Then textt.Text = &H4

Simular_Pulsacion Val(ok(0)), Val(ok(1))
Exit Sub
error:
MsgBox error(Err)
End Sub


bueno ahora mi duda es si alguien me podia explicar esto:
 
Código:
If Val(ok(2)) = 1 Then textt.Text = &H2
If Val(ok(2)) = 2 Then textt.Text = &H8
If Val(ok(2)) = 3 Then textt.Text = &H20
If Val(ok(2)) = 0 Then textt.Text = &H2

SetCursorPos Val(ok(0)), Val(ok(1))
Simular_Pulsacion Val(ok(0)), Val(ok(1))

If Val(ok(2)) = 1 Then textt.Text = &H4
If Val(ok(2)) = 2 Then textt.Text = &H10
If Val(ok(2)) = 3 Then textt.Text = &H40
If Val(ok(2)) = 0 Then textt.Text = &H4



Título: Re: Ayuda con el codigo para apretar el click
Publicado por: Sancho.Mazorka en 8 Diciembre 2005, 23:31 pm
bueno seguro qeu me lo preguntaras a mi que fui quien creo el codigo. en mi post donde sacaste eso creo, bueno lo que pasa es que vos lo tenes incompleto yo no puse la ultima parte que en el timer toma las coordenadas y las pulsaciones del mouse, entonces is la pulsacion es 1 envia las coordenadas de esta forma
 
Código:
165-256-1
entonces es
Código:
If Val(ok(2)) = 1 Then textt.Text = &H2
entonces cuando el text cambie va a leer ese codigo y el
Código:
&H2
significa simular pulsacion izquierda y el
Código:
&H4
significa soltar pulsacion izquierda. aunqeu tiene una falla mi sistema si vos me das tu mail o me agregas cuadno lo termine te lo paso y ahi si que va a andar bien.
agregame rhcp_269@hotmail.com. salu2


Sancho Mazorka    :P