coolness Posted March 30, 2006 Share Posted March 30, 2006 Here is the script that I do have. it will allow me to choose one hotkey to auto write one message. but when I try to duplicate that sectoin of code, and change [f1} to {F2} in the secound string, it says its a duplicate funtion. please help, if you can.run("notepad.exe")HotKeySet( "{F1}", "_Open")While 1WendFunc _Open ()send("Yes f1 wrote this.")send("{enter}")EndFunc ;==>_Openthat script works just fine.this one doesn't work.run("notepad.exe")HotKeySet( "{F1}", "_Open")While 1WendFunc _Open ()send("Yes f1 wrote this.")send("{enter}")EndFunc ;==>_OpenHotKeySet( "{F2}", "_Open")While 1WendFunc _Open ()send("Yes f2 wrote this.")send("{enter}")EndFunc ;==>_OpenCould someone please tell me what I'm doing wrong? Link to comment Share on other sites More sharing options...
viking Posted March 30, 2006 Share Posted March 30, 2006 (edited) You only need one _Open function, you have 3 . Wops, sorry.. well i'll correct your script: HotKeySet( "{F1}", "_Open1") HotKeySet( "{F2}", "_Open2") run("notepad.exe") Func _Open1() send("Yes f1 wrote this.") send("{enter}") EndFunc;==>_Open Func _Open2() send("Yes f2 wrote this.") send("{enter}") EndFunc;==>_Open While 1 Sleep(200) WEnd Edited March 30, 2006 by viking Link to comment Share on other sites More sharing options...
cdkid Posted March 30, 2006 Share Posted March 30, 2006 Mind using the normal forum font? anyway, to answer your question: run("notepad.exe") HotKeySet( "{F1}", "_Open1") HotKeySet( "{F2}", "_Open") While 1 sleep(10000) Wend Func _Open () send("Yes f2 wrote this.") send("{enter}") EndFunc;==>_Open Func _Open1 () send("Yes f1 wrote this.") send("{enter}") EndFunc;==>_Open ~cdkid AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide! Link to comment Share on other sites More sharing options...
coolness Posted March 30, 2006 Author Share Posted March 30, 2006 Thanks cd, it worked. Do you know what I would add to the script, to end on Esc hotkey? Link to comment Share on other sites More sharing options...
viking Posted March 30, 2006 Share Posted March 30, 2006 HotKeySet("{ESC}", "Terminate") Func Terminate() Exit EndFunc Simple as that ;-) Link to comment Share on other sites More sharing options...
coolness Posted March 30, 2006 Author Share Posted March 30, 2006 Thanks viking. I had to change func name, but it worked great. I mentioned earlyer about being able to run multiple hotkeys. I can run f1-f12 as hotkeys. However I would like to add a ctrl+whatever alt+whatever, as hotkeys too. example ctrl+q or ctrl+qw Or Alt+Q or Ctrl+QW. could someone tell me how to add that to the script? Link to comment Share on other sites More sharing options...
greenmachine Posted March 30, 2006 Share Posted March 30, 2006 Look in the helpfile under Send. Link to comment Share on other sites More sharing options...
Bert Posted March 30, 2006 Share Posted March 30, 2006 look here for how to setup hotsetkeys with winactive. This may be more of help to you. http://www.autoitscript.com/forum/index.php?showtopic=23586 The Vollatran project My blog: http://www.vollysinterestingshit.com/ 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