Try this and see if it works for you. You're not using the timer, you'd be using Alterable Values.
- Create an active object called "web page timer."
- Create an event that reads:
IF At Start of a given frame
THEN set Alterable Value A[web page timer] to random((60)+61)
- Create an event that reads:
IF Always
THEN Add 1 to Alterable Value B ["web page timer"]
- Another event:
IF Alterable Value A ["web page timer"] = Alterable Value B ["web page timer"]
THEN Stop loading web page
If it seems to work, then increase the numbers by as much as you want to find an appropriate time to stop loading the web page. Adding zeroes to the end of the numbers in the "Start of Frame" step would likely set things between 1 and 2 minutes. Keep it short until testing works.
Originally Posted by s-m-r Try this and see if it works for you. You're not using the timer, you'd be using Alterable Values.
- Create an active object called "web page timer."
- Create an event that reads:
IF At Start of a given frame
THEN set Alterable Value A[web page timer] to random((60)+61)
- Create an event that reads:
IF Always
THEN Add 1 to Alterable Value B ["web page timer"]
- Another event:
IF Alterable Value A ["web page timer"] = Alterable Value B ["web page timer"]
THEN Stop loading web page
If it seems to work, then increase the numbers by as much as you want to find an appropriate time to stop loading the web page. Adding zeroes to the end of the numbers in the "Start of Frame" step would likely set things between 1 and 2 minutes. Keep it short until testing works.
Thank you sir. its working. Thank you so much...But I need little more help...
meanwhile I was trying another way to do it so that I dont need to create program every time I want to change the timeout.
So this is what I did :-
I added "Numeric Up-Down Control" object 2 times and active object called "web page timer." like you said.
Numeric Up-Down Control and Numeric Up-Down Control 2
then I set default numeric value in Numeric Up-Down Control 60 and Numeric Up-Down Control 2 - 120
then I set Alterable Value Z ["web page timer"] = Random(Value( "Numeric Up-Down Control" )+Value( "Numeric Up-Down Control 2" ))
Problem I am facing is, random time is taking from 0 to 60 I guess? Because webpage sometimes is getting stopped from loading within 3 second , sometimes after 15 seconds , sometimes after 6 seconds... So I guess its not taking random time between 60 to 120 seconds. Its taking from 0 to 60 or 120 I guess ! How do I make it take value between 60 to 120?
Well, try changing your values to a range of 600 to 1200. I think each tick of the internal clock (as opposed to the Timer) is one millisecond or something.
I've never used the Numeric Up-Down Control Object, so I really can't help much with that.
Originally Posted by s-m-r Well, try changing your values to a range of 600 to 1200. I think each tick of the internal clock (as opposed to the Timer) is one millisecond or something.
I've never used the Numeric Up-Down Control Object, so I really can't help much with that.
ok. No problem. Can you please tell me how do I set random number between 60 to 120 ?
when I am setting Random((60)+120), sometimes it is taking random number 52 or 40 ...I mean its taking below 60. I want to it to take a value between 60 to 120 !
You've got the parentheses wrong there. Random((60)+120) is the same as Random(180), which is why you're still getting low values. What you want is (Random(60)+120).
Also, if you want to be precise with your timing, there are 50 frames per second by default. So a value of 50 would give you a 1-second delay. If you work out about how many seconds you want, just multiply that number by 50 and you should be good.
Originally Posted by Fifth You've got the parentheses wrong there. Random((60)+120) is the same as Random(180), which is why you're still getting low values. What you want is (Random(60)+120).
Also, if you want to be precise with your timing, there are 50 frames per second by default. So a value of 50 would give you a 1-second delay. If you work out about how many seconds you want, just multiply that number by 50 and you should be good.
LOL...yes...I was. I was getting confused.Thank you so for your reply.