GodForsakenSoul Posted April 14, 2008 Posted April 14, 2008 i'm trying to make a little script for a friend. here's the main idea: dim $loop=1 while $loop=1 if ???1 then send ("{MEDIA_NEXT}") elseif ???2 then send ("{MEDIA_PREV}") elseif ???3 then exit endif;i'm not sure why, but it does not bitch when i type it this way instead of putting endif after each thing =/ wend as you can see, i managed to nail all the things that are sort of easy... HOWEVER, i can't seem to make the following idea: if shift+n_is_pressed then send ("{MEDIA_NEXT}") endif i have no idea what i can do to make it work =/ also, while $loop=1 wend kind of thing is very cpu-consuming, however it's the only way i know to make the thing run untill i stop it. i would also love suggestions on the topic of how to make it run forever without eating 99% cpu.
monoceres Posted April 14, 2008 Posted April 14, 2008 There are two solutions: HotKeySet("+n","shiftn") while 1 Sleep(100) ; You sleep a loop to make it CPU friendly WEnd Func shiftn () send ("{MEDIA_NEXT}") EndFuncoÝ÷ Øêò¢çë¶¢YhÂ)à[a¢è!¶»-ÆÞ¶×«jëh×6#include <misc.au3> while 1 Sleep(100) ; Always sleep loops If _IsPressed("10") And _IsPressed("4E") Then send ("{MEDIA_NEXT}") EndIf WEnd Broken link? PM me and I'll send you the file!
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