Facebook MobWars Helper

By Piotr P. Karwasz Last update Dec 23, 2008 — Installed 91,001 times.

"You can not perform any job."

in
Subscribe to "You can not perform any job." 9 posts, 6 voices



alfi99 User

I started getting this error/message in a pop-up box.

First I thought it came from mobwars, then I had a look at the source of the script and found that it originated from the script.

I get this message all the time and all I can do is to press "ok" on the pop-up box.
I have no clue as to why this message is popping up and I don't know anything about scripting.
This is the paragraph from the script where this is used:
function jobs_exec() {
if (boss.job_income == 'undefined') boss.job_income = 0;
var jobs = new Joblist();
if (Page.c_page == 'jobs') {
jobs.updateData();
} else if (boss.new_level) {
var action = new Object();
action.page = 'jobs';
action.message = "Checking new jobs available...";
action.time = 0;
boss.actions.jobs_check = action;
return;
}
var jobid = boss.preferences.job;
var message;
switch (jobid) {
case 'none':
boss.job_income = 0;
Menu.update();
return;
case 'payout':
jobid = jobs_selectJob(jobs, false);
if (!jobid) message = "You can not perform any job.";
break;
case 'exp':
jobid = jobs_selectJob(jobs, true);
if (!jobid) message = "You can not perform any job.";
break;
default:
/* Check if we can do this job */
if (!jobs_canDoJob(jobs[jobid])) {
message = "You can not perform the job '" + jobs[jobid].name + "'";
jobid = 0;
break;
}
var prepid;
if (prepid = jobs_needPrepJob(jobs, jobid)) {
if (!jobs_canDoJob(jobs[prepid])) {
message = "You can not perform the preparatory job '" + jobs[prepid].name + "' for '" + jobs[jobid].name + "'";
jobid = 0;
break;
} else {
jobs_updateIncome(jobid);
jobid = prepid;
}
} else jobs_updateIncome(jobid);
break;
}

An example of when I get the message is when the script is trying to heal. After I click "ok" the script says resting.

Could anybody help me in the right direction?

 
alfi99 User

Things have taken a turn, from getting the above error for the past 2 days whenever I activated the script it has now disappeared, however in the menu I get this error:

"Error in module 'jobs' on line 1254: itemlist[item] is undefined"
I'm unsure if they are related....

 
Beagnach User

They've added in new jobs and items. Check your jobs page. These new additions are throwing the script off. Its run 4 Obtain Safehouses in a row for me before I realised and stopped it.

 
alfi99 User

Yeah I noticed small new weapons icons and a new weapons smuggling...

so I guess we wait until someone can add the new stuff to the script or live with it... :-)

thanks for the reply!

 
Chrisos User

Here's a fix while Piotr gets round to doing something more permanent:

Look for this:

function jobs_canDoJob(job) {
  /* Check items */
  for (var item in job.req_items) {

And add this after it:

    if (item == "item_57" || item == "item_58" || item == "item_59") {
      // depends on item not created yet
      return false;
    }

Then look for this:

function jobs_payRatio(jobid, jobs) {
  if (!jobs) jobs = new Joblist();
  var energy = jobs[jobid].energy + 0.0;
  for (var item in jobs[jobid].prep_items) {

And change the following line:

    energy += jobs[jobid].prep_items[item] * itemlist[item].energy_per_unit;

for this:

    try {
      energy += jobs[jobid].prep_items[item] * itemlist[item].energy_per_unit;
    } catch (err) {
      // invalid requirement
    }

That works for me, but your mileage may vary. Hope that helps, have a nice day etc...

Edit:
A quick note: you will still get some errors being displayed, but the auto job execution should work, except for those jobs that will give the nonexistant weapons or that depend upon them.

 
Virii User

I can't seem to get the above fix to work on mine, though my programing knowledge has much to desire...

 
TheDruidsKeeper Scriptwright

I posted a fix as well in the "Updates made to Mob Wars: The reason of the Inventory script problem" post

 
dimmyr User

Seems like that fix breaks the prep for train robbery. It just doesn't do it and attempts to do the actual job without the prep.

 
Chrisos User

My fixed version of the script deals with this issue, you can find it here: http://userscripts.org/topics/18139

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