
// Upgrade Simulator of MybruteCheats
// version 0.1 BETA
// Copyright (c) 2010, Mateusz Grzesiukiewicz
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
//
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script.  To install it, you need
// Greasemonkey 0.3 or later: http://greasemonkey.mozdev.org/
// Then restart Firefox and revisit this script.
// Under Tools, there will be a new menu item to "Install User Script".
// Accept the default configuration and install.
//
// --------------------------------------------------------------------
//
// ==UserScript==
// @name          MybruteCheats Simulator upgrade
// @namespace     http://www.ajdija.com
// @description   Script upgrading Mybrute Cheats simulator to work with seeds.
// @include       http://www.mybrutecheats.com/simulator/*
// ==/UserScript==

window.newseed = function() { var TestVar = document.getElementsByName("inputbox")[0].value;
alert ("You typed: " + TestVar); 

 event.stopPropagation();
    event.preventDefault();
}


function newsubmit() { 
	var seed = prompt("Send seed","1");
	if (seed!=null && seed!="")
  {
  
  /* ************ Creating simulator parameters *********** */
  var box = document.getElementsByName("FlashVars")[0].value;

var newbox = box.replace(/seedi/, "seedi0"+seed);



/* ************ Show simulator *********** */

  var logo = document.createElement("div");
logo.innerHTML = '<div style="margin: 0 auto 0 auto; ' +
    'border-bottom: 1px solid #000000; margin-bottom: 5px; ' +
    'font-size: small; background-color: #000000; ' +
    'color: #ffffff;"><p style="margin: 2px 0 1px 0;"> ' +
    'Current Seed: ' + seed +

	'<FORM NAME="myform" METHOD="GET">Enter new seed: '+'<BR>'+
	'<INPUT TYPE="text" NAME="inputbox" VALUE=""><P>'+
	'<input type="button" Value="Change seed!" value="Change seed"/>'+
	'</form>'+
    '</p></div>'+
	'<div id="simulator">'+
	'<object type="application/x-shockwave-flash" data="simulator.swf?v=3" height="300" width="500">'+
'<param name="movie" value="simulator.swf?v=3">'+
'<param name="FlashVars" value="'+newbox+'">'+
'<param name="wmode" value="transparent">'+
'</object>'+
'</div>';

document.body.insertBefore(logo, document.body.firstChild);

window.addEventListener('change', newsubmit, true);
document.getElementById('container').innerHTML = '';



  }

}
document.form.onclick = newsubmit()




