FBMW++

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

Adding in an extra snipe/swing

in
Subscribe to Adding in an extra snipe/swing 19 posts, 8 voices



lala52 User

Hi, I am sure there are many of us that just need an (few) extra swing / snipe at the hitlist but seems Pea is busy or partying for the new year ;-)
......Many thanks to Pea for all his efforts at this wonderful script that has made life easier for all of us. But, is there anyone who could create or post in a code for sniping that we could integrate along with FBMW+.
Just a simple code without the preference would also do I am sure, those who want it could add it to their script. Can anyone with the knowhow help here please as there has been many repeated requests in vain.

 
Computer Killer User

The edit I use is based on what PC had in the version that had snipers. This is the line I found and added to all later versions. PC had it in a loop for how many snipers you had selected in the preferences. So instead of using a loop, I just add the line for each sniper.

GM_xmlhttpRequest({method:'GET',url:(boss.preferences.hitlist_order?first_target:highest_target)}); // GM ajax snipe!

I search for the text:

if (target_acquired>0)

Then add the above line, above the following line:

window.location.href = (boss.preferences.hitlist_order?first_target:highest_target);

I add one line for each sniper.

 
lala52 User

Comp killa, sorry dear, could not comprehend exactly where to add what. Could you please repeat in other words.

 
Computer Killer User

I search for the text:

if (target_acquired>0)

This puts you in the area for the following edit. Then add this line:

GM_xmlhttpRequest({method:'GET',url:(boss.preferences.hitlist_order?first_target:highest_target)}); // GM ajax snipe!

Above this line:

window.location.href = (boss.preferences.hitlist_order?first_target:highest_target);

I add one line for each sniper.

 
Linc User

Thank you CK. I think I got what you mean. Can you please take a look at the file I uploaded if I got it correct? I renamed it to .txt so I can upload it.

http://www.ziddu.com/download/3046368/CopyofCop...

I've added only one extra swing.

 
remarkable Scriptwright

i added it but yet to see any results. Hopefully this isnt slowing down my already slow refresh, the page seems to stall a small bit before attacking the hitlist victim.

 
masrock User

That would be sweet if PC put it back in. What was the reason for taking it out?

 
masrock User

That seemed to work for me. I had about 3 hits in a couple seconds.

 
remarkable Scriptwright

The snipe works but it prevents the victim list from showing all bounties collected. A minor problem that i dont care about, because i'de rather have the bounties than the bragging rights.

 
Nozama User

It also generated captchas and locked users out of the hitlist page must faster. It's not about bragging rights, I'd rather make more hits long term than a few really quick and then have to wait.

Keep in mind that bounties are completely random, I can have forty or fifty people hit me, several of them in series of three or four hits (sniping) very rarely are these the people who get the kill.

The guy that gets the kill is the guy that just happened to hit at the end more often.

 
masrock User

Computer what do you mean you add one line for each sniper?

 
Tyrant6669 User

If I understand what Computer was saying is if you want two extra swings you would search the script code for line of code:
if (target_acquired>0)

Then above the line:
window.location.href = (boss.preferences.hitlist_order?first_target:highest_target);

Add the number of snipes you want, so in my case I want two snipes so the if block would look like this:


if (target_acquired>0)
{
target_acquired--;
boss.evaded = 0;
boss.jackpot++;
boss.jackpot_id = (boss.preferences.hitlist_order?first_target_id:highest_target_id);
boss.targets = target_acquired;
GM_setValue('boss', boss.toSource());
//GM_log('HIGHEST id:'+highest_target_id+', bt:'+highest);
GM_xmlhttpRequest({method:'GET',url:(boss.preferences.hitlist_order?first_target:highest_target)}); // GM ajax snipe!
GM_xmlhttpRequest({method:'GET',url:(boss.preferences.hitlist_order?first_target:highest_target)}); // GM ajax snipe!
window.location.href = (boss.preferences.hitlist_order?first_target:highest_target);
return;
}

Please correct me if I am wrong Computer...

 
lala52 User

Comp Killer, the thing works, though even for me I suppose it slows down the refresh rate (or so it seems). There are a few fallimento notifications indicating that there were that many snipe hits while attacking. Now the only thing left is if you can add in a command to snipe at an interval of 100ms or 150ms as quite often the hits are spaced very closely to have any effect. (Or am I asking too much comp?)Thanks again buddy for the post though.

 
lala52 User

Tyrant, you have it right I guess, that is the way it is with me too.

 
Computer Killer User

Tyrant6669: What you have is the same as what I have. I hunt from the homepage, I can go at the hitlist for hours. Of course I have to answer the captcha's, but I don't get the hitlist refresh message.

My understanding of the line of script is it does its process outside the control of the script, which is why the result is not captured in the victims list.

I do not yet know how to add a timing adjustment to space out the hits.

 
Tyrant6669 User

If you want to inject a pause in the snipes just do this... you can increase the time between the snipes by increasing the number in the setTimeout lines of code:


setTimeout("Snipe()", 100);

In this example the snipe will wait 100 ms to do the hit before moving on to the next one.

Updated code:

if (target_acquired>0)
{
target_acquired--;
boss.evaded = 0;
boss.jackpot++;
boss.jackpot_id = (boss.preferences.hitlist_order?first_target_id:highest_target_id);
boss.targets = target_acquired;
GM_setValue('boss', boss.toSource());
//GM_log('HIGHEST id:'+highest_target_id+', bt:'+highest);
setTimeout("Snipe()", 100); // GM ajax snipe! with 100 ms delay function
setTimeout("Snipe()", 100); // GM ajax snipe! with 100 ms delay function
window.location.href = (boss.preferences.hitlist_order?first_target:highest_target);
return;
}

Then add this function above the "function hitlist_preferencesInterface(prefs)" signature:


function Snipe()
{
GM_xmlhttpRequest({method:'GET',url:(boss.preferences.hitlist_order?first_target:highest_target)})
}

HTH

 
lala52 User

Thanks for your effort Tyrant, but, somehow, it doesn't seem to hit multiple hits using the above as I have never had any multiple 'fallimento' lines which would indicate that there were multiple hits. Any ideas or suggestions.

 
Chrisos User

It is possible that each of the asychronous HTTP requests is swallowing its respective response, although you would expect the occasional double post to indicate it is working (like the healing messages you occasionally see in a fight page when you have the medic switched on, or the fight results swallowed by the medic).

 
Tyrant6669 User

Ok, I have another version I just hacked up :)... not as pretty but it does work as you can tell by the GM debug log spew below...

http://userscripts.org/users/72944/FBMW+: Start: 1231041904151 End: 1231041905151 Delay: 1000 Diff: 1000
http://userscripts.org/users/72944/FBMW+: Start: 1231041905151 End: 1231041906151 Delay: 1000 Diff: 1000
http://userscripts.org/users/72944/FBMW+: You have reached the end of the world...
http://userscripts.org/users/72944/FBMW+: Start: 1231041907871 End: 1231041908871 Delay: 1000 Diff: 1000
http://userscripts.org/users/72944/FBMW+: Start: 1231041908871 End: 1231041909871 Delay: 1000 Diff: 1000

Here is the updated code:

if (target_acquired>0)
{
target_acquired--;
boss.evaded = 0;
boss.jackpot++;
boss.jackpot_id = (boss.preferences.hitlist_order?first_target_id:highest_target_id);
boss.targets = target_acquired;
GM_setValue('boss', boss.toSource());
//GM_log('HIGHEST id:'+highest_target_id+', bt:'+highest);

GM_xmlhttpRequest({method:'GET',url:(boss.preferences.hitlist_order?first_target:highest_target)});
sleep(1000);
GM_xmlhttpRequest({method:'GET',url:(boss.preferences.hitlist_order?first_target:highest_target)});
sleep(1000);
GM_xmlhttpRequest({method:'GET',url:(boss.preferences.hitlist_order?first_target:highest_target)});

window.location.href = (boss.preferences.hitlist_order?first_target:highest_target);
return;
}

And the new sleep function to be placed above the function hitlist_preferencesInterface(prefs):

function sleep(delay)
{
var start = new Date().getTime();
while (new Date().getTime() < start + delay);
var end = new Date().getTime();
//GM_log('Start: ' + start + ' End: ' + new Date().getTime() + ' Delay: ' + delay + ' Diff: ' + (end - start) );
}

NOTE: If you want to see the debug message uncomment the GM_log like in the sleep function

HTH

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