Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Guild Wars > GW Bots
You last visited: Today at 17:36

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release][Tool] Shortkey Configurator V. 1.0

Discussion on [Release][Tool] Shortkey Configurator V. 1.0 within the GW Bots forum part of the Guild Wars category.

Reply
 
Old   #1
 
Xereon's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 793
Received Thanks: 366
[Release][Tool] Shortkey Configurator V. 1.0

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"
Zur Erläuterung:

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()
Nun, wie ihr seht kommt unsere Variable $name wieder vor.

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"
Nacher:
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
Nacher:
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
Nacher:
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
Attached Files
File Type: rar Shortkey configurator V 1.0.rar (4.1 KB, 9 views)
Xereon is offline  
Thanks
1 User
Old 05/17/2009, 12:03   #2
 
Xereon's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 793
Received Thanks: 366
Ok willkommen zu Part 2

Ich hoffe ihr konntet das alles mit der INI testen die im download enthalten war, jetz wollen wir doch das Programm von Fuß auf selbs auf bauen.

Ok falls ihr den INI File noch habt, löscht den gesammten Inhalt, wir schreiben sie jetz neu.

Als erstes bitte ich euch doch das erstmal in eure INI zu schreiben:

Code:
[Shortkeys]
Dies ist eine sogenantne Section und sorgt dafür das keine Verwechslungen entstehen falls ihr zum Beispiel eine settings.ini schon benutzt.

Ok jetz wollen wir mal ein paar fiktive Shortkeys kreiren:

Code:
[Shortkeys]
guildwars =
chat =
laufen =
whisper =
gildenhalle =
kaieng =
wie ihr seht können wir das endlos weiter führen.
Bevor wir aber loslegen können benötigen wir aber noch ein paar voreingestellte Shortkeys. Wir sind jedoch komplet faul und sagen das kann der User selbs erledigen. Also schreiben wir hinter jedem Shortkey eine -1

Code:
[Shortkeys]
guildwars = -1
chat = -1
laufen = -1
whisper = -1
gildenhalle = -1
kaieng = -1
Ok das wars mti unseren INI File, jetz müssens wir nurnoch wie oben gelernt in unser Script einbauen.

Also ändern wir zunächst mal wieder $name und $display_name

Code:
Global $name[6]
	$name[0] = "guildwars"
	$name[1] = "chat"
	$name[2] = "laufen"
	$name[3] = "whisper"
	$name[4] = "gildenhalle"
        $name[5] = "kaieng"

;Showed Names
Global $name_display[6]
	$name_display[0] = "Guildwars starten"
	$name_display[1] = "Chat öffnen"
	$name_display[2] = "Automatisch Laufen"
	$name_display[3] = "Whispern"
	$name_display[4] = "Gildenhalle besuchen"
        $name_display[5] = "Kaieng genießen"
Ok jetz nur noch die SK Funktion:

Code:
Func Read()
	Global $sk[7]
	$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] = IniRead($ini,"Shortkeys",$name[5],"INI ERROR")
	$sk[6] = 99999999999
EndFunc
Und die $display_sk :

Code:
Global $display_sk[6]
$display_sk[0] = 0
$display_sk[1] = 0
$display_sk[2] = 0
$display_sk[3] = 0
$display_sk[4] = 0
$display_sk[5] = 0
So fertig:



Wie ihr seht wird -1 durch N/A ersetzt.

Übrigens: Ihr könnt den INI File nennen wie ihr wollt, einfach

Code:
$ini = "settings.ini"
in

Code:
$ini = "der_name_eures_inifiles.ini"
ändern.




Einbau ins Mainscript


So dies ist der etwas aufwendigere Teil.
Ich kann hier keine auf jeden Bot maßgeschneiderte Lösung geben jedoch versuche ich einfach mal eine sehr allgemeine Lösung geben.

Zunächst einmal müssen wir den gesammten oberen Part, also die Variablen $name, $display_name, $keys, $display_keys, die Funktion Read() und natürlich noch die Variable $display_sk in das mainscript verfrachten.

Dazu benötigen, falls ihr die Shortkeys den User im Mainscript anzeigne wollt noch die Funktion SK_to_Display_().
Einfach auch mit Copy und Paste ins Mainscript reintuen.

Soooo.
Zunächst einmal erweitern wir mal unsere Read() Funktion.

Es gibt jetz 2 Möglichkeiten: Viel schreiben oder wenig schreiben.
Wenig schreiben hat dne Vorteil das eurer Script dynamischer und auch kleiner ist, hat jedoch den Nachteil das ihr die Namen der funktionen für die Hotkeys nicht selber wählen könnt.

Dynamischer Code:

Code:
Func  Read()
	Global $sk[7]
	$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] = IniRead($ini,"Shortkeys",$name[5],"INI ERROR")
	$sk[6] = 99999999999
	
	For $i = 0 To (_ArrayMaxIndex($sk,1) -1)
		If $sk[$i] <> -1 Then
			HotKeySet($sk[$i],$name[$i])
		EndIf
	Next
EndFunc
Die Funktionen die du dann den shortkeys zuteilen wills müssen dann den Werten von $name entsprechen also in meinen Fall:

Code:
Func guildwars()
EndFunc
Func chat()
EndFunc
Func laufen()
EndFunc
Func whisper()
EndFunc
Func gildenhalle()
EndFunc
Func kaieng()
EndFunc

so jetz der nicht dynamische Weg:
Code:
Func  Read()
	Global $sk[7]
	$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] = IniRead($ini,"Shortkeys",$name[5],"INI ERROR")
	$sk[6] = 99999999999
	
		If $sk[0] <> -1 Then
			HotKeySet($sk[0],"funktion1")
		EndIf
		
		If $sk[1] <> -1 Then
			HotKeySet($sk[1],"funktion2")
		EndIf
		
		If $sk[2] <> -1 Then
			HotKeySet($sk[2],"funktion3")
		EndIf
		
		If $sk[3] <> -1 Then
			HotKeySet($sk[3],"funktion4")
		EndIf
		
		If $sk[4] <> -1 Then
			HotKeySet($sk[4],"funktion5")
		EndIf
		
		If $sk[5] <> -1 Then
			HotKeySet($sk[5],"funktion6")
		EndIf
EndFunc
Jetz haben wir schonmal die Shortkeys gesetzt.
Was fehlt noch? Genau die Anzeige.
Hierfür benötigen wir die Funktion SK_to_Display().
Die Funktion wandel zB. "{Numpad3}" in "Num3" um.

Also schreibt einfach mal an Anfang eurer GUI Section SK_to_Display().
Da ich faul bin übernehm ich einfach den Code aus dem Configurator als Beispiel. Die ist ein vollkommener dynamischer Code und ihr könnt gerne auch mal veruschen so ein Code zu schreiben:

Code:
	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
Dieser Code sollte euch automatisch soviele Inputs erstellen wie es Shortkeys gibt und sie euch dann auch gleich mit den umgerechneten Shortkey also zB. Num3 anzeigen.



Die SendReponse Funktion


Ist euch eigentlich schonmal der Button "Reload" im Configurator aufgefallen?
Damit kann man zwar die Shortkeys reloaden, aber er hat auch noch eine andere Funktion.

Wann weiß unserer Bot wann er die Shortkeys neuladen soll?
Nun dafür haben wir das SendReponse System.
Es speichert einen Code zB 1001 in eine INI.
Unser anderes Programm frägt ständig den Wert von der einen Variable in den der code gespeichert ist hab und wenn der wert zB 1001 hat soll sich das andere Programm beenden.
Ich habe dieses System einfach mal SendReponse getauft.

So bevor wir beginnen können müssen wir noch was an unsere INI rumbasteln.
Fügt in der section "Shortkeys" die Variable "SendReponse" ein und gibt ihr den Wert 0.
0 ist bei diesen System der Wert dafür, dass nix passiert ist.

Also nachdem wir das gemacht haben steltl sicher das
Code:
$SendReponse_ACT = True
auf True steht.
Diese Variable sagt ob die SendReponse funktion an oder aus ist.

Wenden wir uns jetz den Mainscript zu:

Fügt zu den Variablen folgenden Punkte hinzu:
Code:
$SendReponse_ACT = True
Global $Code[2]
$code[1] = 1001
$code[2] = 1002
Bis jetz benutzt der Configurator nur 2 Codes, 1001 als Zeichen dafür das der Reload Button gedrückt wurde und 1002 als Zeichen dafür das der Configurator geschloßen wurde.

Ok die eigentliche Funktion spielt in der GUIloop ab.
Unsere Loop sieht jetz erstmal so aus:
Code:
While 1
$msg = GUIGetMSG()
Switch $msg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
So bevor wir mit der Funktion beginnen können bitte ich euch doch den Configurator schonmal zu compilen.
Ist dies getan können wir die Loop umschreiben:
Code:
While 1
$msg = GUIGetMSG()
$GetReponse = IniRead($ini,"Shortkeys","SendReponse","INI ERROR")
Switch $msg

       Case $GUI_EVENT_CLOSE
              Exit

       Case $menue_configurator
              Run "configurator.exe"
              $Conf_run = True

EndSwitch

If $SendReponse = True AND $Conf_run = True AND $GetReponse = 1001 Then
       MsgBox(-1,"Reload","Reload Complete!")
       Read()
       SK_to_Display
       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
       IniWrite($ini,"Shortkeys","SendReponse",0)
ElseIf $SendReponse = True AND $Conf_run = True AND $GetReponse = 1002 Then
       Read()
       SK_to_Display
       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
       $Conf_run = False
       IniWrite($ini,"Shortkeys","SendReponse",0)
       
EndIf
Wend
Ok sieht auf den ersten Blick kompliziert aus ist aber eigentlich total simpel:

Also wenn der Menü Punkt Configurator gedrückt wird führt den den Configurator aus und setzt $Conf_run auf True.
Diese Variable sagt uns das der Configurator am laufen ist.
So ab diesen Punkt wird durch die If überprüft ob einer der beiden Codes und der Variable SendReponse zu finden ist.
Zwischen den beiden Aktionen die darauf folgen gibt es kaum ein Unterschied.
Die shortkeys werden aktualiesiert und die Varaible SendReponse im INI File wird wieder auf 0 gesetzt damit sich die Aktion nicht endlos wiederholt sondern nur einmal ausgeführt wird.

Bei der Exit Funktion jedoch wird nun auch $Conf_run auf False gesetzt.
Der Configurator läuft nicht mehr und eine Abfrage ist also sinnlos



================================================== ======
================================================== ======


So ich hoffe euch hilft der Configurator auch wenn ich das bei 40 Views und kaum Antworten nicht erwarte.
Der ganze Text wirkt sehr abschreckend aber ich kann euch versichern das es wirklich nur paar Minuten sind die man benötigt.
Die ganzen Code Beispiele "blowen" halt den Text auf xD

also HF

MfG

Xereon
Xereon is offline  
Old 05/17/2009, 12:11   #3
 
NBA's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 1,874
Received Thanks: 213
Ist ja ganz nett, aber poste bitte naechstes mal im richtigen Unterforum (GW Exploits, Hacks, Bots, Tools & Macros). Ist doch ein Tool, oder nicht ?
MfG
¬NBA
NBA is offline  
Old 05/17/2009, 12:27   #4
 
Xereon's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 793
Received Thanks: 366
Quote:
Originally Posted by NBA View Post
Ist ja ganz nett, aber poste bitte naechstes mal im richtigen Unterforum (GW Exploits, Hacks, Bots, Tools & Macros). Ist doch ein Tool, oder nicht ?
MfG
¬NBA
Jaein
Es muss ja erstmal "konfiguriert" werden und ist ja ohne einen Bot sinnlos.
Deswegen kanns du es wie ein Entwicklungs Tool behandeln und die kommen dann doch hier rein oder?
Xereon is offline  
Old 05/17/2009, 12:34   #5
 
NBA's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 1,874
Received Thanks: 213
Gute Frage...
NBA is offline  
Old 07/06/2009, 02:35   #6
 
Keksautomat's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 433
Received Thanks: 50
SUPER Teil !
Ich hab jetzt endlich die Sache mit den Arrays richtig begriffen oO
thx !
Keksautomat is offline  
Old 07/07/2009, 19:20   #7


 
buFFy!'s Avatar
 
elite*gold: 1826
Join Date: Mar 2009
Posts: 4,310
Received Thanks: 6,283
kleiner Tipp, um alle nicht gewünschten zeichen in einem String zu entfernen kann man StringRegExpReplace benutzen und den String ins gewünschte Format bringen.

Hier mal 2 kleine Beispiele.
Code:
;//Example 1
$CurrentString = "-Th.is i^s .a -crip^pled .St^r.i-ng"
$NewString = StringRegExpReplace($CurrentString, "[-.^]" , "")
MsgBox(0x40, "New String: ", $NewString)

;//Example 2
$CurrentString = '"{F12}"'
$NewString = StringRegExpReplace($CurrentString, '["{}]' , "")
MsgBox(0x40, "New String: ", $NewString)
buFFy! is offline  
Reply


Similar Threads Similar Threads
[Release Tool] iBot Auto Relogin Tool
09/12/2011 - SRO Guides & Templates - 8 Replies
iBot Loader 3.2 IS OUT! NOW ADDED RUSSIAN SILKROAD SUPPORT! How to use: -Browse your iBot.exe -Write your server's number to the server number (Search yours below) -Write your informations to the loader -PLAY WITH RELOG 24/7 WITH iBOT! Notice: Don't forget to write your Silkroad's directory to the file
[Release]AutoMintinance TOOl [Release]
01/22/2011 - EO PServer Guides & Releases - 21 Replies
Here is a Auto Mint tool for ur server To make it work well open ToolConfig.ini and edit it according to the place of ur acc - msg - npc Hope u love it :) http://www.mediafire.com/?dttwkzxom2w http://www.speedyshare.com/286357893.html http://www.zshare.net/download/580691874bcb8b30/
[Release Tool] iBot Auto Relogin Tool
09/12/2010 - SRO Hacks, Bots, Cheats & Exploits - 0 Replies
Hello guys :) Showyka iBotRelogin Tool :) iBot Loader 3.1 3.1 IS OUT! How to use: -Browse your iBot.exe -Write your server's number to the server number (Search yours below) -Write your informations to the loader



All times are GMT +2. The time now is 17:36.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.