Overclockers Australia Forums

OCAU News - Wiki - QuickLinks - Pix - Sponsors  

Go Back   Overclockers Australia Forums > Software Topics > Programming & Software Development

Notices


Sign up for a free OCAU account and this ad will go away!
Search our forums with Google:
Reply
 
Thread Tools
Old 2nd August 2007, 11:05 PM   #1
NanoDuke Thread Starter
Member
 
NanoDuke's Avatar
 
Join Date: Feb 2007
Location: Sydney 2043
Posts: 4,985
Default Generating random numbers in a batch file

Greetings.

I have absolutely NO knowledge of programming - except for creating VERY simple .bat files to load programs and websites.


What I want to do, is create a little program to launch a URL with a randomly generated number in it.

eg www.mysite.com.au/images/image1.jpg
www.mysite.com.au/images/image2.jpg
www.mysite.com.au/images/image44.jpg
www.mysite.com.au/images/image65.jpg
www.mysite.com.au/images/imageXX.jpg

I'd like it to run www.mysite.com.au/images/imageXX.jpg, then wait a set amount of time, then launch again, but with a different number in XX.

I've found this link that uses the clock to pick a pseudo random number, but is it possible to have a command that randomly picks from a list of options?


Any help would be appreciated.
__________________
Horize P170EM Laptop - i7-3630QM 2.4Ghz - 16GB DDR3 1600Mhz - 17.3-inch FHD LED 72% GAMUT MATTE - AMD RADEON HD7970M 2.0GB GDDR5
NanoDuke is offline   Reply With Quote

Join OCAU to remove this ad!
Old 2nd August 2007, 11:22 PM   #2
RHCP
Member
 
RHCP's Avatar
 
Join Date: Mar 2003
Location: Earth 148K BC
Posts: 554
Default

From the sounds of it you don't actually want a random number generator.

You could use a few variables and start with a user defined number, and each time the script repeats, it adds 1 (+1) to that number.
This wouldn't be too hard.

RHCP.
RHCP is offline   Reply With Quote
Old 3rd August 2007, 9:00 AM   #3
Silenius
Member
 
Silenius's Avatar
 
Join Date: May 2002
Posts: 655
Default

Google it first

http://www.google.com.au/search?hl=e...m+number&meta=

There's an example in the first result!

I'd suggest using a real programming language, though, if you want the number to be properly random.
Silenius is offline   Reply With Quote
Reply

Bookmarks

Sign up for a free OCAU account and this ad will go away!

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +10. The time now is 7:24 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. -
OCAU is not responsible for the content of individual messages posted by others.
Other content copyright Overclockers Australia.
OCAU is hosted by Internode!