qixx Posted August 2, 2009 Posted August 2, 2009 What is wrong in my Script?This have to press the Key: $Input11and give out the Text: $Input1But it doesn't do this. >_< Why?If you find other mistakes, too, pleaselet me know. Thank you for Help!Complete Code:expandcollapse popup#include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1_1 = GUICreate("GTA-Suchtis Keybinder", 984, 436, 200, 136) $Input1 = GUICtrlCreateInput("", 8, 24, 153, 21) $Input11 = GUICtrlCreateCombo("", 176, 24, 115, 21) GUICtrlSetData(-1, "1|2|3|4|5|6|7|8|9|0|ß|{F1}|{F2}|{F3}|{F4}|{F5}|{F6}|{F7}|{F8}|{F9}|{F10}|{F11}|{F12}|q|w|e|r|t|z|u|i|o|p|ü|a|s|d|f|g|h|j|k|l|ö|ä|y|x|c|v|b|n|m|,|.|-|#|+|{TAB}|{LSHIFT}|{RSHIFT}|{RCTRL}|{LCTRL}|{LALT}|{RALT}|{SPACE}|{NUMPAD0}|{NUMPAD2}|{NUMPAD3}|{NUMPAD4}|{NUMPAD5}|{NUMPAD6}|{NUMPAD7}|{NUMPAD8}|{NUMPAD9}|{NUMPADMULT}|{NUMPADADD}|{NUMPADSUB}|{NUMPADDIV}|{NUMPADDOT}|{NUMPADENTER}") $MenuItem1 = GUICtrlCreateMenu("&Datei") $MenuItem2 = GUICtrlCreateMenuItem("Speichern unter..", $MenuItem1) $MenuItem3 = GUICtrlCreateMenuItem("Laden..", $MenuItem1) $MenuItem4 = GUICtrlCreateMenuItem("Schließen", $MenuItem1) $MenuItem5 = GUICtrlCreateMenu("&Credits") $MenuItem6 = GUICtrlCreateMenuItem("About", $MenuItem5) GUISetState(@SW_SHOW) HotKeySet(GUICtrlRead($Input11), "_start1") Func _start1() Send("T") Sleep(100) Send(GUICtrlRead($Input1)) Send("{ENTER}") EndFunc While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $MenuItem4 Exit Case $MenuItem6 MsgBox(0, "About", "Dieses Tool wurde von qixx für die GTA-Suchtis geskriptet! Vielen Dank auch an Hann_Clammon, der mir sehr weitergeholfen hat!") Case $MenuItem2 $inisave = FileSaveDialog("Datei Speichern...",@ScriptDir,"Ini-Datei (*.ini)",16,".ini") If @error Then Else $save1 = GUICtrlRead($Input1) IniWrite($inisave, "Text", "Command1", $save1) $save11 = GUICtrlRead($Input11) IniWrite($inisave, "Taste", "Taste1", $save11) EndIf Case $MenuItem3 $iniopen = FileOpenDialog("Datei laden...",@ScriptDir,"Ini-Datei (*.ini)") If @error Then Else $edit1 = IniRead($iniopen, "Text", "Command1", "") ControlSetText("GTA-Suchtis Keybinder", "", $Input1, $edit1) $edit11 =IniRead($iniopen, "Taste", "Taste1", "") ControlSetText("GTA-Suchtis Keybinder", "", $Input11, $edit11) EndIf EndSwitch WEnd
Info Posted August 2, 2009 Posted August 2, 2009 Case $Input11 GUICtrlSetData($Input1,GUICtrlRead($Input11))
qixx Posted August 2, 2009 Author Posted August 2, 2009 (edited) If i add this into my script, the $input1 is the same as $input11 and it doesn't work by pressing the key. >_< Edited August 2, 2009 by qixx
Tvern Posted August 2, 2009 Posted August 2, 2009 If i add this into my script, the $input1 isthe same as $input11 and it doesn't work bypressing the key. >_< I'm not completely sure on what you are trying to do, but are you looking for _GUICtrlComboBox_AutoComplete() by any chance?
qixx Posted August 2, 2009 Author Posted August 2, 2009 I'm not completely sure on what you are trying to doIn $Input1 you type a TextIn §Inpot11 you change the key, you have to press to lets typing the text. >_<e.g.:$Input1 = EXAMPLE$Input11 = {F12}You press "F12" and the text "EXAMPLE" is writing in the document. MfGqixx
czardas Posted August 2, 2009 Posted August 2, 2009 I am wondering why you set the HotKey before running the loop, and I also don't know what the default HotKey is in $Input11. I suggest that you place message boxes in your code, and try to step through each stage until you find something you didn't expect. That way you should be able to hunt down the problem. I hope this helps you to solve it. operator64 ArrayWorkshop
Info Posted August 2, 2009 Posted August 2, 2009 (edited) expandcollapse popup#include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Global $CurrentHotkey $Form1_1 = GUICreate("GTA-Suchtis Keybinder", 984, 436, 200, 136) $Input1 = GUICtrlCreateInput("", 8, 24, 153, 21) $Input11 = GUICtrlCreateCombo("", 176, 24, 115, 21) GUICtrlSetData(-1, "1|2|3|4|5|6|7|8|9|0|?|{F1}|{F2}|{F3}|{F4}|{F5}|{F6}|{F7}|{F8}|{F9}|{F10}|{F11}|{F12}|q|w|e|r|t|z|u|i|o|p|?|a|s|d|f|g|h|j|k|l|?|?|y|x|c|v|b|n|m|,|.|-|#|+|{TAB}|{LSHIFT}|{RSHIFT}|{RCTRL}|{LCTRL}|{LALT}|{RALT}|{SPACE}|{NUMPAD0}|{NUMPAD2}|{NUMPAD3}|{NUMPAD4}|{NUMPAD5}|{NUMPAD6}|{NUMPAD7}|{NUMPAD8}|{NUMPAD9}|{NUMPADMULT}|{NUMPADADD}|{NUMPADSUB}|{NUMPADDIV}|{NUMPADDOT}|{NUMPADENTER}") $MenuItem1 = GUICtrlCreateMenu("&Datei") $MenuItem2 = GUICtrlCreateMenuItem("Speichern unter..", $MenuItem1) $MenuItem3 = GUICtrlCreateMenuItem("Laden..", $MenuItem1) $MenuItem4 = GUICtrlCreateMenuItem("Schlie?en", $MenuItem1) $MenuItem5 = GUICtrlCreateMenu("&Credits") $MenuItem6 = GUICtrlCreateMenuItem("About", $MenuItem5) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $MenuItem4 Exit Case $MenuItem6 MsgBox(0, "About", "Dieses Tool wurde von qixx f?r die GTA-Suchtis geskriptet! Vielen Dank auch an Hann_Clammon, der mir sehr weitergeholfen hat!") Case $MenuItem2 $inisave = FileSaveDialog("Datei Speichern...",@ScriptDir,"Ini-Datei (*.ini)",16,".ini") If @error Then Else $save1 = GUICtrlRead($Input1) IniWrite($inisave, "Text", "Command1", $save1) $save11 = GUICtrlRead($Input11) IniWrite($inisave, "Taste", "Taste1", $save11) EndIf Case $MenuItem3 $iniopen = FileOpenDialog("Datei laden...",@ScriptDir,"Ini-Datei (*.ini)") If @error Then Else $edit1 = IniRead($iniopen, "Text", "Command1", "") ControlSetText("GTA-Suchtis Keybinder", "", $Input1, $edit1) $edit11 =IniRead($iniopen, "Taste", "Taste1", "") ControlSetText("GTA-Suchtis Keybinder", "", $Input11, $edit11) EndIf Case $Input11 HotKeySet($CurrentHotkey) HotKeySet(GUICtrlRead($Input11),"_ComboSend") $CurrentHotkey = GUICtrlRead($Input11) EndSwitch WEnd Func _ComboSend() Send("T") Send(GUICtrlRead($Input1)) Send("{Enter}") EndFunc Edited August 2, 2009 by Info
qixx Posted August 2, 2009 Author Posted August 2, 2009 YES MAN! ;) This is it! >_< Thanks!What was the mistake?
qixx Posted August 2, 2009 Author Posted August 2, 2009 Could you help me again, pls? >_< My question:If I use _SendMes1() the functions_SendMes2() and _SendMes3() shouldbe deaktivated.Func _SendMes1() ;DEACTIVATE _SendMes2() and _SendMes3() If WinActive("GTA:SA:MP") Then Send(GUICtrlRead($Input1)) ;ACTIVATE _SendMes2() and _SendMes3() EndIf EndFuncOriginal part of the code:Func _SendMes1() If WinActive("GTA:SA:MP") Then Send(GUICtrlRead($Input1)) EndIf EndFunc Func _SendMes2() If WinActive("GTA:SA:MP") Then Send(GUICtrlRead($Input2)) EndIf EndFunc Func _SendMes3() If WinActive("GTA:SA:MP") Then Send(GUICtrlRead($Input3)) EndIf EndFunc
muhmuuh Posted August 3, 2009 Posted August 3, 2009 (edited) not sure if this is what you mean by "deactivating" Global fl=0 Func _SendMes1() $fl=1 If WinActive("GTA:SA:MP") Then Send(GUICtrlRead($Input1)) EndIf $fl=0 EndFunc Func _SendMes2() if $fl==1 Then Return If WinActive("GTA:SA:MP") Then Send(GUICtrlRead($Input2)) EndIf EndFunc Func _SendMes3() if $fl==1 Then Return If WinActive("GTA:SA:MP") Then Send(GUICtrlRead($Input3)) EndIf EndFunc Edited August 3, 2009 by muhmuuh I ran. I ran until my muscles burned and my veins pumped battery acid. Then I ran some more.
Info Posted August 3, 2009 Posted August 3, 2009 YES MAN! ;) This is it! >_< Thanks!What was the mistake? The hotkey should be set everytime the ComboBox gets a message and not in the beginning of the script.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now