Level 8
 
 
 
 
 
 
 
 
6
to level 9

StormLord

Random number generation is too important to be left to chance.
Overview Stats Wall Reviews About

« First ‹ Previous Replies 2061 - 2061 of 2061
StormLord wrote
at 5:04 PM, Wednesday February 3, 2010 EST
var autoEndTurnOnce;
var autoEndTurn;
var endTurnButton;
unsafeWindow.onload = stormBot;


function stormBot()
{
var parent = document.getElementById("iogc-FavoritePlayersPanel");

autoEndTurnOnce = checkbox("autoEndTurnOnce", "Auto End Turn (Once)", parent);
autoEndTurn = checkbox("autoEndTurn", "Auto End Turn", parent);

endTurnButton = getElementByClass("gwt-Button");
endTurnButton.addEventListener("DOMAttrModified", endTurnTriggered, false);
}

function endTurnTriggered()
{
if (endTurnButton.style.display != "none")
{
if (autoEndTurnOnce.checked)
{
autoEndTurnOnce.checked = false;
forceClick(endTurnButton);
}
else if (autoEndTurn.checked)
{
forceClick(endTurnButton);
}
}
}

function forceClick(target)
{
var oEvent = document.createEvent( "MouseEvents" );
oEvent.initMouseEvent("click", true, true,window, 1, 1, 1, 1, 1, false, false, false, false, 0, target);
target.dispatchEvent(oEvent);
}

function checkbox(name, str, parent)
{
var box = document.createElement("input");
box.setAttribute("type", "checkbox");
box.setAttribute("name", name);
box.setAttribute("value", "");
box.checked = false;
parent.appendChild(box);

var newCell = parent.appendChild(document.createElement("td"));
var txtCell = document.createTextNode(str);
newCell.appendChild(txtCell);

return box;
}

function getElementByClass(theClass)
{
var allHTMLTags = new Array();

//Create Array of All HTML Tags
var allHTMLTags = document.getElementsByTagName("*");
//Loop through all tags using a for loop
for (i=0; i<allHTMLTags.length; i++)
{
//Get all tags with the specified class name.
if (allHTMLTags[i].className==theClass)
{
return allHTMLTags[i];
}
}
}
XSketch - Pictionary Online
XSketch is a multiplayer word sketch game played in monthly competitions. It's like Pictionary. You sketch a picture with the goal of having other players guess your word and vice versa.
CREATED BY RYAN © 2006
RECOMMEND
GAMES
GPokr
Texas Holdem Poker
KDice
Online Strategy
XSketch
Online Pictionary