Jump to content
Sign in to follow this  

help looping script

Recommended Posts


i need help i have worked with visual basic before but am hveing trouble debuging my script. i am trying to run a program that by default has a menu. there is a function to hide the menu by pressing the escape key. so in my script when the program loades immeadiately the escape key is pressed to hide the menu. i next want the program to kill using the escape key by defauld the program escape function is alt+f4. i want this script to run in the backround all the time but i can only get it to work on the initial load of the program. if anyone could help that would be great. scrip is attached. p.s. the program i am tryring to run is snes9x a open source emulator for Linux/Unix, MacOS, and Windows.


func hidemenu()

WinWaitActive("Snes9X v1.43 for Windows")



$hotkey = "{esc}"

$hotkeyset = 0

While 1



Func esckill()

If $hotkeyset = 0 then

HotKeySet($hotkey, "killemu")

Elseif $hotkeyset = 1 then




Func killemu()

$hotkeyset = 1

WinKill("Snes9X v1.43 for Windows")


WinWaitClose("Snes9X v1.43 for Windows")

call hidemenu()

Edited by alhadrad

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.