Pages: 12
You are viewing a post by dracoknight09. View all 23 posts in [b]Original Code:[/b] Javascript.internet.com [b] Credits:[/b] Me.. :eh: :thumbsup: [b]Acknowledgments:[/b] Team DiabolicDuchShiKnights2008 :thunder: ok this code simply redirects you in a rand.
[b]ok.. as usual... this goes outside the loader.. [/b](i always use this format)
[quote]//Random Button
var Lucky = new Array();
var FeelLuckyCookieName = "FeelLuckyCookie";
var NewWindow = "y";
Lucky[0] = "[b]URL[/b]";
Lucky[1] = "[b]URL[/b]";
Lucky[2] = "[b]URL[/b]";
Lucky[3] = "[b]URL[/b]";
var TabChar = String.fromCharCode(9);
var CurrentCookie = '';
function GetLuckyCookie() {
var cookiecontent = '';
if(document.cookie.length > 0) {
var cookiename = FeelLuckyCookieName + '=';
var cookiebegin = document.cookie.indexOf(cookiename);
var cookieend = 0;
if(cookiebegin > -1) {
cookiebegin += cookiename.length;
cookieend = document.cookie.indexOf(";",cookiebegin);
if(cookieend < cookiebegin) { cookieend = document.cookie.length; }
cookiecontent = document.cookie.substring(cookiebegin,cookieend);
}
}
return cookiecontent;
}
function PutLuckyCookie(value) {
if(CurrentCookie.length > 0) { value = CurrentCookie + TabChar + value; }
value = escape(value);
document.cookie = FeelLuckyCookieName + "=" + value;
}
function YesMakeMeLucky() {
CurrentCookie = GetLuckyCookie();
CurrentCookie = unescape(CurrentCookie);
if(CurrentCookie == '.') { CurrentCookie = ''; }
var LuckyVisitedList = CurrentCookie.split(TabChar);
if(LuckyVisitedList.length >= Lucky.length) {
document.cookie = FeelLuckyCookieName + "=.";
CurrentCookie = '';
LuckyVisitedList = Array();
}
for(var i = 0; i < LuckyVisitedList.length; i++) { Lucky[LuckyVisitedList[i]] = ''; }
var LuckyL = new Array();
for(var i = 0; i < Lucky.length; i++) {
if(Lucky[i].length > 0) { LuckyL.push('' + i + TabChar + Lucky[i]); }
}
var LuckyDestinationNumber = 0;
if(LuckyL.length > 1) { LuckyDestinationNumber = Math.ceil((Math.random() * LuckyL.length) - 1); }
var LuckyNumberPlace = new Array();
LuckyNumberPlace = LuckyL[LuckyDestinationNumber].split(TabChar);
PutLuckyCookie(LuckyNumberPlace[0]);
NewWindow = NewWindow.toLowerCase();
if(NewWindow.substr(0,1) == "y") { window.open(LuckyNumberPlace[1]); }
else { document.location = LuckyNumberPlace[1]; }
}[/quote]
you can repeat this line to add more links:
[quote]Lucky[4] = "[b]URL[/b]";[/quote]
just change the number..
then use this HTML code to be inserted anywhere in a replacement/addbox code..