6/23/15

Dungeons of Derp: Auto-Build Swapper Script/Code

blogger Hey there guys! If you've been playing Dungeons of Derp a lot, this JavaScript script will definitely be very useful to you. Don't worry, the Devs of DoD themselves allow these kinds of script, hence me posting it here for everyone to find.
First off, special thanks to Reddit users Ebonmourn and Melzidek for originally making this script/code. I'm not really good at making these kinds of stuff. Their original Reddit posts on these scripts can be found here(Ebonmourn) and here(Melzidek).

The code I'm about to post here is the script originally made by Melzidek, I've made a few changes to it because of the constant patches. I'll try to update this for as long as I can, so if you guys have anything better please share them with us!

Note: This post will be all about the code and its features, if you need help on where to enter this code, CLICK HERE
var updateBuild=function(){
var e=$.trim($(".vitals > .barHolder:last > .text").text().replace(/ \(.+\)/,"").replace(/[0-9]/g,"")),t=$.inArray (e,namespace.bot.itemref.ref.zoneOrder.order);
if(t>-1&&t!=window.last_loaded_build){
var i=jQuery.Event("keydown");
                     if      (t === 0){     gl.loadBuild(0);}
                     else if (t === 1){     gl.loadBuild(1);}
                     else if (t === 2){   gl.loadBuild(2);}
                     else if (t === 3){    gl.loadBuild(3);}
                     else if (t === 4){    gl.loadBuild(4);}
                     else if (t === 5){     gl.loadBuild(5);}
                     else if (t === 6){   gl.loadBuild(6);}
                     else if (t === 7){   gl.loadBuild(7);}
                     else if (t === 8){    gl.loadBuild(8);}
                     else if (t === 9){     gl.loadBuild(9);}
                     else if (t === 10){  gl.loadBuild(10);}
                     else if (t === 11){ gl.loadBuild(11);}
    }
window.last_loaded_build=t,$(".zone_index_helper").remove(),$(".vitals").after('<div class="zone_index_helper" style="position: absolute; left: 200px; top: 40px; font-size: 30px;">Build #'+t+"</div>")
                          };
gl.DirtyListener.on("zone:new",function(){window.updateBuild()});

 If new zones get added, add this line of code below the last "else if" statement.
else if (t === x){ gl.loadbuild(x);}
To make this as idiot-proof as possible, change X into the next counting number. The map arrangement is as follows:

  • 0 = Spooky Dungeon
  • 1 = Dark Forrest
  • 2 = Aggro Crag
  • 3 = Icy Tunnel
  • 4 = Hostile Marsh
  • 5 = Clockwork Ruins
  • 6 = Beginners Field
  • 7 = Gothic Castle
  • 8 = Decaying Temple
  • 9 = Lich Tower
  • 10 = Wicked Dream
  • 11 = Imperial Barracks
The "t === 0" at the else if statements of the code correspond to a map's arrangement in an array: 0 being the first in the cycle. If a new map gets added, simply place it at 12; if a new map is placed between currently existing maps, the whole order will change but a new number will always be added. For example, a new map gets placed between Gothic Castle and Decaying temple, maps 7 and below wouldn't change, the new map is placed at 8, and the map previously at 8 and above should be added by 1: Decaying Temple becomes 9, and so on. The map arrangement could always change so it's better knowing this now.

The "gl.loadbuild(0)" line corresponds to the build number that's going to be loaded when you first enter a map, where (0) is the build number in the build tab. Hint: the number is shown at the left of the load button and the default name when saving a build.
You will see all available build slots in your build tab(shown above), if there is no build saved, it will say "empty", save something and it will default to "Build #". You can change the name of your builds at the bottom-most part of the build tab.

You are only going to need Build 0 - 11 for this current version of the Build-swapper. Builds 0-9 can be saved with the Shift+(number) hotkey, but Builds 10 and onward requires you to go to Build tab directly and save it there--Fun, huh?

Also, to make things easier this code will also show the Build number you should save at, at the lower left side of the game screen, right between your vitals and skills. 


Build-Swapper Features Summary:

  • Automatically switches builds based on current map.
  • If you're experimenting on builds on a particular map, death will not load the current saved build for the map, Current loaded build will only change when you change maps completely: For example, going from Spooky Dungeon to Dark Forest will load your Dark Forest Build.
  • Build # for the map shown at the lower left side of the game screen(Image above)
  • Turns on Derp mode: which does absolutely nothing. Seriously what did you expect? Post says Auto-Build swapper, it swaps builds. DUH

If you need help on where to enter this code, Click here. Sorry, I chose to separate the posts for more views, and so you'd spend more time on my site. lol just kidding, I just didn't want to make this post too long. Seriously. I also wanted to post more images on the next post. Stop Judging me for my decisions!

1 comment :