Results 1 to 1 of 1
  1. #1
    Banana's Avatar
    Join Date
    May 2012
    Gender
    male
    Location
    Too kawaii to live, too sugoi to die
    Posts
    1,012
    Reputation
    268
    Thanks
    8,154
    My Mood
    Amazed

    [AHK Source] Quick Leave Match + Requeue

    A simple AHK code to leave a match, and re-queue asap.
    The re-queue function is bound separately, as it can be used on the disconnect screen, and will navigate back to the main menu from pretty much anywhere to re-queue.
    Only problem as of now is it doesn't have a way to clear the new prompt that appears with Elite queue. As in when you a forgiveness elite queue, or when a teammate left and you maintain your elite status.
    Currently it loops off the White Check that appears next to the player's nameplate on the main menu when the queue is active.
    This was written to not use specific pixel regions, so it should hopefully work for most people, or at least my aspect ratio (16:9).

    Bindings:
    F9 : Queues into a match, will navigate to main screen if in the armory, or disconnected.
    Shift + Escape : Leaves match, and spams space until the queue button is activated.
    F5 : Reloads script if an error occurs with its loop, just reset it.
    Shift + 1 : (Disabled) used to test mouse regions in case the script isn't clicking where it needs to.

    Code:
    #SingleInstance force ; Replace an existing script
    #NoEnv ; Don't check empty variables to see if they are environment variables
    SetDefaultMouseSpeed, 0 ; Move mouse instantly
    ; Changes the tray icon's tooltip (displayed when mouse hovers over it)
    Menu, tray, Tip, Apex ReQueue
    ; Show Tooltip in the tray that the script is active (Quiet)
    TrayTip, Apex Tools, running...,,16
    ; Makes subsequent hotkeys only function if specified window is active
    #IfWinActive Apex Legends ahk_class Respawn001
     
    ; Reload script to break loop if an error occurs
    ~F5:: ;F5
    reload
    return
     
    ;To test a mouse position
    ;+1:: ;Shift + 1
    ;TestFunc() 
    ;return
     
    ;Will click to 'continue' if afk or just launched the client
    ;Then will queue
    ;There is a slight hickup with using this queue fresh after opening the client, as 
    ;the white 'check' diamond near the playername seems to take its sweet time 
    ;appearing
    ~F9 up::
    	Startclick :=GetAbsolutePixels(0.5, 0.66)
    	MouseMove, Startclick[1], Startclick[2]
    	Click,
    	RandomSleep(20,40)
    	Click
    	Loop {
    	
    		ApexQueue() 
    	}
    	Tooltip,
    	return
     
     
     
    ; Leaves the game and Queues into an Apex Match, then reloads the Script to break the loop
     
    ~+Escape up:: ; Shift + Escape / Scipt starts after escape is released
     
    	LeaveUI() 
    	Click,
    		Loop{
    		ApexQueue() 
    	}
    	Tooltip,
    	return
    ;/////////////////Basic Tools\\\\\\\\\\\\\\\\\
    GetAbsolutePixels(RatioX, RatioY) {
    	WinGetPos,,, Width, Height
    	AbsoluteX := Round(Width * RatioX)
    	AbsoluteY := Round(Height * RatioY)
    	return [AbsoluteX, AbsoluteY]
    }
     
    RandomSleep(Between1, Between2) {
    	Random, RandomizedSleepTime, Between1, Between2
    	Sleep, RandomizedSleepTime
    }
     
    TestFunc(){
    asd :=GetAbsolutePixels(0.5 , 0.57)
    MouseMove, asd[1], asd[2]
    }
    ; /////////////////Core Functions\\\\\\\\\\\\\\\\\
     
    ; Leaves Apex match, and confirms prompt
     
    LeaveUI() {
    BlockInput, on
    leavebtn := GetAbsolutePixels(0.5 , 0.57) ;Initial Exit Match / Exit Game Btn Location
    leaveconf := GetAbsolutePixels(0.44 , 0.67) ;Secondary Confirmatory Btn Location
    	;Send, {Esc} ;if the button to enable this function IS NOT Escape, then enable this line to open the initial prompt.
    	Tooltip, Leaving Game, leavebtn[1]-30, leavebtn[2]+40
    	RandomSleep(450, 600)
    	MouseMove, leavebtn[1], leavebtn[2]
    	RandomSleep(35, 50)
    	Send, {Space}
    	RandomSleep(250, 350)
    	MouseMove, leaveconf[1], leaveconf[2]
    	RandomSleep(250, 350)
    	Send, {Space}
    	BlockInput, off
    	return
    }
     
    ;Looks for the white area in the player 'NamePlate' in the Lobby of Apex Legends.
    ;Until it finds the White Pixel it will spam Space, as if to clear the postgame 
    ;screens and stop after the queue button is started.
    ;Can be used in Majority of screens. even on the Pregame menus if you keep the QueueBTN to be on the 'back' button too.
    ApexQueue() {
    BlockInput, on
    QueueBTN := GetAbsolutePixels(0.05, 0.93)
    NamePlate := GetAbsolutePixels(0.425 , 0.115) ; Position on the DIamond Shaped Checkbox that appears when actively in a queue for Apex.
    TTPos := GetAbsolutePixels(0.08, 0.85) ;Used for Tooltip Position over the Queue Button.
    Tooltip, Enabled waiting for loop, TTPos[1], TTPos[2]
    RandomSleep(30,50)
    	MouseGetPos, StartX, StartY
    	Loop {
    			PixelSearch QActiveX, QActiveY, NamePlate[1], NamePlate[2], NamePlate[1], NamePlate[2]+1, 0xFFFFFF, 30, Fast RGB 
    			
    			if !ErrorLevel {
    			ToolTip, "You're Queued -- now reloading", TTPos[1], TTPos[2]
    			MouseMove, StartX,StartY
    			RandomSleep(5000,8000)
    			BlockInput, off
    			Reload,
    			
    				} else {
    			mousemove, QueueBTN[1], QueueBTN[2]
    			Send, {Space}
    			RandomSleep(240,300)
    			Return,
    			}
    			
    return
    }
    MouseMove, StartX,StartY
    BlockInput, off
    return
    }
    Member - 30/05/2012
    Premium - 01/11/2020
    News Force - 12/05/2019 till 24/02/2021





  2. The Following User Says Thank You to Banana For This Useful Post:

    iTTickles (07-05-2019)

Similar Threads

  1. [Source Code] 3 AHK SOURCE CODES (No Recoil/Rapidfire)
    By regan002 in forum Rainbow Six: Siege
    Replies: 5
    Last Post: 06-22-2018, 01:32 PM
  2. How to Use AHK (Source - Code)
    By ZtxGamerYT in forum PUBG Discussions & Help
    Replies: 0
    Last Post: 12-12-2017, 04:28 PM
  3. [Solved] Leaving match right before it ends?
    By Yohibye in forum Counter-Strike 2 Help
    Replies: 2
    Last Post: 07-19-2016, 01:16 PM
  4. [Help] Using Source Codes & Quick Question...
    By HaxoR-Unlimited in forum C++/C Programming
    Replies: 2
    Last Post: 12-12-2011, 11:23 AM
  5. [Release] [With Source] Quick Spammer
    By apezwijn in forum WarRock - International Hacks
    Replies: 13
    Last Post: 11-11-2009, 04:53 PM