It should be kinda easy to use this script with multiple accounts/chars
The problem is that you usually only have 1 session therefore you can only be logged in 1 acc/char
With that addon you can use multiple sessions with firefox, therefore you can be logged in and bot multiple characters/accounts
enjoy
Multifox - Different logins at the same time
It would be good to see this script changed so that tasks are performed in order (if available) rather than randomly selected from the list.
The reason for this suggestion ? Alchemy.
If we can build a list of tasks and the script takes the first task if available , second task if first not available etc etc then we could build a list of tasks to level alchemy efficiently![]()
Updated to include Alchemy
(function($){
"use strict";
var _private = {};
var _public = {};
_private.timers = {
status:null
};
_private.use_optional_assets = true;
_private.locale = {
_continue: 'Continue',
start:'Start Task'
};
_private.professions = {
to_do: ['leadership', 'leatherworking', 'tailoring', 'leatherworking', 'mailsmithing', 'platesmithing', 'alchemy'],
//to_do: [ 'alchemy'],
tasks: {
// level <5
// leadership: ['Feed', 'Guard', 'Scout', 'Protect', 'Explore'],
// Guards (lv7+)
//'Seek Out Maps', 'Follow Map to Treasure Cache',
// leadership: ['Assemble Maps', 'Protect Caravan', 'Explore Local', 'Chart Region']
// Footmen (lv14+)
// leadership: ['Rescue Prisoners', 'Deliver Metals', 'Resell Goods', 'Acquire Siege']
leadership: ['Protect', 'Participate','Assist Local Cleric', 'Build Shelters','Compete in', 'Resell Goods', 'Help the Needy', 'Rescue Prisoners', 'Protect Diamond', 'Seek', 'Follow', 'Assemble', 'Chart', 'Explore', 'Patrol the Mines', 'Caravan'],
leatherworking: ['Prowler', 'Vandal', 'Leather Armor', 'Tough Leather', 'Detailed', 'Cure Tough', 'Gather Tough', 'Simple', 'Gather'],
tailoring: ['Wool Cloth', 'Cotton Scrap', 'Wool Scrap', 'Pants', 'Shirt', 'Robes', 'Weave Cotton', 'Gather Cotton'],
mailsmithing: ['Pants', 'Shirt', 'Steel Ring', 'Gather High', 'High Quality', 'Armor', 'Forge Mithral', 'Gather Mithral'],
platesmithing: ['Steel Plate', 'Gather Iron', 'Forge Iron', 'Pants', 'Armor', 'Forge'],
alchemy:['Rank 1 Experimentation', 'Alchemical Research', 'Gather Simple Components']
}
};
_private.selectors = {
overview: '.professions-overview:visible',
leadership: '.professions-Leadership:visible',
leatherworking: '.professions-Leatherworking:visible',
tailoring: '.professions-Tailoring:visible',
mailsmithing: '.professions-Armorsmithing_Med:visible',
alchemy: '.professions-Alchemy:visible',
platesmithing: '.professions-Armorsmithing_Heavy:visible',
doable_jobs: '.task-list-entry:not(.unmet):contains(' + _private.locale._continue + ')',
job_title:'h4 span',
reward_btn: '#modal .input-field button:visible'
};
_private.busy = false;
_private.clear_timers = function() {
clearTimeout(_private.timers.status);
};
_private.restart_timers = function() {
if(_private.busy) return;
_private.timers.status = setTimeout(_private.check_status, (37500 + (Math.random() * 37500)));
};
_private.check_status = function(waiting) {
_private.clear_timers();
if(_private.busy) return;
if(!waiting) {
$(_private.selectors.overview).trigger('click');
}
var slots = $('.task-slot-locked, .task-slot-progress, .task-slot-finished, .task-slot-open');
if(!slots.length) {
setTimeout(function(){
_private.check_status(true);
}, 3000);
return;
}
slots.filter(':not(.task-slot-progress):not(.task-slot-locked)').each(function(idx, slot) {
slot = $(slot);
var time_left = slot.find('.bar-text').text();
var button_msg = slot.find('.input-field button').text();
//Collection logic
if(slot.hasClass('task-slot-finished')) {
_private.reward.start_collection(slot);
return;
}
if(slot.hasClass('task-slot-open')) {
_private.jobs.new_job(0);
return;
}
});
_private.restart_timers();
};
_private.reward = {
start_collection: function(slot) {
_private.clear_timers();
if(_private.busy) return;
_private.busy = 'reward';
var button = slot.find('.input-field button');
button.trigger('click');
setTimeout(function(){
_private.reward.collect();
}, (1000 + (Math.random() * 1500)));
},
collect: function() {
$(_private.selectors.reward_btn).trigger('click');
_private.busy = false;
setTimeout(function(){_private.check_status();}, (2000 + (Math.random() * 1000)));
}
};
_private.jobs = {
new_job: function() {
_private.clear_timers();
if(_private.busy) return;
_private.busy = 'job';
var to_do = _private.professions.to_do[((Math.random() * 10000)|0) % _private.professions.to_do.length];
$(_private.selectors[to_do]).trigger('click');
setTimeout(function() {
_private.jobs.find_doable_job(to_do);
}, (7500 + (Math.random() * 7000)));
},
find_doable_job: function(to_do) {
var jobs = $(_private.selectors.doable_jobs);
var next_page = $('#tasklist_next:not(.paginate_disabled_next)');
var job_list = _private.professions.tasks[to_do];
console.log('TODO: ', to_do);
if(!to_do || !(job_list && job_list.length)) {
console.error('ERROR: ', _private.professions.tasks);
console.error('Please report this error as something is broken for you');
return;
}
if(!jobs.length && next_page.length) {
next_page.trigger('click');
jobs = $(_private.selectors.doable_jobs);
} else if(!jobs.length && !next_page.length) {
_private.busy = false;
setTimeout(function(){_private.check_status();}, (2000 + (Math.random() * 1000)));
return;
}
jobs = jobs.filter(function(idx){
var job = $(this);
if(job.find('.task-requirements .red').length) {
return false;
}
for(var i=0; i<job_list.length; i++) {
var title = job_list[i];
if(job.find(':contains(' + title + ')').length) {
return true;
}
}
return false;
});
if(!jobs.length && !next_page.length) {
_private.busy = false;
setTimeout(function(){_private.check_status();}, (2000 + (Math.random() * 1000)));
return;
}
if(!jobs.length) {
next_page.trigger('click');
setTimeout(function() {
_private.jobs.find_doable_job(to_do);
}, (500 + (Math.random() * 500)));
return;
}
jobs.eq(((Math.random() * 10000)|0) % jobs.length).find('.input-field button').trigger('click');
// test1 --
setTimeout(function() {
if (_private.use_optional_assets)
_private.jobs.assign_optional_assets();
else
_private.jobs.start();
}, (2000 + (Math.random() * 1000)));
},
// merged assign_person and assign_asset, assign_asset was only ever called from assign_person anyway
assign_optional_assets: function() {
// see if we have any empty slots - if we don't, just start the job
var empty_slots = $('.taskdetails-assets .icon-block.large.any-crafting.Junk.empty .input-field button');
if(empty_slots.length > 0) {
// we have empty slots, click the first
empty_slots.eq(0).trigger('click');
setTimeout(function(){
// get available assets
var assets = $('.modal-item-list .icon-block');
if(assets.length > 0) {
// if we have a suitable asset, assign it
assets.eq(0).trigger('click');
// and recurse
setTimeout(function() {
_private.jobs.assign_optional_assets();
}, (1000 + (Math.random() * 1000)));
}
else {
// otherwise, close the modal window and get ready to start job
$('.modal-window .close-button').eq(0).trigger('click');
setTimeout(function() {
_private.jobs.start();
}, (1000 + (Math.random() * 1000)));
}
}, (1500 + (Math.random() * 1000)));
}
else
_private.jobs.start();
},
// test1 --
start: function() {
$('.footer-body.with-sidebar .input-field button:contains(' + _private.locale.start + ')').trigger('click');
_private.busy = false;
setTimeout(function(){_private.check_status();}, (2000 + (Math.random() * 1000)));
}
};
$(function(){_private.check_status();});
_public.stop = function() {
_private.clear_timers();
};
_public.start = function() {
_private.check_status();
}
$.nwo = $.nwo || {}
$.extend(true, $.nwo, {professions:_public});
}(jQuery));
Thanks for adding alchemy but, due to the way alchemy profession works we would need a priority based (not random) taks list so we can queue up the required tasks
Better still would be the ability to make a list that is a queue list so we could do gather x 9 , extract x 9 , aqua vitae , minor tidespan , minor healing , experimentation. Let that run several times and then research . I.e. an array of task that we fill up and it runs till research becomes available, then it does that
Then we would just build a new queue list of tasks for each level of alchemy
Last edited by TZero; 06-21-2013 at 06:36 AM.
How do you make it do simple extraction and just simple extraction? It always defaults to mass simple extraction.
I also am no java script programmer, but have managed to make some changes that work for myself and I thought I'd share.
First, I defined multiple symbols for the same profession so that I could prioritize (groups of) tasks within that profession as shown in the following example:
_private.professions = {
to_do: ['alchemy1', 'alchemy2', 'alchemy3'],};
tasks: {
alchemy1: ['Research', 'Rank', 'Aqua Vitae'],}
alchemy2: ['Mass Advanced Vitriol Extraction', 'Simple Vitriol Extraction', 'Rejuvenation'],
alchemy3: ['Gather Simple Components']
I had to add these new symbols to _private.selectors as follows:
_private.selectors = {
overview: '.professions-overview:visible',};
leadership: '.professions-Leadership:visible',
leatherworking: '.professions-Leatherworking:visible',
tailoring: '.professions-Tailoring:visible',
mailsmithing: '.professions-Armorsmithing_Med:visible',
alchemy1: '.professions-Alchemy:visible',
alchemy2: '.professions-Alchemy:visible',
alchemy3: '.professions-Alchemy:visible',
platesmithing: '.professions-Armorsmithing_Heavy:visible',
doable_jobs: '.task-list-entry:not(.unmet):contains(' + _private.locale._continue + ')',
job_title:'h4 span',
reward_btn: '#modal .input-field button:visible'
_private.busy = false;
_private.cjob = 0;
Notice above that I added a new variable initialized to 0. This is used to order the use of the defined symbols rather than randomly select them.
I modified the 'collect' function to reset the _private.cjob value to 0. If I don't do that I think the jobs will just loop through my list of symbols. By setting it to 0 every time I collect I start back at the fist symbol.
collect: function() {
$(_private.selectors.reward_btn).trigger('click');...
_private.busy = false;
_private.cjob = 0;
And finally I modified the to_do symbol selection using the following replacement:
// var to_do = _private.professions.to_do[((Math.random() * 10000)|0) % _private.professions.to_do.length];var to_do = _private.professions.to_do[_private.cjob];
_private.cjob++;
if (_private.cjob == _private.professions.to_do.length)
_private.cjob = 0;
The basic behavior is that each time a new task is to be started, it will try each of the symbols in 'to_do' in order and will only move on to the next if one of the associated tasks couldn't be started.
Cheers
Absolutely, whenever a slot opens up -- if anything in 'alchemy1' can run it will, otherwise it moves on to 'alchemy2' and then if nothing there can run it will move on to 'alchemy3'.
I have noticed a minor bug in that it resets to 'alchemy1' when it collects a task result, so it could be working on a open slot, say trying 'alchemy2' and then may find that an earlier slot is ready for collection - it will collect (resting the value) and then start on 'alchemy1' on the newly opened slot and then move back to the original slot without resetting back to 'alchemy1'. I'm sure resetting the value to 0 could be relocated to address that, but I don't see it happen that often.