Destiny 2 Shader Deletion Script: I suck at writing scripts

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
GeneralKenobi
Posts: 4
Joined: 10 Aug 2018, 15:54

Destiny 2 Shader Deletion Script: I suck at writing scripts

11 Aug 2018, 17:29

Hi! I play destiny 2, and have very little experience with autohotkey.

One issue of contention in D2 is deleting massive amounts of items in the game, whether it's shaders, consumables, extra tokens, your vault, you name it: sometimes you need to delete hundreds of items at a time.

This involves holding a key for a set amount of time, letting it go for a set amount of time, and then repeating the process. Ideally, I would like to make a script that does the following:

The user will Press LCtrl + s + d, and holding those keys, enter a number with their other hand (LCtrl, s, and d are all easily pressable with one hand).
Once they are done entering the number, which might be two, three, or even four digits, they release those three keys.
They then position their mouse, hit another key, and the process begins: they can afk while their hundreds or thousands of items are deleted.

So I see the following:

-> when LCtrl is pressed, allow the hotkey sd to activate.
-> while LCtrl, s, and d are held, record input.
-> when they are released, interpret that input as a number
-> when another hotkey is pressed (I was going to say the delete key, seems right) the process begins and loops the number of times indicated by the number value entered
-> process is a delete script that holds a key (for most people, 'f') for a set number of seconds (1.2), and then releasing it for a set number of seconds (.5)

Could I have some help roughing it out? Ideally, if either I can make this or someone else can point me in the right direction (functions, commands, methods to use), I can share it with the Destiny 2 pc community.

Many Thanks!
GeneralKenobi
Posts: 4
Joined: 10 Aug 2018, 15:54

Re: Destiny 2 Shader Deletion Script: I suck at writing scripts

12 Aug 2018, 12:55

Aiight, I'm seeing views and no replies. when I get around to it, I'll post what I have here so that other people can have the script.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Destiny 2 Shader Deletion Script: I suck at writing scripts

12 Aug 2018, 15:53

id really advise against this hodgepodge of hotkeys, stick to single letter/ modifier(s)+letter

Code: Select all

#NoEnv
#SingleInstance Force
SetBatchLines -1

Gui Input: New, +AlwaysOnTop +ToolWindow -Caption
Gui Margin, 2, 2
Gui Add, Edit, w50 Number vRepeatCount +HwndhRepeatCount

#If GetKeyState("Ctrl", "P")
s & x::
	ControlSetText, , , % "ahk_id " hRepeatCount
	Gui Input: Show
return
#If

s & x Up::Gui Input: Submit
Del::
	Loop % RepeatCount
		doProcess()
return

doProcess() {
	ToolTip % "Something's happening... " A_Index
	Sleep 50
}
GeneralKenobi
Posts: 4
Joined: 10 Aug 2018, 15:54

Re: Destiny 2 Shader Deletion Script: I suck at writing scripts

13 Aug 2018, 18:13

Thank you so much for your reply! I just want to make sure I understand what the script is doing before I use it. Here's my best intuition:
swagfag wrote:

Code: Select all

Gui Input: New, +AlwaysOnTop +ToolWindow -Caption
Gui Margin, 2, 2
Gui Add, Edit, w50 Number vRepeatCount +HwndhRepeatCount
Creates a window for me to enter a number of loops I want it to run, stored as RepeatCount
swagfag wrote:

Code: Select all

#If GetKeyState("Ctrl", "P")
s & x::
	ControlSetText, , , % "ahk_id " hRepeatCount
	Gui Input: Show
return
I am unsure of what ControlSetText is doing, but this looks like it shows the window when I press the hotkey Ctrl + s + x
swagfag wrote:

Code: Select all

#If
s & x Up::Gui Input: Submit
Del::
	Loop % RepeatCount
		doProcess()
return
This accepts the input once I let go of the hotkey and starts the loop. Fairly sure.
swagfag wrote:

Code: Select all

doProcess() {
	ToolTip % "Something's happening... " A_Index
	Sleep 50
}
...And here I should put in what I want my delete script to be?
Do I have that all right?

Also, is there a default way to cancel a script while its running if I somehow mess it up? Is there a way I can add that in?

Thank you again so much for your help!
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Destiny 2 Shader Deletion Script: I suck at writing scripts

14 Aug 2018, 03:36

1. yes
2. it just clears the box evry time u open it. u can remove it and backspace everything manually.. something i found rather annoying.
3. Del starts ur loop
4. yes

u can bind a hotkey to Reload or ExitApp

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 244 guests