Shortkey Configurator V 1.0
Was ist der Shortkey Configurator?
Ich habe mich gefragt warum sollte sich der User vorschreiben lassen
,auf welchen Tasten er den Bot starten und beenden will.
Nun, die Lösung war sehr schnell gefunden: Ein Configurator!
Mit dem Configurator kann der User selbst entscheiden auf welchen Tasten er seine Funktionen legen will.
Wie arbeitet der Configurator?
Der Configurator arbeitet über einen INI File in dem die Shortkeys als "AutoIT" codes geschrieben sind, also zB. "{NumpadDot}".
Jedoch formt der der Configurator diesen Shortkey wieder in etwas lesbares um. "{NumpadDot}" wird durch den Configurator in NumDot umgewandelt.
Das ganze funktioniert natürlich auch noch umgekehrt.
Was ist denn nun so besonders am Configurator?
Nun das besonderes am ihm ist sein komplett dynamisches Script.
Während man bei anderen Tools den kompletten Code umschreiben muss um
gewisse Sachen rauszunehmen, müssen bei dem Configurator nur paar Variablen geändert werden um das ganze Script inklusive GUI zu verändern.
Das ganze wird beim Configurator mit For Schleifen und Arrays bewältigt.
Features
- Komplet dynamisches Script (In 3 Minuten einrichtbar)
- SendReponse Funktion
- Umwandlung von Strings wie "{F12}" in F12
- Auslesen und schreiben der Shortkeys
Shortkey Configurator + Changelog + ToDo List
Code:
#CS ==================================================================== ======================= SHORTKEY CONFIGURATOR ====================== ==================================================================== V. 1.0 ------------------------------------------------------------- [[by XeReon]] ============================ Changelog ============================= V- 1.0: -Finaly, Version 1.0 is finished - NEW: SendReponse fuznction - NEW: Full dynamic Script V. 0.1.2: -Now you need only to edit $ini for edit the path of the ini file. -Bugfix: You cant enter now a Numpad Value over 9. V 0.2: -Added a Check function to check if there the same shortkey already setted. -Bugfix: Num0 or "{Numpad0}" work now correctly V 0.1: -The first Version of the Shortkey Configurator is finished. Thanks for all the people who helped me and bore my nerved comments in skype ^^ . -Also i thank all the people on www.elitepvpers.com for their help! -Special Thanks goes to NBA. ==================================================================== ==================================================================== ============================ ToDO-List ============================= -Make the Script full dynamic Finished -Make the Sk_to_Display function dynamic 0 -Make the Gui dynamic 0 -Make the For dynamic 0 -Make a SendReponse fucntion Finished -Add a function to reload the Bot O -Add a function that send a Reponse if you close 0 the Configurator. -Make the file Global so you can use the functions for Planning change a SK Value in a Display Value in another script -Make a Update function Planning -Add the Keys 1-12 to the aviable Key list(12 = ` ) Planning -Add a function to load a INI file from the internet Planning ==================================================================== ==================================================================== ____________________________________________________________________ ------------------------- Avabiable Keys --------------------------- ____________________________________________________________________ F1 ============== Num0 ============================================ F2 ============== Num1 ============================================ F3 ============== Num2 ============================================ F4 ============== Num3 ============================================ F5 ============== Num4 ============================================ F6 ============== Num5 ============================================ F7 ============== Num6 ============================================ F8 ============== Num7 ============================================ F9 ============== Num8 ============================================ F10 ============= Num9 ============================================ F11 ============= NumAdd ========================================== F12 ============= NumSub ========================================== ================== NumMult ========================================= ================== NumDiv ========================================== ================== NumDot ========================================== ================== NumMult ========================================= -------------------------------------------------------------------- Special Thanks goes to: Milchbeutel, NBA, -------------------------------------------------------------------- [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ >Visit www.elitepvpers.com for Updates and more Hacks, Bots, Exploits< ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] #CE ;What is the main function of the Configurator? ;Normal you use codes like "{Enter}" in AutoIt for special chars ;but an user dont wont to see a { or a " ;So the configurator transfer a AutoIt Code(useable Values) to a String that is like Num0(display Values) ;Certainly the Configurator read and sets shortkeys from a ini file ;) ;======= INI & Version =======; $rev = "1.0" $ini = "settings.ini" ;=============================; ;===== Send Reponse Function =====; ;------Activate---------------; Global $SendReponse_ACT = True ;-----------------------------; Global $SendReponse_Code_Reload = 1001 Global $SendReponse_Code_Close = 1002 ;=================================; ;Inludes ;----------------------- #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Array.au3> ;----------------------- FileChangeDir(@ScriptDir) #Region Arrays and Functions ;Names of the Shortkeys ;----------------------- Global $name[5] $name[0] = "hide" $name[1] = "start" $name[2] = "exit" $name[3] = "dumper" $name[4] = "updater" ;Showed Names Global $name_display[5] $name_display[0] = "Hide / Unhide" $name_display[1] = "Start" $name_display[2] = "Exit" $name_display[3] = "Dumper" $name_display[4] = "Updater" ;Ini Variablen ;----------------------- ;Create a function for get new values, may use for set $sk new Func Read() Global $sk[6] $sk[0] = IniRead($ini,"Shortkeys",$name[0],"INI ERROR") $sk[1] = IniRead($ini,"Shortkeys",$name[1],"INI ERROR") $sk[2] = IniRead($ini,"Shortkeys",$name[2],"INI ERROR") $sk[3] = IniRead($ini,"Shortkeys",$name[3],"INI ERROR") $sk[4] = IniRead($ini,"Shortkeys",$name[4],"INI ERROR") $sk[5] = 99999999999 EndFunc Read() ;Void Varaibles ;----------------------- $new_sk = 0 $sk_set_button = 0 $sk_set_button_label = 0 Global $display_sk[5] $display_sk[0] = 0 $display_sk[1] = 0 $display_sk[2] = 0 $display_sk[3] = 0 $display_sk[4] = 0 ;Definiere Arrays ;----------------------- Global $keys[16] $keys[0] = "Numpad0" $keys[1] = "Numpad1" $keys[2] = "Numpad2" $keys[3] = "Numpad3" $keys[4] = "Numpad4" $keys[5] = "Numpad5" $keys[6] = "Numpad6" $keys[7] = "Numpad7" $keys[8] = "Numpad8" $keys[9] = "Numpad9" $keys[10] = "NumpadEnter" $keys[11] = "NumpadDot" $keys[12] = "NumpadAdd" $keys[13] = "NumpadSub" $keys[14] = "NumpadMult" $keys[15] = "NumpadDiv" Global $display_keys[16] $display_keys[0] = "Num0" $display_keys[1] = "Num1" $display_keys[2] = "Num2" $display_keys[3] = "Num3" $display_keys[4] = "Num4" $display_keys[5] = "Num5" $display_keys[6] = "Num6" $display_keys[7] = "Num7" $display_keys[8] = "Num8" $display_keys[9] = "Num9" $display_keys[10] = "NumEnter" $display_keys[11] = "NumDot" $display_keys[12] = "NumAdd" $display_keys[13] = "NumSub" $display_keys[14] = "NumMult" $display_keys[15] = "NumDiv" ;Core function of the configurator. Transfer a useable value(like "{Numpad1}") in a display value(like Num1) Func SK_to_Display() Read() For $i2 = 0 TO (_ArrayMaxIndex($sk,1) -1) Step 1 For $i = 0 TO 15 Step 1 If $sk[$i2] = "{F" & $i & "}" Then $display_sk[$i2] = "F" & $i ElseIf $sk[$i2] = ("{" & $keys[$i] & "}") Then $display_sk[$i2] = $display_keys[$i] ElseIf $sk[$i2] = -1 Then $display_sk[$i2] = "N/A" EndIf Next Next EndFunc ;If a shortkey already exists, this function set $check_equal to true Func Check_equal($check_button_id,$check_control_value) ;Set Varaibles Local $counter = 0 Local $check_equal = False ;Get the values of $sk Read() ;Check if the new value is the same like before If $sk[$check_button_id] = $check_control_value Then $check_equal = False Return $check_equal ;If not, this part checks if the new value already exits Else For $i = 0 to (_ArrayMaxIndex($sk,1) -1) Step 1 ;Check if there already the same value: Then nothing happens and the counter dont go up If $sk[$i] = $check_control_value Then ;If not the counter go up Else $counter += 1 EndIf Next ;Check if True or False: if the counter only 4 it means that onetime the first IF was activated, also that there is already the same key setted If $counter = (_ArrayMaxIndex($sk,1) -1) Then $check_equal = True Return $check_equal ;Check if there are at least more than 1 time the same key already ElseIf $counter < (_ArrayMaxIndex($sk,1) -1) Then MsgBox(-1,"Error!","The same Shortkey ist already setted at least 2 times!" & @CRLF & "Pls open " & $ini & " and edit the values of the shortkeys manuel!") $check_equal = True Return $check_equal ;Check if counter = 5. Means if the first IF was not activated this will happen and say the write function that everything is OK! ElseIf $counter = _ArrayMaxIndex($sk,1) Then $check_equal = False Return $check_equal Endif EndIf EndFunc ;The SendReponse Function: Func SendReponse($type) ;Check if function is activated If $SendReponse_ACT = True Then Switch $type Case "Reload" $SendReponse = $SendReponse_Code_Reload Case "Close" $SendReponse = $SendReponse_Code_Close EndSwitch IniWrite($ini,"Shortkeys","SendReponse",$SendReponse) EndIf EndFunc #EndRegion ;Set SendReponse to 0 IniWrite($ini,"Shortkeys","SendReponse",0) ;Change the values from the INI Sk_to_Display() ;==================================================Set GUI here======================================================; #Region ### START Koda GUI section ### Form=c:\users\parani4x\documents\autoit sripte\forms\shortkey configurator.kxf ;Set Sizes For $i = 0 To (_ArrayMaxIndex($sk,1) -1) Step 1 If $i = (_ArrayMaxIndex($sk,1) -1) Then $GUI_Size = 60 + (25 * $i) Endif Next ;----------------------------------- ;Create Window + Version Label $conf = GUICreate("Shortkey Configurator V " & $rev, 342,$GUI_Size + 100) GUISetBkColor(0xD7E4F2) $titel = GUICtrlCreateLabel("Shortkey Configurator V " & $rev, 70, 8, 201, 20) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) ;Dynamic Labels here Dim $label[_ArrayMaxIndex($sk,1)] For $i = 0 To (_ArrayMaxIndex($sk,1) -1) Step 1 $label[$i] = GUICtrlCreateLabel($name_display[$i] & ":", 32,63 + (25 * $i), 115, 17, 0) Next $group_functions = GUICtrlCreateGroup("Functions:", 8, 40, 121,$GUI_Size -5) ;Dynamic Input is here: Dim $show_sk[_ArrayMaxIndex($sk,1)] For $i = 0 To (_ArrayMaxIndex($sk,1) -1) Step 1 $show_sk[$i] = GUICtrlCreateInput($display_sk[$i], 142,60 + (25 * $i), 56, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) Next $group_keys = GUICtrlCreateGroup("Keys", 134, 40, 72,$GUI_Size -5) ;Dynamic Buttons here Dim $button_def[_ArrayMaxIndex($sk,1)] For $i = 0 To (_ArrayMaxIndex($sk,1) -1) Step 1 $button_def[$i] = GUICtrlCreateButton("Define new Shortkey", 215,60 + (25 * $i), 115, 20, 0) Next $group_buttons = GUICtrlCreateGroup("Set", 210, 40, 126,$GUI_Size -5) ;Create Exit & Reload Button & Cright Label $button_exit = GUICtrlCreateButton("Exit",190,$GUI_Size + 45, 120, 27,-1) $button_reload = GUICtrlCreateButton("Reload",30,$GUI_Size + 45, 120, 27,-1) $label_C = GUICtrlCreateLabel("Made by Xereon. Visit www.elitepvpers.com for more Hacks and Tools",8,$GUI_Size + 80) #EndRegion ### END Koda GUI section ### ;====================================================================================================================; ; The Core function of the configurator. Transfer a display value(like Num1) in a useable value for autoit(like "{Numpad1}")and save it in a ini file Func Display_to_SK($buttom_pressed,$button_id) Local $control = 0 Local $control_set = 0 Local $control_value = 0 For $i = 0 TO 15 Step 1 ;Check for SK = F1-12 If $new_sk = "F" & $i AND $i > 0 AND $i < 13 Then $control = 1 $control_value = String("{" & $new_sk & "}") ;Check for already setted keys $control_set = Check_equal($button_id,$control_value) If $control_set = True Then MsgBox(-1,"Error!","This Shortkey already exists") ExitLoop EndIf $display_sk[$button_id] = $new_sk $sk[$button_id]= String("""{" & $new_sk & "}""") IniWrite($ini,"Shortkeys",$buttom_pressed,$sk[$button_id]) GUICtrlSetData ($show_sk[$button_id],$display_sk[$button_id]) ;Check for SK = Num0-9 ElseIf $new_sk = "Num" & $i AND $i <=10 Then $control = 1 $new_sk = StringTrimLeft ($new_sk,3) $control_value = String("{Numpad" & $new_sk & "}") ;Check for already setted keys $control_set = Check_equal($button_id,$control_value) If $control_set = True Then MsgBox(-1,"Error!","This Shortkey already exists") ExitLoop EndIf $display_sk[$button_id] = String("Num" & $new_sk) $sk[$button_id] = String("""{Numpad" & $new_sk & "}""") IniWrite($ini,"Shortkeys",$buttom_pressed,$sk[$button_id]) GUICtrlSetData ($show_sk[$button_id],$display_sk[$button_id]) ;Check for SK = NumAdd... ElseIf $new_sk = $display_keys[10] OR $new_sk = $display_keys[11] OR $new_sk = $display_keys[12] OR $new_sk = $display_keys[13] OR $new_sk = $display_keys[14] OR $new_sk = $display_keys[15] Then $control = 1 $new_sk = StringTrimLeft ($new_sk,3) $control_value = String("{Numpad" & $new_sk & "}") ;Check for already setted keys $control_set = Check_equal($button_id,$control_value) If $control_set = True Then MsgBox(-1,"Error!","This Shortkey already exists") ExitLoop EndIf $display_sk[$button_id] = String("Num" & $new_sk) $sk[$button_id] = String("""{Numpad" & $new_sk & "}""") IniWrite($ini,"Shortkeys",$buttom_pressed,$sk[$button_id]) GUICtrlSetData ($show_sk[$button_id],$display_sk[$button_id]) ;Check for SK = Unsetted(" ") ElseIf $new_sk = "" Then $control = 1 $control_value = $new_sk ;Check for already setted keys $control_set = Check_equal($button_id,$control_value) If $control_set = True Then MsgBox(-1,"Error!","This Shortkey already exists") ExitLoop EndIf $display_sk[$button_id] = "N/A" $sk[$button_id] = -1 IniWrite($ini,"Shortkeys",$buttom_pressed,$sk[$button_id]) GUICtrlSetData ($show_sk[$button_id],$display_sk[$button_id]) ElseIf $i = 15 AND $control = 0 Then MsgBox (-1, "ERROR", "Pls enter a correct Shortkey:" & @CRLF & @CRLF & "Use Num1-9, NumAdd, NumSub, NumMult, NumDiv, NumEnter, NumDot, F1-12" & @CRLF & "or a empty box for deactivating the Shortkey") EndIf Next EndFunc ;This is the MainGui Loop While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE SendReponse("Close") Exit Case $button_exit SendReponse("Close") Exit Case $button_reload SK_to_Display() For $i = 0 To (_ArrayMaxIndex($sk,1) -1) Step 1 GUICtrlSetData($show_sk[$i],$display_sk[$i]) Next SendReponse("Reload") MsgBox(-1,"Reload","Reload Complete!!!") EndSwitch For $i = 0 To (_ArrayMaxIndex($sk,1) -1) Step 1 Switch $nMsg Case $button_def[$i] $new_sk = InputBox("Shortkey","Enter a new Shortkey","") If NOT @error Then $sk_set_button = $i $sk_set_button_label = $name[$i] Display_to_SK($sk_set_button_label,$sk_set_button) ElseIf @error = 1 Then Else MsgBox(-1,"Error","An error occured!") EndIf EndSwitch Next WEnd
Konfiguration des Configurators
Ok, wie jedes Tool, soll dieses auch nur genau das beinhalten was man benötigt.
In dieser Section zeige ich euch wie man:
- Einstellt welche Shortkeys man benötigt
- Aufsetzen des INI Files
- Send Reponse anwendet und abstellt
- Wie man den Configurator in das eigene Script einbaut
Konfiguration der Shortkeys
Ok das ist eigentlich ganz einfach. Ic h habe oben ja schon erwähnt, dass das Script komplet dynamisch ist.
Das bedeutet das ihr den eigentlich Code garnicht verstehen müsst.
Das coole daran ist: Ich spare mir eine Menge arbeit beim Schreiben xD
Ok fangen wir mal an:
Im Moment sind noch Shortkeys voreingestellt:
- Hide / Unhide
- Start
- Exit
- Dumper
- Updater
Wo finden wir den überhaupt die Namen der Shortkeys?
Ah da habe ich doch was im Code gefunden
Code:
;Names of the Shortkeys ;----------------------- Global $name[5] $name[0] = "hide" $name[1] = "start" $name[2] = "exit" $name[3] = "dumper" $name[4] = "updater" ;Showed Names Global $name_display[5] $name_display[0] = "Hide / Unhide" $name_display[1] = "Start" $name_display[2] = "Exit" $name_display[3] = "Dumper" $name_display[4] = "Updater"
Der oberste Array definiert die Namen im INI File, also wie die Shortkeys im INI lauten.
Der unterste Array definiert die Name die nacher angezeigt werden.
Ein "hide:" und dann der Shortkey sieht irkenntwie langweilig aus.
Ein "Hide / Unhide:" hat jedoch schon viel mehr.
Das bedeutet:
Ändern wir den untersten Arrays verändert sich das was der User sieht, verändern wir den oberen Arrays verändert sich die Variable die aus dem INI ausgelesen wird.
INI, das ist ein guter Stichpunkt: Wo wird denn überhaupt aus der INI ausgelesen?
Auch da habe ich wieder was gefunden(direkt nach den Namen ):
Code:
;Ini Variablen ;----------------------- ;Create a function for get new values, may use for set $sk new Func Read() Global $sk[6] $sk[0] = IniRead($ini,"Shortkeys",$name[0],"INI ERROR") $sk[1] = IniRead($ini,"Shortkeys",$name[1],"INI ERROR") $sk[2] = IniRead($ini,"Shortkeys",$name[2],"INI ERROR") $sk[3] = IniRead($ini,"Shortkeys",$name[3],"INI ERROR") $sk[4] = IniRead($ini,"Shortkeys",$name[4],"INI ERROR") $sk[5] = 99999999999 EndFunc Read()
Eigentlich leist dieser Code nur die Werte aus einen INI File,
jedoch ist dies das wichtigste Stück Code in diesen Script:
Nach diesen Variablen richtet sich das ganze Script.
Also: Das bedeutet, ändern wir diese Variablen, ändern wir das ganze Script.
Die wollen wir doch gleich mal ausprobieren:
Ich finde, ein Shortkey für einen Updater sit sinnlos, also schmeißen wir ihn mal raus:
Zunächst ändere ich die Variablen $Name und $name_display:
Vorher:
Code:
;Names of the Shortkeys ;----------------------- Global $name[5] $name[0] = "hide" $name[1] = "start" $name[2] = "exit" $name[3] = "dumper" $name[4] = "updater" ;Showed Names Global $name_display[5] $name_display[0] = "Hide / Unhide" $name_display[1] = "Start" $name_display[2] = "Exit" $name_display[3] = "Dumper" $name_display[4] = "Updater"
Code:
;Names of the Shortkeys ;----------------------- Global $name[4] $name[0] = "hide" $name[1] = "start" $name[2] = "exit" $name[3] = "dumper" ;Showed Names Global $name_display[4] $name_display[0] = "Hide / Unhide" $name_display[1] = "Start" $name_display[2] = "Exit" $name_display[3] = "Dumper"
Reicht aber noch nicht aus. Erst müssen wir auch noch die Variable $SK ändern.
WICHTIG: Der letzte Arrays von SK muss IMMER einen Zahlenwert haben.
Vorher:
Code:
;Ini Variablen ;----------------------- ;Create a function for get new values, may use for set $sk new Func Read() Global $sk[6] $sk[0] = IniRead($ini,"Shortkeys",$name[0],"INI ERROR") $sk[1] = IniRead($ini,"Shortkeys",$name[1],"INI ERROR") $sk[2] = IniRead($ini,"Shortkeys",$name[2],"INI ERROR") $sk[3] = IniRead($ini,"Shortkeys",$name[3],"INI ERROR") $sk[4] = IniRead($ini,"Shortkeys",$name[4],"INI ERROR") $sk[5] = 99999999999 EndFunc
Code:
;Ini Variablen ;----------------------- ;Create a function for get new values, may use for set $sk new Func Read() Global $sk[6] $sk[0] = IniRead($ini,"Shortkeys",$name[0],"INI ERROR") $sk[1] = IniRead($ini,"Shortkeys",$name[1],"INI ERROR") $sk[2] = IniRead($ini,"Shortkeys",$name[2],"INI ERROR") $sk[3] = IniRead($ini,"Shortkeys",$name[3],"INI ERROR") $sk[4] = 99999999999 EndFunc
So einst fehlt jetz aber noch:
Die Variable $display_sk
Vorher:
Code:
Global $display_sk[5] $display_sk[0] = 0 $display_sk[1] = 0 $display_sk[2] = 0 $display_sk[3] = 0 $display_sk[4] = 0
Code:
Global $display_sk[4] $display_sk[0] = 0 $display_sk[1] = 0 $display_sk[2] = 0 $display_sk[3] = 0
So fertig: Jetz haben wir den Punkt Updater komplett entfernt.
Lasset uns unsere Früchte der Arbeit bestaunen:
Vorher:
Nacher:
Wie ihr seht hat sich das GUI und alles andere automatisch angepasst.
Ihr könnt gerne alles genau unter die Lupe nehmen und alles gerne ausgibig testen.
Ich hoffe das es hier nicht zuviele Leecher gibt.
HF
Part 2 folgt bald