FBMW++

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

Pause after the rate limit

in
Subscribe to Pause after the rate limit 11 posts, 3 voices



remarkable Scriptwright

Can anyone who has the know-how make it so the script un-checks the aggressive refresh box after the "rate limit" message pops up? And by "make it" i mean provide the code changes.

If not the un-check, i have seen posting about a delay in refresh, perhaps adding a 5 minute pause in action after this message pops up.

Thank you.

 
remarkable Scriptwright

This is the code section for heavy rate limiting:

// The [Heavily Rate Limited] page
else if (document.body.innerHTML.match(/This page is being heavily rate limited. Please avoid constantly refreshing this page./))
  {
  window.location.href='http://apps.facebook.com/mobwars/';
  }

This is a section whick i believe returns the script to normal refresh

    {
    if (boss.preferences.passive_refresh) window.setTimeout(function() { window.location.href = "http://apps.facebook.com/mobwars/"+(boss.preferences.hurl?"":"hitlist/") }, norm_refresh);
    }

Is where can the code be changed to make the normal refresh possible?

 
Chris D User

// The [Heavily Rate Limited] page
else if (document.body.innerHTML.match(/This page is being heavily rate limited. Please avoid constantly refreshing this page./))
  {
window.setTimeout(function() {window.location.href='http://apps.facebook.com/mobwars/'}, norm_refresh);
  }

I think norm_refresh is 60 seconds long.
You only need to wait 20 seconds after the rate limited warning.
If you want to come back faster you can do this instead.

// The [Heavily Rate Limited] page
else if (document.body.innerHTML.match(/This page is being heavily rate limited. Please avoid constantly refreshing this page./))
  {
window.setTimeout(function() {window.location.href='http://apps.facebook.com/mobwars/'}, 20000);
  }

 
remarkable Scriptwright

I added the code you suggested for stopping aggressive refresh. It didnt work.

Then i tried this:

// The [Heavily Rate Limited] page
else if (document.body.innerHTML.match(/This page is being heavily rate limited. Please avoid constantly refreshing this page./))
  {
window.setTimeout(function() { window.location.href = "http://apps.facebook.com/mobwars/"+(boss.preferences.hurl?"":"hitlist/") }, norm_refresh);
  }

it just resulted in refreshing the hitlist page, with no turn off of the agg refresh.

 
Chris D User

This is what I personally use then. It turns off the hitlist and puts you on the home page.

// The [Heavily Rate Limited] page
if (/This page is being heavily rate limited/.test(document.body.innerHTML))
{
	document.getElementById('hurl').checked = false;
	boss.preferences.hurl = false;
	GM_setValue('boss', boss.toSource());
	setTimeout('document.location.href="http://apps.facebook.com/mobwars/"', 15000);
}

 
remarkable Scriptwright

It didnt work, thanks anyway

 
remarkable Scriptwright

Anyone have any other suggestions? So far no solution has been posted.

 
CryptoNight User

remarkable,

I have played around with this a bit and haven't found a solution yet that I like. I have put in a "pause" function:

function pausecomp(millis)
{
var date = new Date();
var curDate = null;

do { curDate = new Date(); }
while(curDate-date < millis);
} 

and then called this from just before the page reload. However, because of the use of the loop, it will consume a lot of resources during the pause.

 
remarkable Scriptwright

not sure what you mean by that, Does it work and where is that implemented?

 
CryptoNight User

Put the function somewhere in the script, below the other functions perhaps.

Then, within the error handler (your second post) just above the window.location.href line, call the function using something like:

pausecomp(100000);

Seems to work but the browswer essentially freezes during the pause. Kinda ugly if you ask me.

 
remarkable Scriptwright

Yeah, my computer has enough freezing problems with firefox as it is. Safari used to work a lot better for the hitlist before i found this script - which is why i tried to install this script using greasekit for safari. It didnt work though. I think i will wait til someone solves this before i change any pause codes.

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