Results 1 to 6 of 6
  1. #1
    Class1's Avatar
    Join Date
    Aug 2017
    Gender
    male
    Location
    Contact Tag: Class1#8808
    Posts
    49
    Reputation
    10
    Thanks
    1,198

    Post NEED HELP with my AHK "norecoil" script

    Hey guys I'm going to release a norecoil AHK script on the forum soon with a lot of additional goodies and it's all for PUBG, but I'm having a little problem in regards to the toggles. I've already posted my problem on AHK forum and I'm waiting for a response and if there are AHK people among us I'd love to hear your response as well.

    This is just a small part of my script, but it's enough for demonstrating my problem. Here's how my script works:

    1. We start the script by pressing the button "P" (P for play), if the script started it's gonna say "mouse on" out loud.
    2. Now when we LClick somewhere on our screen it calls a mouse event function
    3. ALSO... I'm able to change how many times do I want the LClick to call my mouse event function, so I made a toggle function, which toggles between "5" and "infinity". I made a variable for it called "n" which has a value of 5. In order to toggle between those I made a keybind for the toggle and assigned it to the button "K"

    My main problem was the toggle, so I decided to give it a " #MaxThreadsPerHotkey [Value] "
    It made it all work, but not how I expected, because " #MaxThreadsPerHotkey [Value] " 's value is limited to something like 10, so after toggling it 10 times it stops but I'd like to be able to toggle as much as I want.

    Any help would be appreciated

    Respectfully yours,
    Class1

    Code:
    dc = 0
    dyRecoil = 22
    n = 5
    
    ;Turn it on/off
    P::
    Loop {
    	If(GetKeyState("P", "p"))
    	{
    		if dc = 0
    		{
    			dc = 1
    			ComObjCreate("SAPI.SpVoice").Speak("mouse on")
    		}
    		else
    		{
    			dc = 0
    			ComObjCreate("SAPI.SpVoice").Speak("mouse off")
    		}
    		Break
    	}
    }
    return
    
    ;Toggle between 5 and infinity
    #MaxThreadsPerHotkey 20
    K::
    toggle := !toggle
    Loop
    {
    	If toggle
    	{
    		n++
    	}
    	else
    	{
    		n := 5
    	}
    
    }
    return
    
    ;By pressing LButton it repeats %n% rounds
    LButton:: 
    Loop %n%
    { 
    	If (dc = True)
    	{
    		Sleep 6
    		Click
    		DllCall("mouse_event", "UInt", 0x0001, "UInt", 0, "UInt", dyRecoil, "UInt", 0, "UPtr", 0)
    		If (GetKeyState("LButton","p")=False)
    		Break 
    	}
    	else
    	{
    		Click
    		Break
    	}
    }
    return
    
    f9::Exitapp
    f8::Reload

  2. #2
    romapiki's Avatar
    Join Date
    Jul 2013
    Gender
    male
    Posts
    36
    Reputation
    10
    Thanks
    312
    I'm not a pro but what if you put #MaxThreadsPerHotkey [Value] multiple times ?

  3. #3
    Class1's Avatar
    Join Date
    Aug 2017
    Gender
    male
    Location
    Contact Tag: Class1#8808
    Posts
    49
    Reputation
    10
    Thanks
    1,198
    Alright, I figured out everything, I'm gonna post it at the end of the day or maybe tommorrow

  4. #4
    modder99's Avatar
    Join Date
    Sep 2017
    Gender
    male
    Posts
    17
    Reputation
    10
    Thanks
    14
    Quote Originally Posted by Class1 View Post
    Alright, I figured out everything, I'm gonna post it at the end of the day or maybe tommorrow
    Any Update?

  5. #5
    VOSSWATER's Avatar
    Join Date
    Jul 2016
    Gender
    male
    Location
    .
    Posts
    224
    Reputation
    10
    Thanks
    9,815
    My Mood
    Amused
    Is AHK bannable ?

  6. #6
    Class1's Avatar
    Join Date
    Aug 2017
    Gender
    male
    Location
    Contact Tag: Class1#8808
    Posts
    49
    Reputation
    10
    Thanks
    1,198
    for PUBG it's not

    - - - Updated - - -

    yes, I've already submitted it. It just needs to be approved

Similar Threads

  1. Need help with ahk script
    By nazgulvshelios in forum Trove Discussions & Help
    Replies: 0
    Last Post: 06-06-2017, 04:25 PM
  2. [Solved] I need help with my AutoHotKey Rapidfire script!
    By mentos265 in forum Rainbow Six: Siege Discussions & Help
    Replies: 9
    Last Post: 06-02-2016, 07:13 AM
  3. [Solved] SCRIPTING help, i need help with a custom lol script.
    By zzooby in forum League of Legends Help
    Replies: 3
    Last Post: 03-24-2014, 09:17 AM
  4. [Help Request] Need Help with coding a RealmRelay Script!
    By Alde. in forum Realm of the Mad God Help & Requests
    Replies: 6
    Last Post: 12-15-2013, 05:08 PM
  5. [Solved] Need help with an AHK script
    By Arrowins in forum Call of Duty Modern Warfare 2 Help
    Replies: 1
    Last Post: 06-26-2011, 10:45 PM

Tags for this Thread