Minor feature request
|
|
Would it be difficult to add a date/timestamp to the victims list? It would serve me well, but maybe not anybody else which in that case it'd be pointless. |
|
|
That's not a bad idea actually! I would love to know when did I kill the person :D |
|
|
me also, maybe a captcha counter as well. i kinda would like it for my own refrence then anything else, just to see if the captchas occur at a greater rate at certain times of day. |
|
|
Absolutely! I have requested this previously as well the ability to more easily grab the data for export. I want the "kill proof" if you will, which would include time/data as well as link to user. You an get the link today from the victim list, but it is convoluted because the link is a "on click" type of event in the TR data instead of an actual hyperlink. I'd love to see this data roll into a CSV file! |
|
|
I made a few changes to insert a date/time stamp to the victim list. You can view code here: |
|
|
Nice |
|
|
CryptoNight - How do I incorporate your changes? Just edit the current script and copy and paste everything in? J |
|
|
meyerje, you need to open the current version of the script in use, and replace all the existing code with CN's version of the code. |
|
|
As Chrisos said. I tried to post just the lines to be changed here but could get it to post properly due to the embedded HTML in the code. |
|
|
Make sure you dont copy the last two lines from google docs saying you can edit the text though :) |
|
|
CryptoNight: To post here just replace all '<' with '< ;' and '>' with '> ;' that usually works for me. (Remove the space before the semi-colons, I cant get anything to display in the forum as it un-escapes and un-double-escapes! EDIT: That will teach me to proof read after I submit! :) |
|
|
Thanks Crypt. Just what you need to prove you're innocent, just in case ;) |
|
|
Works great, I say pc incorporates it in his future updates if he doesn't mind doing so. Thanks! |
|
|
Nice work crypto, i just fixed it and it looks great. |
|
|
Thanks CryptoNight, hopefully PC will add it in the future. |
|
|
Can someone post just the changes. As I and other have done to PC script we have modified it slightly for our needs and to replace our changes just to have the date/time stamp would be more work. So would it be possible for someone to post just what needs to be modified in the existing script? |
|
|
OK, there are two sets of changes to be made. The first is around line 859 or so. Look for this text:
bv_list += '<table width=100% cellspacing=0 id="bvl_table">';
if (victims.length>1)
{
for (var victim in victims)
{
if (victim>0)
{
bv_list += '<tr style="cursor:pointer" onclick="window.location.href=\'http://apps.facebook.com/mobwars/profile/?user_id=' + victims[victim].split(':')[1]+'\';"><td class="td_l">'+victims[victim].split(':')[0]+'</td><td class="td_r">'+victims[victim].split(':')[2]+'</td></tr>';
total_bounties += parseInt(dollars_to_int(victims[victim].split(':')[2]));
}
}
}
bv_list += '<tr id="bvl_table_total"><td nowrap class="td_r" style="border-top:1px solid black;">TOTAL BOUNTIES COLLECTED:</td><td nowrap class="td_r" style="border-top:1px solid black;color:red" id="bvl_total_bounties">'+ int_to_dollars(total_bounties) + '</td></tr>';
bv_list += '</table><br />';
this.div.innerHTML += bv_list;
Swap out that text with the following:
bv_list += '<table width=100% cellspacing=0 id="bvl_table">';
if (victims.length>1)
{
for (var victim in victims)
{
if (victim>0)
{
bv_list += '<tr style="cursor:pointer" onclick="window.location.href=\'http://apps.facebook.com/mobwars/profile/?user_id=' + victims[victim].split(':')[1]+'\';"><td class="td_l">'+victims[victim].split(':')[0]+'</td><td class="td_r">'+victims[victim].split(':')[2]+'</td><td class="td_r">'+victims[victim].split(':')[3]+':'+victims[victim].split(':')[4]+'</td></tr>';
total_bounties += parseInt(dollars_to_int(victims[victim].split(':')[2]));
}
}
}
bv_list += '<tr id="bvl_table_total"><td nowrap class="td_r" style="border-top:1px solid black;"></td><td nowrap class="td_r" style="border-top:1px solid black;">TOTAL BOUNTIES COLLECTED:</td><td nowrap class="td_r" style="border-top:1px solid black;color:red" id="bvl_total_bounties">'+ int_to_dollars(total_bounties) + '</td></tr>';
bv_list += '</table><br />';
this.div.innerHTML += bv_list;
Now, look for the function called "function hitlist_exec()" which begins around line 1665. Within that function you are looking for the following conditional:
if (killing.nextSibling)
{
var vb = killing.nextSibling.nodeValue.match(/(\$[0-9,]+)/)[1];
var newvictim = document.createElement('TR');
newvictim.style.cursor = 'pointer';
newvictim.addEventListener('click', function() { window.location='http://apps.facebook.com/mobwars/profile/?user_id='+vi; }, true);
var newvictim_l = document.createElement('TD');
newvictim_l.className='td_l';
newvictim_l.innerHTML=vn;
var newvictim_r = document.createElement('TD');
newvictim_r.className='td_r';
newvictim_r.innerHTML=vb;
newvictim.appendChild(newvictim_l);
newvictim.appendChild(newvictim_r);
var btt = document.getElementById('bvl_table_total');
btt.parentNode.insertBefore(newvictim,btt);
var bvt = document.getElementById('bvl_total_bounties');
var tmp = parseInt(dollars_to_int(bvt.innerHTML));
tmp += parseInt(dollars_to_int(vb));
bvt.innerHTML = int_to_dollars(tmp);
victims.push(vn+':'+vi+':'+vb);
GM_setValue('victims',victims.join('|'));
boss.evaded = 0;
fresh_kill = true;
}
Change it to this:
if (killing.nextSibling)
{
var currentTime = new Date()
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
var year = currentTime.getFullYear()
var hours = currentTime.getHours()
var minutes = currentTime.getMinutes()
if (minutes < 10)
{
minutes = "0" + minutes
}
var killDate = month + "/" + day + "/" + year + " " + hours
var killTime = minutes
var vb = killing.nextSibling.nodeValue.match(/(\$[0-9,]+)/)[1];
var newvictim = document.createElement('TR');
newvictim.style.cursor = 'pointer';
newvictim.addEventListener('click', function() { window.location='http://apps.facebook.com/mobwars/profile/?user_id='+vi; }, true);
var newvictim_l = document.createElement('TD');
newvictim_l.className='td_l';
newvictim_l.innerHTML=vn;
var newvictim_r = document.createElement('TD');
newvictim_r.className='td_r';
newvictim_r.innerHTML=vb;
newvictim.appendChild(newvictim_l);
newvictim.appendChild(newvictim_r);
var btt = document.getElementById('bvl_table_total');
btt.parentNode.insertBefore(newvictim,btt);
var bvt = document.getElementById('bvl_total_bounties');
var tmp = parseInt(dollars_to_int(bvt.innerHTML));
tmp += parseInt(dollars_to_int(vb));
bvt.innerHTML = int_to_dollars(tmp);
victims.push(vn+':'+vi+':'+vb+':'+killDate+':'+killTime);
GM_setValue('victims',victims.join('|'));
boss.evaded = 0;
fresh_kill = true;
}
|
|
|
That worked perfectly thanks |
|
|
How does everyone code these scripts? Just in notepad or similar text editor? I know that works, but is that how you compose and test them? Sorry if I'm stupid or forgot to look somewhere. |
|
|
I use SEEdit Maxi, i found it on versiontracker.com |
|
|
I use UltraEdit, from IDM. This program (and others like it) are essentially specialized text editors made for programming. They have awareness of language and syntax and will color-code the text and auto-indent, etc. |