Jump to content
Sign in to follow this  
t1g3r

running a percentage of the time.

Recommended Posts

t1g3r

ok bit stuck here been searching the forum for half and hour now and cant seem to find what im looking for, heres my question and i hope someone can answer.

say for example i have a script running that is waiting for my internet browser to open, when the browser opens i want the script to close the browser by the cross in the top right 65% of the time and minimize the browser 35% of the time when it is detected. Is this possible and how would i script this. Thanks for any help.

Share this post


Link to post
Share on other sites
McGod

Local $sRand = Round(Random(0, 100))
If $sRand >= 65 Then
    MsgBox(1, "Part", "A")
ElseIf $sRand < 65 Then
    MsgBox(1, "Part", "B")
EndIf

Try that.

Share this post


Link to post
Share on other sites
Vindicator209

it gets a random number (1 - 100, representing the 100%) and ten it checks if it is greater then 65(35%), and if its not then its 65%... i know that explanation was a bit of a mouthful, but do you get it?


[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Share this post


Link to post
Share on other sites
t1g3r

your script is perfect.... but i asked member t1g3r to explain why to close or minimize a browser in this manner. i see no sense in it.

i just used an example of what im trying to achive, the information which was given works perfect thanks very much for the help.

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  

×