Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31
  1. #1

    [QL] Simple item timer source

    Got permission from the author to post here.
    Credit to Jason @ decompiled.

    .NET4 needed - C# *not* C++.
    http://msdn.microsoft.com/en-us/library/ms645540



    Code:
    using System;
    using System.Configuration;
    using System.Diagnostics;
    using System.Media;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;
    using System.Threading;
     
    namespace KeyHook
    {
        class Program
        {
     
            // Key codes http://msdn.microsoft.com/en-us/library/ms645540
     
            private const int WH_KEYBOARD_LL = 13;
            private const int WM_KEYDOWN = 0x0100;
            private static readonly LowLevelKeyboardProc Proc = HookCallback;
            private static IntPtr _hookID = IntPtr.Zero;
            private static readonly SoundPlayer Pickup = new SoundPlayer(ConfigurationManager.AppSettings.Get("Path2Pickup"));
            private const int TimeArmor = 25;
            private const int TimeQuad = 120;
            private const int TimeMega = 35;
     
            public static void Main()
            {
                Console.WriteLine("QLIT 1.0a LOADED");
                _hookID = SetHook(Proc);
                Application.Run();
                UnhookWindowsHookEx(_hookID);
            }
     
            private static IntPtr SetHook(LowLevelKeyboardProc proc)
            {
                using (Process curProcess = Process.GetCurrentProcess())
                using (ProcessModule curModule = curProcess.MainModule)
                {
                    return SetWindowsHookEx(WH_KEYBOARD_LL, proc,
                        GetModuleHandle(curModule.ModuleName), 0);
                }
            }
     
            private delegate IntPtr LowLevelKeyboardProc(
                int nCode, IntPtr wParam, IntPtr lParam);
     
            private static IntPtr HookCallback(
                int nCode, IntPtr wParam, IntPtr lParam)
            {
                if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN)
                {
                    int vkCode = Marshal.ReadInt32(lParam);
     
                    int mega = Convert.ToInt32(ConfigurationManager.AppSettings.Get("Mega"));
                    int red = Convert.ToInt32(ConfigurationManager.AppSettings.Get("Red"));
                    int yellow = Convert.ToInt32(ConfigurationManager.AppSettings.Get("Yellow"));
                    int quad = Convert.ToInt32(ConfigurationManager.AppSettings.Get("Quad"));
     
                    if ( vkCode == mega )
                    {
                        Pickup.Play();
                        var thread = new Thread(PlayMega);
                        thread.Start();
                    }
                    else if ( vkCode == red )
                    {
                        Pickup.Play();
                        var thread = new Thread(PlayRed);
                        thread.Start();
                    }
                    else if ( vkCode == yellow )
                    {
                        Pickup.Play();
                        var thread = new Thread(PlayYellow);
                        thread.Start();
                    }
                    else if ( vkCode == quad )
                    {
                        Pickup.Play();
                        var thread = new Thread(PlayQuad);
                        thread.Start();
                    }
                    else if ( vkCode == 44 ) Environment.Exit(0);
     
                }
                return CallNextHookEx(_hookID, nCode, wParam, lParam);
            }
     
            private static void PlayMega()
            {
                try
                {
                    //DateTime start = DateTime.Now;
     
                    var delay = Convert.ToInt32(ConfigurationManager.AppSettings.Get("MegaTimeWarn"));
                    var mega = new SoundPlayer(ConfigurationManager.AppSettings.Get("Path2Mega"));
                    Thread.Sleep((TimeMega - delay) * 1000);
                    mega.Play();
     
                    //TimeSpan ts = DateTime.Now.Subtract(start);
                    //Console.WriteLine(ts.TotalSeconds);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.ToString());
                }
            }
     
            private static void PlayRed()
            {
                try
                {
                    //DateTime start = DateTime.Now;
     
                    var delay = Convert.ToInt32(ConfigurationManager.AppSettings.Get("RedTimeWarn"));
                    var red = new SoundPlayer(ConfigurationManager.AppSettings.Get("Path2Red"));
                    Thread.Sleep((TimeArmor - delay) * 1000);
                    red.Play();
     
                    //TimeSpan ts = DateTime.Now.Subtract(start);
                    //Console.WriteLine(ts.TotalSeconds);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.ToString());
                }
            }
     
            private static void PlayYellow()
            {
                try
                {
                    //DateTime start = DateTime.Now;
     
                    var delay = Convert.ToInt32(ConfigurationManager.AppSettings.Get("YellowTimeWarn"));
                    var yellow = new SoundPlayer(ConfigurationManager.AppSettings.Get("Path2Yellow"));
                    Thread.Sleep((TimeArmor - delay) * 1000);
                    yellow.Play();
     
                    //TimeSpan ts = DateTime.Now.Subtract(start);
                    //Console.WriteLine(ts.TotalSeconds);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.ToString());
                }
            }
     
            private static void PlayQuad()
            {
                try
                {
                    //DateTime start = DateTime.Now;
     
                    var delay = Convert.ToInt32(ConfigurationManager.AppSettings.Get("QuadTimeWarn"));
                    var quad = new SoundPlayer(ConfigurationManager.AppSettings.Get("Path2Quad"));
                    Thread.Sleep((TimeQuad - delay) * 1000);
                    quad.Play();
     
                    //TimeSpan ts = DateTime.Now.Subtract(start);
                    //Console.WriteLine(ts.TotalSeconds);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.ToString());
                }
            }
     
            [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
            private static extern IntPtr SetWindowsHookEx(int idHook,
                LowLevelKeyboardProc lpfn, IntPtr hMod, uint dwThreadId);
     
            [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
            [return: MarshalAs(UnmanagedType.Bool)]
            private static extern bool UnhookWindowsHookEx(IntPtr hhk);
     
            [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
            private static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode,
                IntPtr wParam, IntPtr lParam);
     
            [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
            private static extern IntPtr GetModuleHandle(string lpModuleName);
        }
    }
    Keyhook.config:

    Code:
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <configSections>
        </configSections>
      <!--http://msdn.microsoft.com/en-us/library/ms645540-->
        <appSettings>
            <!--Keyboard keys-->
            <add key="Mega" value="37" />
            <add key="Red" value="38" />
            <add key="Yellow" value="39" />
            <add key="Quad" value="40" />
            <!--WAV alert files-->
            <add key="Path2Mega" value="Mega.wav" />
            <add key="Path2Red" value="Red.wav" />
            <add key="Path2Yellow" value="Yellow.wav" />
            <add key="Path2Quad" value="Quad.wav" />
            <add key="Path2Pickup" value="Pickup.wav" />
            <!--Warning Time before Item Spawns-->
            <add key="MegaTimeWarn" value="5" />
            <add key="RedTimeWarn" value="5" />
            <add key="YellowTimeWarn" value="5" />
            <add key="QuadTimeWarn" value="5" />
        </appSettings>
    </configuration>

  2. #2

    Re: [QL] Simple item timer source

    although i am not trying myself in clienthooks, thx for sharing.

  3. #3
    Junior Member
    Join Date
    Jan 2011
    Posts
    3

    Re: [QL] Simple item timer source

    anybody do this ?

    looks ok...

  4. #4
    Junior Member
    Join Date
    Jan 2011
    Posts
    3

    Re: [QL] Simple item timer source

    does this work?

  5. #5
    VIP TopNotch's Avatar
    Join Date
    Jun 2007
    Location
    The Netherlands
    Posts
    1,773

    Re: [QL] Simple item timer source

    Quote Originally Posted by suNnY View Post
    Try it for yourself
    This is not helping. He man here just asked anyone who tried (apparently not you), if this works. Add something to the conversation or don't post at all. We're all here to help each other out. Thank you.

    @ club100free: It probably works as it's the source code of Jason's item timer hack. Compile it and you can test it.


  6. #6
    Junior Member
    Join Date
    Dec 2010
    Posts
    18

    Re: [QL] Simple item timer source

    anybody can compilte it to try and test??? coz i can't....

  7. #7

    Re: [QL] Simple item timer source

    Here:
    Attached Files Attached Files

  8. #8

    Re: [QL] Simple item timer source

    /attachment approved

  9. #9
    Junior Member
    Join Date
    Dec 2010
    Posts
    18

    Re: [QL] Simple item timer source

    Quote Originally Posted by booboo View Post
    Here:
    so can i install it???

    does somebody try it???? i install it but he doesn't run....

  10. #10
    Junior Member
    Join Date
    Feb 2011
    Posts
    13

    Re: [QL] Simple item timer source

    Tried it and doesnt seem to work. i know this is almost 3 months later but new to community

Page 1 of 4 123 ... LastLast

Similar Threads

  1. [Release] MW2-MP Simple NoRecoil + Source
    By AdawolfA in forum Call of Duty 6 : Modern Warfare 2 Cheat Downloads
    Replies: 25
    Last Post: October 22nd, 2010, 18:58
  2. Simple Wallhack for Source Engine Based Games[CS:S][mAsm]
    By ^attilathedud^ in forum Tutorials
    Replies: 2
    Last Post: May 15th, 2010, 23:04
  3. How haev free item of Bf ?? plz come and tell
    By julio58928 in forum BattleField Heroes Cheats
    Replies: 3
    Last Post: December 21st, 2009, 23:32
  4. CSS Simple Hack WITH Source
    By destruct in forum Counterstrike Source Cheats
    Replies: 2
    Last Post: June 23rd, 2009, 20:04
  5. [Source] Simple Third Person.
    By quicktime in forum Tutorials
    Replies: 13
    Last Post: August 20th, 2008, 22:58

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •