Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 23:46

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[VB2010] Toggle Switch style hotkey?

Discussion on [VB2010] Toggle Switch style hotkey? within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
Just.a.Guy's Avatar
 
elite*gold: 0
Join Date: May 2011
Posts: 338
Received Thanks: 144
[VB2010] Toggle Switch style hotkey?

Hi,

I've developed a application for a game, which have some hotkeys. But now, i want to make a hotkey that, when is pressed the first time, a timer will start. When pressed again, the timer will stop, then when pressed the third time, the timer would start. Can someone help me?
Just.a.Guy is offline  
Old 07/10/2011, 18:47   #2
 
Kraizy​'s Avatar
 
elite*gold: 0
The Black Market: 471/0/0
Join Date: Apr 2010
Posts: 9,696
Received Thanks: 1,811
Use a little variable:
PHP Code:
Dim var as Boolean

//Hotkey_Pressed:
var = True = var = False //switches between true & false

Select case var
   Case 
True //if true then timer.start
      
Timer.Start
   
Case Else //if false then timer.stop
      
Timer.Stop
End Select 
Kraizy​ is offline  
Old 07/10/2011, 22:03   #3
 
Just.a.Guy's Avatar
 
elite*gold: 0
Join Date: May 2011
Posts: 338
Received Thanks: 144
didn't worked... I'm using GetAsyncKeyState...
Just.a.Guy is offline  
Old 07/11/2011, 13:36   #4
 
Kraizy​'s Avatar
 
elite*gold: 0
The Black Market: 471/0/0
Join Date: Apr 2010
Posts: 9,696
Received Thanks: 1,811
Well, it would be helpful if you could tell me what didn't work..
If you are using GetAsyncKeyState you would already have created an event which is being called when pressing a key. There you have to put in the Select Case from above.
Kraizy​ is offline  
Old 07/22/2011, 20:49   #5
 
Just.a.Guy's Avatar
 
elite*gold: 0
Join Date: May 2011
Posts: 338
Received Thanks: 144
I'm sorry if i took so long to answer. I have this code to start my script
PHP Code:
 Private Sub Timer3_Tick(ByVal sender As System.ObjectByVal e As System.EventArgsHandles timkeys.Tick
        
'Função principal
        If (GetAsyncKeyState(Keys.ControlKey)) Then            
            timrsb.Start()
            timammo.Start()
            timrocket.Start()
            timhs1.Start()
            tim_i.Start()           
        End If

        If (GetAsyncKeyState(Keys.ShiftKey)) Then '
Stop script
            timrsb
.Stop()
            
timammo.Stop()
            
timrocket.Stop()
            
timhs1.Stop()
            
timjump.Stop()
            
tim_i.Stop()
            
timammo.Interval 4000
        End 
If    

    
End Sub 
GetAsyncKeyState is used with a timer, which interval is set to 1ms. I think that this is why is not working.
Just.a.Guy is offline  
Reply


Similar Threads Similar Threads
VB2010 Fragen!
06/26/2011 - .NET Languages - 18 Replies
Hallo Coder :) Ich suche einige Funktionen für ein Serviceprogramm meines Warrock Services. http://img89.imageshack.us/img89/8848/sdervicepro gramm.png Rot 1 / Rosa 1 / Grün 1 = Soll man seine PSC Reste eingeben Rot 2 / Rosa 2 / Grün 2 = Hier soll er dann anzeigen wieviele EXP/Dinar/KD´s er mit den Resten bekommt. Die EXP´s uvm rechne ich selber aus nur möchte ich Funktionen wissen womit ich das machen kann das er das dann im Programm wenn man seine PSC Reste eingibt anzeigt wieviele EXP...
Toggle Console ?
05/28/2011 - Counter-Strike - 7 Replies
Hallo, ich habe Con_enable auf 1 und wenn ich toggle console auf z.B k mache und dann abspeicher, css starte und k drücke passiert nix. Wenn ich dann CSS beende und die Config anschaue hat sich die Config wieder resettet und Toggle Console steht nicht mehr auf K. Habe auch bemerkt das toggle Console 2 mal in der CFG vorhanden ist aber wenn ich eine daovn lösche und css wieder beende hat sich die cfg wieder resettet und es stehen wieder 2 toggle console drin
[Vb2010]Frage
05/02/2011 - .NET Languages - 5 Replies
Kurtz:Ich möchte mein programm per ftp-server steuern, das heist: Ich stelle eine .txt auf den server, aber wie macht man das, dass mein programm es ausführt?:confused: Währe euch sehr dankbar für jeden beitrag!
[VB2010-TUT] Login_System
05/31/2010 - Coding Tutorials - 12 Replies
Hallo elitepvpers, Heute mache ich mein erstes Tutorial und werde euch dabei zeigen, wie man ein Login System mit Visual Basic 2010 programmiert. Es ist wirklich sehr einfach ;) Fangen wir nun an: 1.) Ihr legt eine neue Form mit 2 Labels, 2 Textboxen und einem Button an. http://a.yfrog.com/img152/6648/form1anlegen1butto nerst.png
toggle starting money or items
01/22/2009 - Conquer Online 2 - 16 Replies
i just wanted to know how can i toggle the starting money or the items on my server , because i want the players to start with 10kk silvers and 10k cps thanks



All times are GMT +1. The time now is 23:46.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.