Witty RPG AutoCast

Add the following link to your favourites, or Drag to your bookmarks bar WittyRPG AutoCast

What is it?

It is a series of Javascript hooks that adds auto-casting into WittyRPG, it also has a loot logger that works while inactive.

The code is open source and basically consists of some horrible hacks and hooks into the existing WittyRPG layout.

This has been tested in Firefox 3.0.10 and Safari 4 and should work in any DOM 2.0 Complient Browser (eg Opera)

It has been tested, and shown not to work in Internet Explorer 7 or under, and likely does not work in IE 8

How does it work?

The WittyRPG AutoCaster works using a similar technology to Amazon's Favourites button, drag or add the link above to your favourites then when you are on the wittyRPG home page, click the button, this will open up the WittyRPG AutoCast console.

When the ACTIVE checkbox is checked, the auto-console will take control of the character you select. It will automatically go to the last location you were battling in and begin automatically killing enemies.

In the case of Warriors, it will ONLY use attack, in the case of Mages, it will use their most powerful spell (Except Egress) If their MP or HP reaches a low point, Egress will be used. This has failed a few times on special enemies (ones that either hit like a truck, or drain your MP) It will use Drain Life spells, however, this can lead to extended fights as Drain Life doesn't do much damage when the enemy is at low HP.

It is not perfect! It is not as efficient as doing it yourself

If you are worried about privacy issues, or are worried that this will include a keylogger of some sort, I have released the code at the end of the document.

Technical speak

If you're a not very technically minded you can skip this bit, as I'll be talking about the Javascript behind it.

The initial Javascript hook is a bookmarklet that embeds another javascript file (the one show at the end of the page)

That Javascript programme then erases the page, and adds it's own elements (the Console, Active checkbox and LootLog button) and adds an iFrame with the default wittyRPG page. Once there, it adds an onLoad event to the iFrame. Every time a page loads, it checks certain things (Player HP, MP, Stamina) and checks for the player state (In Combat, Looting or Free) which is determined by elements currently on the page (for Combat, the lack of "Adventure Again" anchor tag, combined with an H3 tag that contains the word "Combat" means you're in combat, Looting is the same as above, but the "Adventure Again" tag is present)

Very little of the page is IDed, making Javascript hooking more processor intensive, requiring the gathering of similar elements and looping through to find ones that match criteria, or using the dreaded getElementsByClassName() function (in the case of HP and MP) - one of the main reasons why this doesn't work in IE is the lack of native support for this, and the processor intensive custom functions just weren't worth it.

Help! It doesn't work!

If it doesn't work, are you using any of the following:

- Internet Explorer

- Firefox 2 or less

- Have Javascript Disabled

- Using any add-ons such as noScript

If it used to work, but isn't working any more, then it's likely I'm tinkering with the code. Normally however, I would be using a tinker-version rather than the release version to test any new features.

Code View: