FBMW++

By Pea Cracker Last update Feb 24, 2009 — Installed 39,024 times.

Auto Skill Update Required

in
Subscribe to Auto Skill Update Required 3 posts, 2 voices



lala52 User

Hi PC, thanks for the good job done helping us with your code. One lacking feature is Autoskill update, required when you are not too much in front of your comp. like vacations! Give this one also to us PC!

 
Keleas User

What's the priority in this? It's not like the script will be running for weeks without hitting a captcha. You wouldn't exactly get a dozen levels before you run into a captcha. =S

 
lala52 User

The question is not of any priority, it is just one more function that can be easily implemented and taken care of.
The code is also given below, just that it would be better if PC himself who has done such a good job would take it with the rest of the automation. Afterall automation is what PC is doing so well.

The function after adding in module 'skill'

function skill_exec(){
var levelUp = false;
delete boss.actions.skill;
if (boss.preferences.skill == 'none') return;
if (boss.new_level)
levelUp = true;
else {
if ( boss.preferences.job == 'none') return;
var header = document.getElementById('app8743457343_statusMenu');
var divs = Utils.getElementsByClassName('wrap3outer', header);
for (var i = 0; i < divs.length; i++) {
var str = divs[i].innerHTML;
str = str.replace(/,/g,'');
var re = /Level Up/;
var result = str.match(re);
if (result)
levelUp = true;
}
}
if (boss.preferences.skill == "recovery_max" && Page.c_page == 'boss'){
var header = document.getElementById('app8743457343_content');
var announcement = Utils.getElementsByClassName('announcement', header)[0].innerHTML;
announcement = announcement.replace(/,/g,'');
var result = announcement.match(/You have ?\$?([0-9]+)/);
var points = 0;
if (result)
points = parseInt(result[1]);
if (!(points >= 2))
levelUp = false;
}
if (levelUp) {
var action = new Object();
action.message = "Leveling up...";
action.page = 'boss';
action.func = 'skill_levelUp';
action.params = [];
action.time = 0;
boss.actions.skill = action;
} else {
var action = new Object();
action.message = "Waiting for next level up...";
action.page = 'boss';
action.time = boss.actions.jobs.time + 1;
boss.actions.skill = action;
}
}
function skill_levelUp(params, timer){
var obj = Utils.getElementsByXPath('//a[contains(@href, "type=' + boss.preferences.skill + '")]')[0];
var url = obj.href;
Timer.start(url, "Increasing skill...", 3);
}
function skill_preferencesInterface(prefs){
if (boss.preferences.skill == undefined) boss.preferences.skill = 'none';
var div = document.createElement('div');
div.innerHTML = '<label>Skill to automatically level up: </label>';
var select = document.createElement('select');
var option;
select.name = 'skillList';
option = '<option>None<option>Attack Strength<option>Defense Strength<option>Max Energy<option>Max Health<option>Stamina';
select.innerHTML = option;
div.appendChild(select);
prefs.form.insertBefore(div, prefs.button);
}
function skill_preferencesHandler(form, boss) {
var select = form.elements.namedItem('skillList');
if (boss.preferences.skill != select.options[select.selectedIndex].value) {
boss.preferences.skill = select.options[select.selectedIndex].value;
return true;
}
return false;
}

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel