What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Need help with code

zar101

New Member
Joined
Mar 28, 2010
Messages
92
Reaction score
0
OMG! for the life of me i am missing what I am doing wrong. Its been years sinse i did any coding. So anyways any help would be great..

I am wanting to dance when i hit the key z..

Thanks Zar

Code:
 public class Hotkeytrigger : HBPlugin
    {
        [DllImport("User32.dll")]
        private static extern short GetAsyncKeyState(System.Windows.Forms.Keys vKey);
   
        public override void Pulse()
        {
           
            if (Convert.ToInt32(GetAsyncKeyState(Keys.Z).ToString()) > 0)
            {
                Lua.DoString("/script /dance");
            }

        }
 
OMG! for the life of me i am missing what I am doing wrong. Its been years sinse i did any coding. So anyways any help would be great..

I am wanting to dance when i hit the key z..

Thanks Zar

Code:
 public class Hotkeytrigger : HBPlugin
    {
        [DllImport("User32.dll")]
        private static extern short GetAsyncKeyState(System.Windows.Forms.Keys vKey);
   
        public override void Pulse()
        {
           
            if (Convert.ToInt32(GetAsyncKeyState(Keys.Z).ToString()) > 0)
            {
                Lua.DoString("/script /dance");
            }

        }
if i remeber right, i dont think that can be done in Pulse(), i think you have to make a new thread to monitor it, but im not exactly sure, i think it was highvoltz made a plugin that did keypress monitoring, might be a good place to start.
 
Back
Top