Help A noobie Please


Hi guys,

I've been trying to figure something out for the past 2 hours without any luck.

What i'm trying to achieve is this page

http://www.heresy-online.net/forums/misc.php?do=page&template=chapters

I have the two field filling in randomly on a click but i'd like to duplicate the boxes. All attempts at doing it so far have failed.

Could done of you be as kind as to give me some advice on how I would achieve this with the following code?

[code]



function chapter() {
phrase1 = new
Array("Adroit","Alpha","Amethyst","Arcane","Arctic","Astral","Atomic","Azure","Battle","Black","Bleeding","Blood","Blue","Brawling","Brazen","Burning","Crimson","Crowned","Cryptic","Dancing","Dark","Deadly","Death","Delta","Desert","Desolation","Diamond","Divine","Doom","Emerald","Emperors","Fighting","Fire","Flaming","Flying","Frenzied","Furious","Glorious","Golden","Gore","Grail","Green","Grey","Horned","Howling","Ice","Imperial","Infernal","Iron","Light","Majestic","Maleficent","Malevolent","Meteoric","Nova","Omega","Orange","Ozone","Penitent","Polar","Psi","Purple","Raging","Regal","Royal","Rainbow","Ravening","Red","Repentant","Righteous","Ruby","Sabre","Sanguine","Sapphire","Savage","Screaming","Screeching","Shrieking","Shadow","Siege","Silent","Silver","Skulking","Snapping","Snarling","Space","Star","Stealth","Storm","Striking","Thunder","Topaz","Tundra","Vermilion","Vigilant","Vitriolic","Ultra","Umbrageous","War","White","Wicked","Wild","Word","Zeta");

phrase2 = new
Array("Acolytes","Adders","Amazons","Angels","Archangels","Avengers","Bandits","Barracudas","Blades","Bringers","Brothers","Brotherhood","Bulls","Cats","Champions","Chameleons","Claws","Cobras","Company","Consuls","Corsairs","Crusaders","Defenders","Destroyers","Devils","Dogs","Dragons","Eagles","Eaters","Enforcers","Exterminators","Falcons","Fists","Foxes","Gators","Giants","Golems","Gorillas","Griffons","Guard","Guardians","Hands","Hawks","Heralds","Hornets","Hounds","Hunters","Inculpators","Jaguars","Justicars","Knights","Krakens","Lamenters","Lions","Liberators","Lords","Marauders","Martyrs","Marines","Medusas","Mentors","Monitors","Owls","Paladins","Panthers","Patriarchs","Phantoms","Predators","Purgators","Raiders","Rampagers","Raptors","Ravens","Redeemers","Revilers","Saints","Saviours","Salamanders","Scars","Scions","Scorpions","Scythes","Sentinels","Shades","Shadow","Sharks","Sisters","Skulls","Sons","Spectres","Spires","Slayers","Stalkers","Swords","Talons","Templars","Tigers","Vindicators","Vipers","Vultures","Wargeeks","Warriors","Wasps","Wizards","Wolves","Wyverns");
//rand() returns in range 1-n, subtract 1 for array index

rand1=rand(phrase1.length)-1;
rand2=rand(phrase2.length)-1;

msg=""+phrase1[rand1] + " " + phrase2[rand2];
document.chapter_names.message.value=msg;

}

function chapters() {
phrase3 = new
Array("Acolytes","Advocates","Angels","Apostles","Blades","Brotherhood","Brothers","Children","Emissaries","Fists","Hands","Harbingers","Heralds","Heroes","Hounds","Knights","Legion","Lions","Lords","Martyrs","Order","Patriarchs","Protectors","Prophets","Scions","Scythes","Serpents","Sons","Swords","Templars","Titans","Warriors","Ghosts","Guardians","Wolves","Lords","Claws","Champions","Paladins","Scars");
phrase4 = new
Array("Zeal","Doom","Absolution","Annihilation","Damnation","Darkness","Death","Desolution","Despair","Fire","Flame","Glory","Justice","Iron","Purgatory","Purity","Redemption","Retribution","Vengeance","Requital","Ruin","The Hallowed Throne","Vigilance","Deliverance","Battle","War","Steel","The Midnight Sun","Anguish","Havok","Virtue","Anubis","Purgatos","The Red Moon","The Emperor","Pytho","Terra","Silver","The Damned","Perdition","The Emperor's Wrath","Ultramar","Alyx","Arden","Light","Valour","The Argent Fist","The Blooded Moon","Bronze","Primus","Liberation","The Black Dawn","The Bleeding Throne","The Dark Storm","The Lost","The Phoenix","The Thorn","The Emperor's Vengeance","Tyran","Sorrow","Caliban");
//rand() returns in range 1-n, subtract 1 for array index

rand3=rand(phrase3.length)-1;
rand4=rand(phrase4.length)-1;

msg=""+phrase3[rand3] + " Of " + phrase4[rand4];
document.chapter_names2.messages.value=msg;

}



SPACE MARINE RANDOM CHAPTER NAME GENERATOR

Click the button to generate 4 new Space Marine Chapter names.















 

[/code]

Kindest Regards,

Lee

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories