//Based on the real helperscript, made by Anth42

//Only added automated click on green button

//Tickspeed Challenge Helper v2, this also works for normal runs

//Works on Firefox AND Chrome, tested it myself. Press F12 to open console and import it.

//Only press D and G for Boosts/Galaxies, if you dont have the Automatic DimBoosts/Galaxies at fast speed (<1 second)

//Press C at the end of your run, if you dont have the Automatic Big Crunch at fast speed (<10 seconds)

//It only works when you use scientific Notation, thanks to iiZach for telling me!

//Press 1 once after each shift/galaxy/boost.

//Make sure you use the "real" website: http://ivark.github.io/

//Use default Theme

var ids = [ '#tickSpeed' , '#firstMax' , '#secondMax' , '#thirdMax' , '#fourthMax' , '#fifthMax' , '#sixthMax' , '#seventhMax' , '#eightMax' ] ;

var increments = [ 1 , 3 , 4 , 5 , 6 , 8 , 10 , 12 , 15 ]

var to = setInterval ( testValues , 200 ) ;

function testValues ( ) {

var counts = ids. map ( function ( x ) {

var element = $ ( x ) ;

if ( ! element ) {

return - 1 ;

}

var parent = element. parent ( ) . parent ( ) ;

element. css ( 'background' , 'transparent' ) ;

var text = element. text ( ) ;

var index = text. lastIndexOf ( "e" ) ;

var cost = - 1 ;

if ( index !== - 1 && element. css ( 'visibility' ) !== 'hidden' && parent. css ( 'display' ) !== 'none' ) {

cost = parseInt ( text. substr ( index + 1 ) ) ;

}

return cost ;

} ) ;

var results = [ ] ;

var minCost = 9999 ;

var minI = 8 ;

for ( var i = 0 ; i < increments. length ; i ++ ) {

var countsClone = counts. slice ( ) ;

if ( countsClone [ i ] < 0 ) {

continue ;

}

countsClone [ i ] += increments [ i ] ;

if ( ! hasDuplicates ( countsClone ) ) {

var cost = countsClone [ i ] ;

if ( cost <= minCost ) {

minCost = cost ;

minI = i ;

}

results. push ( {

i : i ,

cost : cost

} ) ;

} else {

}

}

$ ( ids [ minI ] ) . css ( 'background' , 'green' ) ;

$ ( ids [ minI ] ) . css ( 'background' , 'green' ) . click ( ) ;

}

function hasDuplicates ( array ) {

array = array. filter ( function ( i ) {

return i >= 0 ;

} ) ;

return ( new Set ( array ) ) . size !== array. length ;