hi guys,
this is the first time i register a forum and ask for help, but i cant find anything usefull on the internet or forums that can help me do something like what i need :\
hopefully i'm not posting this on the wrong section too

i play a game were to pick up stuff u can press Z key, what i wanna do is a "bot" that auto picks my stuff (dont wanna download hacks from sites and i though this was easy to do u.u )

i made a program to spam Z but i cannot make it work when minimized

What i am trying to do is:
-When pressed F7 it starts the program (cant get it to work with F7, i had to add a button, so maybe another key)
-Random *V1 from (40-60)/100 (EXEMPLE: V1=55/100= 0,55)
-Use the value of *V1 to press Z after 0,55 secs
-REPEAT untill F7 pressed

its that easy BUT i cant get it to work when i minimize the program :\ i can get it to spam Z on a Box but it doesnt work with milliseconds nor on other programs, when i minimize it stops.

PS:i wanna randomize the time to make it untraceble to GM's, if its 100% of the times 0,50 sec is obvious that i have a aid program x)
Any ideas? is this possible using VB?