wc3edit.net
https://forum.wc3edit.net/

Vb 2008 help.
https://forum.wc3edit.net/tech-support-f37/vb-2008-help-t16698.html
Page 1 of 1

Author:  owner123 [ March 17th, 2010, 7:06 pm ]
Post subject:  Vb 2008 help.

I was trying to make something that clicks in many places. So I uploaded the MyMethod clicking. The clicking works, but for some reason my timers are wierd. Heres the code I used.

Spoiler for code.
Spoiler:
Code:
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Cursor.Position = New Point(Form1.X.Text, Form1.Y.Text)
        MyMethod()

        Timer2.Start()


        Timer1.Stop()
    End Sub


'part 2
    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Cursor.Position = New Point(Form2.X.Text, Form2.Y.Text)
        MyMethod()

        Timer1.Start()


        Timer2.Stop()


Yes its supposed to loop.
It only clicks once then stops.
Thanks.

Author:  Ken [ March 19th, 2010, 2:13 am ]
Post subject:  Re: Vb 2008 help.

Try this. I just reordered stuff so it stops the timers first thing in the functions, and enables the other one at the end.

Code:
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Timer1.Stop()
        Cursor.Position = New Point(Form1.X.Text, Form1.Y.Text)
        MyMethod()
        Timer2.Start()
    End Sub

'part 2
    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Timer2.Stop()
        Cursor.Position = New Point(Form2.X.Text, Form2.Y.Text)
        MyMethod()
        Timer1.Start()

Author:  owner123 [ March 19th, 2010, 2:43 am ]
Post subject:  Re: Vb 2008 help.

Nope =[ Thanks for trying.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/