Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Super Invoker Hotkeys


  • Please log in to reply
No replies to this topic
HunterSeeker
  • Members
  • 3 posts
  • Last active: Oct 22 2010 02:30 PM
  • Joined: 01 Jul 2009
This is a script to automate the spells of hero Invoker in Warcraft III custom map DotA. I was learning Ahk at that time and i believe that most of my code is inefficient.
Releasing the script now. Feel free to change it but keep the changed script posted over here as i would like this to grow into a better tool.
Please keep my name in the credits section.
;##################################################################
; AutoHotkey Version: 1.x										###
; Language:       English										###
; Platform:       Win9x/NT										###
; Author:         HunterSeeker <seekerhunter@live.com>			###
;																###
; Script Function:												###
;	Invoker HOTkeys												###
;																###
;##################################################################
;///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;###################################################    BACKBONE   #################################################
;///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
List2=MaxQuas,MaxWex,MaxExort,EMP,SunStrike,Tornado,Meteor,Blast,IceWall,GhostWalk,ForgeSpirit,Alcarity,ColdSnap,ResetKey,InvokeModifier,Togglekeys,GetQuasStat,GetWexStat,GetExortStat,GetInvokeStat,Numpad8,Numpad7,Numpad5,Numpad4,Numpad2,Numpad1
List1=MaxQuas,MaxWex,MaxExort|EMP,SunStrike,Tornado,Meteor,Blast,IceWall,GhostWalk,ForgeSpirit,Alcarity,ColdSnap|ResetKey,InvokeModifier|Togglekeys,GetQuasStat,GetWexStat,GetExortStat,GetInvokeStat|Numpad8,Numpad7,Numpad5,Numpad4,Numpad2,Numpad1

;///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Random,,seed %A_MSec%
Gui, Submit,Nohide
gosub,inireaduser
if 1=Debug
{
gosub, debug
}
Gosub,InitHotkeys
Gosub,InitModKeys
GoSub,CreateTray
Gosub,Chkinit
GoSub,Guiinit
Hotkey,LButton,Off
Hotkey,Escape,Off

;SUPER INVOKER GUI
#SingleInstance force
#EscapeChar \
#IfWinActive Warcraft

AutoTrim,Off
;initvariables
cd=0
sts=3
tabchk=0
invoked=1
Orbstate=3
Mod_On=0



CreateTray:
;Menu, tray, Icon, Invoke.ico,1,1
Menu, tray, Tip, Super Invoker
Menu, tray, NoStandard
Menu, tray, add, Main Window,GUIINIT
Menu, tray, add, Remap Keys, ShowRemap
Menu, tray, add, About, AboutHS
Menu, tray, add  ; Creates a separator line.
Menu, tray, add, Exit, ExitApp  ; Creates a new menu item.
Menu, tray,Default,Main Window
return

GUIINIT:
Gui, destroy
Gui, font, s10, Verdana
Gui, Add, Button,gShowRemap,Remap Keys
Gui, Add, Button,gHotkeyDetails,HotkeyDetails
Gui, Add, Button,gAboutHS Default,About
Gui, Add, Button,gGUICancel,To Tray
Gui, Add, Button,gExitApp yp xp+150,&Exit
Gui, Show,Autosize Centre,Super Invoker Hotkeys
winsettitle, SuperInvoker
return

;About Window
AboutHS:
;Msgbox, font, s15, Verdana, About HunterSeeker, Super Invoker Coded By: HunterSeeker\nFor your suggestions, please E-Mail me at seekerhunter@live.com
Gui, 3: Add,Text,,Super Invoker Coded By: HunterSeeker\n
Gui, 3: Add,Text,,For your suggestions, Please E-Mail me at:  seekerhunter@live.com
Gui, 3: Add,Text,,Many Many thanks to PS2MAN to make all this work possible.
Gui, 3:Show,Autosize Center
disableclose()
return
GuiClose:
gui,Destroy
GuiEscape:
GUICancel:
Gui,1:Destroy
return






remap1:
tab=1
gosub, hotkey_change
gui,5:add,button,xp+100 yp+30 gDestroy Default,OK
gui,5:show,Autosize Centre
DisableClose()
return

remap2:
tab=2
gosub, hotkey_change
gui,5:add,button,xp+100 yp+30 gDestroy Default,OK
gui,5:show,Autosize Centre
DisableClose()
return

remap3:
tab=3
gosub, hotkey_change
gui,5:add,button,xp+100 yp+30 gDestroy Default,OK
gui,5:show,Autosize Centre
DisableClose()
return
remap4:
tab=4
gosub, hotkey_change
gui,5:add,button,xp+100 yp+30 gDestroy Default,OK
gui,5:show,Autosize Centre
return

remap5:
tab=5
gosub, hotkey_change
gui,5:add,button,xp+100 yp+30 gDestroy Default,OK
gui,5:show,Autosize Centre
DisableClose()
return

;///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;
;///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
hotkey_change:
gui,5: Add,text,Section,
Loop, Parse, list1, |
{
	if A_Index=%tab%
	Loop, Parse, A_LoopField, \,
	{
		Hval = %A_LoopField%
		HK	 := %Hval%
		hotkey,%HK%,off
	}
	;Gui,2,%: Submit,Nohide
	if A_Index=%tab%
	Loop, Parse, A_LoopField, \,
	{
		Gui,2: Submit,Nohide
		Hval = %A_LoopField%
		HK	 := %Hval%
		keystring:=key2string(HK)
		;msgbox %HK% changed to %keystring%
		hotkey,%HK%,%Hval%,On
		;msgbox, Turning %HK% on at routine %Hval%
		gui,5: Add, text,xs ys+15 Section,%Hval%  set to:
		gui,5: Add, text,xp+200 yp, %keystring% 
		
	 }
}

tabchk=1  ;<-----------------------------------------------BUGGY
return

Destroy:
gui,5:Destroy
return


;//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;##############################################   DISPLAY REMAPPING GUI $#########################################
;//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ShowRemap:
winhide,SuperInvoker
;Second window
Gui, 2:font, s10, Verdana
Gui,2:+LastFound  ; Make the GUI window the last found window for use by the line below.
Gui, 2:Add,Tab2,xp yp AltSubmit W800 H600 gchktab  vchtab altsubmit, Simple Commands|Spell Hotkeys|Spell Modifiers|Miscallaneous|Inventory Remap

Loop, Parse, list1, \|
{
	Gui, 2:Tab,%A_Index%
	Gui, 2:Add, Text,xm+40 ym+51 Section,Function\t\t\t\t\t\t\t\t\t\t\tKey
	Loop, Parse, A_LoopField, \,
	{
		Hval = %A_LoopField%
		HK	 := %Hval%
		Gui, 2:Add, Text,xs ys+35 Section, %Hval%
		Gui, 2:Add, Hotkey, W150 xp+600 v%Hval%,%Hk% 
	}
Gui, 2:Add, Button,xm+100 y550 gremap%A_Index%,Remap Keys
Gui, 2:Add, Button,wp xp+100 yp ggetdefini,Default
Gui, 2:Add, Button,wp xp+100 yp ginisave,Save
Gui, 2:Add, Button,wp xp+400 yp gExitMenu2,Exit
}
Gui,2:Show,Centre,Remap Hotkeys
winsettitle, Remapping Keys
return

ExitApp:
ExitApp
return

;#IfWinActive Warcraft

;//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;													SPELL	ACTIONS
;//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;													MAXOUT ORBS
MaxQuas:
SendPlay,{q}{q}{q}
OrbState =1
Return
MaxWex:
SendPlay,{w}{w}{w}
OrbState =2
Return
MaxExort:
SendPlay,{e}{e}{e}
OrbState =3
Return

;											Buying Skills and stats
GetQuasStat:
SendPlay, {o}{q}{Escape}
Return
GetWexStat:
SendPlay, {o}{w}{Escape}
Return
GetExortStat:
SendPlay, {o}{e}{Escape}
Return
GetInvokeStat:
SendPlay, {o}{r}{Escape}
Return


SendOrbState:
if orbstate=1
gosub, MaxQuas
if orbstate=2
gosub, MaxWex
if orbstate=3
gosub, MaxExort
Return

;//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;########################################   INVENTORY REMAP KEYS   #####################################################
;//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Numpad8:
Sendplay, {%A_ThisLabel%}
Return

Numpad7:
Sendplay, {%A_ThisLabel%}
Return

Numpad5:
Sendplay, {%A_ThisLabel%}
Return

Numpad4:
Sendplay, {%A_ThisLabel%}
Return

Numpad2:
Sendplay, {%A_ThisLabel%}
Return

Numpad1:
Sendplay, {%A_ThisLabel%}
Return

;//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;#################################################   MODIFIER KEY  ###################################################
;//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
InvokeModifier:
sleep,100
getkeystate,modkeystate,%InvokeModifier%,p
if modkeystate= D
	{
	mod_on=1
	}
send {%InvokeModifier% Up}
return
;//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
; ###############################################	INOVKE / CAST SPELLS   ###########################################
;//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
EMP:
spelladded=%A_ThisLabel%
if (%A_ThisLabel%=%invokedarray1% or %A_ThisLabel%=%invokedarray2%)
	{
	gosub, empcast
	Return
	}
else
	{
	SendPlay, {w}{w}{w}{r}
	gosub, Addinvoke
	if (mod_on=0)
	{
		Sleep, 600
		SendPlay, {c}{LButton}
		SendPlay, {F1}
	}
	Gosub,SendOrbstate 
	Return
	}
Return

SunStrike:
spelladded=%A_ThisLabel%
if (%A_ThisLabel%=%invokedarray1% or %A_ThisLabel%=%invokedarray2%)
{
gosub, sunstrikecast
Return
}
else
{
SendPlay, {e}{e}{e}{r}
gosub, Addinvoke
if (mod_on=0)
{
Sleep, 600
SendPlay, {t}{LButton}
SendPlay, {F1}
}
Gosub,SendOrbstate
mod_on=0
Return
}

Tornado:
spelladded=%A_ThisLabel%
if (%A_ThisLabel%=%invokedarray1% or %A_ThisLabel%=%invokedarray2%)
{
gosub, tornadocast
Return
}
else
{
SendPlay, {w}{w}{q}{r}
gosub, Addinvoke
if (mod_on=0)
{
Sleep, 600
SendPlay, {x}{LButton}
SendPlay, {F1}
}
Gosub,SendOrbstate
mod_on=0
Return
}
Meteor:
spelladded=%A_ThisLabel%
if (%A_ThisLabel%=%invokedarray1% or %A_ThisLabel%=%invokedarray2%)
{
gosub, meteorcast
Return
}
else
{
SendPlay, {e}{e}{w}{r}
gosub, Addinvoke
if (mod_on=0)
{
Sleep, 600
SendPlay, {d}{LButton}
SendPlay, {F1}
}
Gosub,SendOrbstate
mod_on=0
Return
}
Blast:
spelladded=%A_ThisLabel%
if (%A_ThisLabel%=%invokedarray1% or %A_ThisLabel%=%invokedarray2%)
{
gosub, blastcast
Return
}
else
{
SendPlay, {q}{w}{e}{r}
gosub, Addinvoke
if (mod_on=0)
{
Sleep, 600
SendPlay, {b}{LButton}
SendPlay, {F1}
Gosub,SendOrbstate
}
mod_on=0
Return
}
IceWall:
spelladded=%A_ThisLabel%
if (%A_ThisLabel%=%invokedarray1% or %A_ThisLabel%=%invokedarray2%)
{
gosub, IceWallcast
Return
}
else
{
SendPlay, {q}{q}{e}{r}
gosub, Addinvoke
if (mod_on=0)
{
Sleep, 600
SendPlay, {g}
}
Gosub,SendOrbstate
mod_on=0
Return
}
GhostWalk:
spelladded=%A_ThisLabel%
if (%A_ThisLabel%=%invokedarray1% or %A_ThisLabel%=%invokedarray2%)
{
gosub, GhostWalkcast
Return
}
else
	{
	SendPlay, {q}{q}{w}{r}
	gosub, Addinvoke
	if (mod_on=0)
		{
		Sleep, 400
		if OrbState=3
			OrbState=2
		Gosub,SendOrbstate
		SendPlay, {v}
		Return
		}
	}
ForgeSpirit:
spelladded=%A_ThisLabel%
if (%A_ThisLabel%=%invokedarray1% or %A_ThisLabel%=%invokedarray2%)
{
gosub, ForgeSpiritCast
Return
}
else
{
SendPlay, {e}{e}{q}{r}
gosub, Addinvoke
if (mod_on=0)
{
Sleep, 600
SendPlay, {f}
}
Gosub,SendOrbstate
mod_on=0
Return
}

Alcarity:
spelladded=%A_ThisLabel%
if (%A_ThisLabel%=%invokedarray1% or %A_ThisLabel%=%invokedarray2%)
{
Gosub, Alcaritycast
Return
}
else
{
SendPlay, {w}{w}{e}{r}
gosub, Addinvoke
if (mod_on=0)
{
Sleep, 600
SendPlay, {z}{LButton}
SendPlay, {F1}
}
Gosub,SendOrbstate
mod_on=0
Return
}
ColdSnap:
spelladded=%A_ThisLabel%
if (%A_ThisLabel%=%invokedarray1% or %A_ThisLabel%=%invokedarray2%)
{
gosub, ColdSnapCast
return
}
else
{
SendPlay, {q}{q}{q}{r}
gosub, Addinvoke
if (mod_on=0)
{
Sleep, 600
SendPlay, {y}{LButton}
SendPlay, {F1}
}
Gosub,SendOrbstate
mod_on=0
Return
}

;SendPlaying Respective Spell (Ctrl+Invokeset) Hotkey+mouseclick
EMPCast:
SendPlay, {c}{LButton}
SendPlay, {F1}
Gosub,SendOrbstate
Return
SunStrikeCast:
SendPlay, {t}{LButton}
SendPlay, {F1}
Gosub,SendOrbstate
Return
TornadoCast:
SendPlay, {x}{LButton}
SendPlay, {F1}
Gosub,SendOrbstate
Return
MeteorCast:
SendPlay, {d}{LButton}
SendPlay, {F1}
Gosub,SendOrbstate
Return
BlastCast:
SendPlay, {b}{LButton}
SendPlay, {F1}
Gosub,SendOrbstate
Return
IceWallCast:
SendPlay, {g}
SendPlay, {F1}
Gosub,SendOrbstate
Return
GhostWalkCast:
Gosub,SendOrbstate
SendPlay, {v}
Return
ForgeSpiritCast:
SendPlay, {f}
Gosub,SendOrbstate
Return
AlcarityCast:
SendPlay, {z}{LButton}
SendPlay, {F1}
Gosub,SendOrbstate
Return
ColdSnapCast:
SendPlay, {y}{LButton}
SendPlay, {F1}
Gosub,SendOrbstate
Return

;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;#################################################   TOGGLE KEYS   ###################################################
;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ToggleKeys:
sts++
if(Mod(sts,2)=0)
{
SendPlay, {Enter}Hotkeys Off{Enter}
SoundPlay,HotkeyOff.wav
SetScrollLockState , Off
}
else
{
SendPlay, {Enter}Hotkeys On{Enter}
SoundPlay,HotkeyOn.wav
SetScrollLockState , Off
}
ToggleKeys1:
	Loop, Parse, List2, \,
	{
		key=%A_Loopfield%
		keyval:=%A_Loopfield%
		;msgbox, togelling %keyval%
		Hotkey, %keyval%, Toggle
	}
Hotkey,%Togglekeys%,on
return
; to skip, set a varaible named %hotkeyvar%_skip and set it to true
; e.g.

ExitMenu2:
Gui, 2:Destroy
winshow,SuperInvoker
return

;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;######################################## 	CREATING THE HOTKEY DETAILS GUI  #########################################
;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
HotkeyDetails:
Gui,4:font, s10, Verdana
Gui,4:Add, Text,,Function\t\t     Hotkey\t          Status
Loop, Parse, List2, \,
	{
		chkboxval=true
		chkbox=chk%A_Loopfield%
		chkboxval:=chk%Loopfield%
		key=%A_Loopfield%
		keyval:=%key%
		Gui,4:Add,Text,xs ys+20 Section,%A_Loopfield% key:
		;msgbox chkbox value should be : %chkboxval%
		Gui,4:Add, Text, xp+200 ,%keyval%
		Gui,4:Add,Checkbox, xp+150 checked%chkboxval% g%chkbox% v%chkbox%
	}
Gui,4:Add, Button,xp-250 yp+30 w70 Label gGui4Exit,Exit
GuiControl,+vscroll,%A_GUIControl%
WinsetTitle, Hotkey Status
Gui,4:Show, Autosize Centre
disableclose()
return

;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;##########################################	INI WRITE FOR SAVE TO INI BUTTON   ######################################
;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
inisave:
tabchk=1

;////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;###########################################   GOTO CLASH CHECK SHOULD BE IMPLEMENTED HERE   ##################################
;////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Gui, Submit,Nohide
Loop, Parse, List2, \,
	{
		Hval := A_LoopField
		HK	 := %A_Loopfield%
		IniWrite, %HK%,userkeys.ini,keys,%Hval%
		;msgbox Hval= %Hval% HK= %HK%
	}
msgbox,,Saved User Keys,The Changed keys will be shown next time.
return

;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;#############################  INITIALIZATION OF HOTKEY VARIABLES CALLED AT START  ##################################
;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
InitHotkeys:
Loop, Parse, List2, \,
	{
		Name = %A_LoopField%
		Key :=%Name%

		;msgbox key %key% name %Name%
		hotkey,%Key%,%Name%
	}
return
;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;############################################   MODIFIER HOTKEYS INIT (USELESS)   ####################################
;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
InitModkeys:
Loop,Parse,List1, |
{
	if A_LoopIndex=2
	{
	Loop, Parse, A_LoopField, \,
		{
			Name = %A_LoopField%
			Key := %Name%
			hotkey,%invokeModifier%%Key%,Mod%Name%
		}
	}
}
return
;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;#################################   INI READ VARS DEFAULT KEYS FOR SET DEFAULT KEYS BUTTON   ########################
;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
getdefini:
Loop, Parse, List2, \,
	{
		Iniread, %A_Loopfield%,default keys.ini,keys, %A_LoopField%
		;msgbox reading from ini as var %A_Loopfield% filename defaultkeys.ini section keys key value %A_LoopField% 
	}
Gosub,InitHotkeys
GoSub,Exitmenu2
Gosub,ShowRemap
return

;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;####################################   TOGGLING HOTKEYS VIA CHECKBOX   ##############################################
;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Loop, Parse, List2, \,
	{
		
		Var = %A_Loopfield%
		HK:=%Var%
		chk%A_Loopfield%:
		msgbox,togelling %HK%
		hotkey, %HK%,toggle
		return
	}
;Return
;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;##############################################  GOTTA CHECK CODE WORKS AFTER DELETING BELOW LINES  ################## 
;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
chkMaxQuas:
Hotkey,%Quas%,toggle
return
chkMaxWex:
Hotkey,%Wex%,toggle
return
chkMaxExort:
Hotkey,%Exort%,toggle
return
chkEMP:
Hotkey,%Emp%,toggle
return
chkSunStrike:
Hotkey,%SunStrike%,toggle
return
chkTornado:
Hotkey,%Tornado%,toggle
return
chkMeteor:
Hotkey,%Meteor%,toggle
return
chkBlast:
Hotkey,%Blast%,toggle
return
chkIceWall:
Hotkey,%IceWall%,toggle
return
chkGhostWalk:
Hotkey,%GhostWalk%,toggle
return
chkForgeSpirit:
Hotkey,%ForgeSpirit%,toggle
return
chkAlcarity:
Hotkey,%Alcarity%,toggle
return
chkColdSnap:
Hotkey,%ColdSnap%,toggle
return


chkInvokeModifier:
Hotkey,%InvokeModifier%,toggle
return
;////////////////////////////////////////////////////
chkToggleKeys:
Hotkey,%ToggleKey%,toggle
return
chkGetQuasStat:
Hotkey,%GetQuasStat%,toggle
return
chkGetWexStat:
Hotkey,%GetWexStat%,toggle
return
chkGetExortStat:
Hotkey,%GetExortStat%,toggle
return
chkGetInvokeStat:
Hotkey,%GetInvokeStat%,toggle
return

chkresetkey:
Hotkey,%ResetKey%,toggle
return

;//////////////////////////////////////////////// GOTTA DELETE EM
chkcd25:
Hotkey,%CD25%,toggle
return
chkCD12:
Hotkey,%CD12%,toggle
return
chkCD5:
Hotkey,%CD5%,toggle
return
chkCD2:
Hotkey,%CD2%,toggle
return
;///////////////////////////////////////////////////////////////////
chkNumpad8:
Hotkey,%Numpad8%,Toggle
return
chkNumpad7:
Hotkey,%Numpad8%,Toggle
return
chkNumpad5:
Hotkey,%Numpad8%,Toggle
return
chkNumpad4:
Hotkey,%Numpad8%,Toggle
return
chkNumpad2:
Hotkey,%Numpad8%,Toggle
return
chkNumpad1:
Hotkey,%Numpad8%,Toggle
return

;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;#########################################   SET CHECKBOXES VARIABLES AS 1   #########################################
;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
chkinit:
Loop, Parse, List2, \,
	{
		HK := A_LoopField
			chk%HK%=1
	}
return
;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;##########################################   GUI 4 IS THE WINDOW WHICH DISPLAYS   ###################################
;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Gui4Exit:
Gui,4:Submit
Gui,4:Destroy
return

;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;################################    CHECKING CLASH OF KEYS ( STILL TO COMPLETE )  ###################################
;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Clashcheck:
;still to be completed
a=1
b=2
while a<34
	{
	FileReadLine, Tmpchk, hotkeys.txt, %a%
	while b<35
		{
		FileReadLine, Tmpcomp, hotkeys.txt, %b%
		if (Tmpchk=Tmpcmp)
			{
			clsfound=1
			gosub,Clsfound
			}
		b++
		}
	a++
	}
return

Clsfound:
msgbox,,Clash Found,%TmpChk% has the same value as %TmpComp2%\nPlease Change.\nOr use the BackSpace key to disable an action.
gui,cancel
gui,show
return


;//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;########################################   STOP HOTKEYS IN CHAT   ####################################################
;//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
^Enter::
Suspend Permit
Suspend Toggle
hotkey,LButton,toggle
hotkey,Escape,toggle
Sendplay, ^{Enter}
return

!Enter::
Suspend Permit
Suspend Toggle
hotkey,LButton,toggle
hotkey,Escape,toggle
Sendplay, !{Enter}
Return

+Enter::
Suspend Permit
Suspend Toggle
hotkey,LButton,toggle
hotkey,Escape,toggle
Sendplay, +{Enter}
Return

Enter::
Suspend Permit
Suspend Toggle
hotkey,LButton,toggle
hotkey,Escape,toggle
Sendplay, {Enter}
Return

LButton::
Suspend,Permit
Suspend,Toggle
Sendplay, {LButton}
Hotkey, LButton,off
Hotkey, Escape,off
Sendplay,{LButton}{Enter}{Enter}
return

Escape::
Suspend,Permit
Suspend,Toggle
Sendplay, {Escape}
Hotkey, LButton,off
Hotkey, Escape,off
Sendplay,{Escape}{Enter}{Enter}
return


;////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;###########################################   DEBUGGING PART   #####################################################
;////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
debug:
listvars
return


;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;################################   CHTAB USED TO TELL USER TO REMAP IF HE DID NOT PRESS REMAP BUTTON   ##############
;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
chktab:
if tabchk=0
{ }
else
{
if chtab>=1 and chtab<=4
gosub, askremap
}

return

askremap:
Msgbox,4,Change Hotkeys?,You did not press save or remap button.\nDo you want to save changes?
IfMsgBox Yes
{
gosub remap%chtab%
tabchk=0
}
return

;//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;##########################################   SAVE HOTKEYS IN A FILE   ############################################
;//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Cr8Fkeys:
return
Gui,Submit,Nohide
Loop, Parse, List2, \,
	{
		HK := %A_LoopField%
		FileAppend, {%HK%}\n, hotkeys.txt
	}
return
;////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;##########################################   SET VALUES FROM USERKEYS.INI   ########################################
;////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
IniReadUser:
Loop, Parse, List2, \,
	{
		IniRead, %A_Loopfield%,userkeys.ini,keys,%A_Loopfield%
	}
return

;//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;############################################	TURNS ALL HOTKEYS OFF   ###############################################
;//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Alloff:
loop,parse,list2,\,
	{
	var=%A_Loopfield%
	key:=%var%
	hotkey,%key%,Off
	}
return

;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;###################################   FUNTION RETURNS KEY NAME AGAINST KEY SYMBOL   #################################
;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
key2string(x)
{
	StringReplace, x, x, + , Shift+, 1
	StringReplace, x, x, ^ , Ctrl+, 1
	StringReplace, x, x, ! , Alt+, 1
	return x
} 
;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;#############################################   FUNCTION DISABLES CLOSE BUTTON  #####################################
;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
DisableClose(hWnd="") 
{
 If hWnd=
    hWnd:=WinExist("A")
 hSysMenu:=DllCall("GetSystemMenu","Int",hWnd,"Int",FALSE)
 nCnt:=DllCall("GetMenuItemCount","Int",hSysMenu)
 DllCall("RemoveMenu","Int",hSysMenu,"UInt",nCnt-1,"Uint","0x400")
 DllCall("RemoveMenu","Int",hSysMenu,"UInt",nCnt-2,"Uint","0x400")
 DllCall("DrawMenuBar","Int",hWnd)
Return ""
}
;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;#################################   ADDs SPELL TO THE ARRAY (USED TO CHECK WHICH SPELL IS INVOKED####################
;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Addinvoke:
if invoked=1
invokedarray2=%spelladded%
if invoked=3
invoked=2
invokedarray1=%invokedarray2%
invokedarray%invoked%=%spelladded%
invoked++
return

;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;######################################   RESET KEY SUB RESETS ARRAY TO START NEW GAME   ############################
;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ResetKey:
Invokedarray1=****
InvokedArray2=You
return