SalazarCheats Posted May 10, 2007 Share Posted May 10, 2007 (edited) hello all.. can anybody debug my script it is ment to send the text that is in the first input box and then the text that is in the second one... (this has be be by the same function) And is it possible to chage the F1 func... to ctrl+shift+z here is my script: CODE#include <GUIConstants.au3> Opt("GUIOnEventMode", 1) ; Added this since it looks like you using on event mode for your GUI Opt("TrayMenuMode", 1) ;Added this to only show Autotalker tray menu options Opt("TrayOnEventMode", 1) ;Added this for tray menu to work on event as well TraySetClick(16) ; Set tray menu to show when right mouse click Global $input[13], $Hide[1], $SettingsPath[1], $label[13] ; Just some arrays for storing settings etc HotKeySet("^s", "Save") ; This is to call save settings function HotKeySet("^l", "Load") ; This is to call load settings function HotKeySet("^h", "Hide") ; This is to call hide function, toggles hide or show gui HotKeySet("!{ESC}", "Close") ; This is to call close function, this way a user can exit autotalker even if the gui is hidden HotKeySet("{F1}", "F1") $Main = GUICreate("Auto-Login- By J4g3xm4n", 450, 100) ;Put your main window in a variable so you can use it on an event. WinSetOnTop("Auto-Login- By J4g3xm4n", "", 1) ;---- Gui Labels GUICtrlCreateLabel("Really easy to use just press F1 and this will type in your username and password!", 5, 65) ;----- Gui Menu $MenuItem2 = GUICtrlCreateMenu("File") $MenuItem7 = GUICtrlCreateMenuItem("Load Settings (CTRL + L)", $MenuItem2) ;Load settings File Menu GUICtrlSetOnEvent(-1, 'Load') ; Added this so your gui will call load function when a user selects load from the File Menu $MenuItem4 = GUICtrlCreateMenuItem("Save Settings (CTRL + S)", $MenuItem2) GUICtrlSetOnEvent(-1, 'Save') ; Added this so your gui will call save function when a user selects save from the File Menu GUICtrlCreateMenuItem('', $MenuItem2) ; Divider line in menu , cosmetic touch...lol $MenuItem8 = GUICtrlCreateMenuItem("Hide (CTRL + H)", $MenuItem2) GUICtrlSetOnEvent(-1, 'Hide') ; Added this so your gui will call hide function when a user selects hide from the File Menu GUICtrlCreateMenuItem('', $MenuItem2) ; Divider line in menu , cosmetic touch...lol $MenuItem3 = GUICtrlCreateMenuItem("EXIT (ALT + ESC)", $MenuItem2) GUICtrlSetOnEvent(-1, 'Close') ; Added this so your gui will call close function when a user selects exit from the File Menu $MenuItem1 = GUICtrlCreateMenu("Other") $MenuItem5 = GUICtrlCreateMenuItem("About", $MenuItem1) GUICtrlSetOnEvent(-1, 'About') ; Added this so your gui will call about function when a user selects about from the File Menu $MenuItem6 = GUICtrlCreateMenuItem("Version", $MenuItem1) GUICtrlSetOnEvent(-1, 'Version') ; Added this so your gui will call version function when a user selects version from the File Menu ;---- Gui Input Boxes $input1 = GUICtrlCreateInput("", 25, 10) $input2 = GUICtrlCreateInput("", 25, 35) GUISetOnEvent($GUI_EVENT_CLOSE, 'Close') ; Added this so your GUI will call a function to exit GUISetOnEvent($GUI_EVENT_MINIMIZE, 'Hide') ; Added this so your GUI will call a function to hide gui GUISetState() ;--- Tray Menu $HideShow = TrayCreateItem('Hide Auto-Login', -1, 0) TrayItemSetOnEvent(-1, "Hide") TrayCreateItem('', -1, 1) ;Divider line in tray menu , cosmetic touch...lol $Load = TrayCreateItem('Load Settings', -1, 2) TrayItemSetOnEvent(-1, "Load") $Save = TrayCreateItem('Save Settings', -1, 3) TrayItemSetOnEvent(-1, "Save") TrayCreateItem('', -1, 4) ;Divider line in tray menu , cosmetic touch...lol $Close = TrayCreateItem('Exit', -1, 5) TrayItemSetOnEvent(-1, "Close") TraySetState() StartupLoad() ;Load settings from Auto-Login.ini if it exists in the script directory. While 1 Sleep(10) WEnd ;~ Func Menu Func F1() If GUICtrlRead($input[1]) <> "" Then Send(GUICtrlRead($input[1])) Send("{ENTER}") Then GUICtrlRead($input[2]) <> "" Then Send(GUICtrlRead($input[2])) EndIf EndFunc ;==>F1 Func Hide() ; Toggle hide or show the gui function. If $Hide[0] = 1 Then GUISetState(@SW_SHOW, $Main) If BitAND(WinGetState("Auto-Login- By J4g3xm4n", ""), 16) Then WinSetState("Auto-Login- By J4g3xm4n", '', @SW_RESTORE) EndIf WinSetOnTop("Auto-Login- By J4g3xm4n", "", 1) $Hide[0] = 0 TrayItemSetText($HideShow, 'Hide Auto-Login') ElseIf $Hide[0] = 0 Then GUISetState(@SW_HIDE, $Main) $Hide[0] = 1 TrayItemSetText($HideShow, 'Show Auto-Login') EndIf EndFunc ;==>Hide Func Save() ;Save the settings to an ini when a user select Save from File Menu, Hotkey or Tray. Settings will be saved to loaded ini if it's got write access. If FileExists($SettingsPath[0]) Then For $i = 1 To 12 $SaveIni1 = IniWrite($SettingsPath[0], 'Settings', 'F' & $i, GUICtrlRead($input[$i])) Next If $SaveIni1 <> 1 Then For $i = 1 To 12 $SaveIni = IniWrite(@ScriptDir & '\Auto-Login.ini', 'Settings', 'F' & $i, GUICtrlRead($input[$i])) Next If $SaveIni = 1 Then $SettingsPath[0] = @ScriptDir & '\Auto-Login.ini' ElseIf $SaveIni <> 1 Then ;If the script is run from read only directory then offer the user where to save the settings. WinSetOnTop("Auto-Login- By J4g3xm4n", "", 0) $SaveFile = FileSaveDialog('Save Auto-Login settings to ...', '::{450D8FBA-AD25-11D0-98A8-0800361B1103}', 'Auto-Login (*.ini)', 18, 'Auto-Login.ini') If Not @error = 1 Then For $i = 1 To 12 $SaveIni2 = IniWrite($SaveFile, 'Settings', 'F' & $i, GUICtrlRead($input[$i])) Next $SettingsPath[0] = $SaveFile EndIf WinSetOnTop("Auto-Login- By J4g3xm4n", "", 1) EndIf EndIf ElseIf Not FileExists($SettingsPath[0]) Then ; <- Start updated, this was the part I forgot to add when there's no ini path stored in array For $i = 1 To 12 $SaveIni = IniWrite(@ScriptDir & '\Autotalker.ini', 'Settings', 'F' & $i, GUICtrlRead($input[$i])) Next If $SaveIni = 1 Then $SettingsPath[0] = @ScriptDir & '\Auto-Login.ini' ElseIf $SaveIni <> 1 Then WinSetOnTop("Auto-Login- By J4g3xm4n", "", 0) $SaveFile = FileSaveDialog('Save Auto-Login settings to ...', '::{450D8FBA-AD25-11D0-98A8-0800361B1103}', 'Auto-Login (*.ini)', 18, 'Auto-Login.ini') If Not @error = 1 Then For $i = 1 To 12 $SaveIni2 = IniWrite($SaveFile, 'Settings', 'F' & $i, GUICtrlRead($input[$i])) Next $SettingsPath[0] = $SaveFile EndIf WinSetOnTop("Auto-Login- By J4g3xm4n", "", 1) EndIf EndIf ;<- This is the end of what I updated EndFunc ;==>Save Func Load() ; File Menu Load settings from an ini that the user has saved somewhere. WinSetOnTop("Auto-Login- By J4g3xm4n", "", 0) $FileLoad = FileOpenDialog('Load Auto-Login settings from...', '::{450D8FBA-AD25-11D0-98A8-0800361B1103}', '(Auto-Login.ini)|(*.ini)', 3, 'Auto-Login.ini') If Not @error = 1 Then $ReadSection = IniReadSection($FileLoad, 'Settings') For $i = 1 To 12 GUICtrlSetData($input[$i], $ReadSection[$i][1]) Next $SettingsPath[0] = $FileLoad EndIf WinSetOnTop("Auto-Login- By Jag3xm4n", "", 1) EndFunc ;==>Load Func StartupLoad() ;On startup load settings from ini if it exists into the input boxes. Default the ini will be loaded from script directory when started If FileExists(@ScriptDir & '\Auto-Login.ini') Then $ReadSection = IniReadSection(@ScriptDir & '\Auto-Login.ini', 'Settings') For $i = 1 To 12 GUICtrlSetData($input[$i], $ReadSection[$i][1]) Next EndIf EndFunc ;==>StartupLoad Func About() ; Other File Menu About function WinSetOnTop("Auto-Login- By Jag3xm4n", "", 0) MsgBox(64, 'About Auto-Login', 'Made for runescape' & @CRLF & 'this little basic program will log you in when u press F1' & _ @CRLF & 'For more information... Go to www.j4g3xm4n') WinSetOnTop("Auto-Login- By Jag3xm4n", "", 1) EndFunc ;==>About Func Version() ; Other File Menu Version function WinSetOnTop("Auto-Login- By J4g3xm4n", "", 0) MsgBox(64, 'Auto-Login Version', 'V.1.00 ') WinSetOnTop("Auto-Login- By J4g3xm4n", "", 1) EndFunc ;==>Version Func Close() ; This is the function called from GUISetOnEvent to exit. Exit EndFunc ;==>Close EDIT: this is made from one of my Old scripts( the auto talker one) Edited May 10, 2007 by SalazarCheats Ok im 14 with a spelling age of a 9 year old... that explanes all my spelling mistakes Link to comment Share on other sites More sharing options...
AITEE Posted August 31, 2007 Share Posted August 31, 2007 Umm the first thing i noticed right off the bat is for the Ctrl + Shift + z, the code for setting that as a hotkey is as follows: HotKeySet("^+z", "F1") fyi these are some commands that can be used in setting hotkeys or sending text with the Send() function. ^ Ctrl ! Alt + Shift # Win also btw if you want to learn, or get this accomplished, read the help file; it will explain everything. Wow, I just noticed how old this post is. I'm going to post anyway just for people searching. Link to comment Share on other sites More sharing options...
jphillips2 Posted September 17, 2007 Share Posted September 17, 2007 Umm the first thing i noticed right off the bat is for the Ctrl + Shift + z, the code for setting that as a hotkey is as follows:HotKeySet("^+z", "F1")fyi these are some commands that can be used in setting hotkeys or sending text with the Send() function.^ Ctrl ! Alt + Shift # Winalso btw if you want to learn, or get this accomplished, read the help file; it will explain everything.Wow, I just noticed how old this post is.I'm going to post anyway just for people searching.I am having the same problem. When i assign HotKeySet("^+z", "F1") it locks the keyboard in either alt, shift, or ctrl. Can anyone help????????? Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 18, 2007 Share Posted September 18, 2007 I am having the same problem. When i assign HotKeySet("^+z", "F1") it locks the keyboard in either alt, shift, or ctrl. Can anyone help????????? The second parameter in HotKeySet is a declared function name to handle the event, not another key to send. From the much under-used help file: HotKeySet -------------------------------------------------------------------------------- Sets a hotkey that calls a user function. HotKeySet ( "key" [, "function"] ) Parameters key = The key combination to use as the hotkey. Same format as Send(). function [optional] = The name of the function to call when the key is pressed. Leave blank to unset a previous hotkey. If you want to send F1 with ctrl-shift-z, it will look like this: HotKeySet("^+z", "_F1") While 1 Sleep(20) WEnd Func _F1() Send("{F1}") EndFunc ;==>_F1 Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
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