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.")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.")EndFunc ;==>_OpenHotKeySet( "{F2}", "_Open")While 1WendFunc _Open () send("Yes f2 wrote this.")EndFunc ;==>_OpenCould someone please tell me what I'm doing wrong? Link to comment Share on other sites More sharing options...
Richard Robertson Posted March 30, 2006 Share Posted March 30, 2006 You mentioned this is another section, I thought you were asking there. And stop with the large fonts. Anyways, you are getting exactly the error you should be getting. You are putting "Func _Open" twice. You can't have 2 functions with the same name in the same file. Link to comment Share on other sites More sharing options...
coolness Posted March 30, 2006 Author Share Posted March 30, 2006 do you know how, I can get it to work, to where it will allow multiple hotkey functions, under one. script? Link to comment Share on other sites More sharing options...
greenmachine Posted March 30, 2006 Share Posted March 30, 2006 do you know how, I can get it to work, to where it will allow multiple hotkey functions, under one. script?Write. a full. sentence, using, proper grammar?Tell the second hotkey to go to a different function. Like IceKirby said, it doesn't have anything to do with you calling it twice or using different hotkeys to call it, the reason it isn't working is because you have two declarations of Func _Open(). Call one _Open2() and you'll be fine.Next time post support questions in the support forum. This is the Scripts and Scraps forum, a place for posting complete programs. Link to comment Share on other sites More sharing options...
Uten Posted March 30, 2006 Share Posted March 30, 2006 Write. a full. sentence, using, proper grammar?Easy for a person living the language! Please reply in a neutral language, Esperanto. (hmm, not that I speak it ) Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
ConsultingJoe Posted March 30, 2006 Share Posted March 30, 2006 (edited) Comon guys hes a nooby. its not his fault he was just born that way. lol it should look like this: Opt("SendKeyDelay", 0);speed run("notepad.exe") HotKeySet( "{F1}", "_Open") HotKeySet( "{F2}", "_Open2") While 1 Wend Func _Open () send("Yes f1 wrote this." ) EndFunc;==>_Open Func _Open2 () send("Yes f2 wrote this.") EndFunc;==>_Open2 That's it Edited March 30, 2006 by zerocool60544 [center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center] Link to comment Share on other sites More sharing options...
coolness Posted March 30, 2006 Author Share Posted March 30, 2006 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...
ConsultingJoe Posted March 30, 2006 Share Posted March 30, 2006 use {ctrl}{f1} or ^{f1} READ YOUR HELP FILE [center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center] Link to comment Share on other sites More sharing options...
coolness Posted March 30, 2006 Author Share Posted March 30, 2006 That worked for Ctrl, just need to find out alt, thanks zerocool. Link to comment Share on other sites More sharing options...
greenmachine Posted March 30, 2006 Share Posted March 30, 2006 Read your helpfile and stop repeating questions. Link to comment Share on other sites More sharing options...
nfwu Posted March 30, 2006 Share Posted March 30, 2006 This should go into help & support... TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
Apzo Posted March 30, 2006 Share Posted March 30, 2006 This is a very bad way to write a program. A basic skeletton would be : HotKeySet("{F1}", "_yourfunc") HotKeySet("{F2}", "_yourfunc") HotKeySet("{F2}", "_yourfunc") .... While 1 WEnd Func _yourfunc() Switch @HotKeyPressed Case "{F1}" Send("F1 pressed") Case "{F2}" Send("F2 pressed") Case "{F3}" Send("F3 pressed") EndSwitch EndFunc I wrote it just here, not tested, but it should work with few debug. Apzo All the pop3 functions.Rsync your files on your USB key (or anywhere else) 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