Splitz Posted January 24, 2012 Share Posted January 24, 2012 I have a script here i've been messing with, but i cant seem to figure out how to change how it works. Currently when i press the 1 key it will 'turn on' and then controlsend the '1' key multiple times to the comodo window and if i press 1 again it will simply shut off, but i want to change this. I would like: When i press the 1 key, i would like for it to make the first sound 'spam.wave' and trigger the script to be 'on'.. it will then await for the color 0x2E1700 to appear and then controlsend the 1 key to comodo window, after it has sent the 1 key ONE time, i want it to make the second 'beep' sound and the script will trigger its self 'off' until i press "1" again which will turn it back ON and it will wait for the color 0x2E1700 to appear Thanks =) Global $On HotKeySet("1", "on_off") While 1 Sleep(100) WEnd Func on_off() if Not $on Then SoundPlay("C:\Program Files (x86)\FeedDemon\Data\sounds\Spam.wav") ; On Else Beep(5500, 500) ; Off EndIf $On = Not $On While $On Sleep(100) PixelSearch(689, 767, 699, 777, 0x2E1700, 1) If Not @error Then ControlSend("Comodo", "", "", "1") Sleep(100) EndIf WEnd EndFunc Link to comment Share on other sites More sharing options...
Splitz Posted January 25, 2012 Author Share Posted January 25, 2012 bump Link to comment Share on other sites More sharing options...
Splitz Posted January 25, 2012 Author Share Posted January 25, 2012 bump Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 25, 2012 Moderators Share Posted January 25, 2012 Fenix`, Please wait at least 24hrs before bumping your own threads. Remember this is not a 24/7 support forum - those who answer are only here because they like helping others and have some time to spare. You just have to wait until someone who knows something about your particular problem, and is willing to help, comes online. Be patient and someone will answer eventually. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Blinky Posted January 25, 2012 Share Posted January 25, 2012 Try it this way: HotKeySet("1", "on_off") While 1 Sleep(100) WEnd Func on_off() Beep(2500, 500) ; On Sleep(100) While 1 PixelSearch(689, 767, 699, 777, 0x2e1700, 1) If Not @error Then ControlSend("Comodo", "", "", "1") Sleep(100) Beep(5500, 500) ; Off ExitLoop EndIf Sleep(100) WEnd EndFunc it was sending "1" because it was finding the color over and over again Link to comment Share on other sites More sharing options...
Blinky Posted January 25, 2012 Share Posted January 25, 2012 (edited) u could of asked me on the original thread since i gave u the on_off function Edited January 25, 2012 by Blinky Link to comment Share on other sites More sharing options...
Mikeman27294 Posted January 25, 2012 Share Posted January 25, 2012 Also, I hope this doesn't come out the wrong way, but the title you have given to this thread is not very descriptive and so many people will not click on it. People are on this forum because they need help with their script, ofcourse. A title that gives people an idea of the problem you are experiencing would be good. As an example, this particular thread should be called something along the lines of "Control Send Problem" or rather "Control Send Sending Repeatedly". Atleast then, people have an idea what the problem is before they go to check out the thread. Link to comment Share on other sites More sharing options...
Blinky Posted January 25, 2012 Share Posted January 25, 2012 u can alsow detect if a program is running or has started with these functions: WinExists ProcessExists search the help for usage Link to comment Share on other sites More sharing options...
Splitz Posted January 25, 2012 Author Share Posted January 25, 2012 Thanks Blinky youve helped me a bunch with this, i do have one last thing though Could you please add a function so that it can be turned 'off' if i hit 1 again before the color is detected? it works perfectly right now but i'd just like the option to press 1 and have it 'deactivate' as well So it would work like this: press 1, it turns on and waits for the color, sends 1 if the color is detected and shuts off just like it does now but if i press 1 a second time before it finds the color, it will shut off as if it detected the color and make the second beep as well pressing 1 at anytime after this will trigger it back on thanks =) Link to comment Share on other sites More sharing options...
Developers Jos Posted January 25, 2012 Developers Share Posted January 25, 2012 Want fries with that? jaberwacky 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Blinky Posted January 25, 2012 Share Posted January 25, 2012 Here it is Global $on=0 HotKeySet("1", "on_off") While 1 Sleep(100) WEnd Func on_off() if $on=0 Then SoundPlay("C:Program Files (x86)FeedDemonDatasoundsSpam.wav") ; On $on=1 Else Beep(5500, 500) ; Off $on=0 EndIf While $on=1 Sleep(100) PixelSearch(689, 767, 699, 777, 0x2E1700, 1) If Not @error Then ControlSend("Comodo", "", "", "1") Sleep(100) Beep(5500, 500) ; Off same sound $on=0 EndIf WEnd EndFunc If u whant to learn autoit i recomand the tutorials or at least the AutoIt help its very useful this is basic code and im sure there is a nother way to handle ur probblem 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