Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Visual Basic Help

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
theapollo
Master Cheater
Reputation: 0

Joined: 11 Mar 2007
Posts: 404

PostPosted: Mon Mar 10, 2008 12:42 am    Post subject: Visual Basic Help Reply with quote

Could some one look at this code and explain to me how to make the traffic light colors switch when I hit Tab. What I am trying to do is make a traffic light, starting at a green light and changing to the next light after I hit Tab. Example light is green, hit Tab light turns yellow. If anyone can help thanks.

Here is what I got so far, this just changes the colors on a timer.

Code:

Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.WindowState = 2
        r.Visible = False
        g.Visible = True
        y.Visible = False
        st.Visible = False
        Ready.Visible = False
        Go.Visible = True
        Timer1.Enabled = False
        Timer2.Enabled = False
        Timer3.Enabled = False
    End Sub
    Private Sub Timer3_Time(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        r.Visible = False
        st.Visible = False
        y.Visible = False
        Ready.Visible = False
        g.Visible = True
        Go.Visible = True
        Timer2.Enabled = True
        Timer3.Enabled = False




    End Sub


    Private Sub Timer2_Time(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        y.Visible = True
        Ready.Visible = True
        g.Visible = False
        Go.Visible = False
        r.Visible = False
        st.Visible = False
        Timer3.Enabled = True
        Timer1.Enabled = False
    End Sub



    Private Sub Timer1_time(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
        g.Visible = False
        Go.Visible = False
        r.Visible = True
        st.Visible = True
        y.Visible = False
        Ready.Visible = False
        Timer1.Enabled = True
        Timer2.Enabled = False
    End Sub
End Class



Could someone test this why I am in school.

Code:

keyup
if keycode=vbkeytab then

If green.Visible Then
   Go.visible = false   
   green.Visible = False
        Ready.visible = true
        Yellow.Visible = True
  ElseIf Yellow.Visible Then
   
   Yellow.visible = False
   Ready.visible = false
       Red.visible = True
   St.visible = true
  Else
       Red.Visible = False
   St.visible = false
   Go.visible = true   
   Green.Visible = True
  end if




Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites