Alternating Hotkeys in DDO (or other games)

Post gaming related scripts
jesseb
Posts: 10
Joined: 15 Oct 2013, 03:40

Alternating Hotkeys in DDO (or other games)

15 Oct 2013, 04:39

This is a GUI that will create a script containing your alternating hotkeys.
Run the GUI, Save script, and Run the new script to see effects.
Big credit to Temil2008 for all his help.

Image

Here is the script for the GUI

Code: Select all

ahklist = Notepad||Turbine Device Class|
S1V3 = S1W1|S1W2|S1W3
S1V4 = S1W1|S1W2|S1W3|S1W4
S1V5 = S1W1|S1W2|S1W3|S1W4|S1W5
S1V6 = S1W1|S1W2|S1W3|S1W4|S1W5|S1W6
S1V7 = S1W1|S1W2|S1W3|S1W4|S1W5|S1W6|S1W7
S1V8 = S1W1|S1W2|S1W3|S1W4|S1W5|S1W6|S1W7|S1W8
S1V9 = S1W1|S1W2|S1W3|S1W4|S1W5|S1W6|S1W7|S1W8|S1W9
S1V0 = S1W1|S1W2|S1W3|S1W4|S1W5|S1W6|S1W7|S1W8|S1W9|S1W0
S2V3 = S2W1|S2W2|S2W3
S2V4 = S2W1|S2W2|S2W3|S2W4
S2V5 = S2W1|S2W2|S2W3|S2W4|S2W5
S2V6 = S2W1|S2W2|S2W3|S2W4|S2W5|S2W6
S2V7 = S2W1|S2W2|S2W3|S2W4|S2W5|S2W6|S2W7
S2V8 = S2W1|S2W2|S2W3|S2W4|S2W5|S2W6|S2W7|S2W8
S2V9 = S2W1|S2W2|S2W3|S2W4|S2W5|S2W6|S2W7|S2W8|S2W9
S2V0 = S2W1|S2W2|S2W3|S2W4|S2W5|S2W6|S2W7|S2W8|S2W9|S2W0
S1C1 = 2
S1L3 = {S1K1}|{S1K2}|{S1K3}
S1L4 = {S1K1}|{S1K2}|{S1K3}|{S1K4}
S1L5 = {S1K1}|{S1K2}|{S1K3}|{S1K4}|{S1K5}
S1L6 = {S1K1}|{S1K2}|{S1K3}|{S1K4}|{S1K5}|{S1K6}
S1L7 = {S1K1}|{S1K2}|{S1K3}|{S1K4}|{S1K5}|{S1K6}|{S1K7}
S1L8 = {S1K1}|{S1K2}|{S1K3}|{S1K4}|{S1K5}|{S1K6}|{S1K7}|{S1K8}
S1L9 = {S1K1}|{S1K2}|{S1K3}|{S1K4}|{S1K5}|{S1K6}|{S1K7}|{S1K8}|{S1K9}
S1L0 = {S1K1}|{S1K2}|{S1K3}|{S1K4}|{S1K5}|{S1K6}|{S1K7}|{S1K8}|{S1K9}|{S1K0}
S2C1 = 2
S2L3 = {S2K1}|{S2K2}|{S2K3}
S2L4 = {S2K1}|{S2K2}|{S2K3}|{S2K4}
S2L5 = {S2K1}|{S2K2}|{S2K3}|{S2K4}|{S2K5}
S2L6 = {S2K1}|{S2K2}|{S2K3}|{S2K4}|{S2K5}|{S2K6}
S2L7 = {S2K1}|{S2K2}|{S2K3}|{S2K4}|{S2K5}|{S2K6}|{S2K7}
S2L8 = {S2K1}|{S2K2}|{S2K3}|{S2K4}|{S2K5}|{S2K6}|{S2K7}|{S2K8}
S2L9 = {S2K1}|{S2K2}|{S2K3}|{S2K4}|{S2K5}|{S2K6}|{S2K7}|{S2K8}|{S2K9}
S2L0 = {S2K1}|{S2K2}|{S2K3}|{S2K4}|{S2K5}|{S2K6}|{S2K7}|{S2K8}|{S2K9}|{S2K0}
FileRead, Source, source.txt
DropDownListPart1 = NONE|1|2|3|4|5|6|7|8|9|0|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z
DropDownListPart2 = ``|-|=|[|]|\|,|.|/
DropDownListPart3 = Space|Tab|Enter|Escape|Backspace|Delete|Insert|Home|End|PgUp|PgDn
DropDownListPart4 = Up|Down|Left|Right|ScrollLock|CapsLock|NumLock
DropDownListPart5 = Click Left|Click Right|Click Middle|NumpadDiv|NumpadMult|NumpadAdd|NumpadSub|NumpadEnter|NumpadDel|NumpadIns|NumpadClear
DropDownListPart6 = NumpadUp|NumpadDown|NumpadLeft|NumpadRight|NumpadHome|NumpadEnd|NumpadPgUp|NumpadPgDn
DropDownListPart7 = Numpad0|Numpad1|Numpad2|Numpad3|Numpad4|Numpad5|Numpad6|Numpad7|Numpad8|Numpad9|NumpadDot
DropDownListPart8 = F1|F2|F3|F4|F5|F6|F7|F8|F9|F10|F11|F12
DropDownListPart9 = AppsKey|LWin|RWin|Alt|Control|LControl|RControl|Shift|LShift|RShift|LAlt|RAlt|PrintScreen|CtrlBreak|Pause
DropDownListPart0 = Joy1|Joy2|Joy3|Joy4|Joy5|Joy6|Joy7|Joy8|Joy9|Joy10|Joy11|Joy12
DropDownListHalf1 = %DropDownListPart1%|%DropDownListPart0%|%DropDownListPart3%|%DropDownListPart4%|%DropDownListPart2%
DropDownListHalf2 = %DropDownListPart8%|%DropDownListPart7%|%DropDownListPart6%|%DropDownListPart9%|%DropDownListPart5%
DropDownListList = %DropDownListHalf1%|%DropDownListHalf2%
Gui,Add,DropDownList,x50 y40 w120 vS1A1 gClick,LButton||%DropDownListList%
Gui,Add,DropDownList,x50 y60 w120 vS1A2 gClick,%DropDownListList%
Gui,Add,DropDownList,x50 y110 w120 vS1K1 gClick,%DropDownListList%
Gui,Add,DropDownList,x50 y130 w120 vS1K2 gClick,%DropDownListList%
Gui,Add,DropDownList,x50 y150 w120 vS1K3 gClick,%DropDownListList%
Gui,Add,DropDownList,x50 y170 w120 vS1K4 gClick,%DropDownListList%
Gui,Add,DropDownList,x50 y190 w120 vS1K5 gClick,%DropDownListList%
Gui,Add,DropDownList,x50 y210 w120 vS1K6 gClick,%DropDownListList%
Gui,Add,DropDownList,x50 y230 w120 vS1K7 gClick,%DropDownListList%
Gui,Add,DropDownList,x50 y250 w120 vS1K8 gClick,%DropDownListList%
Gui,Add,DropDownList,x50 y270 w120 vS1K9 gClick,%DropDownListList%
Gui,Add,DropDownList,x50 y290 w120 vS1K0 gClick,%DropDownListList%
Gui,Add,DropDownList,x330 y40 w120 vS2A1 gClick,RButton||%DropDownListList%
Gui,Add,DropDownList,x330 y60 w120 vS2A2 gClick,%DropDownListList%
Gui,Add,DropDownList,x330 y110 w120 vS2K1 gClick,%DropDownListList%
Gui,Add,DropDownList,x330 y130 w120 vS2K2 gClick,%DropDownListList%
Gui,Add,DropDownList,x330 y150 w120 vS2K3 gClick,%DropDownListList%
Gui,Add,DropDownList,x330 y170 w120 vS2K4 gClick,%DropDownListList%
Gui,Add,DropDownList,x330 y190 w120 vS2K5 gClick,%DropDownListList%
Gui,Add,DropDownList,x330 y210 w120 vS2K6 gClick,%DropDownListList%
Gui,Add,DropDownList,x330 y230 w120 vS2K7 gClick,%DropDownListList%
Gui,Add,DropDownList,x330 y250 w120 vS2K8 gClick,%DropDownListList%
Gui,Add,DropDownList,x330 y270 w120 vS2K9 gClick,%DropDownListList%
Gui,Add,DropDownList,x330 y290 w120 vS2K0 gClick,%DropDownListList%
Gui,Add,Edit,x180 y110 w45 h21 Number vS1W1 gClick,Edit
Gui,Add,Edit,x180 y130 w45 h21 Number vS1W2 gClick,Edit
Gui,Add,Edit,x180 y150 w45 h21 Number vS1W3 gClick,Edit
Gui,Add,Edit,x180 y170 w45 h21 Number vS1W4 gClick,Edit
Gui,Add,Edit,x180 y190 w45 h21 Number vS1W5 gClick,Edit
Gui,Add,Edit,x180 y210 w45 h21 Number vS1W6 gClick,Edit
Gui,Add,Edit,x180 y230 w45 h21 Number vS1W7 gClick,Edit
Gui,Add,Edit,x180 y250 w45 h21 Number vS1W8 gClick,Edit
Gui,Add,Edit,x180 y270 w45 h21 Number vS1W9 gClick,Edit
Gui,Add,Edit,x180 y290 w45 h21 Number vS1W0 gClick,Edit
Gui,Add,Edit,x280 y110 w45 h21 Number vS2W1 gClick,Edit
Gui,Add,Edit,x280 y130 w45 h21 Number vS2W2 gClick,Edit
Gui,Add,Edit,x280 y150 w45 h21 Number vS2W3 gClick,Edit
Gui,Add,Edit,x280 y170 w45 h21 Number vS2W4 gClick,Edit
Gui,Add,Edit,x280 y190 w45 h21 Number vS2W5 gClick,Edit
Gui,Add,Edit,x280 y210 w45 h21 Number vS2W6 gClick,Edit
Gui,Add,Edit,x280 y230 w45 h21 Number vS2W7 gClick,Edit
Gui,Add,Edit,x280 y250 w45 h21 Number vS2W8 gClick,Edit
Gui,Add,Edit,x280 y270 w45 h21 Number vS2W9 gClick,Edit
Gui,Add,Edit,x280 y290 w45 h21 Number vS2W0 gClick,Edit
Gui,Add,Edit,x180 y40 w45 h21 Number vS1CT gClick,Edit
Gui,Add,Edit,x280 y40 w45 h21 Number vS2CT gClick,Edit
Gui,Add,Text,x80 y20 w60 h13 Center,Activator 1
Gui,Add,Text,x360 y20 w60 h13 Center,Activator 2
Gui,Add,Text,x80 y90 w60 h13 Center,Keys
Gui,Add,Text,x360 y90 w60 h13 Center,Keys
Gui,Add,Text,x18 y50 ,AND`n/ OR
Gui,Add,Text,x458 y50  ,AND`n/ OR
Gui,Add,Button,x280 y380 w43 h23 gGuiClose2,Submit
Gui,Add,Text,x229 y29 w50 h13,Cast Time
Gui,Add,Text,x220 y90 w65 h13,ReCast Time
Gui,Add,Button,x180 y380 w43 h23 gHelp,Help
Gui,Add,Edit,x190 y331 w123 h21 1 vMyFile gClick,File Name Here
Gui,Add,ComboBox,x190 y355 w123 vwindow,%ahklist%
Gui,Add,Checkbox,x20 y155 w30 h13 vS1T3 gClick,----
Gui,Add,Checkbox,x20 y175 w30 h13 vS1T4 gClick,----
Gui,Add,Checkbox,x20 y195 w30 h13 vS1T5 gClick,----
Gui,Add,Checkbox,x20 y215 w30 h13 vS1T6 gClick,----
Gui,Add,Checkbox,x20 y235 w30 h13 vS1T7 gClick,----
Gui,Add,Checkbox,x20 y255 w30 h13 vS1T8 gClick,----
Gui,Add,Checkbox,x20 y275 w30 h13 vS1T9 gClick,----
Gui,Add,Checkbox,x20 y295 w30 h13 vS1T0 gClick,----
Gui,Add,Text,x451 y156 w15 h13,----
Gui,Add,Text,x451 y176 w15 h13,----
Gui,Add,Text,x451 y196 w15 h13,----
Gui,Add,Text,x451 y216 w15 h13,----
Gui,Add,Text,x451 y236 w15 h13,----
Gui,Add,Text,x451 y256 w15 h13,----
Gui,Add,Text,x451 y276 w15 h13,----
Gui,Add,Text,x451 y296 w15 h13,----
Gui,Add,Checkbox,x465 y155 w30 h13 vS2T3 gClick,
Gui,Add,Checkbox,x465 y175 w30 h13 vS2T4 gClick,
Gui,Add,Checkbox,x465 y195 w30 h13 vS2T5 gClick,
Gui,Add,Checkbox,x465 y215 w30 h13 vS2T6 gClick,
Gui,Add,Checkbox,x465 y235 w30 h13 vS2T7 gClick,
Gui,Add,Checkbox,x465 y255 w30 h13 vS2T8 gClick,
Gui,Add,Checkbox,x465 y275 w30 h13 vS2T9 gClick,
Gui,Add,Checkbox,x465 y295 w30 h13 vS2T0 gClick,
Gui,Show,x429 y99 w500 h420 , 
Return
#NoEnv


Click:
Gui, Submit , NoHide
Return

Help:
MsgBox, The keys you select for "Activator 1" will set off the keys beneath it, Same for "Activator 2" `n`nCast Time is the amount of time to wait between each keypress, This should be the amount of time it takes for you to "cast" or "perform" the action before the next press `n`nReCast Time is the amount of time (milliseconds) before that button is used again, for example if you want one key to go once a minute, and one to go once a second, make the first 60000 make the second 1000 `n`nJoy1-12 may be used for activators 1-2, But may not be used for keys. `n`nThe "Turbine Device Class" may be changed to another program, the script will only be active inside this window.
Return

GuiClose:
ExitApp
Return

GuiClose2:
Gui, Submit , NoHide
if S1T3 = 1
	S1C1 = 3
if S1T4 = 1
	S1C1 = 4
if S1T5 = 1
	S1C1 = 5
if S1T6 = 1
	S1C1 = 6
if S1T7 = 1
	S1C1 = 7
if S1T8 = 1
	S1C1 = 8
if S1T9 = 1
	S1C1 = 9
if S1T0 = 1
	S1C1 = 10
if S1C1 = 3
	{
		StringReplace, Source, Source, S1K1|S1K2 , %S1L3%, A
		StringReplace, Source, Source, S1W1|S1W2 , %S1V3%, A
	}
if S1C1 = 4
	{
		StringReplace, Source, Source, S1K1|S1K2 , %S1L4%, A
		StringReplace, Source, Source, S1W1|S1W2 , %S1V4%, A
	}
if S1C1 = 5
	{
		StringReplace, Source, Source, S1K1|S1K2 , %S1L5%, A
		StringReplace, Source, Source, S1W1|S1W2 , %S1V5%, A
	}
if S1C1 = 6
	{
		StringReplace, Source, Source, S1K1|S1K2 , %S1L6%, A
		StringReplace, Source, Source, S1W1|S1W2 , %S1V6%, A
	}
if S1C1 = 7
	{
		StringReplace, Source, Source, S1K1|S1K2 , %S1L7%, A
		StringReplace, Source, Source, S1W1|S1W2 , %S1V7%, A
	}
if S1C1 = 8
	{
		StringReplace, Source, Source, S1K1|S1K2 , %S1L8%, A
		StringReplace, Source, Source, S1W1|S1W2 , %S1V8%, A
	}
if S1C1 = 9
	{
		StringReplace, Source, Source, S1K1|S1K2 , %S1L9%, A
		StringReplace, Source, Source, S1W1|S1W2 , %S1V9%, A
	}
if S1C1 = 10
	{
		StringReplace, Source, Source, S1K1|S1K2 , %S1L0%, A
		StringReplace, Source, Source, S1W1|S1W2 , %S1V0%, A
	}
if S2T3 = 1
	S2C1 = 3
if S2T4 = 1
	S2C1 = 4
if S2T5 = 1
	S2C1 = 5
if S2T6 = 1
	S2C1 = 6
if S2T7 = 1
	S2C1 = 7
if S2T8 = 1
	S2C1 = 8
if S2T9 = 1
	S2C1 = 9
if S2T0 = 1
	S2C1 = 10
if S2C1 = 3
	{
		StringReplace, Source, Source, S2K1|S2K2 , %S2L3%, A
		StringReplace, Source, Source, S2W1|S2W2 , %S2V3%, A
	}
if S2C1 = 4
	{
		StringReplace, Source, Source, S2K1|S2K2 , %S2L4%, A
		StringReplace, Source, Source, S2W1|S2W2 , %S2V4%, A
	}
if S2C1 = 5
	{
		StringReplace, Source, Source, S2K1|S2K2 , %S2L5%, A
		StringReplace, Source, Source, S2W1|S2W2 , %S2V5%, A
	}
if S2C1 = 6
	{
		StringReplace, Source, Source, S2K1|S2K2 , %S2L6%, A
		StringReplace, Source, Source, S2W1|S2W2 , %S2V6%, A
	}
if S2C1 = 7
	{
		StringReplace, Source, Source, S2K1|S2K2 , %S2L7%, A
		StringReplace, Source, Source, S2W1|S2W2 , %S2V7%, A
	}
if S2C1 = 8
	{
		StringReplace, Source, Source, S2K1|S2K2 , %S2L8%, A
		StringReplace, Source, Source, S2W1|S2W2 , %S2V8%, A
	}
if S2C1 = 9
	{
		StringReplace, Source, Source, S2K1|S2K2 , %S2L9%, A
		StringReplace, Source, Source, S2W1|S2W2 , %S2V9%, A
	}
if S2C1 = 10
	{
		StringReplace, Source, Source, S2K1|S2K2 , %S2L0%, A
		StringReplace, Source, Source, S2W1|S2W2 , %S2V0%, A
	}
StringReplace, Source, Source, S1A1 , %S1A1%, A
StringReplace, Source, Source, S1A2 , %S1A2%, A
StringReplace, Source, Source, S2A2 , %S2A2%, A
StringReplace, Source, Source, S1K1 , %S1K1%, A
StringReplace, Source, Source, S1K2 , %S1K2%, A
StringReplace, Source, Source, S1K3 , %S1K3%, A
StringReplace, Source, Source, S1K4 , %S1K4%, A
StringReplace, Source, Source, S1K5 , %S1K5%, A
StringReplace, Source, Source, S1K6 , %S1K6%, A
StringReplace, Source, Source, S1K7 , %S1K7%, A
StringReplace, Source, Source, S1K8 , %S1K8%, A
StringReplace, Source, Source, S1K9 , %S1K9%, A
StringReplace, Source, Source, S1K0 , %S1K0%, A
StringReplace, Source, Source, S2A1 , %S2A1%, A
StringReplace, Source, Source, S2K1 , %S2k1%, A
StringReplace, Source, Source, S2K2 , %S2k2%, A
StringReplace, Source, Source, S2K3 , %S2k3%, A
StringReplace, Source, Source, S2K4 , %S2k4%, A
StringReplace, Source, Source, S2K5 , %S2k5%, A
StringReplace, Source, Source, S2K6 , %S2k6%, A
StringReplace, Source, Source, S2K7 , %S2k7%, A
StringReplace, Source, Source, S2K8 , %S2k8%, A
StringReplace, Source, Source, S2K9 , %S2k9%, A
StringReplace, Source, Source, S2K0 , %S2k0%, A
StringReplace, Source, Source, S1W1 , %S1W1%, A
StringReplace, Source, Source, S1W2 , %S1W2%, A
StringReplace, Source, Source, S1W3 , %S1W3%, A
StringReplace, Source, Source, S1W4 , %S1W4%, A
StringReplace, Source, Source, S1W5 , %S1W5%, A
StringReplace, Source, Source, S1W6 , %S1W6%, A
StringReplace, Source, Source, S1W7 , %S1W7%, A
StringReplace, Source, Source, S1W8 , %S1W8%, A
StringReplace, Source, Source, S1W9 , %S1W9%, A
StringReplace, Source, Source, S1W0 , %S1W0%, A
StringReplace, Source, Source, S2W1 , %S2W1%, A
StringReplace, Source, Source, S2W2 , %S2W2%, A
StringReplace, Source, Source, S2W3 , %S2W3%, A
StringReplace, Source, Source, S2W4 , %S2W4%, A
StringReplace, Source, Source, S2W5 , %S2W5%, A
StringReplace, Source, Source, S2W6 , %S2W6%, A
StringReplace, Source, Source, S2W7 , %S2W7%, A
StringReplace, Source, Source, S2W8 , %S2W8%, A
StringReplace, Source, Source, S2W9 , %S2W9%, A
StringReplace, Source, Source, S2W0 , %S2W0%, A
StringReplace, Source, Source, S1CT , %S1CT%, A
StringReplace, Source, Source, S2CT , %S2CT%, A
StringReplace, Source, Source, ahk_class Notepad, ahk_class %window%, A
FileDelete, %MyFile%.ahk
FileAppend, %Source%, %MyFile%.ahk
Gui, Cancel
ExitApp
Here is the source.txt file (must be in same directory as script)

Code: Select all

VarList_1 = S1K1|S1K2
VarRecast_1 = S1W1|S1W2
PauseSec_1 = S1CT

VarList_2 = S2K1|S2K2
VarRecast_2 = S2W1|S2W2
PauseSec_2 = S2CT



Loop, 2
{
	CurrentIndex := A_Index
	Loop, parse, VarList_%CurrentIndex%, |
	{
		CurrentIndex_%CurrentIndex% := A_Index
		Maxnum_%CurrentIndex% := A_Index+1
		var%A_Index%_key_%CurrentIndex% := A_LoopField
		Loop, parse, VarRecast_%CurrentIndex%, |
		{
			if (A_Index = CurrentIndex_%CurrentIndex%)
				var%A_Index%_recast_%CurrentIndex% := A_LoopField
		}
	}
}

#IfWinActive, ahk_class Notepad


S1A1::
Loop
{
	if  (GetKeyState("CapsLock", "T") = 1)
	{
		Loop, parse, VarList_1, |
		{
			num_1 = 1
			if (Start%A_Index%_1 = "")
			{
				Send , % var%A_Index%_key_1
				Start%A_Index%_1 := A_TickCount
				Sleep, %PauseSec_1%
			}
			else
			{
				Elapsed%A_Index%_1 := A_TickCount - Start%A_Index%_1
				if (Elapsed%A_Index%_1 >= Var%A_Index%_recast_1)
				{
					Send , % var%A_Index%_key_1
					Start%A_Index%_1 := A_TickCount
					Sleep, %PauseSec_1%
				}
			}
			if  (GetKeyState("S1A1", "P") = 0)
				break
		}
	}
	else
	{
		if  (GetKeyState("S1A1", "P") = 1)
		{
			send , {S1A1 down}
			KeyWait , S1A1
			Send , {S1A1 up}
		}
		break
	}
if  (GetKeyState("S1A1", "P") = 0)
	break
}
return


S2A1::
Loop
{
	if  (GetKeyState("CapsLock", "T") = 1)
	{
		Loop, parse, VarList_2, |
		{
			num_2 = 1
			if (Start%A_Index%_2 = "")
			{
				Send , % var%A_Index%_key_2
				Start%A_Index%_2 := A_TickCount
				Sleep, %PauseSec_2%
			}
			else
			{
				Elapsed%A_Index%_2 := A_TickCount - Start%A_Index%_2
				if (Elapsed%A_Index%_2 >= Var%A_Index%_recast_2)
				{
					Send , % var%A_Index%_key_2
					Start%A_Index%_2 := A_TickCount
					Sleep, %PauseSec_2%
				}
			}
			if  (GetKeyState("S2A1", "P") = 0)
				break
		}
	}
	else
	{
		if  (GetKeyState("S2A1", "P") = 1)
		{
			send , {S2A1 Down}
			KeyWait , S2A1
			Send , {S2A1 Up}
		}
		break
	}
if  (GetKeyState("S2A1", "P") = 0)
	break
}
return


S1A2::
Loop
{
	if  (GetKeyState("ScrollLock", "T") = 1)
	{
		Loop, parse, VarList_1, |
		{
			num_1 = 1
			if (Start%A_Index%_1 = "")
			{
				Send , % var%A_Index%_key_1
				Start%A_Index%_1 := A_TickCount
				Sleep, %PauseSec_1%
			}
			else
			{
				Elapsed%A_Index%_1 := A_TickCount - Start%A_Index%_1
				if (Elapsed%A_Index%_1 >= Var%A_Index%_recast_1)
				{
					Send , % var%A_Index%_key_1
					Start%A_Index%_1 := A_TickCount
					Sleep, %PauseSec_1%
				}
			}
			if  (GetKeyState("S1A2", "P") = 0)
				break
		}
	}
	else
	{
		if  (GetKeyState("S1A2", "P") = 1)
		{
			send , {S1A2 Down}
			KeyWait , S1A2
			Send , {S1A2 Up}
		}
		break
	}
if  (GetKeyState("S1A2", "P") = 0)
	break
}
return


S2A2::
Loop
{
	if  (GetKeyState("ScrollLock", "T") = 1)
	{
		Loop, parse, VarList_2, |
		{
			num_2 = 1
			if (Start%A_Index%_2 = "")
			{
				Send , % var%A_Index%_key_2
				Start%A_Index%_2 := A_TickCount
				Sleep, %PauseSec_2%
			}
			else
			{
				Elapsed%A_Index%_2 := A_TickCount - Start%A_Index%_2
				if (Elapsed%A_Index%_2 >= Var%A_Index%_recast_2)
				{
					Send , % var%A_Index%_key_2
					Start%A_Index%_2 := A_TickCount
					Sleep, %PauseSec_2%
				}
			}
			if  (GetKeyState("S2A2", "P") = 0)
				break
		}
	}
	else
	{
		if  (GetKeyState("S2A2", "P") = 1)
		{
			Send , {S2A2 Down}
			KeyWait , S2A2
			Send , {S2A2 Up}
		}
		break
	}
if  (GetKeyState("S2A2", "P") = 0)
	break
}
return



~CapsLock::
{
	if  (GetKeyState("CapsLock", "T") = 1)
	{
		TrayTip, , HotKeys-Mouse: On, 10, 1
	}
	else if  (GetKeyState("CapsLock", "T") = 0)
	{
		TrayTip, , HotKeys-Mouse: Off, 10, 1
	}
}
return


~ScrollLock::
{
	if  (GetKeyState("ScrollLock", "T") = 1)
	{
		TrayTip, , HotKeys-Key: On, 10, 1
	}
	else if  (GetKeyState("ScrollLock", "T") = 0)
	{
		TrayTip, , HotKeys-Key: Off, 10, 1
	}
}
return


~MButton & WheelDown::
{
	SetStoreCapslockMode, off
	send , {capslock}
	if  (GetKeyState("CapsLock", "T") = 1)
	{
		TrayTip, , HotKeys-Mouse: On, 10, 1
	}
	else if  (GetKeyState("CapsLock", "T") = 0)
	{
		TrayTip, , HotKeys-Mouse: Off, 10, 1
	}	
}
Return


~MButton & WheelUp::
{
	SetStoreCapslockMode, off
	send , {scrolllock}
	if  (GetKeyState("ScrollLock", "T") = 1)
	{
		TrayTip, , HotKeys-Key: On, 10, 1
	}
	else if  (GetKeyState("ScrollLock", "T") = 0)
	{
		TrayTip, , HotKeys-Key: Off, 10, 1
	}
}
Return

#IfWinActive ahk_class Notepad
This is really helpful for when you have a certain amount of spells, skills, or attacks (2-9) that you would do in a row, say in battle if you would press your hotkey (a) it would press 1st hotkey the first time, 2nd hotkey the 2nd time, 3rd hotkey the 3rd time, and so on. same with holding it down, you'd get 123456. It also keeps track of how long they take to recast or cooldown so that you can just hold down the button and it do your work for you.
Example: if you press a a a a a you get 1 2 3 4 5. Also if you hold "a" down you also get 1 2 3 4 5

Nothing in this script runs automatic, its not spamming keys. It only sends keys while you are pressing the button down. I created this for playing with a joypad on DDO. I had around 5-10 attacks on different buttons and couldn't map all the keys I needed, This was a perfect solution. I hope this can be helpful to someone else in the future :D

CapsLock and ScrollLock are used to toggle the hotkeys on and off (the toggle can also be activated with clicking your mouse wheel and scrolling up or down)



Edit: Updated the scripts

Edit2: Updated description, planning on adding some more recent updates soon to code [12/27/13]
Last edited by jesseb on 27 Dec 2013, 17:01, edited 2 times in total.
jesseb
Posts: 10
Joined: 15 Oct 2013, 03:40

Re: Alternating Hotkeys in DDO (or other games)

07 Nov 2013, 17:49

Made a GUI for this, updated some stuff. Reposted code, will add more details and stuff when I'm finished.
PhaseOut
Posts: 3
Joined: 27 Jan 2014, 17:31

Re: Alternating Hotkeys in DDO (or other games)

28 Jan 2014, 05:08

Sir, Can you please help me how to use your hotkey? I'm kinda new in this thing
What I did:
i Downloaded the 2 source codes on the same directory then I open the GUI configure some stuffs then click submit. I get an error like this

I also uploaded the new source code
Attachments
bandicam 2014-01-28 18-07-07-530.jpg
bandicam 2014-01-28 18-07-26-279.jpg
VarList_1 = 1|2
VarRecast_1 = 2000|3000
PauseSec_1 = 10000

VarList_2 = 1|2
VarRecast_2 = 2000|3000
PauseSec_2 = 1000



Loop, 2
{
CurrentIndex := A_Index
Loop, parse, VarList_%CurrentIndex%, |
{
CurrentIndex_%CurrentIndex% := A_Index
Maxnum_%CurrentIndex% := A_Index+1
var%A_Index%_key_%CurrentIndex% := A_LoopField
Loop, parse, VarRecast_%CurrentIndex%, |
{
if (A_Index = CurrentIndex_%CurrentIndex%)
var%A_Index%_recast_%CurrentIndex% := A_LoopField
}
}
}

#IfWinActive, ahk_class Turbine Device Class


Home::
Loop
{
if (GetKeyState("CapsLock", "T") = 1)
{
Loop, parse, VarList_1, |
{
num_1 = 1
if (Start%A_Index%_1 = "")
{
Send , % var%A_Index%_key_1
Start%A_Index%_1 := A_TickCount
Sleep, %PauseSec_1%
}
else
{
Elapsed%A_Index%_1 := A_TickCount - Start%A_Index%_1
if (Elapsed%A_Index%_1 >= Var%A_Index%_recast_1)
{
Send , % var%A_Index%_key_1
Start%A_Index%_1 := A_TickCount
Sleep, %PauseSec_1%
}
}
if (GetKeyState("Home", "P") = 0)
break
}
}
else
{
if (GetKeyState("Home", "P") = 1)
{
send , {Home down}
KeyWait , Home
Send , {Home up}
}
break
}
if (GetKeyState("Home", "P") = 0)
break
}
return


=::
Loop
{
if (GetKeyState("CapsLock", "T") = 1)
{
Loop, parse, VarList_2, |
{
num_2 = 1
if (Start%A_Index%_2 = "")
{
Send , % var%A_Index%_key_2
Start%A_Index%_2 := A_TickCount
Sleep, %PauseSec_2%
}
else
{
Elapsed%A_Index%_2 := A_TickCount - Start%A_Index%_2
if (Elapsed%A_Index%_2 >= Var%A_Index%_recast_2)
{
Send , % var%A_Index%_key_2
Start%A_Index%_2 := A_TickCount
Sleep, %PauseSec_2%
}
}
if (GetKeyState("=", "P") = 0)
break
}
}
else
{
if (GetKeyState("=", "P") = 1)
{
send , {= Down}
KeyWait , =
Send , {= Up}
}
break
}
if (GetKeyState("=", "P") = 0)
break
}
return


::
Loop
{
if (GetKeyState("ScrollLock", "T") = 1)
{
Loop, parse, VarList_1, |
{
num_1 = 1
if (Start%A_Index%_1 = "")
{
Send , % var%A_Index%_key_1
Start%A_Index%_1 := A_TickCount
Sleep, %PauseSec_1%
}
else
{
Elapsed%A_Index%_1 := A_TickCount - Start%A_Index%_1
if (Elapsed%A_Index%_1 >= Var%A_Index%_recast_1)
{
Send , % var%A_Index%_key_1
Start%A_Index%_1 := A_TickCount
Sleep, %PauseSec_1%
}
}
if (GetKeyState("", "P") = 0)
break
}
}
else
{
if (GetKeyState("", "P") = 1)
{
send , { Down}
KeyWait ,
Send , { Up}
}
break
}
if (GetKeyState("", "P") = 0)
break
}
return


::
Loop
{
if (GetKeyState("ScrollLock", "T") = 1)
{
Loop, parse, VarList_2, |
{
num_2 = 1
if (Start%A_Index%_2 = "")
{
Send , % var%A_Index%_key_2
Start%A_Index%_2 := A_TickCount
Sleep, %PauseSec_2%
}
else
{
Elapsed%A_Index%_2 := A_TickCount - Start%A_Index%_2
if (Elapsed%A_Index%_2 >= Var%A_Index%_recast_2)
{
Send , % var%A_Index%_key_2
Start%A_Index%_2 := A_TickCount
Sleep, %PauseSec_2%
}
}
if (GetKeyState("", "P") = 0)
break
}
}
else
{
if (GetKeyState("", "P") = 1)
{
Send , { Down}
KeyWait ,
Send , { Up}
}
break
}
if (GetKeyState("", "P") = 0)
break
}
return



~CapsLock::
{
if (GetKeyState("CapsLock", "T") = 1)
{
TrayTip, , HotKeys-Mouse: On, 10, 1
}
else if (GetKeyState("CapsLock", "T") = 0)
{
TrayTip, , HotKeys-Mouse: Off, 10, 1
}
}
return


~ScrollLock::
{
if (GetKeyState("ScrollLock", "T") = 1)
{
TrayTip, , HotKeys-Key: On, 10, 1
}
else if (GetKeyState("ScrollLock", "T") = 0)
{
TrayTip, , HotKeys-Key: Off, 10, 1
}
}
return


~MButton & WheelDown::
{
SetStoreCapslockMode, off
send , {capslock}
if (GetKeyState("CapsLock", "T") = 1)
{
TrayTip, , HotKeys-Mouse: On, 10, 1
}
else if (GetKeyState("CapsLock", "T") = 0)
{
TrayTip, , HotKeys-Mouse: Off, 10, 1
}
}
Return


~MButton & WheelUp::
{
SetStoreCapslockMode, off
send , {scrolllock}
if (GetKeyState("ScrollLock", "T") = 1)
{
TrayTip, , HotKeys-Key: On, 10, 1
}
else if (GetKeyState("ScrollLock", "T") = 0)
{
TrayTip, , HotKeys-Key: Off, 10, 1
}
}
Return

#IfWinActive ahk_class Turbine Device Class
bandicam 2014-01-28 18-07-26-279.jpg (19.94 KiB) Viewed 4731 times
jesseb
Posts: 10
Joined: 15 Oct 2013, 03:40

Re: Alternating Hotkeys in DDO (or other games)

18 Apr 2014, 15:24

PhaseOut wrote:Sir, Can you please help me how to use your hotkey? I'm kinda new in this thing
What I did:
i Downloaded the 2 source codes on the same directory then I open the GUI configure some stuffs then click submit. I get an error like this
Sorry for my extremely late reply :) I really didn't think that anyone would ever see / use this thread after a while.

Okay, I think the issue is because you haven't checked the boxes to the left of the keys you want active, you have to check the tickboxes for "3", "=" , and "4".
Also, at the bottom, remember to change where it says notepad to turbine or whichever program your using. Unless you just had it on notepad for testing :)

There is an error on my part, but it should still function correctly if used correctly. If you have any more issues, I'll try to fix them :)

Return to “Gaming Scripts (v1)”

Who is online

Users browsing this forum: No registered users and 49 guests