HTML - Random And Timed Commands
Hello, I am trying to design a very simple HTML game, but there are some fundamental questions which I need to resolve before I know where I need to start.
I was wondering if its possible to use just HTML (running on an old computer (pentium 3 or 4) on linux) to execute commands like, loading up a random page, loading a page after a count down timer is up, loading a page when any key is pressed and being able to turn these commands on and off according to eachother.. You might be able to tell from this that I am not very experienced at all with this sort of thing.. an example: A web page is showing, the user presses any key, a random page is loaded, a countdown timer starts, the user either presses a specific key or the time runs out, the result is a new web page loading depending on the amount of time that has expired on the countdown timer, a new coundown timer starts, when it runs out the original start webpage is loaded and the loop can go on. I would really appreciate any help on this. Similar Tutorialsok right heres the deal, i have lots of links that i need clicking daily i use to have a site that i used for a game, the game was based on getting people to click your link, and what i did was got some code that loaded a pop up every 5 mins (this was the maximum time between clicks you were allowed) but i put many links in to click as i was a nice person and thought id help others i have found similar code and now for the life of me it wont work i know longer need it for the game, but its a similar concept, what appears to be happening is it skipping straight to pop up 2 and not loading any others Would you please read through and see whats wrong? Code: <script language="javascript"> <HEAD> <TITLE>The Official OutwarTricks.Com Thugbuilder Created By BMFSMOKE</TITLE> <META http-equiv=Content-Type content="text/html; charset=windows-1252"> </head> <BODY bgcolor="#000000"> <STYLE TYPE="text/css"><!-- body {scrollbar-face-color: #000000; scrollbar-shadow-color: #FFFFFF; scrollbar-highlight-color: #FFFFFF; scrollbar-3dlight-color: #000000; scrollbar-darkshadow-color: #000000; scrollbar-track-color: #000000; scrollbar-arrow-color: #FFFFFF; scrollbar-base-color: #FFFFFF;} --> //--></STYLE> <p align="center"><img src="bmfpic.jpg"> <CENTER> <P style="line-height: 100%"><font color="white"><b>This Is The Official OutwarTricks.Com Thugbuilder.</b></font></P> <p style="line-height: 100%"><font color="white"><b>Please Treat This As Any Other Thugbuilder Website, And Do Not Open Other Thugbuilders Or Click On Outwar Links Outside Of This Thugbuilder.</b></font></p> <P style="line-height: 100%"><font color="white"><b>To Be Added To The Thugbuilders Rotation Please Contact Me At The Following <div>Aim: <a href="aim:goim?screenname=OutwarChamp">OuTwArChAmP</a> - Outwar: <a href="http://outwar.com/sendmessage.php?name=BMFSMOKE">BMFSMOKE</a><BR></b></font></p> <P style="line-height: 100%"><font color="white"><b>NOTE: Pop-Up Blockers Must Be On Or You Will Not Be Credited With The Thugs You Deserve,</b></font></p> <P> <SCRIPT language=JavaScript> <!-- document.writeln("<form name='my_form' action=''><align=right><table border='1' bordercolor='#A5B3CA' bgcolor='#000000' cellpadding='5' cellspacing='0' width='150'><tr><td><center><font size='1' face='verdana'><input type='text' name='my_text' size='35'><br>Official OutwarTricks.Com ThugBuilder Created By: BMFSMOKE</tr></tr></font><br><font size='1' face='verdana' color='#000000'></font></a></font></center></tr></td></table></form>"); var the_minutes = [ " 2", " 1", " 0" ] ;// ** add/remove quoted numbers in this line to increase/decrease page reload time - currently set to begin at 5 minutes 01 seconds var the_seconds = [ "59", "58", "57", "56", "55", "54", "53", "52", "51", "50", "49", "48", "47", "46", "45", "44", "43", "42", "41", "40", "39", "38", "37", "36", "35", "34", "33", "32", "31", "30", "29", "28", "27", "26", "25", "24", "23", "22", "21", "20", "19", "18", "17", "16", "15", "14", "13", "12", "11", "10", "09", "08", "07", "06", "05", "04", "03", "02", "01", "00", "00", "00", "00", "00", "00" ]; var index = 0; var a = 0; var my_timer; function countDown(){ if (index <= the_seconds.length){window.document.my_form.my_text.value = the_minutes[a] + ":" + the_seconds[index] + " Minutes Remaining"; index++;}; if (index == the_seconds.length){a++; index = "0";}; if (a == the_minutes.length){window.location.reload()}; my_timer = setTimeout('countDown();', 1000)}; countDown(); //--> </SCRIPT> <SCRIPT language=JavaScript type=text/JavaScript> <!-- function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); //--> </SCRIPT> <BLOCKQUOTE> <SCRIPT> /// HERE IS WHERE YOU ADD NEW PLAYERS...Copy a string and replace the [#] and add the player's id after the x=. Leave the quotation mark./// var popunder=new Array() popunder[0]="http://www.google.com" popunder[1]="http://www.outwar.com" popunder[2]="http://www.bbc.com" popunder[3]="http://www.yahoo.com" var winfeatures="width=1000,height=800,scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1,status=1,directories=1" var once_per_session=0 ///No editing beyond here required///// function get_cookie(Name) { var search = Name + "=" var returnvalue = ""; if (document.cookie.length > 0) { offset = document.cookie.indexOf(search) if (offset != -1) { // if cookie exists offset += search.length // set index of beginning of value end = document.cookie.indexOf(";", offset); // set index of end of cookie value if (end == 400) end = document.cookie.length; returnvalue=unescape(document.cookie.substring(offset, end)) } } return returnvalue; } function loadornot(){ if (get_cookie('popunder')==''){ loadpopunder() document.cookie="popunder=yes" } } function loadpopunder(){ win2=window.open(popunder[Math.floor(Math.random()*(popunder.length))],"",winfeatures) win2.blur() window.focus() } if (once_per_session==0) loadpopunder() else loadornot() </SCRIPT> </CENTER> I'd like to create a link, which I can define, when it will activate. Is there any code, where I can define every one of the links activation day? Sorry, my English isn't very good... Hi. I'm new to web development, and since I didn't have any luck on google with this I thought I'd ask here. What I need is the ability to allow only one user to access my page at a time, with the access time tied to their account/password. This is not a general web page, and you already have to vpn to get to it so overall security isn't a big deal. The system allows remote control of a few simple machines, and currently if more than one person can get to it simultaneously the last access steals control. Anyway, heres an example: Joe's Time: 1:00 - 3:00 M, cannot login before 1:00 and auto-logout at 3:00 Tom's Time: 3:00 -5:00 M, Bob's Time, etc.. I suspect this might require Java or something, but I don't have the first clue where to start looking. Its a windows box btw, and I don't have control of the user machines so this has to be set up for my local directory. Any hints (or free code if this is a simple/stupid question) are appreciated. Is it possible to make pictures pop up in the corner of the same page when the music gets to a certain point? On myspace for example, when the embedded song gets to a certain time. hi, i have an image rotation code, but its working on switching the code on a timer, and i want it to appear randomly on the page load. anybody know how to change the code? i have the timer part of it below. thanks in advance. var interval = 1.5; // delay between rotating images (in seconds) var random_display = 1; // 0 = sequential, 1 = random interval *= 1000; I made this in my CSS-file: li { margin: 0em 0em 0em 4em; padding: 0px 0px 0px 0px; font-size: 9pt; } (This is for an element in a list) Then I made this: h3 { margin: 0; padding: 5px 0px 10px 0px; font-size: 10pt; } Now IE7 refuses to understand that I want to put the h3 margin to zero. It keeps using the li margin even though I programmed it like that. How is this possible? Everything works fine in Firefox with this code. Hi there, I have created a site that can be viewed at www.prestigeinteractive.com/legacy2 On this site I have utilized a basic two column design with both a header and a footer. You may need to look at the first page to know what i am talking about. Upon creating the site I wanted to make the athletes on the page extend beyond the borders of the site's wrapper. In order to do that and maintain reasonable filesizes, I opted to splice the images. I used a jpeg for the large part within the wrapper, and used a png in a absolute positioned div for the parts that are to extend beyond the site's wrapper/container (needed a transparent image to display the border and site's background properly). The friend I am making the site for asked if I could set it up so that there can be a number of images that randomly load when a user enters the home page. I am not sure it that is possible using the format I've implemented (2 images properly aligned). Can this be done? I've done it before with single images within a div tag, but not two that need specific coordinates to appear aligned correctly. If "yes this can be done", could someone kindly point me in the right direction to find a tutorial on this. If not, I'd appreciate knowing this as well, as I'll need to come up with an alternative plan. Thank you for your time, G Hello everyone. Sorry for appearing to be another person to register with "vitally important question" and then probably never be seen again, but I think I'll be using this site to learn as much as I can about HTML. Anyway, my question is about HTML, but not for a website. It's for an iPhone widget. I don't want to advertise for any other forums or anything, but there is currently a tweak in development that allows for windows phone 7 live tiles on an iPhone. They use HTML code and as you can tell, I'm not a coder. There is a slideshow widget available that displays a random picture from a set location. I'm very new to HTML, but I have figured out quite a bit by changing a value and having a look at what it did. There is one thing that has me completely stumped though and this is what I would like to know. In the following code, it has the [Math.floor(math.random() bit. I've tried to add a 1 in the brackets, I've tried changin the random to no and false, I've tried just removing the line and I still can't get it. <html> <head> <meta name="viewport" content="width=238, user-scalable=no" /> <script> window.onload = onLoad; var array = "101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124".sp lit("|"); function onLoad(){ document.getElementById("show").src = array[Math.floor(Math.random()*array.length)] + ".png"; setTimeout(onLoad,1*200); } </script> </head> <body> <img src = "overlay.png" style = "position:absolute;top:0px;left:0px;z-index:1;"/> <img id ="show" style="position:absolute;top:-0px;left:0px;width:238px" /> </body> </html> What I want is for it to cycle through all the images in order. Any help would be greatly appreciated. THanks. Hey there! Is it possible to have a random GIF file loaded each time you open the site? For example if you open the page now, an animated GIF will load to advertise x and when you go to the same page later, an ad will load to advertise y. Thanks in advance! I I have this code below, and i would like it to randomly place 2 X's in any of the boxes, and each time i refresh the page the X's could end up in any of them, any idea how to do it? Thanks Dr Ben HTML Code: <html> <head><title></title></head> <body> <form name="placeships" action="board.php" method="post"> <table> <tr> <td align="center" bgcolor="black"><input type="text" id="1" class="hide" name="1" value="" size="2"> </td> <td align="center" bgcolor="black"><input type="text" id="2" class="hide" name="2" value="" size="2"> </td> <td align="center" bgcolor="black"><input type="text" id="3" class="hide" name="3" value="" size="2"> </td> <td align="center" bgcolor="black"><input type="text" id="4" class="hide" name="4" value="" size="2"> </td> </tr> <tr> </tr> <input value="submit" name="submit" type="submit"> </form> </body> </html> on the mainpage of my site, i have a enter button, however I have 4 different sites. I want when you click enter, it brings you to 1 of the 4 at random each time... how would i go about that? thanksss. its much appreciated to whoever trys or can help. Say I have 10+ 468x60 banners I was wondering if there is anyway of having them show up randomly in one spot when you refresh the page. For example here is an ad I'm using: <script type="text/javascript" language="javascript" src="http://www.tkqlhce.com/placeholder-2762512?target=_blank&mouseover=N"></script> I know there is a way to random images but how do you randomize scripts? Hey all. Can anyone help? I want to make a feature of my site that if you follow a broken link or navigate to a page that doesnt exist, you will get one of 3 different 404 pages. My hosting allows for one catch - all error page, but I was wondering if theres a function in html that redirects immediately to aother page. Thanks in advance I tried using the search function, but I don't know if it's my browser or what but it won't finish loading the results page. Is there a way in HTML, to create a link that can go to two possible pages, but when you click it, it randomly goes to either one? Thanks, Jon How would i show a random image? When people come onto my site, i want the header to be random out of about, 6 different ones. When you refresh the page, it changes the image. (for more explaingin, ha) How would i go about doing this? Hello everyone! I have this client who has a lot of resellers, and all of them are on a list in his website, so that when customers look for someone to buy from, they can choose through his site. However, he is afraid that if the list is static, no one will bother to look beyond the first 2 or 3 names, and the ones in the bottom of the list will never be contacted. So, I need to create a method to display the resellers list in such a way that everytime one accesses the list, the order is changed at random, but always displaying all the names. The HTML code the names are arranged right now is a simple table with one reseller per TR tag. I don't work with MySQL, so the solution should be something else... PHP or Java preferred. Thanks in advance! I used this code here but it doesnt seem to work for GoogleChrome browser well, as it did for the others. Is there a code that will work for all the browsers? HTML Code: <html> <head> <script language="javascript"> function randomBackground() { var myImages = Array(); myImages[0] = 'xxx.jpg'; myImages[1] = 'xxx.jpg'; myRandomNumber = Math.floor(Math.random()*myImages.length); document.body.style.backgroundImage = 'URL('+myImages[myRandomNumber]+')'; } </script> <style type="text/css"> body { background-attachment: fixed; background-repeat: no-repeat; } </style> </head> <body onload="randomBackground();"></body> Hello, I'm sure the subject about random generators must have been asked a billion times before, but I can't seem to find an answer for my set up. Basically I have a style.css sheet which defines some images like this: #gallery .pic01 { background: url('images/gallery_images/pic_01.jpg') no-repeat; width: 205px Then in my html I have a list of these images like this <div id="gallery"> <ul> <li class="pic01"></li> <li class="pic02"></li> <li class="pic03"></li> </ul> What I'd like to do is have the pictures choosen randomly so that each time the page loads you get a different set of pictures. Is this possible. Please forgive me if this is easy peasy to do - I'm a real html thicky! Maybe someone here can shed some light on this for me. I am trying to create a site which displays 12 random questions from a pool of a few hundred. A visitor will come to the site, answer the questions and see the results, much like a poll but they will be randomly generated. I am lost as to where to start on this. I tried a poll type approach but that was not the answer. Those were fixed questions and the polls were powered by other sites. Anyone have ideas or tips on how I can start on this? I am an Admin for a PC gaming clan ( |ESF| ), and we have several game servers. Our goal is to have a random "server of the day" widget on the main page of the site. Here is what we need it to do: > Show the same server for all visitors to the page > Show the same server for a 24 hour period, say from 12am - 11:59pm > Have the code editable in case we change/add/remove a server I have some experience in Vb6 and Vb.Net, but not much HTML. I would assume the code would be something similar to: Dim SOTD As New String (Server of the Day) "Server List" Dim s1 As New String (Server 1) Dim s2 As New String (Server 2) Dim s3 As New String (Server 3) If TimeOfDay Is 12:00am Then Show SOTD(Random Server from List) Until TimeOfDay Is 11:59pm End If I know that isn't close to HTML, but it should help get the overall point across. Any help to get us closer to this goal is MUCH appreciated. If I wasn't specific enough with the above information, please let me know what else you need to know. It's very late and I'm super tired. Thank you in advance. |