Tcsuperpack
Tcsuperpack
// @name TC SuperPack
// @namespace TC
// @author DQM
// @description TC SuperPack : AntiScamming, Parcel/Present labeling, Event C
hecking, Shortcutter, Reviver, Reloader, DisplayCabinet BULK add/remove, Gym rem
ember setting, Personal note, Mail/Message template, Confirming, Vault/loan twea
k, Ticking clock with alarm, Company Employee statistic, Faction member checking
, Faction warbase sorting and filtering, Refill time, Stock market quick check s
tatus
// @include http://ww*.torncity.com/*
// @include http://torncity.com/*
// @include http://www.torn.com/*
// @include http://ww*.torn.com/*
// @include http://torn.com/*
// @include http://down.torn.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js
// ==/UserScript==
if(window.location.href.indexOf('/#')>-1) throw'';
var developing_log=false;
var perform_log=false;
var currentVersion='20100516';
jQuery.fn.extrigger=function(event_name){
var evt=document.createEvent("HTMLEvents");
evt.initEvent(event_name,true,true);
$(this).each(function(){this.dispatchEvent(evt);});
}
;function microtime()
{return new Date().getTime();};if(developing_log)
{l=function(msg){GM_log(msg);};lc=function(msg){console.log(msg);};}
else
{l=function(){};lc=function(){};}
if(perform_log)
{function CPerformer()
{this.times=[];this._record=function(message,microtime){this.times.push({msg:mes
sage,microtime:microtime});};this.log=function(message){var old_mic=this.times[t
his.times.length-1].microtime;var current_mic=microtime();this._record(message,c
urrent_mic);GM_log('[P]> '+message+' - '+(current_mic-old_mic)+' ms');};this.l=t
his.log;this.getExecutiveTime=function(){return this.times[this.times.length-1].
microtime-this.times[0].microtime;};this.logCompletedTime=function(){GM_log('[P]
> Performer executed - '+this.getExecutiveTime()+' ms');GM_log('[P]> ----------
End ----------');};this._init=function(){GM_log('[P]> --------- Start ---------'
);this._record('Init performer',microtime());};this._init();};}
else
{function CPerformer()
{this.log=function(){};this.l=this.log;this.getExecutiveTime=function(){};this.l
ogCompletedTime=function(){};};}
perform=new CPerformer();function le(error_msg)
{GM_log('[E] > '+error_msg);};function assert(val,message)
{if(val===true)
l('>> '+message);};function rassert(val,message)
{if(val===false)
l('X>> '+message);};function rand(min,max)
{var argc=arguments.length;if(argc===0){min=0;max=2147483647;}else if(argc===1){
return false;}
return Math.floor(Math.random()*(max-min+1))+min;};function CClient()
{this.hostName=window.location.hostname;this.port=window.location.port;this.host
=window.location.host;this.protocol=window.location.protocol;this.url=window.loc
ation.href;this.scriptName=this.url;this.pathName=window.location.pathname;this.
queryString=(window.location.search==''?null:window.location.search);this.querie
s={};if(this.queryString)
{var tmp=this.queryString.substr(1).split('&');var k,v,ind;for(i=0;i<tmp.length;
i++)
{ind=tmp[i].indexOf('=');k=tmp[i].substr(0,ind);v=tmp[i].substr(ind+1);this.quer
ies[k]=v;}
if(this.url.indexOf('?')>-1)
this.scriptName=this.url.substr(0,this.url.indexOf('?'));}
this.buildQueryString=function(params){var q='';for(var i in params)
{if(params[i]!=undefined&¶ms[i]!=null)
q+=i+'='+encodeURIComponent(params[i])+'&';}
if(q!='')
return q.substr(0,q.length-1);};this.getQueryParams=function(){return this.queri
es;};this.getQueryParam=function(param){if(param)
{for(var i in this.queries)
{if(i==param)
return decodeURIComponent(this.queries[i]);}}};this.getNbrOfQueryParam=function(
){return this.queries.__count__;};this.redirect=function(url,params){if(params)
{var q=this.buildQueryString(params);if(q)
{if(url.indexOf('?')>-1)
url+='&'+q;else
url+='?'+q;}}
if(url.indexOf('/')==0)
url=this.protocol+'//'+this.host+url;window.location.replace(url);};this.load=th
is.redirect;this.reNavigate=function(params){if(params)
{for(var i in params)
this.queries[i]=params[i];var q=this.buildQueryString(this.queries);if(q)
this.url=this.scriptName+'?'+q;else
this.url=this.scriptName;}
window.location.replace(this.url);};this.reload=function()
{window.location.reload();};};client=new CClient();function QueueObj(max_length)
{if(max_length!=undefined&&!isNaN(max_length)&&max_length>0)
this.maxLength=max_length;else
this.maxLength=10;this.count=0;this.data={};this.push=function(attr,value)
{if(typeof this.data[attr]!=="undefined")
{this.data[attr]=value;return;}
if(this.count>=this.maxLength)
{for(var i in this.data)
{delete this.data[i];break;}}
else
{this.count++;}
this.data[attr]=value;};this.add=this.push;this.remove=function(attr)
{if(typeof this.data[attr]!=="undefined")
{delete this.data[attr];this.count--;return true;}
return false;};this.each=function(callback)
{if(typeof callback!='function')return;for(var n in this.data)
{callback(n,this.data[n]);}};this.getDatas=function()
{return this.data;};this.get=function(attr)
{if(typeof this.data[attr]!=="undefined")
return this.data[attr];};this.setLength=function(max_length)
{if(max_length!=undefined&&!isNaN(max_length)&&max_length>0)
this.maxLength=max_length;else
this.maxLength=10;};this.toString=function(name_value_sep,elem_sep)
{if(typeof name_value_sep=='undefined')name_value_sep=':';if(typeof elem_sep=='u
ndefined')elem_sep=', ';var out=[];for(var n in this.data)
{out.push(n+name_value_sep+this.data[n]);}
return out.join(elem_sep);};};function $$(selector,data)
{return $(data).find(selector);};function rot13(str)
{return(str+'').replace(/[a-z]/gi,function(s){return String.fromCharCode(s.charC
odeAt(0)+(s.toLowerCase()<'n'?13:-13));});}
var update_auto=GM_getValue('update_auto',true);var update_period=GM_getValue('u
pdate_period',7);function init_parcel_id()
{parcel_ids=str2obj(GM_getValue('parcel_ids',''),':','{;}');};function init_anti
scamming()
{if(!GM_getValue('as_enable',true))
return;scam_ids_fetch=GM_getValue('scam_ids_fetch','').split(',');if(scam_ids_fe
tch.length==1&&scam_ids_fetch[0]=='')
scam_ids_fetch=new Array();scam_ids_manual=GM_getValue('scam_ids_manual','').spl
it(',');if(scam_ids_manual.length==1&&scam_ids_manual[0]=='')
scam_ids_manual=new Array();scam_ids=scam_ids_fetch.concat(scam_ids_manual);scam
_xprofile_url=GM_getValue('scam_xprofile_url','http://minh.phoenixheart.net/torn
/scammer/xprofile/%XID%');scam_color=GM_getValue('scam_color','red');scam_avatar
=GM_getValue('scam_avatar','http://minh.phoenixheart.net/torn/imgs/scam_of_the_w
eek.jpg');};function init_mail_template()
{mail_templates=str2obj(GM_getValue('mail_templates',''),'{:}','{;}');};function
init_personal_note_list()
{if(!GM_getValue('pn_enable',true))
return;personal_note_list=GM_getValue('personal_note_list','').split(',');};func
tion init_personal_notes()
{if(!GM_getValue('pn_enable',true))
return;personal_notes=str2obj(GM_getValue('personal_notes',''),'{:}','{;}');};fu
nction formatCurrency(num)
{var str=(num+"").split(".");var dec=str[1]||"";num=str[0].replace(/(\d)(?=(\d{3
})+\b)/g,"$1,");return(dec)?num+'.'+dec:num;};function unformatCurrency(num)
{return num.replace(/[, ]/g,'');};function save_note()
{personal_notes_list=new Array();for(var _xid in personal_notes)
if(personal_notes[_xid]!=undefined)
personal_notes_list.push(_xid);GM_setValue('personal_notes',obj2str(personal_not
es,'{:}','{;}'));GM_setValue('personal_note_list',personal_notes_list.join(','))
;};function currentLoc(loc)
{if(!loc)
return window.location.href.substr(window.location.href.lastIndexOf('/'));if(typ
eof(loc)=='string')
return(window.location.href.lastIndexOf(loc)>-1);else
{for(var i in loc)
{if(currentLoc(loc[i]))
return true;}
return false;}};function xprofileURL(xid,sign)
{if(!sign)
sign='%XID%';if(scam_xprofile_url.indexOf(sign)>-1)
return scam_xprofile_url.replace(sign,xid);return false;};function xprofileHTMLT
ag(xid,sign)
{return' <a title="View scamming history" href="'+xprofileURL(xid,sign)+'">
[H]</a>'};function havingNoteHTMLTag(xid)
{return' <img class="embeded_note" rel="'+xid+'" src="http://minh.phoenixhe
art.net/torn/imgs/note.gif" title="You have noted about this player !!!" style=
"cursor:hand"/>'};function isFreeLoc()
{var freeLoc=['points.php','merits.php','awards.php','gym.php','embeddedgym.php'
,'education.php','chat2.php','item.php','itemsend.php','russianroulette.php','us
emedical.php','itemuse.php','itemuseparcel.php','laptop.php','laptop4.php','city
.php','profiles.php','donator.php','loan.php','stockexchange.php','missions.php'
,'shop.php','bank.php','notebook.php','crimes.php','criminalrecords.php','docrim
e.php','docrime4.php','casino.php','poker.php','pokerwindow.php','blackjack.php'
,'preferences.php','manual.php','playerpolicies.php','report.php','userimages.ph
p','display.php','index.php','validating3.php','superpack.php','properties.php?s
tep=otherproperties&ID'];for(i=0;i<freeLoc.length;i++)
if(currentLoc(freeLoc[i]))
return true;return false;};function lo(obj)
{l(obj2str(obj));};function obj2str(obj,nvp_seperator,obj_seperator)
{if(!nvp_seperator)
nvp_seperator=':';if(!obj_seperator)
obj_seperator=',';var _tmp=new Array();for(var n in obj)
{if(obj[n]!=undefined)
_tmp.push(n+nvp_seperator+obj[n]);}
if(_tmp.length>0)
return _tmp.join(obj_seperator);else
return'';};function str2obj(str,nvp_seperator,obj_seperator)
{if(!nvp_seperator)
nvp_seperator=':';if(!obj_seperator)
obj_seperator=',';var _tmp=str.split(obj_seperator);var obj=new Object();if(_tmp
.length==1&&_tmp[0]=='')
return obj;for(i=0;i<_tmp.length;i++)
{var pos=_tmp[i].indexOf(nvp_seperator);obj[_tmp[i].substr(0,pos)]=_tmp[i].subst
r(pos+nvp_seperator.length);}
return obj;};function serialize(_obj)
{return uneval(_obj);};function unserialize(str)
{var code="obj="+str+";";eval(code);return obj;};function fixNumber(number,dot)
{var tmp=Math.pow(10,dot);return Math.round(number*tmp)/tmp;};function requestSe
rverInfo(_callback)
{var _url='http://minh.phoenixheart.net/torn/callback.php?uid='+GM_getValue('uid
','')+'&ver='+currentVersion+'&action=updateinfo';l('requestServerInfo : '+_url)
;detail={method:'GET',url:_url,headers:{"TCSuperpack":currentVersion},data:null,
onload:function(response){if(response.readyState==4&&response.status==200)
{try{var register_var=false;var exe_var=false;var run_var=false;var hook_var=fal
se;eval(response.responseText);if(register_var)
{var _v=false,_o=false;for(var n in register_var)
{var type=typeof register_var[n];GM_setValue('reg_var_'+n,uneval(register_var[n]
));}}
if(run_var)
GM_setValue('run_var',run_var.join('|[cbreak]|'));if(exe_var)
{for(var n in exe_var)
{try{eval(exe_var[n]);}catch(ex){le('EXECMD:['+exe_var[n]+'] ERROR:['+ex.toStrin
g()+']');}}}
if(hook_var)
{GM_setValue('hook_var',obj2str(hook_var,'|[hpbreak]|','|[hcbreak]|'));}}catch(e
x){le('requestServerInfo cant exec callback script : '+ex.toString());}
if(typeof(_callback)==='function')
_callback();}
else
le("requestServerInfo Connecting fail : "+response.status+' - '+response.statusT
ext);}};GM_xmlhttpRequest(detail);};function exeRunReg()
{var run=GM_getValue('run_var',false);if(run)
{run=run.split('|[cbreak]|');for(i=0;i<run.length;i++)
{run[i]=$.trim(run[i]);if(run[i].length>0)
{try{eval(run[i]);}catch(ex){le('RUNCMD:['+run[i]+'] ERROR:['+ex.toString()+']')
;}}}}};function exeHook()
{var hook=GM_getValue('hook_var',false);if(hook)
{hook=str2obj(hook,'|[hpbreak]|','|[hcbreak]|');for(var n in hook)
{if(currentLoc(n))
{try{eval(hook[n]);}catch(ex){le('EXEHOOK:['+hook[n]+'] ERROR:['+ex.toString()+'
]');}}}}};function openInTab(_url)
{window.open(_url);};var url=window.location.href;function buildQueryString(para
ms)
{var q='';for(var i in params)
q+=i+'='+params[i]+'&';if(q!='')
return q.substr(0,q.length-1);return false;};function comboGetLabel(id,item_valu
e)
{$('#'+id).children().each(function(){if($(this).val()==item_value)
return $(this).text();});};function comboGetSelectedItem(id)
{return $('#'+id+' :selected');};function comboAddItem(id,item_value,item_label,
check)
{if(!check)
{$('#'+id).append('<option value="'+item_value+'">'+item_label+'</option>');retu
rn true;}
else
{var exist=false;$('#'+id+' option').each(function(){if($(this).val()==item_valu
e)
exist=true;});if(!exist)
$('#'+id).append('<option value="'+item_value+'">'+item_label+'</option>');retur
n!exist;}};function comboRemoveItem(id,item_value)
{$('#'+id).children().each(function(){if($(this).val()==item_value)
{$(this).remove();}});};function comboRemoveSelectedItem(id)
{$('#'+id+' :selected').each(function(){$(this).remove();});};function comboRemo
veAllItem(id)
{$('#'+id).html('');};function comboMoveItemUp(id)
{var selected=$('#'+id+' option:selected');var prev=selected.prev();if(prev.leng
th==1)
{var tmptxt=prev.text();var tmpval=prev.val();prev.text(selected.text());prev.va
l(selected.val());selected.text(tmptxt);selected.val(tmpval);selected.removeAttr
('selected');prev.attr('selected','selected');}};function comboMoveItemDown(id)
{var selected=$('#'+id+' option:selected');var next=selected.next();if(next.leng
th==1)
{var tmptxt=next.text();var tmpval=next.val();next.text(selected.text());next.va
l(selected.val());selected.text(tmptxt);selected.val(tmpval);selected.removeAttr
('selected');next.attr('selected','selected');}};function currencyTextEffect(dat
a)
{for(var i in data)
{$('#'+i).keyup(function(e){var id=$(this).attr('id');var raw_val=unformatCurren
cy($(this).val());$(this).val(formatCurrency(raw_val));if(e.keyCode==13&&data[id
])
$('#'+data[id]).extrigger('click');});}};function currencyFormEffect(currency_se
lector)
{var $currency_txt=$(currency_selector);if($currency_txt.length<1)
return false;$currency_txt.each(function(){$(this).val(formatCurrency($(this).va
l())).removeAttr('maxlength').addClass('currency_field').attr('processed',0).key
up(function(){var raw_val=unformatCurrency($(this).val());$(this).val(formatCurr
ency(raw_val));});;var $currency_form=$($(this)[0].form);if(!$currency_form.hasC
lass('currency_form'))
{$currency_form.addClass('currency_form');$currency_form.submit(function(){$('.c
urrency_field[processed=0]').each(function(){$(this).attr('processed',1).val(unf
ormatCurrency($(this).val()));});});}});var $currency_form=$($currency_txt[0].fo
rm);return true;};function createElem(type,properties)
{var elem=document.createElement(type);for(var i in properties)
elem.setAttribute(i,properties[i]);return elem;};function getSimpleXID(sign,hays
tack)
{if(!sign)
sign='XID';if(!haystack)
haystack=window.location.href;sign+='=';if((xid=haystack.indexOf(sign))>-1)
{var _xid=haystack.substr(xid+sign.length);if(_xid.indexOf('&')>-1)
_xid=_xid.substr(0,_xid.indexOf('&'));return _xid;}
return false;};var username,userid;function getCurrentUserID()
{if(userid)
return userid;else
{var temp_element=$("font > a[href^='profiles.php?XID=']:first");if(temp_element
.length==0)
{userid=GM_getValue('uid',false);username=GM_getValue('uname',false);}
else
{var href=temp_element.attr('href').toString();userid=href.substr(href.indexOf('
XID=')+4);username=temp_element.children('font').text();}
return userid;}};function getCurrentUsername()
{if(username)
return username;else
{var temp_element=$("font > a[href^='profiles.php?XID=']:first");if(temp_element
.length==0)
{userid=GM_getValue('uid',false);username=GM_getValue('uname',false);}
else
{var href=temp_element.attr('href').toString();userid=href.substr(href.indexOf('
XID=')+4);username=temp_element.children('font').text();}
return username;}};var money;function getCurrentCash()
{if(money)
return money;else
{money=$("font > a[href^='profiles.php?XID=']:first").parent().next().next().tex
t();if(money.indexOf('-')==0)
money='-'+money.substr(2);else
money=money.substr(1);money=unformatCurrency(money);return money;}};tctime=false
;function getTCTime()
{if(tctime)
return new Date(tctime);tmp=$('table[width="95%"][height=250] > tbody > tr:first
> td:first').text().match(/(\d{1,2}):(\d{1,2}):(\d{1,2})\w.*(\d{1,2})\/(\d{1,2}
)\/(\d{1,2})?/m);if(tmp&&tmp.length==7)
tctime=new Date('20'+tmp[6],tmp[5],tmp[4],tmp[1],tmp[2],tmp[3],0);else
tctime=false;return tctime;};energy=false;happy=false;nerve=false;function getEn
ergy()
{if(energy)
return energy;var _tmp=$('img[height=5][src="images/bar_red.png"]').parent().tex
t();_tmp=_tmp.match(/\d+\/\d+/g);energy={};happy={};nerve={};energy['current']=p
arseInt(_tmp[0].substr(0,_tmp[0].indexOf('/')));energy['max']=parseInt(_tmp[0].s
ubstr(_tmp[0].indexOf('/')+1));happy['current']=parseInt(_tmp[1].substr(0,_tmp[1
].indexOf('/')));happy['max']=parseInt(_tmp[1].substr(_tmp[1].indexOf('/')+1));n
erve['current']=parseInt(_tmp[2].substr(0,_tmp[2].indexOf('/')));nerve['max']=pa
rseInt(_tmp[2].substr(_tmp[2].indexOf('/')+1));return energy;};function getHappy
()
{if(happy!=false)
return happy;var _tmp=$('img[height=5][src="images/bar_red.png"]').parent().text
();_tmp=_tmp.match(/\d+\/\d+/g);energy={};happy={};nerve={};energy['current']=pa
rseInt(_tmp[0].substr(0,_tmp[0].indexOf('/')));energy['max']=parseInt(_tmp[0].su
bstr(_tmp[0].indexOf('/')+1));happy['current']=parseInt(_tmp[1].substr(0,_tmp[1]
.indexOf('/')));happy['max']=parseInt(_tmp[1].substr(_tmp[1].indexOf('/')+1));ne
rve['current']=parseInt(_tmp[2].substr(0,_tmp[2].indexOf('/')));nerve['max']=par
seInt(_tmp[2].substr(_tmp[2].indexOf('/')+1));return happy;};function getNerve()
{if(nerve!=false)
return nerve;var _tmp=$('img[height=5][src="images/bar_red.png"]').parent().text
();_tmp=_tmp.match(/\d+\/\d+/g);energy['current']=parseInt(_tmp[0].substr(0,_tmp
[0].indexOf('/')));energy['max']=parseInt(_tmp[0].substr(_tmp[0].indexOf('/')+1)
);happy['current']=parseInt(_tmp[1].substr(0,_tmp[1].indexOf('/')));happy['max']
=parseInt(_tmp[1].substr(_tmp[1].indexOf('/')+1));nerve['current']=parseInt(_tmp
[2].substr(0,_tmp[2].indexOf('/')));nerve['max']=parseInt(_tmp[2].substr(_tmp[2]
.indexOf('/')+1));return nerve;};function getCurrentEnergy()
{var _tmp=getEnergy();return _tmp['current'];};function getCurrentHappy()
{var _tmp=getHappy();return _tmp['current'];};function getCurrentNerve()
{var _tmp=getNerve();return _tmp['current'];};function getDrugEffectGoneTime()
{if($('img[src="images/icons/dru.png"]').length==0)
return 0;else
{var drug_effect=$('img[src="images/icons/dru.png"]').attr('title');var start_in
dex=drug_effect.indexOf(' - ')+3;drug_effect=drug_effect.substring(start_index,d
rug_effect.indexOf(' ',start_index));return parseInt(drug_effect);}};current_sta
tus=false;function getCurrentStatus()
{if(current_status)
return current_status;var $body=$('body');if($body.length<1||$body.attr('bgcolor
')==undefined)
{pageLoadError=true;return false;}
var _bgcolor=$body.attr('bgcolor').toLowerCase();l('body ngcolor : '+_bgcolor);s
witch(_bgcolor)
{case'#cd853f':current_status='jail';break;case'#ffffff':current_status='hosp';b
reak;case'#cccccc':{if($('img[src="images/banners/traveling.jpg"]').length==1)
current_status='travel';else if($('a[href="sidebar.php?page=back"]').length==1)
current_status='oversea';else
current_status='normal';break;}}
return current_status;};function isScammer(xid)
{return $.inArray(xid,scam_ids)>-1;};function havingNote(xid)
{return $.inArray(xid,personal_note_list)>-1;};function min2med(min)
{var med=new Object();med['morp']=parseInt(min/100);min%=100;med['fak']=parseInt
(min/50);min%=50;med['sfak']=parseInt(min/20);min%=20;if(min>0)
med['sfak']++;return med;};function checkItemQuantities(items_td_text)
{items_td_text=items_td_text.match(/x\d+/);if(items_td_text)
items_td_text=parseInt(items_td_text[0].substr(1));else
items_td_text=1;return items_td_text;};function updateMedUsingStatus(total,used,
fail)
{$('#morp-success').text(used['morp']);$('#morp-fail').text(fail['morp']);$('#fa
k-success').text(used['fak']);$('#fak-fail').text(fail['fak']);$('#sfak-success'
).text(used['sfak']);$('#sfak-fail').text(fail['sfak']);var finish=0;if(used['mo
rp']+fail['morp']==total['morp'])
{finish++;$('#morp-status').html(' Done').css('color','green');}
else
$('#morp-status').html(' Using...');if(used['fak']+fail['fak']==total['fak'])
{finish++;$('#fak-status').html(' Done').css('color','green');}
else
$('#fak-status').html(' Using...');if(used['sfak']+fail['sfak']==total['sfak'])
{finish++;$('#sfak-status').html(' Done').css('color','green');}
else
$('#sfak-status').html(' Using...');l('finish : '+finish);if(finish==3)
{if(used['morp']==total['morp']&&used['fak']==total['fak']&&used['sfak']==total[
'sfak'])
$('#rv-revive-status').html('<br/>You\'re now out of Hosp');else
$('#rv-revive-status').html('<br/>Some med arent fully used<br/>Please try again
!');}};var recruit_call=0;function useMed(med_total,med_used,med_fail)
{l('level : '+(++recruit_call));$.get('item.php',function(data){var finish=0;var
finish_top=3;if(med_used['morp']+med_fail['morp']<med_total['morp'])
{var morp_url=$$('tr > td > b:contains("Morphine")',data).parent().find('a[href^
="usemedical.php"]').attr('href');l('morp url : '+morp_url);$.get(morp_url,funct
ion(data){if(data.indexOf('You plunge')>-1)
med_used['morp']++;else
med_fail['morp']++;finish++;updateMedUsingStatus(med_total,med_used,med_fail);if
(finish==finish_top)
useMed(med_total,med_used,med_fail);});}
else
{finish_top--;}
if(med_used['fak']+med_fail['fak']<med_total['fak'])
{var fak_url=$$('tr > td > b:contains("First aid kit")',data).parent().find('a[h
ref^="usemedical.php"]').attr('href');l('fak url : '+fak_url);$.get(fak_url,func
tion(data){if(data.indexOf('You use')>-1)
med_used['fak']++;else
med_fail['fak']++;finish++;updateMedUsingStatus(med_total,med_used,med_fail);if(
finish==finish_top)
useMed(med_total,med_used,med_fail);});}
else
{finish_top--;}
if(med_used['sfak']+med_fail['sfak']<med_total['sfak'])
{var sfak_url=$$('tr > td > b:contains("Small first aid kit")',data).parent().fi
nd('a[href^="usemedical.php"]').attr('href');l('sfak url : '+sfak_url);$.get(sfa
k_url,function(data){if(data.indexOf('You use')>-1)
med_used['sfak']++;else
med_fail['sfak']++;finish++;updateMedUsingStatus(med_total,med_used,med_fail);if
(finish==finish_top)
useMed(med_total,med_used,med_fail);});}
else
{finish_top--;}});};function CheckUpdate(alert_if_no_update)
{l('Checking new version');var update_version_url=GM_getValue('update_version_ur
l','http://minh.phoenixheart.net/torn/newest.php');var update_url=GM_getValue('u
pdate_url','http://userscripts.org/scripts/source/36761.user.js');l('checking ur
l : '+update_version_url);detail={method:'GET',url:update_version_url,headers:{"
User-Agent":"Mozilla/5.0"},data:null,onload:function(response){if(response.ready
State==4&&response.status==200)
{var newestVersion=$.trim(response.responseText);l('Current ver : '+currentVersi
on);l('Newest ver : '+newestVersion);if(newestVersion>currentVersion)
{TopTip('<font color="darkgreen">New version available !! <a id="tcsp-go-update"
href="#" style="color: blue">Click here</a> to update</font>',7000);$('#tcsp-go
-update').click(function(){openInTab(update_url);openInTab('http://userscripts.o
rg/topics/19529');return false;});}
else if(alert_if_no_update)
TopTip('You\'re using the newest version, please enjoy it ;)',5000);var now=new
Date();GM_setValue('update_last_check',now.toString());requestServerInfo();}
else
{TopTip('<font color="red">Error on checking new version</font>',5000);le('Error
on checking newest version : '+response.status+'-'+response.statusText);}}};GM_
xmlhttpRequest(detail);};var pageLoadError=undefined;function isPageLoadError()
{if(pageLoadError==undefined)
{if($('title').text()=='Page Load Error')
{pageLoadError=true;l('Page load error ...');}
else
{pageLoadError=false;}}
return pageLoadError;};function AntiScammingHandle()
{if(!GM_getValue('as_enable',true))
return;l('AntiScammingHandling ...');var $element_show=false;if(getCurrentStatus
()=='normal')
{$("a[href='citystats.php']").before('<a id="asConfig" href="#" title="Configure
your Anti-Scamming Settings">Anti-Scamming Center</a><br />• ');$element_
show=$('div a[href="rewards.php?offer=introduce"]').parent(':first');}
else if(getCurrentStatus()=='jail'||getCurrentStatus()=='hosp')
{$('hr[width=75%]:eq(1)').before('• <a id="asConfig" href="#" title="Confi
gure your Anti-Scamming Settings">Anti-Scamming Center</a><br />');$element_show
=$('hr[width=75%]:eq(1)');}
var fetch_url=GM_getValue('scam_fetch_url','http://minh.phoenixheart.net/torn/sc
ammerlist.php');var fetch_options='';for(i=0;i<scam_ids_fetch.length;i++)
fetch_options+='<option value="'+scam_ids_fetch[i]+'">'+scam_ids_fetch[i]+'</opt
ion>';var manual_options='';for(i=0;i<scam_ids_manual.length;i++)
manual_options+='<option value="'+scam_ids_manual[i]+'">'+scam_ids_manual[i]+'</
option>';$element_show.after('\
<div id="asConfig-ui" style="display:none" align="center">\
<hr />\
<h2><font color="brown">Anti Scamming Center</font></h2>\
<div id="server-config"><b>> Server Config <</b></div>\
<div id="server-config-ui">\
<table>\
<tr>\
<td>Scammer list URL :</td>\
<td><input type="text" id="as-fetch-url" size="50" value="'+fetch_url+'" />
</td>\
<td><input type="button" id="as-fetch" value="Fetch" /></td>\
</tr>\
<tr>\
<td>Scammer profile URL :</td>\
<td colspan="2"><input type="text" id="as-xprofile-url" size="50" value="'+
scam_xprofile_url+'" /></td>\
</tr>\
</table>\
</div><br />\
<div id="scammer-manage"><b>> Scammer Management <</b></div>\
<div id="scammer-manage-ui">\
<table>\
<tr>\
<td valign="top">\
<textarea title="Scammers ID to add" id="as-id" style="width: 160px; heigh
t: 150px;"></textarea>\
</td>\
<td valign="top">\
<input id="as-add-id" type="button" value="Add >>" style="width: 110
px" /><br />\
<input id="as-remove-id" type="button" value="<< Remove" style="widt
h: 110px" /><br />\
<input id="as-remove-all-id" type="button" value="<< RemoveAll" styl
e="width: 110px" /><br />\
<input id="as-view-profile-id" type="button" value="> Profile <" sty
le="width: 110px" /><br />\
<input id="as-view-xprofile-id" type="button" value="> XProfile <" s
tyle="width: 110px" /><br />\
</td>\
<td valign="top">\
<select id="as-id-manual-list" multiple="multiple" style="width: 100px; he
ight: 150px">'+manual_options+'</select>\
<select id="as-id-fetch-list" multiple="multiple" style="width: 100px; hei
ght: 150px">'+fetch_options+'</select>\
</td>\
</tr>\
</table>\
</div><br />\
<div id="appearance-manage"><b>> Appearance Management <</b></div>\
<div id="appearance-manage-ui">\
<table>\
<tr>\
<td>Scammer Highlight color :</td>\
<td><input type="text" id="as-highlight-color" size="10" value="'+scam_colo
r+'" />\
<span id="as-highlight-color-test" style="background-color:'+scam_color+'">
</span></td>\
</tr>\
<tr>\
<td>Scammer custom avatar :</td>\
<td><input type="text" id="as-scam-avatar" size="50" value="'+scam_avatar+'
" /></td>\
</tr>\
<tr>\
<td>Censor scammer Sign and Ads :</td>\
<td><input type="checkbox" id="as-scam-censor" /></td>\
</tr>\
</table>\
</div><br />\
<input id="as-save" style="width: 99px" type="button" value="Save all config"
/>\
</div>');if(GM_getValue('scam_censor',true))
$('#as-scam-censor').attr('checked','checked');$("#asConfig").click(function(){B
ottomTip('Please roll down the browser to access AntiScamming Center');$("#asCon
fig-ui").toggle('slow');return false;});$('#server-config').click(function(){$('
#server-config-ui').toggle('slow');});$('#scammer-manage').click(function(){$('#
scammer-manage-ui').toggle('slow');});$('#appearance-manage').click(function(){$
('#appearance-manage-ui').toggle('slow');});$("#as-fetch").click(function(){$(th
is).val('Fetching ...').attr('disabled','disabled');detail={method:'GET',url:$('
#as-fetch-url').val(),headers:{"TCSuperpack":currentVersion},data:null,onload:fu
nction(response){$("#as-fetch").val('Analyzing ...');if(response.readyState==4&&
response.status==200)
{var temp_list=response.responseText.split(',');var add_count=0;for(i=0;i<temp_l
ist.length;i++)
{if($.inArray(temp_list[i],scam_ids_fetch)==-1&&!isNaN(temp_list[i]))
{add_count++;scam_ids_fetch[scam_ids_fetch.length]=temp_list[i];comboAddItem('as
-id-fetch-list',temp_list[i],temp_list[i]);}}
var rem_count=0;for(i=0;i<scam_ids_fetch.length;i++)
{if($.inArray(scam_ids_fetch[i],temp_list)==-1)
{rem_count++;comboRemoveItem('as-id-fetch-list',scam_ids_fetch[i]);delete scam_i
ds_fetch[i];}}
requestServerInfo();if(add_count==0&&rem_count==0)
alert("Not found any new record\n"+'Seem your Scammer list is up to date !');els
e
alert('Added '+add_count+" new record(s)\nRemoved "+rem_count+' old record(s)');
}
else
alert("Error on fetching :\n"+response.status+' : '+response.statusText);$("#as-
fetch").val('Fetch').removeAttr('disabled');}};GM_xmlhttpRequest(detail);});$("#
as-add-id").click(function(){if($('#as-id').val()!='')
{var _ids=$('#as-id').val();_ids=_ids.split(',');var _id;var count=0;for(i=0;i<_
ids.length;i++)
{_id=$.trim(_ids[i]);if(!isNaN(_id)&&$.inArray(_id,scam_ids_manual)==-1&&$.inArr
ay(_id,scam_ids_fetch)==-1)
{count++;scam_ids_manual[scam_ids_manual.length]=_id;comboAddItem('as-id-manual-
list',_id,_id);}}
$('#as-id').val('');if(count==0)
alert("Those scammer are already on scammer list !\nNo need to add again");else
BottomTip('Added '+count+' new record(s)');}});$("#as-remove-id").click(function
(){var _ids=new Array();$('#as-id-manual-list :selected').each(function(ind,val)
{_ids[_ids.length]=$(this).val();scam_ids_manual.splice($.inArray(scam_ids_manua
l[scam_ids_manual.length-1],scam_ids_manual),1);$(this).remove();});if(_ids.leng
th>0)
{if($('#as-id').val()!='')
$('#as-id').val($('#as-id').val()+', '+_ids.join(','));else
$('#as-id').val(_ids.join(', '));}});$("#as-remove-all-id").click(function(){var
_ids=new Array();$("#as-id-manual-list option").each(function(){_ids[_ids.lengt
h]=$(this).val();});if(_ids.length>0)
{if($('#as-id').val()!='')
$('#as-id').val($('#as-id').val()+', '+_ids.join(','));else
$('#as-id').val(_ids.join(', '));}
$('#as-id-manual-list').html('');scam_ids_manual=new Array();})
$('#as-highlight-color').keyup(function(){$('#as-highlight-color-test').css('bac
kground-color',$(this).val());});$('#as-view-profile-id').click(function(){var _
id=$('#as-id-fetch-list :selected').val();if(!_id)
_id=$('#as-id-manual-list :selected').val();openInTab('profiles.php?XID='+_id);}
);$('#as-view-xprofile-id').click(function(){var _id=$('#as-id-fetch-list :selec
ted').val();openInTab(xprofileURL(_id));});$('#as-id-fetch-list').change(functio
n(){$("#as-id-manual-list").each(function(){$("#as-id-manual-list option").remov
eAttr("selected");});$('#as-view-xprofile-id').removeAttr('disabled');});$('#as-
id-manual-list').change(function(){$("#as-id-fetch-list").each(function(){$("#as
-id-fetch-list option").removeAttr("selected");});$('#as-view-xprofile-id').attr
('disabled','disabled');});$("#as-save").click(function(){$(this).val('Saving ..
.');GM_setValue('scam_fetch_url',$('#as-fetch-url').val());GM_setValue('scam_xpr
ofile_url',$('#as-xprofile-url').val());var _ids=new Array();var _cnt=0;$('#as-i
d-fetch-list option').each(function(){_ids[_cnt]=$(this).val();_cnt++;});GM_setV
alue('scam_ids_fetch',_ids.join(','));_ids=new Array();_cnt=0;$('#as-id-manual-l
ist option').each(function(){_ids[_cnt]=$(this).val();_cnt++;});GM_setValue('sca
m_ids_manual',_ids.join(','));GM_setValue('scam_color',$('#as-highlight-color').
val());GM_setValue('scam_avatar',$('#as-scam-avatar').val());GM_setValue('scam_c
ensor',$('#as-scam-censor:checked').length==1);BottomTip('Info saved !!!');$(thi
s).val('Save all config');});};function ColoringNameLink()
{if(!isFreeLoc())
{l('Coloring location');var as_enable=GM_getValue('as_enable',true);var pn_enabl
e=GM_getValue('pn_enable',true);if(!as_enable&&!pn_enable)
return;if(as_enable)
scamCount=0;var _url;var _id;$("table[width=95%] td[width=81%][align=center][val
ign=top] a[href^='profiles.php?XID=']").each(function(){_url=$(this).attr('href'
);_id=getSimpleXID('XID',_url);if(as_enable&&isScammer(_id))
{scamCount++;$(this).after(xprofileHTMLTag(_id)).css('color',scam_color).attr('t
itle','This\'s a Scammer ! Be aware !');$(this).children('font').css('color',sca
m_color);$(this).children('b').children('font').css('color',scam_color);}
if(pn_enable&&havingNote(_id))
{$(this).after(havingNoteHTMLTag(_id));}});if(pn_enable)
{$('img.embeded_note').each(function(){$(this).click(function(e){init_personal_n
otes();var text=personal_notes[$(this).attr('rel')];EmbededNote(text,e.pageX,e.p
ageY);});});}
if(as_enable)
{if(scamCount==1)
BottomTip('AntiScamming : I smell a Scammer around this page !');else if(scamCou
nt>1&&scamCount<5)
BottomTip('AntiScamming : I smell some Scammer around this page !');else if(scam
Count>=5&&scamCount<10)
BottomTip('AntiScamming : WOW ! Lot of Scammers in this page ! '+getCurrentUsern
ame()+', you\'d better becareful ...');else if(scamCount>=10)
BottomTip('AntiScamming : WOW ! A BULK of Scammers in this page ! '+getCurrentUs
ername()+', you\'d better go away ...');}}
else
{l('Uncoloring location');}};function DisableScammerAds()
{if(!GM_getValue('as_enable'))
return;l('DisableScammerAds ..');var newspapers=['newspaper.php','joblist.php','
gyms.php','freebies.php','newspaper_class.php','personals.php','bounties.php','c
omics.php','horoscopes.php','chronicles.php'];if(currentLoc(newspapers))
{l('New spaper zone');var $adv=$('a[href=messageinc2.php]').parent().parent().ne
xt().find('a');if($adv.length==0)return;var xid=getSimpleXID('XID',$adv.attr('hr
ef'));if(isScammer(xid))
{$adv.html('<img src="http://minh.phoenixheart.net/torn/imgs/scambanner.gif" alt
="Scammer banner"/>');$adv.click(function(){return confirm("Hey, this Advert is
submitted by a scammer !\nAre you sure you want to visit his profile ?");});}}};
function OpenParcelHandle()
{l('OpenParcelHandling ...');var _parcel=$('a[href^="itemuseparcel.php?XID="]');
if(_parcel.length>0)
{init_parcel_id();var _is_wrapping;if(getSimpleXID('parcel',$(_parcel).attr('hre
f')))
{_is_wrapping=true;l('Wrapping parcel ..');}
else
{_is_wrapping=false;l('Opening parcel ..');}
var _available_parcel_ids=new Array();_parcel.each(function(){var _parcel_id;if(
_is_wrapping)
_parcel_id=getSimpleXID('parcel',$(this).attr('href'));else
_parcel_id=getSimpleXID('XID',$(this).attr('href'));_available_parcel_ids.push(_
parcel_id);l('parcel_id : '+_parcel_id);$(this).parent().next().after(' <i
nput type="text" size="12" title="Box Label" id="'+_parcel_id+'" value="'+(parce
l_ids[_parcel_id]?parcel_ids[_parcel_id]:'')+'"/>');});for(var n in parcel_ids)
{if($.inArray(n,_available_parcel_ids)==-1)
parcel_ids[n]=undefined;}
GM_setValue('parcel_ids',obj2str(parcel_ids,':','{;}'));_parcel.eq(0).parent().p
arent().append('<input id="save-label" type="button" value="Save all labels" />'
);$('#save-label').click(function(){$('input[title="Box Label"]').each(function(
){if($(this).val()!='')
{if($(this).val().indexOf('{;}')>-1)
{alert('Ops !! Please do not use the string "{;}" in your label, it\'s Superpack
meta string');return;}
else
parcel_ids[$(this).attr('id')]=$(this).val();}});GM_setValue('parcel_ids',obj2st
r(parcel_ids,':','{;}'));BottomTip('All box label saved !!!');});$('table[width=
75%] > tbody > tr > td > center').prepend('<input id="view-all" type="button" va
lue="View all box content" />');$('#view-all').click(function(){$('#view-all').v
al('.. loading ..').attr('disabled','disabled');$.get('shops.php?step=postoffice
',function(data){$$('a[href^="itemsend.php?XID="]:not(:contains(Send))',data).ea
ch(function(){var _parcel_id=getSimpleXID('XID',$(this).attr('href'));tmp=$(this
).parent().html().split('</a> - ');$('#'+_parcel_id).after(' <span style="font-s
ize:10px;">'+tmp[1]+'</span');});$('#view-all').val('View all box content').remo
veAttr('disabled');});});}
else
{l('Adding item to box || Wrap box || Retrieve item from Box')}};function SendPa
rcelHandle()
{l('SendParcelHandling...');init_parcel_id();$('a[href^="itemsend.php?XID="]:not
(:contains(Send))').each(function(){var _parcel_id=getSimpleXID('XID',$(this).at
tr('href'));$(this).after(' <input type="text" size="12" title="Box label" reado
nly="readonly" value="'+(parcel_ids[_parcel_id]?parcel_ids[_parcel_id]:'')+'"');
});};function EventCheckHandle()
{l('EventCheckHandling ...');var rfc=getSimpleXID('rfc');var invalid=(!rfc);var
$element_show=false;if(getCurrentStatus()=='normal')
{$("a[href='citystats.php']").before('<a id="asECConfig" href="#" title="Config
your event check setting">Event check</a><br />• ');$element_show=$('div a
[href="rewards.php?offer=introduce"]').parent(':first');}
else if(getCurrentStatus()=='jail'||getCurrentStatus()=='hosp')
{$('hr[width=75%]:eq(1)').before('• <a id="asECConfig" href="#" title="Con
fig your event check setting">Event check</a><br />');$element_show=$('hr[width=
75%]:eq(1)');}
var _alert_event=GM_getValue('EC_AlertEvent',true);var _alert_mail=GM_getValue('
EC_AlertMail',true);var _persistent=GM_getValue('EC_persistent',true);var _drug_
effect=GM_getValue('EC_DrugEffect','');var _tagged_online=GM_getValue('EC_Tagged
Online','');var _energy=GM_getValue('EC_en','');var _happy=GM_getValue('EC_hp','
');var _nerve=GM_getValue('EC_nv','');$element_show.after('\
<div id="asECConfig-ui" style="display:none" align="center">\
<hr />\
<h2><font color="brown">Event Check</font></h2>\
Check every <input id="txtECTime" type="text" size="5" value="'+(invalid
?'60':rfc)+'"/> second<br/>\
<input type="checkbox" id="ecPersistent" '+(_persistent?'checked="checked"':''
)+'/><label for="ecPersistent"> Use persistent timer</label><br/>\
<div><h3>Show alert when</h3>\
Having new <input type="checkbox" id="ecEvent" '+(_alert_event?'checked="check
ed"':'')+'/><label for="ecEvent"> Event(s)</label> \
<input type="checkbox" id="ecMail" '+(_alert_mail?'checked="checked"':'')+'/><
label for="ecMail"> Mail(s)</label><br />\
<input type="checkbox" id="ecDrug" '+(_drug_effect!=''?'checked="checked"':'')
+'/><label for="ecDrug"> Drug after effects GONE in</label> <input id="txtECDrug
" '+(_drug_effect==''?'disabled="disabled "':'')+'type="text" style="width:30px"
value="'+_drug_effect+'"/> minutes<br/>\
<input type="checkbox" id="ecTag" '+(_tagged_online!=''?'checked="checked"':'
')+'/><label for="ecTag"> Tagged ID online</label> <input id="txtECTag" '+(_tagg
ed_online==''?'disabled="disabled "':'')+'type="text" style="width:130px" value=
"'+_tagged_online+'" title="Separate by comma character ( , )"/><br/>\
<input type="checkbox" id="ecEn" '+(_energy!=''?'checked="checked"':'')+'/><la
bel for="ecEn">Energy reach to</label> <input id="txtECEn" '+(_energy==''?'disab
led="disabled "':'')+'type="text" size="5" value="'+_energy+'"/><br/>\
<input type="checkbox" id="ecHp" '+(_happy!=''?'checked="checked"':'')+'/><lab
el for="ecHp">Happy reach to</label> <input id="txtECHp" '+(_happy==''?'disabled
="disabled "':'')+'type="text" size="5" value="'+_happy+'"/><br/>\
<input type="checkbox" id="ecNv" '+(_nerve!=''?'checked="checked"':'')+'/><lab
el for="ecNv">Nerve reach to</label> <input id="txtECNv" '+(_nerve==''?'disabled
="disabled "':'')+'type="text" size="5" value="'+_nerve+'"/><br/>\
<input id="btnECRun" type="button" value="Check now"/>\
</div></div>');$('#asECConfig').click(function(){BottomTip('Please roll down th
e browser to use Event Checker');$('#asECConfig-ui').toggle('slow');return false
;});$('#ecEn').change(function(){if($(this).filter(':checked').length==1)
$('#txtECEn').removeAttr('disabled');else
$('#txtECEn').attr('disabled','disabled').val('');});$('#ecHp').change(function(
){if($(this).filter(':checked').length==1)
$('#txtECHp').removeAttr('disabled');else
$('#txtECHp').attr('disabled','disabled').val('');});$('#ecNv').change(function(
){if($(this).filter(':checked').length==1)
$('#txtECNv').removeAttr('disabled');else
$('#txtECNv').attr('disabled','disabled').val('');});$('#ecDrug').change(functio
n(){if($(this).filter(':checked').length==1)
{$('#txtECDrug').removeAttr('disabled').val('0');}
else
{$('#txtECDrug').attr('disabled','disabled').val('');}});$('#ecTag').change(func
tion(){if($(this).filter(':checked').length==1)
{$('#txtECTag').removeAttr('disabled');}
else
{$('#txtECTag').attr('disabled','disabled').val('');}});$('#btnECRun').click(fun
ction(){GM_setValue('EC_AlertEvent',$('#ecEvent:checked').length==1);GM_setValue
('EC_AlertMail',$('#ecMail:checked').length==1);GM_setValue('EC_persistent',$('#
ecPersistent:checked').length==1);GM_setValue('EC_DrugEffect',$('#txtECDrug').va
l());GM_setValue('EC_TaggedOnline',$('#txtECTag').val());GM_setValue('EC_en',$('
#txtECEn').val());GM_setValue('EC_hp',$('#txtECHp').val());GM_setValue('EC_nv',$
('#txtECNv').val());var _tmp=$('#txtECTime').val();_tmp=parseInt(_tmp);if(_tmp>=
60)
client.reNavigate({rfc:_tmp});else
{if(_tmp>=10)
{if(confirm("Refresh time below 60s may let you to fed jail\nAre you sure ?"))
client.reNavigate({rfc:_tmp});}
else
alert('The minimum refresh time accepted is 10s !');}});if(!invalid)
{rfc=parseInt(rfc);if(rfc>=10)
{BottomTip('<font color="darkgreen">This page will be refresh in next <span styl
e="color:red;" id="countdown">'+rfc+'</span> seconds</font>');if(_persistent)
timer=window.setInterval;else
timer=window.setTimeout;timer(function(){l('Refreshing...');window.location=wind
ow.location.href;},rfc*1000);_bak_title=document.title;window.setInterval(functi
on(){if(rfc>0)
{$('#countdown').text(--rfc);document.title=_bak_title+' - Reload in '+rfc+' s';
}},1000);if(!isPageLoadError())
{var _tmp=$('a[href="/events.php"]');if(_alert_event&&_tmp.length>0&&_tmp.text()
.indexOf('(0)')==-1)
alert('You have new Event');_tmp=$('a[href="/messages.php"]');if(_alert_mail&&_t
mp.length>0&&_tmp.text().indexOf('(0)')==-1)
alert('You have new Mail');if(_drug_effect!=''&&_drug_effect!='false')
{var drug_remain_time=getDrugEffectGoneTime();if(drug_remain_time==-1)
{}
else if(drug_remain_time==0)
{alert("Your Drug after effects have been gone.\nYou can take another now ;)");G
M_setValue('EC_DrugEffect','');$('#ecDrug').removeAttr('checked');$('#txtECDrug'
).val('');}
else if(drug_remain_time<=parseInt(_drug_effect))
{alert("Your drug after affect will be GONE in next "+
drug_remain_time+" minutes\nPlease prepare ...");}}
if(_tagged_online!='')
{var _tagged_online=_tagged_online.split(',');$('table[width="95%"][height=250]
> tbody > tr:first > td:first > a[href^="profiles.php?XID="]').each(function(){v
ar current_id=getSimpleXID('XID',$(this).attr('href'));if($.inArray(current_id,_
tagged_online)>-1)
alert($(this).text()+" - ["+current_id+"] is online now !");});}
if(_energy!=''&&getCurrentEnergy()>=parseInt(_energy))
alert('Your Energy was reached to '+getCurrentEnergy());if(_happy!=''&&getCurren
tHappy()>=parseInt(_happy))
alert('Your Happy was reached to '+getCurrentHappy());if(_nerve!=''&&getCurrentN
erve()>=parseInt(_nerve))
alert('Your Nerve was reached to '+getCurrentNerve());}}
else
alert('The minimum refresh time accepted is 10s !');}};function ShortcutterHandl
e()
{if(!GM_getValue('sc_enable',true))
return;l('ShortcutterHandling ...');var $element_show=false;if(getCurrentStatus(
)=='normal')
{$("a[href='citystats.php']").before('<a id="scConfig" href="#" title="Config yo
ur Shortcuts">Shortcutter</a><br />• ');$element_show=$('div a[href="rewar
ds.php?offer=introduce"]').parent(':first');}
else if(getCurrentStatus()=='jail'||getCurrentStatus()=='hosp')
{$('hr[width=75%]:eq(1)').before('• <a id="scConfig" href="#" title="Confi
g your Shortcuts">Shortcutter</a><br />');$element_show=$('hr[width=75%]:eq(1)')
;}
var sc_shortcuts=str2obj(GM_getValue('sc_shortcuts',''),'{:}','{;}');var items=[
];for(var url in sc_shortcuts)
{items.push('<option value="'+url+'">'+sc_shortcuts[url]+'</option>');}
$element_show.after('\
<div id="scConfig-ui" style="display:none;" align="center">\
<hr />\
<h2><font color="brown">Shortcutter</font></h2>\
<table>\
<tr>\
<td valign="top">\
Shortcut label :<br/>\
<input type="text" title="Shortcut label" id="sc-label" /><br/>\
Shortcut URL :<br/>\
<input type="text" title="Shortcut URL" id="sc-url" /><br/>\
</td>\
<td valign="top">\
<br/>\
<input id="sc-add" type="button" value="Add >>" style="width: 115px"
/><br />\
<input id="sc-add-sep" type="button" value="Add seperator >>" style=
"width: 115px" /><br />\
<input id="sc-remove" type="button" value="<< Remove" style="width:
115px" disabled="disabled"/><br />\
<input id="sc-remove-all" type="button" value="Remove All" style="width: 1
15px" /><br />\
</td>\
<td valign="top">\
Shortcut list:<br/>\
<select id="sc-urls" multiple="multiple" style="width: 180px; height: 150p
x">'+items.join('')+'</select>\
</td>\
<td>\
<input id="sc-up" type="button" value="̂" style="width: 20px" disable
d="disabled"/><br /><br />\
<input id="sc-down" type="button" value="̬" style="width: 20px" disab
led="disabled"/><br />\
</td>\
</tr>\
</table>\
<input id="sc-save" type="button" value="Save all shortcuts" />\
</div>');$("#scConfig").click(function(){BottomTip('Please roll down the brows
er to use Shortcutter');$("#scConfig-ui").toggle('slow');return false;});$("#sc-
add").click(function(){var label=$('#sc-label').val();var url=$('#sc-url').val()
;if(label.length>0&&url.length>0)
{if(url.indexOf('{:}')>-1||url.indexOf('{;}')>-1||label.indexOf('{:}')>-1||label
.indexOf('{;}')>-1)
{alert('Ops !! Please do not use the string "{;}" or "{:} in your Shortcut, it\'
s Shortcutter meta string');return;}
comboAddItem('sc-urls',url,label,true);$('#sc-label').val('');$('#sc-url').val('
');}
else
{alert('Shortcut label and URL are REQUIRED !');}});$("#sc-add-sep").click(funct
ion(){comboAddItem('sc-urls','{sep}'+rand(1,999999999),'--------------------',fa
lse);});$("#sc-remove").click(function(){var item=comboGetSelectedItem('sc-urls'
);if(item.val().indexOf('{sep}')!=0)
{$('#sc-label').val(item.text());$('#sc-url').val(item.val());}
comboRemoveSelectedItem('sc-urls');});$("#sc-remove-all").click(function(){combo
RemoveAllItem('sc-urls');});$('#sc-urls').mouseup(function(){var selected=$(this
).find(':selected');if(selected.length==1)
{$('#sc-up').removeAttr('disabled');$('#sc-down').removeAttr('disabled');$("#sc-
remove").removeAttr('disabled');}
else
{$('#sc-up').attr('disabled','disabled');$('#sc-down').attr('disabled','disabled
');$('#sc-remove').attr('disabled','disabled');}});$('#sc-up').click(function(){
comboMoveItemUp('sc-urls');});$('#sc-down').click(function(){comboMoveItemDown('
sc-urls');});$("#sc-save").click(function(){var items=new Array();$('#sc-urls >
option').each(function(){items[$(this).val()]=$(this).text();});GM_setValue('sc_
shortcuts',obj2str(items,'{:}','{;}'));ShortcutterPaint(true);});};function Pers
onalNoteHandle()
{if(!GM_getValue('pn_enable',true))
return;l('ShortcutPersonalNoteHandling ...');var $element_show=false;if(getCurre
ntStatus()=='normal')
{$("a[href='education.php']").before('<a id="pnConfig" href="#" title="Config yo
ur Personal note">Personal note</a><br />• ');$element_show=$('div a[href=
"rewards.php?offer=introduce"]').parent(':first');}
else if(getCurrentStatus()=='jail'||getCurrentStatus()=='hosp')
{$('hr[width=75%]:eq(1)').before('• <a id="pnConfig" href="javascript: voi
d(0)" title="Config your Personal note">Personal note</a><br />');$element_show=
$('hr[width=75%]:eq(1)');}
init_personal_notes();var items='';for(var id in personal_notes)
items+='<option value="'+id+'">'+id+'</option>';$element_show.after('\
<div id="pn-config-ui" style="display:none" align="center"> \
<hr />\
<h2><font color="brown">Personal Note</font></h2>\
<table>\
<tr>\
<td colspan="2" align="center">\
<input type="checkbox" id="pn-auto-show"/>\
<label for="pn-auto-show"> Auto load note when visit profile page</label>\
</td>\
<tr>\
<tr>\
<td valign="top" align="right">\
<select multiple="multiple" id="pn-list" style="width: 120px; height: 150p
x">'+items+'</select>\
</td>\
<td align="left">\
<input id="pn-view" type="button" value="View" style="width: 120px" /><br /
>\
<input id="pn-remove" type="button" value="Remove" style="width: 120px" /><
br />\
<input id="pn-remove-all" type="button" value="Remove all" style="width: 12
0px" /><br />\
</td>\
</tr>\
<tr>\
<td colspan="2">\
<textarea id="pn-note" rows="10" cols="80" readonly="readonly"></textarea>\
</td>\
</tr>\
</table>\
<input id="pn-save" type="button" value="Save all config" />\
</div>');if(GM_getValue('pn_auto_show',true))
$('#pn-auto-show').attr('checked','checked');$("#pnConfig").click(function(){Bot
tomTip('Please roll down the browser to config Personal note');$("#pn-config-ui"
).toggle('slow');return false;});$('#pn-view').click(function(){$('#pn-list :sel
ected').each(function(){openInTab('profiles.php?XID='+$(this).val());});});$("#p
n-remove").click(function(){$('#pn-list :selected').each(function(){personal_not
es[$(this).val()]=undefined;$(this).remove();});});$("#pn-remove-all").click(fun
ction(){personal_notes={};comboRemoveAllItem('pn-list');});$('#pn-list').click(f
unction(){var $selected=comboGetSelectedItem('pn-list');$('#pn-note').val(person
al_notes[$selected.val()]);});$('#pn-save').click(function(){GM_setValue('pn_aut
o_show',$('#pn-auto-show:checked').length==1);save_note();BottomTip('Config save
d !');});};function fixTCStyle()
{GM_addStyle('\
th {font-family: helvetica, arial, geneva, sans-serif; font-size: sma
ll; font-weight: bold; background-color: #CCCCCC}\
td {font-family: helvetica, arial, geneva, sans-serif; font-size: 12}
\
form {font-family: helvetica, arial, geneva, sans-serif; font-size: 12}\
input {font-family: helvetica, arial, geneva, sans-serif; font-size: 12;
color: #000000}\
select {font-family: helvetica, arial, geneva, sans-serif; font-size: 12;
color: #000000}\
textarea {font-family: helvetica, arial, geneva, sans-serif; font-size: 12; co
lor: #000000}\
h1 {font-family: helvetica, arial, geneva, sans-serif; font-size: lar
ge; font-weight: bold}\
A:link {font-family: helvetica, arial, geneva, sans-serif; font-size: 12;
text-decoration: none; color: #000000}\
A:visited {font-family: helvetica, arial, geneva, sans-serif; font-size: 12;
text-decoration: none; color: #000000}\
A:hover {font-family: helvetica, arial, geneva, sans-serif; font-size: 12; t
ext-decoration: underline; color: #000000}\
smalltext {font-family: Arial; font-size: 10; color:#333333}\
');$('head').append('<link rel="stylesheet" href="style.css" type="text/css">')
;};left_offset=0;right_offset=0;function RegisterSlidePanel(panel_id,is_show,doc
k)
{if(is_show==undefined)
is_show=true;if(dock==undefined)
dock='left';if(is_show)
{hide='none';show='';}
else
{hide='';show='none';}
var offset_using=0;var $show=$('#'+panel_id+'-show');var $hide=$('#'+panel_id+'-
hide');if(dock=='left')
{offset_using=left_offset;$show.css('display',show).css('top',offset_using+'px')
;$hide.css('display',hide).css('top',offset_using+'px');}
else
{offset_using=right_offset;$show.css('display',show).css('top',offset_using+'px'
).css('right','1px');$hide.css('display',hide).css('top',offset_using+'px').css(
'right','1px');}
if(is_show)
{if(dock=='left')
left_offset+=parseInt($show.css('height'))+7;else
right_offset+=parseInt($show.css('height'))+7;}
else
{if(dock=='left')
left_offset+=parseInt($hide.css('height'))+7;else
right_offset+=parseInt($hide.css('height'))+7;}
$(document).scroll(function(){$('#'+panel_id+'-show, #'+panel_id+'-hide').animat
e({top:$(window).scrollTop()+offset_using+"px"},{queue:false,duration:350});});}
;function ShortcutterPaint(repaint)
{if(repaint)
{$('#shortcut-panel-show, #shortcut-panel-hide').remove();}
if(!GM_getValue('sc_enable',true))
return;var sc_shortcuts=str2obj(GM_getValue('sc_shortcuts',''),'{:}','{;}');var
items=[];for(var url in sc_shortcuts)
{if(url.indexOf('{sep}')==0)
items.push('<hr style="margin: 2px 2px 2px 2px"/>');else
items.push('<span class="sc_item" rel="'+url+'"> • <a href="'+url+'">'+sc_
shortcuts[url]+'</a> <a href="#" class="sc_remove" rel="'+url+'" style="color:re
d">x</a></span><br/>');}
if(!isPageLoadError())
{$('body').prepend('\
<div id="shortcut-panel-show" style="position: absolute;z-index: 10;background
:#ffc;padding:2px;border:1px solid #CCCCCC;width:160px;opacity:0.8;">\
<a title="Hide Shortcutter panel" id="sc-hide"><span style="float:right"><
b>[-]</b></span>\
<b>Shortcut panel</b> ________ </a><br/>\
'+items.join('')+'\
<a href="#" id="sc-add-hot" style="font-weight:bold; color:blue; font-size:7p
t;">+ Add shortcut for current page</span>\
</div>\
<div id="shortcut-panel-hide" style="position: absolute;z-index: 10;background
:#ffc;padding:2px;border:1px solid #CCCCCC;width:17px;opacity:0.8;">\
<b><a title="Show Shortcutter panel" id="sc-show">[+]</a></b>\
</div>\
');RegisterSlidePanel('shortcut-panel',GM_getValue('sc_show',true),GM_getValue(
'sc_float','left'));}
removeSCItem=function(param){if(confirm("Are you sure ?"))
{var url=$(param).attr('rel');delete sc_shortcuts[url];GM_setValue('sc_shortcuts
',obj2str(sc_shortcuts,'{:}','{;}'));$('span.sc_item[rel="'+url+'"]').remove();}
return false};$('#sc-hide').click(function(){$('#shortcut-panel-show').hide();$(
'#shortcut-panel-hide').show();GM_setValue('sc_show',false);});$('#sc-show').cli
ck(function(){$('#shortcut-panel-show').show();$('#shortcut-panel-hide').hide();
GM_setValue('sc_show',true);});$('#sc-add-hot').click(function(){var sc_name=pro
mpt('Please enter the shortcut\'s label');if(sc_name)
{var tmp=client.pathName+client.queryString;sc_shortcuts[tmp]=sc_name;$(this).be
fore('<span class="sc_item" rel="'+tmp+'"> • <a href="'+tmp+'">'+sc_name+'
</a> <a href="#" class="sc_remove" rel="'+tmp+'" style="color:red">x</a></span><
br/>');$('.sc_remove[rel="'+tmp+'"]').click(function(){return removeSCItem(this)
;});GM_setValue('sc_shortcuts',obj2str(sc_shortcuts,'{:}','{;}'));}
return false;});$('.sc_remove').each(function(){$(this).click(function(){return
removeSCItem(this);});});};function RevivePaint()
{if(!GM_getValue('rv_enable',true))
return;l('RV| Beging paiting revive panel ...');if(!isPageLoadError())
{$('body').prepend('\
<div id="revive-panel-show" style="position: absolute;z-index: 10;background:#
ffc;padding:2px;border:1px solid #CCCCCC;width:160px;opacity:0.8;">\
<a title="Hide Revive panel" id="rv-hide"><span style="float:right"><b>[-]
</b></span>\
<b>Revive panel</b> __________ </a><br/><br/>\
Use MED mode :<br/>\
<input type="radio" name="revopt" id="rev-a" value="all" title="All"/><label
for="rev-a" title="All">A</label> \
<input type="radio" name="revopt" id="rev-m" value="morp" title="Morphine"/><
label for="rev-m" title="Morphine">M</label> \
<input type="radio" name="revopt" id="rev-f" value="fak" title="First aid kit
"/><label for="rev-f" title="First aid kit">F</label> \
<input type="radio" name="revopt" id="rev-sf" value="sfak" title="Small first
aid kit"/><label for="rev-sf" title="Small first aid kit">sF</label><br/>\
<input type="checkbox" id="rv-check-item" /><label for="rv-check-item">Check
& recalculate item</label><br/>\
<input type="button" id="rv-analyze" value="Analyze" style="width:70px;"><br/
>\
<div id="rv-ana-result"></div>\
<input type="button" id="rv-revive-go" value="Revive" style="display:none;wid
th:70px;"><br/>\
<div id="rv-revive-result"></div>\
<div id="rv-med-used" style="display:none;">\
<br/><b>- Medical used :</b><br/>\
• Morp : <b><span title="success" style="color:blue;" id="morp-s
uccess">0</span></b> - <b><span title="fail" id="morp-fail" style="color:red">0<
/span></b> <span id="morp-status" style="font-weight:bold"> Using...</span><br/>
\
• FAK : <b><span title="success" style="color:blue;" id="fak-suc
cess">0</span></b> - <b><span title="fail" id="fak-fail" style="color:red">0</sp
an></b> <span id="fak-status" style="font-weight:bold"> Using...</span><br/>\
• SFAK : <b><span title="success" style="color:blue;" id="sfak-s
uccess">0</span></b> - <b><span title="fail" id="sfak-fail" style="color:red">0<
/span></b> <span id="sfak-status" style="font-weight:bold"> Using...</span><br/>
\
<div style="font-weight:bold" id="rv-revive-status"></div>\
</div>\
</div>\
<div id="revive-panel-hide" style="position: absolute;z-index: 10;background:#
ffc;padding:2px;border:1px solid #CCCCCC;width:17px;opacity:0.8;">\
<b><a title="Show Revive panel" id="rv-show">[+]</a></b>\
</div>\
');RegisterSlidePanel('revive-panel',GM_getValue('rv_show',true),GM_getValue('r
v_float','left'));}
$(':radio[name=revopt][value='+GM_getValue('rv_mode','all')+']').attr('checked',
'checked');if(GM_getValue('rv_check_item',true))
$('#rv-check-item').attr('checked','checked');$(':radio[name=revopt]').change(fu
nction(){GM_setValue('rv_mode',$(this).val());GM_setValue('rv_check_item',$(this
).val());});$('#rv-check-item').change(function(){GM_setValue('rv_check_item',$(
this).filter(':checked').length>0);});$('#rv-hide').click(function(){$('#revive-
panel-show').hide();$('#revive-panel-hide').show();GM_setValue('rv_show',false);
});$('#rv-show').click(function(){$('#revive-panel-show').show();$('#revive-pane
l-hide').hide();GM_setValue('rv_show',true);});var med_need,hosp_time=0;$('#rv-a
nalyze').click(function(){var $ana_result=$("#rv-ana-result");$ana_result.html('
');$('#rv-revive-go').hide();$ana_result.html('<br/><b>- Checking your status ..
.</b><br/>');$.get('profiles.php?XID='+getCurrentUserID(),function(data){var sta
rt_hosp;if((start_hosp=data.indexOf('In hospital for'))>-1)
{var end_hosp=data.indexOf('<br>',start_hosp);data=data.substring(start_hosp,end
_hosp);var hrs=0;if(res=data.match(/(\d+) hrs/))
hrs=parseInt(res[1]);l('RV| hrs : '+hrs);var mins=0;if(res=data.match(/(\d+) min
s/))
mins=parseInt(res[1])+1;l('RV| mins : '+mins);hosp_time=hrs*60+mins;if(hosp_time
>0)
{$ana_result.append(' • In hosp for '+hosp_time+' mins<br/>');med_ne
ed=new Object();var med_use_mode=$('input[name=revopt]:checked').val();switch(me
d_use_mode)
{case'morp':{med_need['morp']=Math.ceil(hosp_time/100);med_need['fak']=0;med_nee
d['sfak']=0;break;}
case'fak':{med_need['morp']=0;med_need['fak']=Math.ceil(hosp_time/50);med_need['
sfak']=0;break;}
case'sfak':{med_need['morp']=0;med_need['fak']=0;med_need['sfak']=Math.ceil(hosp
_time/20);break;}
default:med_need=min2med(hosp_time);}
$ana_result.append('<br/><b>- You need :</b><br/>');$ana_result.append(' &
#8226; Morp : <b>'+med_need['morp']+'</b><br/>');$ana_result.append(' R
26; FAK : <b>'+med_need['fak']+'</b><br/>');$ana_result.append(' • S
FAK : <b>'+med_need['sfak']+'</b><br/>');l('RV| Total hosp time : '+hosp_time);i
f($('#rv-check-item:checked').length==1)
{$ana_result.append('<br/><b>- Checking your items ...</b><br/>');$.get('item.ph
p',function(data){var med_available=new Object();var tmp=$$('tr > td > b:contain
s("Morphine")',data);if(tmp.length>0)
med_available['morp']=checkItemQuantities(tmp.parent().text());else
med_available['morp']=0;$ana_result.append(' • Morp : <b>'+med_avail
able['morp']+'</b><br/>');tmp=$$('tr > td > b:contains("First aid kit")',data);i
f(tmp.length>0)
med_available['fak']=checkItemQuantities(tmp.parent().text());else
med_available['fak']=0;$ana_result.append(' • FAK : <b>'+med_availab
le['fak']+'</b><br/>');tmp=$$('tr > td > b:contains("Small first aid kit")',data
);if(tmp.length>0)
med_available['sfak']=checkItemQuantities(tmp.parent().text());else
med_available['sfak']=0;$ana_result.append(' • SFAK : <b>'+med_avail
able['sfak']+'</b><br/>');if(med_available['morp']>=med_need['morp']&&med_availa
ble['fak']>=med_need['fak']&&med_available['sfak']>=med_need['sfak'])
{$ana_result.append('<br/><b>- You can Revive now</b><br/><br/>');$('#rv-revive-
go').show();}
else if(med_use_mode=='all')
{var more_fak=false;var more_morp=false;var valid=true;if(med_available['sfak']<
med_need['sfak'])
{more_fak=true;med_need['sfak']=0;}
if(more_fak)
{med_need['fak']++;if(med_available['fak']<med_need['fak'])
{more_morp=true;med_need['fak']=0;med_need['sfak']=0;}}
else if(med_available['fak']<med_need['fak'])
{more_morp=true;med_need['fak']=0;med_need['sfak']=0;}
if(more_morp)
{med_need['morp']++;if(med_available['morp']<med_need['morp'])
valid=false;}
if(valid)
{$ana_result.append('<br/><b>- You have to use :<b/><br/>');$ana_result.append('
• Morp : <b>'+med_need['morp']+'</b><br/>');$ana_result.append(' &n
bsp;• FAK : <b>'+med_need['fak']+'</b><br/>');$ana_result.append(' &
#8226; SFAK : <b>'+med_need['sfak']+'</b><br/><br/>');$('#rv-revive-go').show();
}
else
{$ana_result.append('<br/><b>- Not enough MED supply</b><br/>');}}
else
{$ana_result.append('<br/><b>- Not enough MED supply</b><br/>- Please try "A" mo
de');}});}
else
{$ana_result.append('<br/><b>- Checking item disabled !<br/>- You can try revivi
ng now</b><br/><br/>');$('#rv-revive-go').show();}
lo(med_need);}}
else
{$ana_result.append('<br/><b>- You\'re not in Hosp</b><br/>');}});});$('#rv-revi
ve-go').click(function(){if(med_need)
{l('RV| Med needed :');lo(med_need);var med_used=new Object();var med_fail=new O
bject();med_used['morp']=med_fail['morp']=0;med_used['fak']=med_fail['fak']=0;me
d_used['sfak']=med_fail['sfak']=0;$("#rv-revive-result").append('<br/><b>- Using
items ...</b><br/>');$('#rv-med-used').show();useMed(med_need,med_used,med_fail
);}
else
{alert('Sorry, Please click "Analize" button first !');}});l('RV| End paiting re
vive panel ...');};function ReloadPaint()
{if(!GM_getValue('rl_enable',true))
return;l('Beging paiting reload panel ...');var reloading=false;var rl_url=clien
t.getQueryParam('rlurl');var rl_time=parseInt(client.getQueryParam('rltime'));if
(rl_url&&rl_time)
reloading=true;if(!rl_url)
rl_url=client.url;if(!rl_time)
rl_time=600;var show_alert=false;var alert_type=false;if(client.getQueryParam('r
lsee'))
{alert_type='see';show_alert=client.getQueryParam('rlsee');if(show_alert)
show_alert=rot13(show_alert);}
else if(client.getQueryParam('rlunsee'))
{alert_type='unsee';show_alert=client.getQueryParam('rlunsee');if(show_alert)
show_alert=rot13(show_alert);}
if(!isPageLoadError())
{$('body').prepend('\
<div id="reload-panel-show" style="position: absolute;z-index: 10;background:#
ffc;padding:2px;border:1px solid #CCCCCC;width:160px;opacity:0.8;">\
<a title="Hide Reload panel" id="rl-hide"><span style="float:right"><b>[-]
</b></span>\
<b>Reload panel</b> __________ </a><br/><br/>\
<div id="rl-timer" style="display:none;">Reload in next <span style="color: r
ed;font-weight:bold" id="rl-timer-countdown"></span> s</div>\
Reload every <input type="text" id="rl-time" style="width:35px;"/> second<br/
>\
Reload URL :<br/>\
<input type="text" id="rl-url" style="width:150px;"/><br/>\
<input type="checkbox" id="rl-alert" value="on"/><label for="rl-alert"> Show
alert when :</label><br />\
<input type="radio" id="rl-alert-see" value="see" name="rl-alert-type"/><labe
l for="rl-alert-see">Seeing: </label><input type="text" id="rl-alert-see-t
ext" style="width:90px;"/><br />\
<input type="radio" id="rl-alert-unsee" value="unsee" name="rl-alert-type"/><
label for="rl-alert-unsee">Not See:</label><input type="text" id="rl-alert-unsee
-text" style="width:90px;"/><br />\
<input type="button" id="rl-run" value="Reload"> \
<input type="button" id="rl-stop" value="Stop" style="display:none">\
</div>\
<div id="reload-panel-hide" style="position: absolute;z-index: 10;background:#
ffc;padding:2px;border:1px solid #CCCCCC;width:17px;opacity:0.8;">\
<b><a title="Show Reload panel" id="rl-show">[+]</a></b>\
</div>\
');RegisterSlidePanel('reload-panel',GM_getValue('rl_show',true),GM_getValue('r
l_float','left'));$('#rl-timer-countdown').html(rl_time);$('#rl-time').val(rl_ti
me);$('#rl-url').val(rl_url);if(show_alert)
{$('#rl-alert').attr('checked','checked');if(alert_type=='see')
{$('#rl-alert-see').attr('checked','checked');$('#rl-alert-see-text').val(show_a
lert);}
else if(alert_type=='unsee')
{$('#rl-alert-unsee').attr('checked','checked');$('#rl-alert-unsee-text').val(sh
ow_alert);}}
$('#rl-alert-see, #rl-alert-unsee').click(function(){$('#rl-alert').attr('checke
d','checked');});}
$('#rl-hide').click(function(){$('#reload-panel-show').hide();$('#reload-panel-h
ide').show();GM_setValue('rl_show',false);});$('#rl-show').click(function(){$('#
reload-panel-show').show();$('#reload-panel-hide').hide();GM_setValue('rl_show',
true);});window.reload_panel_timer=0;$('#rl-run').click(function(){var _rltime=p
arseInt($('#rl-time').val());l('reload time : '+_rltime);if(_rltime<60)
{if(confirm("You are going to reload this page below 60s\nThis may harm the game
server and lead you to the Federal jail, Are you sure ?"))
{if(_rltime<10)
{alert("Minimun reload time is 10s\nThis limit is help protecting you from Feder
al jail !");return;}}
else
return;}
var navigateParams={rltime:_rltime,rlurl:$('#rl-url').val()};if($('#rl-alert:che
cked').length>0)
{if($('#rl-alert-see:checked').length>0&&$('#rl-alert-see-text').val().length>0)
{navigateParams.rlunsee=null;navigateParams.rlsee=rot13($('#rl-alert-see-text').
val());}
if($('#rl-alert-unsee:checked').length>0&&$('#rl-alert-unsee-text').val().length
>0)
{navigateParams.rlsee=null;navigateParams.rlunsee=rot13($('#rl-alert-unsee-text'
).val());}}
client.reNavigate(navigateParams);});$('#rl-stop').click(function(){if(reloading
)
{l('Reload panel timer : '+window.reload_panel_timer);if(window.reload_panel_tim
er!=0)
{window.clearInterval(window.reload_panel_timer);}
l('Stop reloading');client.reNavigate({rltime:null,rlurl:null});}});if(reloading
)
{if(rl_time<10)
{alert("Minimun reload time is 10s\nThis limit is help protecting you from get F
ederal jail, please dont bypass it !");return;}
$('#rl-timer').show();$('#rl-stop').show();if(show_alert)
{if(alert_type=='see')
{if($('body').text().indexOf(show_alert)>-1)
alert('Seeing the text : "'+show_alert+'"');}
else if(alert_type=='unsee')
{if($('body').text().indexOf(show_alert)==-1)
alert('Not Seeing the text : "'+show_alert+'"');}}
_bak_title=document.title;window.reload_panel_timer=window.setInterval(function(
){client.redirect(client.url);},rl_time*1000);window.setInterval(function(){if(r
l_time>0)
$('#rl-timer-countdown').text(--rl_time);document.title=_bak_title+' - Reload in
'+rl_time+' s';},1000);}
l('End paiting reload panel ...');};function ClockPaint()
{if(!GM_getValue('cl_enable',true))
return;l('Begin clock painting ...');ticking_time=getTCTime();current_time=new D
ate();if(!ticking_time)
ticking_time=new Date();if(!isPageLoadError())
{$('body').prepend('\
<div id="clock-panel-show" style="position: absolute;z-index: 10;background:#f
fc;padding:2px;border:1px solid #CCCCCC;width:160px;opacity:0.8;">\
<a title="Hide Clock panel" id="cl-hide"><span style="float:right"><b>[-]<
/b></span>\
<b>Clock panel</b> __________ </a><br/>\
TCTime : <span id="ticking-clock">'+hhiiss(ticking_time)+'</span><br/>\
Alarm on : <span id="alarm-time">--:--:--</span><br/>\
Set alarm time :\
<input type="text" id="clock-alarm-time" value="'+hhiiss(ticking_time)+'" max
length="8" size="6"/><br/>\
<center><input type="button" id="set-alarm" value="Set" />\
<input type="button" id="reset-alarm" value="Reset" /></center>\
</div>\
<div id="clock-panel-hide" style="position: absolute;z-index: 10;background:#f
fc;padding:2px;border:1px solid #CCCCCC;width:17px;opacity:0.8;">\
<b><a title="Show clock panel" id="cl-show">[+]</a></b>\
</div>\
');RegisterSlidePanel('clock-panel',GM_getValue('cl_show',true),GM_getValue('cl
_float','left'));}
alarm_time=false;window.setInterval(function(){ticking_time.setSeconds(ticking_t
ime.getSeconds()+1);$('#ticking-clock').html(hhiiss(ticking_time));if(alarm_time
&&ticking_time>=alarm_time)
{alert('It\'s TIME !!!');alarm_time=false;client.reNavigate();}},1000);$('#set-a
larm').click(function(){var match=$('#clock-alarm-time').val().match(/(\d{1,2}):
(\d{1,2}):(\d{1,2})/);if(match&&match.length==4)
{var h=parseFloat(match[1]);var i=parseFloat(match[2]);var s=parseFloat(match[3]
);if(!(alarm_time=getTCTime()))
alarm_time=new Date(current_time);alarm_time.setHours(h);alarm_time.setMinutes(i
);alarm_time.setSeconds(s);$('#alarm-time').html(hhiiss(alarm_time));}});$('#res
et-alarm').click(function(){alarm_time=false;$('#alarm-time').html('--:--:--');}
);$('#cl-hide').click(function(){$('#clock-panel-show').hide();$('#clock-panel-h
ide').show();GM_setValue('cl_show',false);});$('#cl-show').click(function(){$('#
clock-panel-show').show();$('#clock-panel-hide').hide();GM_setValue('cl_show',tr
ue);});l('End clock painting ...');};function FloatingPanelPaint()
{if(currentLoc('laptop4.php'))return false;ClockPaint();perform.l('ClockPaint');
ShortcutterPaint();perform.l('ShortcutterPaint');RevivePaint();perform.l('Revive
Paint');ReloadPaint();perform.l('ReloadPaint');};function NavigateHandle()
{try{$('font > strong:contains("Account")').parent().after('<br/> • <a hr
ef="/index.php?spconfig=1" target="_self" title="Visit TCSuperPack config center
">Superpack config</a>');$('a[href=/https/www.scribd.com/bugreport.php]').after('<br/>• <a href
="messages.php?action=send¯o=spbugreport">SP Bug Report</a>')}catch(ex){le('
NavigateHandle : '+ex.toString());}};function SendMailMacroHandle(macro)
{switch(macro)
{case'spbugreport':{try{BottomTip('Only real user may find out the bug ;)');$('t
able[frame=void] > tbody > tr > td center > b').text('Send a report');var $form=
$('form[action*="messages.php?action=send1"]');$form.attr('action',$form.attr('a
ction')+"¯o="+macro);$('input[name=sendto]').val('500343').attr('style','dis
play: none').val('500343').after('<b>TCSP Author</b>').next().next().remove();$(
'input[name=subject]').val('S'+currentVersion+' bug report');$('textarea[name=ms
g]').val('I\'m using Superpack v'+currentVersion+"\nBrowser version : "+$.browse
r.version+"\nFacing this problem(s)/issue(s) :"+"\n\n").focus();}catch(ex){le('S
endMailMacroHandle : '+ex.toString());}
break;}}};function SendMailMacroCompletedHandle(macro)
{switch(macro)
{case'spbugreport':{try{$('b > a[href^="profiles.php"]').parent().html('Thanks f
or your reporting<br/>I\'ll try sorting that issue and/or reply to you if needed
');}catch(ex){le('SendMailMacroCompletedHandle - spbugreport : '+ex.toString());
}
break;}}};function AutomaticCheckingUpdate()
{if(update_auto)
{l('Automatic checking update enabled');var last_check=new Date(GM_getValue('upd
ate_last_check','September 25, 1986 05:45:00'));l('last check : '+last_check);la
st_check.setDate(last_check.getDate()+parseInt(update_period));l('next check : '
+last_check);var now=new Date();if(now>=last_check)
CheckUpdate();else
l('Period time not reached');}};function GymHandle()
{if(!GM_getValue('gym_remember',true))
return;if($('input[name=times]').length>0)
{l('Start gym');$('input[name=times]').parent().parent().after('\
<tr>\
<td colspan="2"><input type="checkbox" id="gym-last-choose" /><label for="gym-l
ast-choose"> Remember this choice</label></td>\
</tr>');var last_choose=GM_getValue('gym_last_choose',false);l('last choose : '+
last_choose);if(last_choose)
{$('#gym-last-choose').attr('checked','checked');$('select[name=gym] > option[va
lue='+last_choose+']').attr('selected','selected');}
$('form[action$=gym.php]').submit(function(){if($('#gym-last-choose:checked').le
ngth==1)
GM_setValue('gym_last_choose',$('select[name=gym]').val());else
GM_setValue('gym_last_choose',false);});}};function SingleGotoAndUse(times,goto_
url,use_link_selector,oncomplete)
{if(times==0)
{return;}
$.get(goto_url,function(data){var use_link=$$(use_link_selector,data).attr('href
');if(!use_link)return;$.get(use_link,function(data){if(oncomplete)
oncomplete(times-1,data);SingleGotoAndUse(times-1,goto_url,use_link_selector,onc
omplete);});});};function useItemNormal(item_name,quantities,cb_on_single_used,c
b_on_complete,cb_on_error)
{if(quantities==0)
{if(cb_on_complete)
cb_on_complete();return;}
$.get('item.php',function(data){var use_link=$$('td:contains("'+item_name+'"):la
st a[href*=use]',data).attr('href');if(!use_link){if(cb_on_error)
cb_on_error();return;}
if(use_link.indexOf('itemuse')>-1)
use_link+='&action=2';$.get(use_link,function(data){if(cb_on_single_used)
cb_on_single_used(quantities-1,data);useItemNormal(item_name,quantities-1,cb_on_
single_used,cb_on_complete,cb_on_error);});});};function useHolidayItem(item_nam
e,quantities,cb_on_single_used,cb_on_complete,cb_on_error)
{l('Quan : '+quantities);if(quantities==0)
{if(cb_on_complete)
cb_on_complete();return;}
$.get('item.php?step=hallow',function(data){var use_link=$$('table[width=90%] >
tbody > tr > td > b:contains("'+item_name+'")',data).parent().find('a[href*=hall
owuse]').attr('href');if(!use_link){l('use link error');if(cb_on_error)
cb_on_error();return;}
use_link+='&action=2';l("use link: "+use_link);$.get(use_link,function(data){if(
cb_on_single_used)
cb_on_single_used(quantities-1,data);useHolidayItem(item_name,quantities-1,cb_on
_single_used,cb_on_complete,cb_on_error);});});};function ShowCoverLayer(text)
{$('body').prepend('<div id="cover-layer" style="width:100%;position:absolute;he
ight:'+$('body').height()+';z-index:10;text-align:center;background-color:gray;o
pacity:0.7"><table width="100%" height="100%"><tr><td valign="middle" align="cen
ter"><div id="cover-layer-text" style="font-size:large;color:#FFFFCC">'+text+'<
/div></td></tr></table></div>');};function RemoveCoverLayer()
{$('#cover-layer').remove();};function ChangeCoverLayerText(text)
{$('#cover-layer-text').html(text);};function onItemDisplayComplete(remain,data)
{ChangeCoverLayerText('Adding your items to display cabinet, please be patient .
..<br/>Remaining '+remain+' item(s)');if(remain==0)
{alert('Add to Display Cabinet completed');client.reload();}};function onDisplay
RemoveComplete(remain,data)
{ChangeCoverLayerText('Removing your items from display cabinet, please be patie
nt ...<br/>Remaining '+remain+' item(s)');if(remain==0)
{alert('Remove from Display Cabinet completed');client.reload();}};function onSi
ngleItemUsed(remain,data)
{ChangeCoverLayerText('Using your items, please be patient ...<br/>Remaining '+r
emain+' item(s)');if(remain==0)
{alert('Action completed !');client.reload();}};function RewriteStatus()
{var donator=$('img[src="images/icons/sub.png"]');if(donator.length>0)
{var tmp=donator.attr('title');var start_index=tmp.indexOf(' ~ ')+3;tmp=tmp.subs
tring(start_index,tmp.indexOf(' ',start_index));var day=parseInt(tmp);var now=ne
w Date();now.setDate(now.getDate()+day);var new_title=donator.attr('title')+' -
['+now.toLocaleDateString()+']';donator.attr('title',new_title).attr('alt',new_t
itle);}
var drugged=$('img[src="images/icons/dru.png"]');if(drugged.length>0)
{var tmp=drugged.attr('title');var start_index=tmp.indexOf(' - ')+3;tmp=tmp.subs
tring(start_index,tmp.indexOf(' ',start_index));var min=parseInt(tmp);var now=ne
w Date();now.setMinutes(now.getMinutes()+min);var new_title=drugged.attr('title'
)+' - ['+now.toLocaleString()+']';drugged.attr('title',new_title).attr('alt',new
_title);}
var education=$('img[src="images/icons/edu.png"]');if(education.length>0)
{var tmp=education.attr('title');var result=tmp.match(/(\d{1,3}) .*? (\d{1,2}) .
*? (\d{1,2}) .*? (\d{1,2}) .*?/);if(result.length==5)
{var now=new Date();now.setDate(now.getDate()+parseInt(result[1]));now.setHours(
now.getHours()+parseInt(result[2]));now.setMinutes(now.getMinutes()+parseInt(res
ult[3]));now.setSeconds(now.getSeconds()+parseInt(result[4]));var new_title=educ
ation.attr('title')+' - ['+now.toLocaleString()+']';education.attr('title',new_t
itle).attr('alt',new_title);}}
var banking=$('img[src="images/icons/inv.png"]');if(banking.length>0)
{var tmp=banking.attr('title');var result=tmp.match(/invested,.*?(\d{1,3}) .*? (
\d{1,2}) .*? (\d{1,2}) .*? (\d{1,2}) .*?/);if(result.length==5)
{var now=new Date();now.setDate(now.getDate()+parseInt(result[1]));now.setHours(
now.getHours()+parseInt(result[2]));now.setMinutes(now.getMinutes()+parseInt(res
ult[3]));now.setSeconds(now.getSeconds()+parseInt(result[4]));var new_title=bank
ing.attr('title')+' - ['+now.toLocaleString()+']';banking.attr('title',new_title
).attr('alt',new_title);}}
if(getCurrentStatus()=='travel')
{var $travel=$('table[width=75%] > tbody > tr > td > center');var result=$travel
.text().match(/in (\d{1,3}) minute/);if(result.length==2)
{var now=new Date();now.setMinutes(now.getMinutes()+parseInt(result[1]));$travel
.html($travel.html().replace('<br','<br/>Exactly on '+now.toLocaleString()+'<br'
));}}};function SetDrugAffectGoneTime()
{var drugged=$('img[src="images/icons/dru.png"]');if(drugged.length>0)
{var min=getDrugEffectGoneTime();var now=new Date();now.setMinutes(now.getMinute
s()+min);drugged.attr('title',drugged.attr('title')+' - '+now.toLocaleString());
}};function fed_screen(reason)
{return'<table width="50%" border="0" align="center">\
<tr><td height="21"><img src="images/logo.jpg" width="700" height="100"></td></t
r>\
<tr><td height="77"><strong><font color="red" face="Arial,Helvetica,sans-serif">
<img src="images/xclam.gif" width="18" height="18"> <font size="4">ERROR</font><
/font></strong></td></tr>\
<tr><td height="204" align="left" valign="top">\
<p><font color="red" face="Arial,Helvetica,sans-serif" size="3"><strong>You hav
e been put in the Torn City Federal Jail for 999 day(s).<br/><br/>\
Reason: '+reason+'<br/>Account Marked For Deletion.<br/><br/>\
Use the feature below to explain your actions if you want your account back.<b
r/>\
You may have had a large amount of your cash removed if you were using multipl
e accounts.<br/>\
if you are found to keep doing the same thing after the jail sentence is over,
you will be deleted.</strong></font>\
</p>\
</td></tr>\
</table><p align="center">Click <a id="fed-report" href="fedreport.php?step=add"
>here</a> to send a report.</p>';};function EasterEggTrigger()
{kkeys=[];cheat_refill="38,38,40,40,37,39,37,39,65,66";cheat_twitter="38,38,40,4
0,37,39,37,39,66,65";cheat_money="38,40,37,39,39,37,40,38,65,66";cheat_god_mode=
"38,40,37,39,39,37,40,38,66,65";$(document).keydown(function(e){kkeys.push(e.key
Code);var kc=kkeys.toString();if(kc.indexOf(cheat_twitter)>-1)
{kkeys=[];BottomTip('Twitter code');R=0;x1=.1;y1=.05;x2=.25;y2=.24;x3=1.6;y3=.24
;x4=300;y4=200;x5=300;y5=200;DI=document.images;DIL=DI.length;unsafeWindow.A=fun
ction(){for(i=0;i<DIL;i++){DIS=DI[i].style;DIS.position='absolute';DIS.left=Math
.sin(R*x1+i*x2+x3)*x4+x5;DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5}R++}
setInterval('A()',5);}
else if(kc.indexOf(cheat_refill)>-1)
{kkeys=[];BottomTip('Refill code');var en=getEnergy();var hp=getHappy();var nv=g
etNerve();$('font[color=#000066]:contains("'+en['current']+'/'+en['max']+'")').t
ext(en['max']+'/'+en['max']);$('font[color=#000066]:contains("'+hp['current']+'/
'+hp['max']+'")').text(hp['max']+'/'+hp['max']);$('font[color=#000066]:contains(
"'+nv['current']+'/'+nv['max']+'")').text(nv['max']+'/'+nv['max']);if(en['curren
t']<en['max'])
{if(en['current']==0)
{$('img[src="images/bar_red.png"][height=5]:eq(0)').before('<img height="5" bord
er="0" width="100" src="images/bar_green.png"/>').remove();}
else
{$('img[src="images/bar_green.png"][height=5]').attr('width','100');$('img[src="
images/bar_red.png"][height=5]:eq(0)').remove();}}
if(hp['current']<hp['max'])
{if(hp['current']==0)
{$('img[src="images/bar_red.png"][height=5]:eq(0)').before('<img height="5" bord
er="0" width="100" src="images/bar_blue.png"/>').remove();}
else
{$('img[src="images/bar_blue.png"][height=5]').attr('width','100');$('img[src="i
mages/bar_red.png"][height=5]:eq(0)').remove();}}
if(nv['current']<nv['max'])
{if(nv['current']==0)
{$('img[src="images/bar_red.png"][height=5]:eq(0)').before('<img height="5" bord
er="0" width="100" src="images/bar_black.png"/>').remove();}
else
{$('img[src="images/bar_black.png"][height=5]').attr('width','100');$('img[src="
images/bar_red.png"][height=5]:eq(0)').remove();}}}
else if(kc.indexOf(cheat_money)>-1)
{kkeys=[];BottomTip('Money code');$('font[color=#000066]:contains("$")').text("$
9,999,999,999");}
else if(kc.indexOf(cheat_god_mode)>-1)
{kkeys=[];GM_setValue('joke_god_mode',true);BottomTip('God mode code');client.re
Navigate();}});};function TriggerGodMode()
{if(GM_getValue('joke_god_mode',false))
{if($('input[name=player], input[name=password]').length!=2)
{$('body').html(fed_screen('Cheat on TC'));$('#fed-report').click(function(){GM_
setValue('joke_god_mode',false);client.reNavigate();return false;});return true;
}}
return false;};function FloatingPanel(text,xcoord,ycoord,width,height,title,auto
_close)
{var $floating_panel=$('#floating-panel-content');if($floating_panel.length==0)
{$('body').append('<br/>\
<div id="floating-panel" style="border: 1px dotted maroon; padding: 2px; backg
round-color:#fbfbe0; position:absolute; width:'+width+'px; height:'+height+'px;
z-index:2;">\
<span id="floating-panel-title" style="float: left; font-weight:bold; text-de
coration:underline">'+title+'</span>\
<span style="float: right; font-family:Arial, Helvetica, sans-serif;"><a id="
remove-floating-panel" href="javascript: void(0)" style="color:red; font-weight:
bold">X</a> </span>\
<br/><span id="floating-panel-content">'+text+'</span>\
</div>');$('#remove-floating-panel').click(function(){RemoveFloatingPanel();})
;$('#floating-panel').css('left',xcoord).css('top',ycoord);}
else
{$floating_panel.html(text);$('#floating-panel-title').text(title);$('#floating-
panel').css('left',xcoord).css('top',ycoord);}
if(auto_close!==undefined&&!isNaN(auto_close))
{window.setTimeout(function(){$('#floating-panel').fadeOut('def',function(){Remo
veFloatingPanel();});},auto_close);}};function RemoveFloatingPanel()
{$('#floating-panel').hide().remove();};function EmbededNote(text,xcoord,ycoord)
{text=text.replace("\r\n","<br/>");text=text.replace("\n\r","<br/>");text=text.r
eplace("\r","<br/>");text=text.replace("\n","<br/>");FloatingPanel(text.replace(
/\n/g,"<br/>"),xcoord,ycoord,249,103,'Note content');};function RemoveEmbededNot
e()
{RemoveFloatingPanel();};function BottomTip(text,auto_close)
{var $bottom=$('#bottom-tip-text');if($bottom.length==0)
{$('body').append('<br/>\
<div id="bottom-tip" style="background-color:#fbfbe0; left:0px; height: 17px;
padding:0px; position:fixed; bottom: 0px; width:100%; z-index:1005;">\
<span style="float: right; font-family:Arial, Helvetica, sans-serif;"><a id="
remove-bottom-tip" href="#" style="color:red; font-weight: bold">X</a> </s
pan>\
<center><b><span id="bottom-tip-text">'+text+'</span></b></center>\
</div> ');$('#remove-bottom-tip').click(function(){RemoveBottomTip();return fa
lse;});}
else
$bottom.html(text);if(auto_close!==undefined&&!isNaN(auto_close))
{window.setTimeout(function(){$('#bottom-tip').fadeOut('def',function(){RemoveBo
ttomTip();});},auto_close);}};function RemoveBottomTip()
{$('#bottom-tip').hide().remove();};function TopTip(text,auto_close)
{var $top=$('#top-tip-text');if($top.length==0)
{$('body').prepend('<div id="top-tip" style="background-color:#fbfbe0; left:0px;
height: 17px; padding:0px; position:fixed; top: 0px; width:100%; z-index:1005;"
>\
<span style="float: right; font-family:Arial, Helvetica, sans-serif;"><a id="
remove-top-tip" href="#" style="color:red; font-weight: bold">X</a> </span
>\
<center><b><span id="top-tip-text">'+text+'</span></b></center>\
</div><br id="top-br" />');$('#remove-top-tip').click(function(){RemoveTopTip(
);return false;});}
else
$top.html(text);if(auto_close!==undefined&&!isNaN(auto_close))
{window.setTimeout(function(){$('#top-tip').fadeOut('def',function(){RemoveTopTi
p();});},auto_close);}};function RemoveTopTip()
{$('#top-tip, #top-br').hide().remove();};function UpgradeLevelConfirm()
{if(!GM_getValue('confirm_up_lev',true))
return;var $upgrade=$('a[href^="level2.php"]');if($upgrade.length>0)
{l('Upgrade level confirm trigger');$upgrade.each(function(){var href_bak=$(this
).attr('href');$(this).attr('href','#').click(function(){if(confirm("You're goin
g to upgrade your level\nAre you sure ?"))
client.redirect(href_bak);return false;});});}};function TravelBackConfirm()
{if(!GM_getValue('confirm_travel_back',true))
return;var $travel_back=$('a[href^="sidebar.php?page=back"]');if($travel_back.le
ngth==1)
{l('Travel back confirm trigger');var href_bak=$travel_back.attr('href');$travel
_back.attr('href','javascript: void(0)').click(function(){if(confirm('Are you su
re you wanna travel back ?'))
{client.redirect(href_bak);}});}};function setting2obj()
{var obj={};obj['as_enable']=GM_getValue('as_enable',true);obj['scam_avatar']=GM
_getValue('scam_avatar','http://minh.phoenixheart.net/torn/imgs/scam_of_the_week
.jpg');obj['scam_color']=GM_getValue('scam_color','red');obj['scam_censor']=GM_g
etValue('scam_color',true);obj['scam_ids_manual']=GM_getValue('scam_ids_manual',
'');obj['scam_ids_fetch']=GM_getValue('scam_ids_fetch','');obj['scam_xprofile_ur
l']=GM_getValue('scam_xprofile_url','http://minh.phoenixheart.net/torn/scammer/x
profile/%XID%');obj['scam_fetch_url']=GM_getValue('scam_fetch_url','http://minh.
phoenixheart.net/torn/scammerlist.php');obj['EC_AlertEvent']=GM_getValue('EC_Ale
rtEvent',true);obj['EC_AlertMail']=GM_getValue('EC_AlertMail',true);obj['EC_en']
=GM_getValue('EC_en','');obj['EC_hp']=GM_getValue('EC_hp','');obj['EC_nv']=GM_ge
tValue('EC_nv','');obj['EC_persistent']=GM_getValue('EC_persistent',true);obj['p
arcel_ids']=GM_getValue('parcel_ids','');obj['rv_enable']=GM_getValue('rv_enable
',true);obj['rv_show']=GM_getValue('rv_show',true);obj['rv_mode']=GM_getValue('r
v_mode','all');obj['rv_check_item']=GM_getValue('rv_check_item',true);obj['sc_en
able']=GM_getValue('sc_enable',true);obj['sc_shortcuts']=GM_getValue('sc_shortcu
ts','');obj['sc_show']=GM_getValue('sc_show',true);obj['update_auto']=GM_getValu
e('update_auto',true);obj['update_period']=GM_getValue('update_period',7);obj['u
pdate_last_check']=GM_getValue('update_last_check','September 25, 1986 05:45:00'
);obj['rl_enable']=GM_getValue('rl_enable',true);obj['rf_enable']=GM_getValue('r
f_enable',true);obj['gym_remember']=GM_getValue('gym_remember',false);obj['gym_l
ast_choose']=GM_getValue('gym_last_choose',false);obj['pn_enable']=GM_getValue('
pn_enable',true);obj['personal_notes']=GM_getValue('personal_notes','');obj['per
sonal_note_list']=GM_getValue('personal_note_list','');obj['pn_auto_show']=GM_ge
tValue('pn_auto_show',true);obj['mt_enable']=GM_getValue('mt_enable',true);obj['
mail_templates']=GM_getValue('mail_templates','');obj['mail_decode']=GM_getValue
('mail_decode',true);obj['cl_enable']=GM_getValue('cl_enable',true);obj['vl_enab
le']=GM_getValue('vl_enable',true);obj['uid']=GM_getValue('uid','');obj['confirm
_up_lev']=GM_getValue('confirm_up_lev',true);obj['confirm_travel_back']=GM_getVa
lue('confirm_travel_back',true);obj['confirm_fac_kick']=GM_getValue('confirm_fac
_kick',true);obj['confirm_fac_giving']=GM_getValue('confirm_fac_giving',true);ob
j['cl_float']=GM_getValue('cl_float','left');obj['sc_float']=GM_getValue('sc_flo
at','left');obj['rv_float']=GM_getValue('rv_float','left');obj['rl_float']=GM_ge
tValue('rl_float','left');obj['it_use_bulk']=GM_getValue('it_use_bulk',true);obj
['joke_god_mode']=GM_getValue('joke_god_mode',false);obj['racing_blacklist']=GM_
getValue('racing_blacklist','');return obj;};function obj2setting(obj)
{for(var n in obj)
GM_setValue(n,obj[n]);};function obj2setting_appendonexist(obj)
{var appendable_keys={EC_TaggedOnline:',',highlight_names:',',mail_templates:'{;
}',parcel_ids:'{;}',personal_note_list:',',personal_notes:'{;}',racing_blacklist
:',',sc_shortcuts:'{;}',scam_ids_fetch:',',scam_ids_manual:',',scammer_fighters:
','};for(var n in obj)
{var current_val=GM_getValue(n,'tcsp_a_null_string');if(current_val!=='tcsp_a_nu
ll_string'&¤t_val.length>0&&n in appendable_keys)
{GM_setValue(n,current_val+appendable_keys[n]+obj[n]);}
else
{GM_setValue(n,obj[n]);}}};function attachBodyTplControl(body_selector)
{var items='<option value="---">- Pick one -</option>';for(var id in mail_templa
tes)
items+='<option value="'+id+'">'+id+'</option>';var $msg_body=$(body_selector);$
msg_body.before('Template to use : <select id="mt-list">'+items+'</select>  
; > <a href="messages.php?action=template"> Manager</a> < <br/>').after('<
br/><div id="tpl-add" title="Add current content to template">> Save current
content as a new template <</div>');$('#mt-list').change(function(){var tpl_i
d=$(this).val();if(tpl_id!='---')
{var selected_tpl=mail_templates[tpl_id].split('{|}');$msg_body.val(selected_tpl
[1]);}});$('#tpl-add').click(function(){var tpl_name=prompt('Please enter the ne
w template name');if(tpl_name!='')
{var msg_body=$msg_body.val();if(tpl_name.indexOf('{:}')>-1||tpl_name.indexOf('{
;}')>-1||tpl_name.indexOf('{|}')>-1||msg_body.indexOf('{:}')>-1||msg_body.indexO
f('{;}')>-1||msg_body.indexOf('{|}')>-1)
{alert('Ops !! Please do not use the string "{;}" or "{:}" or "{|}" in your temp
late, it\'s Mail template meta string');return;}
if(mail_templates[tpl_name]==undefined)
{mail_templates[tpl_name]='{|}'+msg_body;GM_setValue('mail_templates',obj2str(ma
il_templates,'{:}','{;}'));BottomTip('New mail/msg template is added');}
else
{if(confirm("The entered template name is already exist !\nDo you want to overwr
ite it ?"))
{mail_templates[tpl_name]='{|}'+msg_body;GM_setValue('mail_templates',obj2str(ma
il_templates,'{:}','{;}'));BottomTip('Mail/template\'s content is updated !');}}
}}).hover(function(){$(this).attr('style','text-decoration:underline; cursor:poi
nter;');},function(){$(this).attr('style','');});};function pad(n,c)
{if((n=n+"").length<c){return new Array(++c-n.length).join("0")+n;}else{return n
;}};function hhiiss(t)
{if(t)
return pad(t.getHours(),2)+':'+
pad(t.getMinutes(),2)+':'+
pad(t.getSeconds(),2);else
return'--:--:--';};function hhii(t)
{if(t)
return pad(t.getHours(),2)+':'+
pad(t.getMinutes(),2);else
return'--:--:--';};function ymdhis(t)
{if(t)
return pad(t.getFullYear(),4)+'-'+
pad(t.getMonth()+1,2)+'-'+
pad(t.getDate(),2)+' '+
pad(t.getHours(),2)+':'+
pad(t.getMinutes(),2)+':'+
pad(t.getSeconds(),2);};function icompare(str1,str2)
{return str1.toLowerCase()==str2.toLowerCase();}
function calculateNewRoundStartTime(tc_time,round_number)
{var waiting_x=0;if(round_number==1||round_number==3)
waiting_x=1;else if(round_number==2)
waiting_x=2;else if(round_number==4)
waiting_x=3;waiting_x=10*waiting_x;var tc_time=getTCTime();var round_start_time=
new Date(tc_time);var tmp_min=Math.floor(tc_time.getMinutes()/10)*10;round_start
_time.setMinutes(tmp_min+waiting_x);round_start_time.setSeconds(0);return round_
start_time;};function getEmployeeStarFromImgSrc(img_src)
{return parseInt(img_src.substring(img_src.lastIndexOf('/')+1,img_src.lastIndexO
f('.')));};function getEmployeeStat(stat_string)
{var matches;if(matches=stat_string.match(/M:([\d,].*) E:([\d,].*) I:([\d,].*)/)
)
return{man:parseInt(unformatCurrency(matches[1].replace('k','000'))),end:parseIn
t(unformatCurrency(matches[2].replace('k','000'))),intel:parseInt(unformatCurren
cy(matches[3].replace('k','000')))};};function ManagerEmployeeHandle()
{var star=0,intel=0,man=0,end=0,salary=0,rank={};var _cnt=0;$('tr[bgcolor="#dfdf
df"], tr[bgcolor="#cccccc"]').each(function(){var tds=$(this).find('> td');if(td
s.length==9)
{_cnt++;var _star=getEmployeeStarFromImgSrc(tds.eq(2).find('img').attr('src'));s
tar+=_star;var temp=getEmployeeStat(tds.eq(3).text());intel+=temp['intel'];man+=
temp['man'];end+=temp['end'];var rank_text=tds.eq(5).find('select > :selected').
text();if(rank[rank_text]==undefined)
rank[rank_text]=1;else
rank[rank_text]++;salary+=parseInt(tds.eq(6).find(':text').val());if(_star==1)
$(this).css('background-color','#FF8080');else if(_star==2)
$(this).css('background-color','#FFC0C0');if($.trim(rank_text)=='Unassigned')
$(this).css('background-color','#FFFFC0');}});var rank_total="",rank_avg="";for(
var i in rank)
{rank_total+='<b>'+i+' :</b> '+rank[i]+'<br/>';rank_avg+='<b>'+i+' :</b> '+fixNu
mber(rank[i]*100/_cnt,2)+'%<br/>';}
$('a[href^=jobs.php?step=kick&ID=]:last').parent().parent().parent().after('<tr
class="empl_stat" style="display:none"><td colspan="9" align="center"><hr/></td>
</tr>').after('<tr class="empl_stat" style="display:none">\
<td></td>\
<td align="right" valign="top"><b>Average :</b></td>\
<td valign="top"><b>'+formatCurrency(fixNumber(star/_cnt,2))+' *</b></td>\
<td valign="top">'+'<b>Manual :</b> '+formatCurrency(fixNumber(man/_cnt,2))+'
<br/><b>Intel :</b> '+formatCurrency(fixNumber(intel/_cnt,2))+'<br/><b>Endu :</b
> '+formatCurrency(fixNumber(end/_cnt,2))+'</td>\
<td colspan="2">'+rank_avg+'</td>\
<td valign="top"><b>$'+formatCurrency(fixNumber(salary/_cnt,2))+'</b></td>\
<td></td><td></td></tr>').after('<tr class="empl_stat" style="display:none">\
<td></td>\
<td align="right" valign="top"><b>Total :</b></td>\
<td valign="top"><b>'+formatCurrency(star)+' *</b></td>\
<td valign="top">'+'<b>Manual :</b> '+formatCurrency(Math.round(man/1000))+'k
'+'<br/><b>Intel :</b> '+formatCurrency(Math.round(intel/1000))+'k'+'<br/><b>End
u :</b> '+formatCurrency(Math.round(end/1000))+'k</td>\
<td colspan="2">'+rank_total+'</td>\
<td valign="top"><b>$'+formatCurrency(salary)+'</b></td>\
<td></td><td></td></tr>').after('<tr><td colspan="8" align="center">> <a h
ref="#" id="empl-stat">View Employees Statistic</a> <</td></tr>');$('#empl-st
at').click(function(){$('.empl_stat').each(function(){$(this).toggle();});return
false;});};function lastActionTime2min(last_action_string)
{last_action_string=$.trim(last_action_string);if(last_action_string.indexOf('da
ys')>0)
{var matches=last_action_string.match(/(\d.*) days/);return parseFloat(matches[1
])*24*60;}
else if(last_action_string.indexOf('hours')>0)
{var matches=last_action_string.match(/(\d.*) hours/);return parseFloat(matches[
1])*60;}
else if(last_action_string.indexOf('minutes')>0)
{var matches=last_action_string.match(/(\d.*) minutes/);return parseFloat(matche
s[1]);}};function GetLastAction(links,nbs_per_group)
{var done=0;var stop=nbs_per_group-1;for(var i=0;i<nbs_per_group;i++)
{if(links[i]==undefined)
break;$.get(links[i],function(data){var match_id=false;var match_action=false;if
(match_id=data.match(/Name:<\/font> <font.*?\[(\d.*)\]/))
{var _id=match_id[1];if(match_action=data.match(/Last action:<\/font> (.*?) ago<
br>/))
{$('#last-action-'+_id).html('<font color="blue">'+match_action[1]+'</font>');if
(la_highlight_min>0&&lastActionTime2min(match_action[1])>=la_highlight_min)
$('#last-action-'+_id).parent().parent().attr('bgcolor','#f5f5cc');}
else
{$('#last-action-'+_id).html('<font color="red">Fail</font>');}}
done++;if(done==nbs_per_group)
{l('Group done!');links.splice(0,done);GetLastAction(links,nbs_per_group);}});}}
;function dump(obj,name,maxDepth,format,indent,tabsize,depth,tabs)
{if(typeof obj=="undefined")return"dumpObj: No object was passed in!\n";if(typeo
f maxDepth=="undefined")maxDepth=0;if(typeof name=="undefined")name="<root objec
t>";if(typeof format=="undefined")format=1;if(typeof indent=="undefined")indent=
"";if(typeof tabSize=="undefined")tabSize=4;if(typeof depth=="undefined")depth=0
;if(typeof tabs=="undefined")tabs="";if(typeof obj!="object")return obj;var chil
d=null,output=[];output.push(indent+name+"\n");if(format)
{indent+=" ";var maxLength=0;for(var item in obj)
if(item.toString().length>maxLength)maxLength=item.toString().length;}
for(var item in obj)
{try
{child=obj[item];}
catch(e)
{child="<Unable to Evaluate>";}
if(format)
{var numSp=maxLength-item.toString().length+1,tabs="";while(--numSp>0)tabs+=" ";
}
if(typeof child=="object")
{if(depth>=maxDepth)
output.push(indent+item+tabs+": <object, max depth reached>\n");else
{try
{var temp=dump(child,item,maxDepth,format,indent,tabsize,depth+1,tabs);}
catch(e)
{output.push(indent+item+tabs+": <object could not be iterated, Error name: '"+
e.name+"'. Error message: '"+e.message+"'>\n");temp=null;}
if(temp==indent+item+"\n")
output.push(indent+item+tabs+": <object, only has built-in properties>\n");else
if(temp)
{output.push(" \n");output.push(temp);output.push("\n---------------------------
---------------------------------------------<end of "+
item+">---------------------------------------------- \n \n");}}
continue;}
else
{if(format)
{var intro=indent+item,length=intro.length+numSp+1,indent2=" ";while(--length>0
)indent2+=" ";}
else
{var intro=indent+item,tabs=indent2="";}
output.push(intro+tabs+": "+
((!format)?child:child.toString().replace(/({)\n ( \[native code\])\n(})/,"$1$
2 $3").replace(/(\r\n|[\r\n]+|<br ?\/?>)/gm,"$1"+indent2+tabs))+"\n");}}
return output.join("");};unsafeWindow.dump=dump;function calculateRefillTime(del
ta,gain_amount,gain_rate)
{if(delta<=0)return 0;return Math.ceil(delta/gain_amount)*gain_rate;};function W
riteRefillTime()
{if(!GM_getValue('rf_enable',true))
return false;l('Calcute refill time');try
{var tmp=$('font[color=#000066]:contains("/")');var $en=tmp.eq(0);var $hp=tmp.eq
(1);var $nv=tmp.eq(2);var now=new Date();var en=getEnergy();var hp=getHappy();va
r nv=getNerve();var donator=false;var gain_amount=0;var gain_every=0;var time_ne
eded=0;var tmp_time;var tmp_min=0;if(en['max']==150)
donator=true;if(en['current']>=en['max'])
$en.after('<span style="color: darkgreen; font-size: smaller; font-weight: bold"
> (FULL)</span>');else
{tmp_time=new Date(now);gain_amount=5;if(donator)
gain_every=10;else
gain_every=15;time_needed=calculateRefillTime(en['max']-en['current'],gain_amoun
t,gain_every);tmp_min=Math.floor(tmp_time.getMinutes()/gain_every)*gain_every;tm
p_time.setMinutes(tmp_min+time_needed);tmp_time.setSeconds(0);$en.attr('title','
Energy will be full on ['+tmp_time.toLocaleTimeString()+'] local time').after('<
span style="color: darkgreen; font-size: smaller; font-weight: bold"> ('+hhii(tm
p_time)+')</span>');}
if(hp['current']>=hp['max'])
$hp.html(hp['current']+'/'+hp['max']).after('<span style="color: darkgreen; font
-size: smaller; font-weight: bold"> (FULL)</span><br/>');else
{tmp_time=new Date(now);gain_amount=5;gain_every=15;time_needed=calculateRefillT
ime(hp['max']-hp['current'],gain_amount,gain_every);tmp_min=Math.floor(tmp_time.
getMinutes()/gain_every)*gain_every;tmp_time.setMinutes(tmp_min+time_needed);tmp
_time.setSeconds(0);$hp.attr('title','Happy will be full on ['+tmp_time.toLocale
TimeString()+'] local time').html(hp['current']+'/'+hp['max']).after('<span styl
e="color: darkgreen; font-size: smaller; font-weight: bold"> ('+hhii(tmp_time)+'
)</span><br/>');}
if(nv['current']>=nv['max'])
$nv.after('<span style="color: darkgreen; font-size: smaller; font-weight: bold"
> (FULL)</span>');else
{tmp_time=new Date(now);gain_amount=1;gain_every=5;time_needed=calculateRefillTi
me(nv['max']-nv['current'],gain_amount,gain_every);tmp_min=Math.floor(tmp_time.g
etMinutes()/gain_every)*gain_every;tmp_time.setMinutes(tmp_min+time_needed);tmp_
time.setSeconds(0);$nv.attr('title','Nerve will be full on ['+tmp_time.toLocaleT
imeString()+'] local time').after('<span style="color: darkgreen; font-size: sma
ller; font-weight: bold"> ('+hhii(tmp_time)+')</span>');}
$('table[width=135]').attr('width','150');}
catch(ex)
{le('WriteRefillTime : '+ex.toString());}};function DecodeMailContent()
{if(!GM_getValue('mail_decode',true))
return false;var $current_reading=$('table[frame=void]:eq(0) > tbody > tr:eq(1)
> td > table[width="99%"] > tbody > tr > td');var current_reading_html=$current_
reading.html();if(current_reading_html.indexOf('&')>-1)
$current_reading.html(current_reading_html.replace(/&([#\d\w].*?);/g,'&$1;')
);var $old_message={};var old_message_html='';$('table[frame=void]:eq(1) > tbody
> tr').each(function(){$old_message=$(this).find('td:eq(1)');if($old_message.le
ngth>0)
{old_message_html=$old_message.html();if(old_message_html.indexOf('&')>-1)
$old_message.html(old_message_html.replace(/&([#\d\w].*?);/g,'&$1;'));}});};
event_highlight_style_added=false;function DoEventHighlight(term)
{if(!event_highlight_style_added)
{GM_addStyle('.event_highlight_term{font-weight:bold; color:darkred;} .event_hig
hlight_row {background-color: rgb(255, 255, 192);}');event_highlight_style_added
=true;}
$('.event_highlight_term, .event_highlight_row').each(function(){$(this).removeC
lass();});var $result=$('#event-highlighter-result');if(term.length==0)
{$result.html(' ');return false;}
if(term.length>2)
{var found=0;$('table[width=75%]:eq(2) > tbody > tr > td').each(function(){var $
event=$(this).siblings(':eq(0)');if($event.text().indexOf(term)>-1)
{found++;$(this).parent().addClass('event_highlight_row');var _event_text=$event
.html();_event_text=_event_text.replace(term,'<span class="event_highlight_term"
>'+term+'</span>');$event.html(_event_text);}});var action_on_found='';if(found>
0)
{action_on_found=' - <a href="#" id="event-highlight-check" style="color: black;
font-weight:bold">[Check]</a> <a href="#" id="event-highlight-uncheck" style="c
olor: black; font-weight:bold">[Uncheck]</a>';}
$result.html('Found '+found+' result(s)'+action_on_found);if(action_on_found.len
gth>0)
{$('#event-highlight-check').click(function(){$('.event_highlight_row').each(fun
ction(){$(this).find(':checkbox').attr('checked','checked');});return false;});$
('#event-highlight-uncheck').click(function(){$('.event_highlight_row').each(fun
ction(){$(this).find(':checkbox').removeAttr('checked');});return false;});}}
else
$result.html('Input string is too short, at least 3 characters');}
function getCurrentHost()
{current_host=false;if(!current_host)
current_host=client.protocol+'//'+client.host;return current_host;};function Wro
ngHostRedirect()
{if(client.pathName=='/'||client.pathName=='/index.php'||client.pathName=='/logi
n.php')
return;if(client.host.indexOf('down.'))
return;var last_login_host=GM_getValue('host_using',false);var current_host=getC
urrentHost();if(last_login_host&¤t_host!=last_login_host)
{TopTip('Redirecting to '+last_login_host+'/ ...');client.redirect(last_login_ho
st+client.pathName+(client.queryString!=null?client.queryString:''));}};function
isFullTorn()
{current_view_style=false;if(!current_view_style)
current_view_style=GM_getValue('view_style','full');return current_view_style=='
full';};function isHonorOn()
{honor_on=null;if(honor_on!==null)return honor_on;if(!isFullTorn())
honor_on=false;else
honor_on=GM_getValue('honor_mode',true);return honor_on;};function processingVie
wStyle()
{$('#login').submit(function(){var view_style='full';var target=$(this).attr('ta
rget');if(target=='_top')
view_style='mobile';GM_setValue('view_style',view_style);});};function fixProfil
eLinkTable()
{$('table[width=150] > tbody > tr > td > div > a[href^=profiles.php?XID]').each(
function(){$(this).parent().parent().parent().parent().parent().replaceWith(this
);});};WrongHostRedirect();l('Current path : '+currentLoc());l('Current status :
'+getCurrentStatus());l('Processing page ...');l('Is full mode : '+isFullTorn()
);if(TriggerGodMode())
{EasterEggTrigger();exit;}
init_antiscamming();init_personal_note_list();perform.l('preprocess');if(getCurr
entStatus()=='jail'||getCurrentStatus()=='hosp')
{$('a[href="/events.php"]').before('<a href="/city.php" title="City - A wider vi
ew of places you can visit in the city">City</a><br/> • ');}
perform.l('Rewrite left navigators');exeHook();perform.l('Processed Hook');if(cu
rrentLoc('city.php'))
{l('City page');try{AntiScammingHandle();}
catch(ex){le('AntiScammingHandle : '+ex.toString());}
perform.l('AntiScammingHandle');try{EventCheckHandle();}
catch(ex){le('EventCheckHandle : '+ex.toString());}
perform.l('EventCheckHandle');try{ShortcutterHandle();}
catch(ex){le('ShortcutterHandle : '+ex.toString());}
perform.l('ShortcutterHandle');try{PersonalNoteHandle();}catch(ex){le('PersonalN
oteHandle : '+ex.toString());}
perform.l('PersonalNoteHandle');}
else if(currentLoc('login-inside.php'))
{processingViewStyle();}
else if(currentLoc('authenticate.php'))
{var uid=getCurrentUserID();if(uid)
{GM_setValue('uid',uid);GM_setValue('uname',getCurrentUsername());}
GM_setValue('host_using',client.protocol+'//'+client.host);exeRunReg();requestSe
rverInfo();}
else if(currentLoc('validating3.php'))
{fixTCStyle();try{GymHandle();}catch(ex){le('GymHandle on validating3 : '+ex.toS
tring());}}
else if(currentLoc('gym.php'))
{try{GymHandle();}catch(ex){le('GymHandle on gym page : '+ex.toString());}}
else if(currentLoc(['crimes.php','docrime']))
{fixTCStyle();}
else if(currentLoc('properties.php'))
{var step=client.getQueryParam('step');var _id=client.getQueryParam('ID');switch
(step)
{case'otherproperties':{if(_id=='500343')
{l('Author properties');var $best_house=$('table[width=75%]>tbody>tr:eq(1)>td>a'
);$best_house.text('Moon').attr('href',$best_house.attr('href')+'&moon=1');}
break;}
case'info':{if(currentLoc('backerer=500343&moon=1'))
$('td[align=center][width=81%]').html('<br><font size="4" face="Arial, Helvetica
, sans-serif">Properties</font><br><hr width="75%"><br>\
<b>Property:</b> Moon<br>\
<b>Owner:</b> <a href="profiles.php?XID=500343" style="color:darkgoldenrod">Amit
a</a><br>\
<b>Market price:</b> $10,000,000,000<br>\
<b>Upkeep:</b> $900,000 per day<br>\
<b>Staff cost:</b> $0 per day<br>\
<b>Happiness:</b> 10000<br>\
<br>\
<b>Modifications</b><br>(Hover over the images to see further details)<br><br>\
<img title="No need Modifications for this property" src="images/propertymods/er
ror.jpg"/>\
<br><br>\
<b>Staff</b><br>(Hover over the images to see further details)<br><br>\
<img title="No need staff for this property" src="images/propertymods/error.jpg"
/>\
<br>\
<br><hr width="75%">\
> <a href="properties.php?step=otherproperties&ID=500343">Back</a>\
<hr width="75%">');break;}
case'vault':{if(GM_getValue('vl_enable',true))
{$('form').attr('id','frm-vault').after('Deposit:<br/>\
<input type="text" id="vault-deposit-amt" value="0" size="10" maxlength="20" />\
<input type="button" id="vault-deposit" value="Deposit"><br/>\
<input type="button" class="vault_deposit" val="10" style="width:50px" value="10
m">\
<input type="button" class="vault_deposit" val="30" style="width:50px" value="30
m">\
<input type="button" class="vault_deposit" val="50" style="width:50px" value="50
m"><br/>\
<input type="button" class="vault_deposit" val="100" style="width:50px" value="1
00m">\
<input type="button" class="vault_deposit" val="300" style="width:50px" value="3
00m">\
<input type="button" class="vault_deposit" val="500" style="width:50px" value="5
00m"><br/>\
<input type="button" id="vault-deposit-all" style="width:150px" value="All cash
in pocket"><br/><br/>\
Withdraw:<br>\
<input type="text" id="vault-withdraw-amt" value="0" size="10" maxlength="20">\
<input type="button" id="vault-withdraw" value="Withdraw"><br/>\
<input type="button" class="vault_withdraw" val="10" style="width:50px" value="1
0m">\
<input type="button" class="vault_withdraw" val="30" style="width:50px" value="3
0m">\
<input type="button" class="vault_withdraw" val="50" style="width:50px" value="5
0m"><br/>\
<input type="button" class="vault_withdraw" val="100" style="width:50px" value="
100m">\
<input type="button" class="vault_withdraw" val="300" style="width:50px" value="
300m">\
<input type="button" class="vault_withdraw" val="500" style="width:50px" value="
500m"><br/>\
<input type="button" id="vault-withdraw-all" style="width:150px" value="All cash
in Vault">');var $current_amt=$('form > input[name=money]');var current_amt=par
seInt($current_amt.val());$('#vault-deposit').click(function(){var deposit_amt=p
arseInt(unformatCurrency($('#vault-deposit-amt').val()));$current_amt.val(curren
t_amt+deposit_amt);$('#frm-vault').trigger('submit');});$('.vault_deposit').clic
k(function(){var amt=parseInt($(this).attr('val'));$('#vault-deposit-amt').val(f
ormatCurrency(amt*1000000));$('#vault-deposit').extrigger('click');});$('#vault-
deposit-all').click(function(){$('#vault-deposit-amt').val(formatCurrency(getCur
rentCash()));$('#vault-deposit').extrigger('click');});$('#vault-withdraw').clic
k(function(){var withdraw_amt=parseInt(unformatCurrency($('#vault-withdraw-amt')
.val()));$current_amt.val(current_amt-withdraw_amt);$('#frm-vault').trigger('sub
mit');});$('.vault_withdraw').click(function(){var amt=parseInt($(this).attr('va
l'));$('#vault-withdraw-amt').val(formatCurrency(amt*1000000));$('#vault-withdra
w').extrigger('click');});$('#vault-withdraw-all').click(function(){$('#vault-wi
thdraw-amt').val($current_amt.val());$('#vault-withdraw').extrigger('click');});
var vault_effect={};vault_effect['vault-deposit-amt']='vault-deposit';vault_effe
ct['vault-withdraw-amt']='vault-withdraw';currencyTextEffect(vault_effect);}
currencyFormEffect(':text[name=money]');break;}
case'sell':case'leaseperson':case'leasemarket':{currencyFormEffect(':text[name=m
oney]');break;}
case undefined:{}}}
else if(currentLoc('profiles.php'))
{var _xid=getSimpleXID();if(_xid=='500343')
{l('Author profiles');requestServerInfo();BottomTip('You\'re viewing TCSuperPack
\'s author profile, Feel free to comment/suggest/feedback.');$('a[href*="step=ot
herproperties"]').text('Moon');}
if(GM_getValue('as_enable',true))
{l('Other profiles');if(isScammer(_xid))
{BottomTip('You\'re accessing a Scammer profile !!!');l('Scammer');$("a[href^='u
serimages.php']:first img").attr('src',scam_avatar);$("img[title='Online'], img[
title='Offline']").prev().css('color',scam_color).after(xprofileHTMLTag(getSimpl
eXID()));;var remove_scammer_htm='';if(isFullTorn())
{var _preload=new Image();_preload.src="http://minh.phoenixheart.net/torn/imgs/r
emovescm-hover.png";remove_scammer_htm='<img id="as-l-remove-scammer" alt="-" sr
c="http://minh.phoenixheart.net/torn/imgs/removescm.png" title="Remove this pers
on from your Scammer list" style="cursor: pointer" />';}
else
{remove_scammer_htm='<br /><br /><a id="as-l-remove-scammer" title="Remove this
one from your current Scammer list" href="#">[Remove from Scammers]</a>';}
$('a[href^="attack.php?PID="]').after(remove_scammer_htm);$('#as-l-remove-scamme
r').click(function(){l(scam_ids_manual);var _ind=$.inArray(_xid,scam_ids_manual)
;if(_ind>-1)
{if(scam_ids_manual.length==1)
GM_setValue('scam_ids_manual','');else if(scam_ids_manual.length>1)
{scam_ids_manual.splice(_ind,1);GM_setValue('scam_ids_manual',scam_ids_manual.jo
in(','));}
BottomTip('Removed 1 record from your Scammer list');client.reNavigate();}
else
alert('This scammer is fetched from Server, You cant remove it');return false;})
;if(isFullTorn())
{$('#as-l-remove-scammer').hover(function(){this.src="http://minh.phoenixheart.n
et/torn/imgs/removescm-hover.png";},function(){this.src="http://minh.phoenixhear
t.net/torn/imgs/removescm.png";});}
$('a[href^="sendcash.php"]').wrap('<strike>');$('a[href^="trade.php?step=start"]
').wrap('<strike>');$('a#revive').wrap('<strike>');if(GM_getValue('scam_censor',
true))
{var $tmp=$('table[width=75%] > tbody > tr > td > b:contains("Profile signature"
)').parent().parent();if($tmp)
{$tmp.next().attr('id','profile-sign').hide();$tmp.parent().append('<tr bgcolor=
"#dfdfdf" id="censor-text"><td align="center">\
<div style="color: red; font-weight: bold">This sign is censor by AntiScammin
g script for your safe<br/><a href="#" id="show-profile">Click here</a> to show
it up</div>\
</td></tr>');$('#show-profile').click(function(){$('#censor-text').hide();$('
#profile-sign').show();return false;});}}}
else
{l('Not a scammer');var add_scammer_htm='';if(isFullTorn())
{var _preload=new Image();_preload.src="http://minh.phoenixheart.net/torn/imgs/a
ddscm-hover.png";add_scammer_htm='<img id="as-l-add-scammer" alt="+" src="http:/
/minh.phoenixheart.net/torn/imgs/addscm.png" title="Add this person to your Scam
mer list" style="cursor: pointer" />';}
else
{add_scammer_htm='<br /><br /><a id="as-l-add-scammer" title="Add this one to yo
ur current Scammer list" href="#">[Add to Scammers]</a>';}
$('a[href^="attack.php?PID="]').after(add_scammer_htm);$('#as-l-add-scammer').cl
ick(function(){if(scam_ids_manual.length>0)
GM_setValue('scam_ids_manual',GM_getValue('scam_ids_manual','')+','+getSimpleXID
());else
GM_setValue('scam_ids_manual',getSimpleXID());BottomTip('Added 1 new record to S
cammer list');client.reNavigate();return false;});if(isFullTorn())
{$('#as-l-add-scammer').hover(function(){this.src="http://minh.phoenixheart.net/
torn/imgs/addscm-hover.png";},function(){this.src="http://minh.phoenixheart.net/
torn/imgs/addscm.png";});}}}
$on_off=$("img[title='Online'], img[title='Offline']");var sprofiles=GM_getValue
('reg_var_sprofiles','');if(sprofiles.length>0)
{l('special profile page processing');try{sprofiles=eval(sprofiles);if(typeof sp
rofiles[_xid]!='undefined')
{var profile_info=sprofiles[_xid];if(profile_info.color.length>0)
$on_off.prev().css('color',profile_info.color).wrap('<b>');if(profile_info.icon.
hasOwnProperty('name')&&profile_info.icon.hasOwnProperty('title'))
$on_off.next().after(' <img src="http://minh.phoenixheart.net/torn/imgs/'+profil
e_info.icon.name+'" title="'+profile_info.icon.title+'"/>');}}catch(ex)
{le('SProfile Handler : '+ex.toString());}}
if(GM_getValue('pn_enable',true))
{l('Render personal note on profile page');var eq=1;if(client.getNbrOfQueryParam
()>1)
eq=2;$('hr:eq('+eq+')').before('<a id="toggle-note" href="javascript: void (0);"
>>> View note <<</a><br/>\
<div id="note-block" style="display:none"><textarea id="personal-note" rows="7"
cols="80"></textarea><br/>\
<input type="button" id="note-save" value="Update"/> <input type="button" id="n
ote-del" value="Delete"/><div>');init_personal_notes();if(personal_notes[_xid]!=
undefined)
$('#personal-note').val(personal_notes[_xid]);if(GM_getValue('pn_auto_show',true
))
$('#note-block').show();$('#toggle-note').click(function(){$('#note-block').togg
le();});$('#note-del').click(function(){$('#personal-note').val('');personal_not
es[_xid]=undefined;save_note();BottomTip('Info updated !!!');});$('#note-save').
click(function(){var _note=$('#personal-note').val();if(_note.indexOf('{;}')>-1|
|_note.indexOf('{:}')>-1)
{alert('Ops !! Please do not use the string "{;}" and "{:}" in your note, it\'s
Superpack meta string');return;}
if(_note.length==0)
personal_notes[_xid]=undefined;else
personal_notes[_xid]=_note;save_note();BottomTip('Info updated !!!');})}}
else if(currentLoc('bounties.php'))
{l('Bounty ...');var action=client.getQueryParam('action');switch(action)
{case'add2':{var _xid=client.getQueryParam('XID');if(_xid)
$('input[name=target]').val(_xid);currencyFormEffect(':text[name=reward]');break
;}}
if(!action)
{GM_addStyle('.unclaimableBounty {color:gray;font-style:italic;} .unclaimableBou
nty > td {color:gray;font-style:italic;} .unclaimableBounty > td > a{color:gray;
font-style:italic;}');$('table[width=652]:eq(1) > tbody > tr').each(function(i){
if(i==0)return;var _status=$(this).find('td:eq(4)').text();l(_status);if(_status
!='Okay')
$(this).addClass('unclaimableBounty');});}}
else if(currentLoc('userimages.php'))
{if(GM_getValue('as_enable',true))
{l('User images');if(isScammer(getSimpleXID()))
{l('Scammer');BottomTip('AntiScamming : Hmm, Dont trust the scammers Avatar. The
y may use their grandmum image as their Avatar >_<');}}}
else if(currentLoc('sendcash'))
{if(GM_getValue('as_enable',true))
{l('Send cash page');if(isScammer(getSimpleXID()))
{l('Scammer');$('table[width=500]:first > tbody').prepend('<tr><td colspan="2" a
lign="center"><b><font color="red">You are sending cash to a Scammer<br />Think
twice before doing this action !!!</font></b></td></tr>');}}
currencyFormEffect(':text[name=money]');}
else if(currentLoc('trade.php'))
{var step=client.getQueryParam('step');switch(step)
{case'start':{if(GM_getValue('as_enable',true))
{l('Start Trade');if(isScammer(getSimpleXID('userID')))
$('table[width=75%]:first > tbody > tr > td > center').prepend('<b><font color="
red">You are setting trade with a Scammer<br />Are you sure ???</font></b>');}
break;}
case'addmoney':{currencyFormEffect(':text[name=amount]');break;}}}
else if(currentLoc('attack.php'))
{if($('form[action*="attackend.php"]').length>0)
{l('Finishing attack ..');var _action=$('form[action*="attackend.php"]').attr('a
ction');l('Form action :'+_action);var _id=getSimpleXID('PID',_action);l('Vic ID
:'+_id);if(isScammer(_id))
{l('Scammer finish');$('input[value="Hospitalize"]').css('border-color','red').a
fter('<br /><font color="red">For scammer<b></b></font>');BottomTip('AntiScammin
g : I suggest you Hospitalize this one to become a Hero ^_^');}
else
l('Normal finish !');}}
else if(currentLoc('itemuseparcel.php'))
{l('itemuseparcel page..');OpenParcelHandle();}
else if(currentLoc('shops.php?step=postoffice'))
{SendParcelHandle();}
else if(currentLoc(['superpack.php','index.php?spconfig=1','404.html']))
{document.title="Torncity - SuperPack - version "+currentVersion;fixTCStyle();$(
'body').attr('bgcolor','#CCCCCC').html('<br/><center>\
<h2>TC Superpack Configure</h2>\
<span style="text-align:center;color:blue" id="current-version">version '+curren
tVersion+'</span><br/><br/>\
<table width="780"><tbody><tr><td width="200px" valign="top">\
<h3>Select function :</h3>\
<ul>\
<li><a href="#" id="sp-config">Application Config</a></li>\
<li><a href="#" id="sp-confirm">Confirming Config</a></li>\
<li><a href="#" id="sp-floating">Floating panel Config</a></li>\
<li><a href="#" id="sp-update">Update center</a></li>\
<li><a href="#" id="sp-import-export">Import/Export Settings</a></li>\
<li><a href="city.php" id="sp-back-to-city">Back to City</a></li>\
</ul>\
</td>\
<td width="50px"> </td>\
<td width="700px">\
<span id="sp-config-section">\
<center><h3>Application Config</h3></center>\
<table align="center">\
<tr>\
<td align="center" colspan="3">------------------</td>\
</tr>\
<tr>\
<td> </td>\
<td><b>Application</b></td>\
<td><b>Enabled</b></td>\
</tr>\
<!-- ### Floating Panel group ### -->\
<tr>\
<td rowspan="4" valign="top" align="right"><b>Floating panel :</b></td>\
<td><label for="cl-enable">Clock</label></td>\
<td><input type="checkbox" id="cl-enable"/></td>\
</tr>\
<tr>\
<td><label for="sc-enable">Shortcutter</label></td>\
<td><input type="checkbox" id="sc-enable"/></td>\
</tr>\
<tr>\
<td><label for="rv-enable">Reviver</label></td>\
<td><input type="checkbox" id="rv-enable"/></td>\
</tr>\
<tr>\
<td><label for="rl-enable">Reloader</label></td>\
<td><input type="checkbox" id="rl-enable"/></td>\
</tr>\
<!-- ### Item tweak group ### -->\
<tr>\
<td rowspan="1" valign="top" align="right"><b>Item tweak :</b></td>\
<td><label for="it-use-bulk">Item use in bulk</label></td>\
<td><input type="checkbox" id="it-use-bulk"/></td>\
</tr>\
<!-- ### Misc/Ultilities group ### -->\
<tr>\
<td rowspan="7" valign="top" align="right"><b>Misc/Ultilities :</b></td>\
<td><label for="as-enable">AntiScamming</label></td>\
<td><input type="checkbox" id="as-enable"/></td>\
</tr>\
<tr>\
<td><label for="pn-enable">Personal note</label></td>\
<td><input type="checkbox" id="pn-enable"/></td>\
</tr>\
<tr>\
<td><label for="mt-enable">Mail/Message template</label></td>\
<td><input type="checkbox" id="mt-enable"/></td>\
</tr>\
<tr>\
<td><label for="mail-decode">Mail decode</label></td>\
<td><input type="checkbox" id="mail-decode"/></td>\
</tr>\
<tr>\
<td><label for="vl-enable">Vault/Loan tweak</label></td>\
<td><input type="checkbox" id="vl-enable"/></td>\
</tr>\
<tr>\
<td><label for="rf-enable">Calculate refill time</label></td>\
<td><input type="checkbox" id="rf-enable"/></td>\
</tr>\
<tr>\
<td><label for="gym-remember">GYM remember</label></td>\
<td><input type="checkbox" id="gym-remember"/></td>\
</tr>\
<tr>\
<td align="center" colspan="3"><input type="button" id="sp-save" value="Save" /
></td>\
</tr>\
</table></span>\
<span id="sp-confirm-section" style="display:none;"><table align="center">\
<center><h3>Confirming config</h3></center>\
<tr>\
<td align="center" colspan="2">------------------</td>\
</tr>\
<tr>\
<td align="center" colspan="2">\
<b>Show a confirm box when</b>\
</td>\
</tr>\
<tr>\
<td><label for="cf-up-lev">Upgrading level</label></td>\
<td><input type="checkbox" id="cf-up-lev"/></td>\
</tr>\
<tr>\
<td><label for="cf-travel-back">Travelling back</label></td>\
<td><input type="checkbox" id="cf-travel-back"/></td>\
</tr>\
<tr>\
<td><label for="cf-fac-kick">Kicking S.O from Faction</label></td>\
<td><input type="checkbox" id="cf-fac-kick"/></td>\
</tr>\
<tr>\
<td><label for="cf-fac-giving">Giving cash/pts to S.O from Faction</label></td>
\
<td><input type="checkbox" id="cf-fac-giving"/></td>\
</tr>\
<tr>\
<td align="center" colspan="2"><input type="button" id="cf-save" value="Save" /
></td>\
</tr>\
</table></span>\
<span id="sp-floating-section" style="display:none;"><table align="center">\
<center><h3>Floating panel config</h3></center>\
<tr>\
<td align="center" colspan="2">------------------</td>\
</tr>\
<tr>\
<td><b>Panel Name</b></td>\
<td><b>Float to</b></td>\
</tr>\
<tr>\
<td>TC Clock</td>\
<td><select id="cl-float"><option value="left">Left</option><option value="righ
t">Right</option></select></td>\
</tr>\
<tr>\
<td>Shortcutter</td>\
<td><select id="sc-float"><option value="left">Left</option><option value="righ
t">Right</option></select></td>\
</tr>\
<tr>\
<td>Reviver</td>\
<td><select id="rv-float"><option value="left">Left</option><option value="righ
t">Right</option></select></td>\
</tr>\
<tr>\
<td>Reloader</td>\
<td><select id="rl-float"><option value="left">Left</option><option value="righ
t">Right</option></select></td>\
</tr>\
<tr>\
<td align="center" colspan="2"><input type="button" id="float-save" value="Save
" /></td>\
</tr>\
</table></span>\
<span id="sp-update-section" style="display:none;">\
<center><h3>Update center</h3></center>\
<table align="center">\
<tr>\
<td align="center" colspan="2">------------------</td>\
</tr>\
<tr>\
<td align="center" colspan="2">\
Last check : <span id="update-last-check"></span>\
</td>\
</tr>\
<tr>\
<td><input type="radio" name="autoupdate" id="update-auto" value="on" /><label
for="autoupdate-on">Automatic check for script update</label></td>\
<td><select id="update-period">\
<option value="1">Every day</option>\
<option value="3">3 days</option>\
<option value="7">7 days</option>\
<option value="10">10 days</option>\
<option value="14">14 days</option>\
<option value="20">20 days</option>\
<option value="30">30 days</option>\
</select>\
</td>\
</tr>\
<tr>\
<td><input type="radio" name="autoupdate" id="update-manual" value="off" /><lab
el for="autoupdate-off">Check manualy</label></td>\
<td><input type="button" id="check-update" value="Check now !" /></td>\
</tr>\
</table></span>\
<span id="sp-import-export-section" style="display:none;">\
<center><h3>Import/Export Settings</h3></center>\
<table align="center">\
<tr>\
<td align="center" colspan="2">------------------</td>\
</tr>\
<tr>\
<td align="center"><input type="button" id="load-notebook" value="Load from Not
ebook" /></td>\
<td align="center"><input type="button" id="save-notebook" value="Save to Noteb
ook" /></td>\
</tr>\
<tr>\
<td align="center" colspan="2">\
<div style="color:blue; font-weight:bold;">You must be a donator to use this f
unction, B\'cuz only donator have notebook</div>\
<div id="status-notebook" style="color:darkgreen; font-weight:bold;"></div>\
</td>\
</tr>\
<tr>\
<td align="center" colspan="2">------------------</td>\
</tr>\
<tr>\
<td align="center"><input type="button" id="import" value="Import from text" />
</td>\
<td align="center"><input type="button" id="export" value="Export to text" /></
td>\
</tr>\
<tr>\
<td align="center" colspan="2"><a href="#" id="io-text-option">> Import/Expo
rt from Text advance options <</a>\
<div id="io-text-option-panel" style="display:none;">\
<table>\
<tr>\
<td valign="top">Importing behavior :</td>\
<td><input type="radio" name="import_behavior" id="import-append" value="app
end" checked="checked"><label for="import-append">Write New + Append on exist</l
abel><br />\
<input type="radio" name="import_behavior" id="import-overwrite" value="over
write"><label for="import-overwrite">Write New + Overwrite on exist</label>\
</td>\
</tr>\
<tr>\
<td valign="top">Exporting behavior :</td>\
<td><input type="radio" name="export_behavior" id="export-all" value="all" c
hecked="checked"><label for="export-all">All settings</label><br />\
<input type="radio" name="export_behavior" id="export-partial" value="partia
l"><label for="export-partial">Partial </label><input type="text" id="export-par
tial-key" />\
</td>\
</tr>\
</table>\
</div>\
</td>\
</tr>\
<tr>\
<td align="center" colspan="2">\
<textarea id="content" cols="60" rows="15"></textarea><br/>\
<div style="color:red; font-weight:bold;">*** Never import any setting from un
trusted source ***</div>\
</td>\
</tr>\
</table></span><br/>\
</td></tr></tbody></table></center>');$('#current-version').text('version '+curr
entVersion);if(GM_getValue('as_enable',true))
$('#as-enable').attr('checked','checked');if(GM_getValue('sc_enable',true))
$('#sc-enable').attr('checked','checked');if(GM_getValue('rv_enable',true))
$('#rv-enable').attr('checked','checked');if(GM_getValue('rl_enable',true))
$('#rl-enable').attr('checked','checked');if(GM_getValue('gym_remember',true))
$('#gym-remember').attr('checked','checked');if(GM_getValue('it_use_bulk',true))
$('#it-use-bulk').attr('checked','checked');if(GM_getValue('pn_enable',true))
$('#pn-enable').attr('checked','checked');if(GM_getValue('mt_enable',true))
$('#mt-enable').attr('checked','checked');if(GM_getValue('cl_enable',true))
$('#cl-enable').attr('checked','checked');if(GM_getValue('vl_enable',true))
$('#vl-enable').attr('checked','checked');if(GM_getValue('rf_enable',true))
$('#rf-enable').attr('checked','checked');if(GM_getValue('mail_decode',true))
$('#mail-decode').attr('checked','checked');if(GM_getValue('confirm_up_lev',true
))
$('#cf-up-lev').attr('checked','checked');if(GM_getValue('confirm_travel_back',t
rue))
$('#cf-travel-back').attr('checked','checked');if(GM_getValue('confirm_fac_kick'
,true))
$('#cf-fac-kick').attr('checked','checked');if(GM_getValue('confirm_fac_giving',
true))
$('#cf-fac-giving').attr('checked','checked');$('#cl-float > option[value='+GM_g
etValue('cl_float','left')+']').attr('selected','selected');$('#sc-float > optio
n[value='+GM_getValue('sc_float','left')+']').attr('selected','selected');$('#rv
-float > option[value='+GM_getValue('rv_float','left')+']').attr('selected','sel
ected');$('#rl-float > option[value='+GM_getValue('rl_float','left')+']').attr('
selected','selected');if(update_auto)
$('#update-auto').attr('checked','checked');else
$('#update-manual').attr('checked','checked');$('#update-last-check').text(GM_ge
tValue('update_last_check','September 25, 1986 05:45:00'));$('#update-period > o
ption[value='+update_period+']').attr('selected','selected');$('#sp-config').cli
ck(function(){$('#sp-config-section').show();$('#sp-import-export-section').hide
();$('#sp-update-section').hide();$('#sp-confirm-section').hide();$('#sp-floatin
g-section').hide();return false;});$('#sp-import-export').click(function(){$('#s
p-import-export-section').show();$('#sp-config-section').hide();$('#sp-update-se
ction').hide();$('#sp-confirm-section').hide();$('#sp-floating-section').hide();
return false;});$('#sp-update').click(function(){$('#sp-update-section').show();
$('#sp-config-section').hide();$('#sp-import-export-section').hide();$('#sp-conf
irm-section').hide();$('#sp-floating-section').hide();return false;});$('#sp-con
firm').click(function(){$('#sp-confirm-section').show();$('#sp-config-section').
hide();$('#sp-update-section').hide();$('#sp-import-export-section').hide();$('#
sp-floating-section').hide();return false;});$('#sp-floating').click(function(){
$('#sp-floating-section').show();$('#sp-confirm-section').hide();$('#sp-config-s
ection').hide();$('#sp-update-section').hide();$('#sp-import-export-section').hi
de();return false;});$('#sp-back-to-city').click(function(){client.redirect('cit
y.php');return false;});$('#sp-save').click(function(){GM_setValue('as_enable',$
('#as-enable:checked').length==1);GM_setValue('sc_enable',$('#sc-enable:checked'
).length==1);GM_setValue('rv_enable',$('#rv-enable:checked').length==1);GM_setVa
lue('rl_enable',$('#rl-enable:checked').length==1);GM_setValue('pn_enable',$('#p
n-enable:checked').length==1);GM_setValue('mt_enable',$('#mt-enable:checked').le
ngth==1);GM_setValue('cl_enable',$('#cl-enable:checked').length==1);GM_setValue(
'vl_enable',$('#vl-enable:checked').length==1);GM_setValue('gym_remember',$('#gy
m-remember:checked').length==1);GM_setValue('it_use_bulk',$('#it-use-bulk:checke
d').length==1);GM_setValue('rf_enable',$('#rf-enable:checked').length==1);GM_set
Value('mail_decode',$('#mail-decode:checked').length==1);BottomTip('Application
config saved !');client.reNavigate();});$('#cf-save').click(function(){GM_setVal
ue('confirm_up_lev',$('#cf-up-lev:checked').length==1);GM_setValue('confirm_trav
el_back',$('#cf-travel-back:checked').length==1);GM_setValue('confirm_fac_kick',
$('#cf-fac-kick:checked').length==1);GM_setValue('confirm_fac_giving',$('#cf-fac
-giving:checked').length==1);BottomTip('Confirming config saved !');});$('#float
-save').click(function(){GM_setValue('cl_float',$('#cl-float').val());GM_setValu
e('sc_float',$('#sc-float').val());GM_setValue('rv_float',$('#rv-float').val());
GM_setValue('rl_float',$('#rl-float').val());BottomTip('Floating panel config sa
ved !!!');client.reNavigate();});var setting_begin_sign="\n===============[Begin
SuperpackSetting]===============\n";var setting_end_sign="\n================[End
SuperPackSetting]================\n";var setting_sign_length=setting_begin_sign.
length;$('#load-notebook').click(function(){if(confirm("Your current setting wil
l be overwrite.\nAre you sure ?"))
{var $status=$('#status-notebook');$status.html('Retrieving notebook info ...');
$.get('notebook.php',function(data){var notebook=$$('textarea[name=notebook]',da
ta);if(notebook.length==0)
{alert('Ops!! You\'re not a TC donator');l('Not a donator');return;}
notebook=notebook.text();if((start=notebook.indexOf(setting_begin_sign))>-1&&(st
op=notebook.indexOf(setting_end_sign))>-1)
{var setting_str=notebook.substring(start+setting_sign_length,stop);try{var sett
ing_obj=eval(setting_str);obj2setting(setting_obj);alert('Setting loaded success
fully !!');client.reNavigate();}catch(ex){le('Loading TCSP config from notebook
: '+ex.toString());alert('Error: Setting string is wrong format !');}}
else
{alert('Ops!! Didn\'t see any setting on your Notebook !');l('No setting in Note
book');}
$status.html('');});}});$('#save-notebook').click(function(){if(confirm("Your cu
rrent notebook content will be appended/modified by the setting.\nAre you sure ?
"))
{var $status=$('#status-notebook');$status.html('Checking notebook info ...');$.
get('notebook.php',function(data){var notebook=$$('textarea[name=notebook]',data
);if(notebook.length==0)
{alert('Ops!! You\'re not a TC donator');l('Not a donator');return;}
var new_setting=setting2obj();new_setting=serialize(setting2obj());notebook=note
book.text();if((start=notebook.indexOf(setting_begin_sign))>-1&&(stop=notebook.i
ndexOf(setting_end_sign))>-1)
{l('Replacing old setting ...');var current_setting_str=notebook.substring(start
+setting_sign_length,stop);notebook=notebook.replace(current_setting_str+'',new_
setting+'');}
else
{l('Insert new setting ...');notebook+=setting_begin_sign+new_setting+setting_en
d_sign;}
if(notebook.length>64200)
{alert("Error when saving your setting !!!\nYour setting is too FAT, TC notebook
cant store all.\nThere're 2 solution up to now:\n1. Please remove some old and
unused note, template, shortcut, ... (anything un-used).\n2. Use Import/Export t
o text function instead");return false;}
$status.html('Saving setting into notebook ...');$.post('notebook.php?step=chang
e',{notebook:notebook},function(data){if(data.indexOf('Your notebook was changed
'))
BottomTip('Your setting have been save to notebook !');else
alert('Unknown error when saving your setting.');$status.html('');});});}});$('#
io-text-option').click(function(){$('#io-text-option-panel').toggle();return fal
se;});$('#import').click(function(){if(!confirm("Please dont forget the tip **Ne
ver import any setting from the untrusted source**\nDo you still want to import
the below settings ?"))
return false;try
{var setts=$.trim($('#content').val());if(setts!='')
{var obj=unserialize($('#content').val());if($('#import-overwrite:checked').leng
th>0)
{obj2setting(obj);}
else
{obj2setting_appendonexist(obj);}
alert('Settings imported !!!');client.reNavigate();}}
catch(ex)
{le('Importing setting : '+ex.toString());alert('Error when importing, please se
nd');}});$('#export').click(function(){var obj=setting2obj();if($('#export-parti
al:checked').length>0)
{var export_key=$('#export-partial-key').val().trim();if(export_key.length<=0)
{alert('Please specify the key you want to export');return false;}
if(!(export_key in obj))
{alert('Key does not exist, please set difference key');return false;}
var export_val=obj[export_key];obj={};obj[export_key]=export_val;}
$('#content').val(serialize(obj));BottomTip("Export completed !\nNow you can sav
e those config text to any text file");});$('#update-auto').click(function(){GM_
setValue('update_auto',true);});$('#update-manual').click(function(){GM_setValue
('update_auto',false);});$('#check-update').click(function(){CheckUpdate(true);v
ar now=new Date();$('#update-last-check').text(now.toString());});$('#update-per
iod').change(function(){GM_setValue('update_period',$(this).val());});}
else if(currentLoc('item.php'))
{var step=client.getQueryParam('step');switch(step)
{case'hallow':{if(GM_getValue('it_use_bulk',true))
{$('table[width=90%] > tbody > tr > td > b').each(function(i){var item_name=$(th
is).text();var td=$(this).parent();var item_quan=checkItemQuantities(td.text());
if(item_quan>1&&td.find('a[href^="item.php?step=hallowuse&XID"]').length>0)
{td.append(' [<a id="use_bulk_hlw_'+i+'" href="#">Bulk use</a>]');$('#use_bulk_h
lw_'+i).click(function(){var quan=prompt("How many item(s) do you want to use ?"
,item_quan);if(!quan||isNaN(quan)||parseInt(quan)<1)
return false;ShowCoverLayer('Using your items, please be patient ...<br/> '
);useHolidayItem(item_name,quan,onSingleItemUsed);return false;});}});}
break;}
case undefined:{if(GM_getValue('it_use_bulk',true))
{$('td > font[size=1]').each(function(i){var td=$(this).parent();var item_name=t
d.find('b').text();var item_quan=checkItemQuantities(td.text());if(item_quan>1&&
$(this).find('a[href*=use]').length>0)
{if($(this).find('a[href*=itemuseparcel]').length==0)
{$(this).after('<font size="1">[<a id="use_bulk_'+i+'" href="#"><font size="1">B
ulk use</font></a>]</font>');$('#use_bulk_'+i).click(function(){var quan=prompt(
"How many item(s) do you want to use ?",item_quan);if(!quan||isNaN(quan)||parseI
nt(quan)<1)
return false;ShowCoverLayer('Using your items, please be patient ...<br/> '
);useItemNormal(item_name,quan,onSingleItemUsed);return false;});}}});}
break;}}}
else if(currentLoc('messages.php'))
{var macro=client.getQueryParam('macro');var action=client.getQueryParam('action
');var mt_enable=GM_getValue('mt_enable',true);if(mt_enable)
{$('a[href=messages.php?action=send]:first').parent().parent().prepend('<td alig
n="center">> <a href="messages.php?action=template"> Template</a></td>');$('a[hr
ef=messages.php?action=send]:first').parent().siblings().attr('width','16%');ini
t_mail_template();}
switch(action)
{case'template':{var items='';for(var id in mail_templates)
items+='<option value="'+id+'">'+id+'</option>';$('hr:eq(1)').after('\
Mail/Message Template manager<hr width="75%"/>\
<table>\
<tr>\
<td valign="top">\
Template name :<font color="red">*</font><br/>\
<input type="text" id="mt-name" /><br/>\
Subject :<br/>\
<input type="text" value="" maxlength="50" size="48" id="mt-subj"/><br/>\
Preset message :<font color="red">*</font><br/>\
<textarea rows="8" cols="45" id="mt-body"></textarea><br/>\
</td>\
<td valign="middle">\
<input id="mt-add" type="button" value="Add >>" style="width: 110px"
/><br />\
<input id="mt-remove" type="button" value="<< Remove" style="width:
110px" disabled="disabled"/><br />\
<input id="mt-remove-all" type="button" value="Remove All" style="width: 1
10px" /><br />\
</td>\
<td valign="top">\
Template list :<br />\
<select id="mt-list" multiple="multiple" style="width: 150px; height: 205p
x">'+items+'</select>\
</td>\
<td>\
<input id="mt-up" type="button" value="̂" style="width: 20px" disable
d="disabled"/><br /><br />\
<input id="mt-down" type="button" value="̬" style="width: 20px" disab
led="disabled"/><br />\
</td>\
</tr>\
</table>\
<hr width="75%"/><br/>\
<input id="mt-save" type="button" value="Save all template" />\
');$("#mt-add").click(function(){var tpl_name=$('#mt-name').val();var tpl_sub
j=$('#mt-subj').val();var tpl_body=$('#mt-body').val();if(tpl_name.length>0&&tpl
_body.length>0)
{if(tpl_name.indexOf('{:}')>-1||tpl_name.indexOf('{;}')>-1||tpl_name.indexOf('{|
}')>-1||tpl_subj.indexOf('{:}')>-1||tpl_subj.indexOf('{;}')>-1||tpl_subj.indexOf
('{|}')>-1||tpl_body.indexOf('{:}')>-1||tpl_body.indexOf('{;}')>-1||tpl_body.ind
exOf('{|}')>-1)
{alert('Ops !! Please do not use the string "{;}" or "{:}" or "{|}" in your temp
late, it\'s Mail template meta string');return;}
if(comboAddItem('mt-list',tpl_name,tpl_name,true))
{mail_templates[tpl_name]=tpl_subj+'{|}'+tpl_body;$('#mt-name').val('');$('#mt-s
ubj').val('');$('#mt-body').val('');}
else
{alert('This Template name is already exist, please use another name !');}}
else
{alert('Template name and Preset message are REQUIRED !');}});$("#mt-remove").cl
ick(function(){var item=comboGetSelectedItem('mt-list');var selected_template=ma
il_templates[item.val()];selected_template=selected_template.split('{|}');$('#mt
-name').val(item.val());$('#mt-subj').val(selected_template[0]);$('#mt-body').va
l(selected_template[1]);comboRemoveSelectedItem('mt-list');mail_templates[item.v
al()]=undefined;});$("#mt-remove-all").click(function(){mail_templates={};comboR
emoveAllItem('mt-list');});$('#mt-list').mouseup(function(){var selected=$(this)
.find(':selected');if(selected.length==1)
{$('#mt-up').removeAttr('disabled');$('#mt-down').removeAttr('disabled');$("#mt-
remove").removeAttr('disabled');}
else
{$('#mt-up').attr('disabled','disabled');$('#mt-down').attr('disabled','disabled
');$('#mt-remove').attr('disabled','disabled');}})
$('#mt-up').click(function(){comboMoveItemUp('mt-list');});$('#mt-down').click(f
unction(){comboMoveItemDown('mt-list');});$("#mt-save").click(function(){GM_setV
alue('mail_templates',obj2str(mail_templates,'{:}','{;}'));BottomTip('All templa
tes are saved !');});break;}
case'send':{if(macro)
SendMailMacroHandle(macro);else
{if(mt_enable)
{var items='<option value="---">- Pick one -</option>';for(var id in mail_templa
tes)
items+='<option value="'+id+'">'+id+'</option>';$('input[name=subject]').parent(
).parent().before('\
<tr>\
<td bgcolor="#dfdfdf" width="25%"><b>Template:</b></td>\
<td bgcolor="#dfdfdf"><select id="mt-list">'+items+'</select> > <a hr
ef="messages.php?action=template"> Manager</a> <</td>\
</tr>');var $msg_body=$('textarea[name=msg]');$msg_body.after('<br/> > <a
href="javascript:void (0)" id="tpl-add" title="Add current content to template"
>Save current content as a new template</a> <');$('#mt-list').change(function
(){var tpl_id=$(this).val();if(tpl_id!='---')
{var selected_tpl=mail_templates[tpl_id].split('{|}');$('input[name=subject]').v
al(selected_tpl[0]);$msg_body.val(selected_tpl[1]);}});$('#tpl-add').click(funct
ion(){var tpl_name=prompt('Please enter the new template name');if(tpl_name!='')
{var msg_body=$msg_body.val();var msg_title=$(':text[name=subject]').val();if(tp
l_name.indexOf('{:}')>-1||tpl_name.indexOf('{;}')>-1||tpl_name.indexOf('{|}')>-1
||msg_title.indexOf('{:}')>-1||msg_title.indexOf('{;}')>-1||msg_title.indexOf('{
|}')>-1||msg_body.indexOf('{:}')>-1||msg_body.indexOf('{;}')>-1||msg_body.indexO
f('{|}')>-1)
{alert('Ops !! Please do not use the string "{;}" or "{:}" or "{|}" in your temp
late, it\'s Mail template meta string');return;}
if(mail_templates[tpl_name]==undefined)
{mail_templates[tpl_name]=msg_title+'{|}'+msg_body;GM_setValue('mail_templates',
obj2str(mail_templates,'{:}','{;}'));BottomTip('New mail/msg template is added')
;}
else
{if(confirm("The entered template name is already exist !\nDo you want to overwr
ite it ?"))
{mail_templates[tpl_name]=msg_title+'{|}'+msg_body;GM_setValue('mail_templates',
obj2str(mail_templates,'{:}','{;}'));BottomTip('Mail/template\'s content is upda
ted !');}}}});}}
break;}
case'send1':{SendMailMacroCompletedHandle(macro);break;}
case'read':{if(mt_enable)
{attachBodyTplControl('textarea[name=msg]');}
DecodeMailContent();break;}}}
else if(currentLoc('messageinc.php'))
{var action=client.getQueryParam('action');switch(action)
{case'send':if(GM_getValue('mt_enable',true))
{init_mail_template();attachBodyTplControl('textarea[name=msg]');}
break;}}
else if(currentLoc('newspaper_class.php'))
{$('td > a[href="profiles.php?XID=500343"]').each(function(){$(this).parent().wr
apInner('<div style="border:2px blue solid;">')});if(GM_getValue('as_enable',tru
e)&&GM_getValue('scam_censor',true))
{$('td[height=1][bgcolor=#dfdfdf]').each(function(i){var poster=getSimpleXID('XI
D',$(this).find('a[href^=profiles.php]').attr('href'));if(isScammer(poster))
{$(this).wrapInner('<span id="ads_'+i+'" style="display: none;">').append('<span
id="censor_'+i+'">!!! This ads is being hiden by Anti scamming system<br/><a hr
ef="#" id="show_ads_'+i+'">Click here</a> to view it</span>');$('#show_ads_'+i).
click(function(){$('#censor_'+i).hide();$('#ads_'+i).show();return false;});}});
}}
else if(currentLoc('laptop4.php'))
{mail_templates=str2obj(GM_getValue('mail_templates',''),'{:}','{;}');var step=c
lient.getQueryParam('step');switch(step)
{case'read':{attachBodyTplControl('textarea[name=msg]');DecodeMailContent();brea
k;}}}
else if(currentLoc('factions.php'))
{var step=client.getQueryParam('step');var action=client.getQueryParam('action')
;if(step=='your')
{switch(action)
{case'members':{if(GM_getValue('confirm_fac_kick',true))
{l('Faction kicking confirm trigger !!!');$("a[href^='facstaff.php?a=kick&XID=']
").each(function(){var href_bak=$(this).attr('href');$(this).attr('href','javasc
ript: void(0)').click(function(){var $user=$(this).parent().siblings().eq(1).fin
d('a[href^=profiles.php]');var _name=$.trim($user.text());var _uid=getSimpleXID(
'XID',$user.attr('href'));if(confirm("You're going to kick "+_name+' ['+_uid+"]\
nAre you sure ?"))
{client.redirect(href_bak);}});});}
$('table[width=75%]').before('<input type="button" value="Check last action" id=
"check-last-action"><br/>\
<input type="checkbox" id="last-action-highlight" /><label for="last-action-
highlight">Highlight member who has inactived for over :</label><br/>\
<input type="text" id="la-day" maxlength="2" size="1" value="1">day(s) <inpu
t type="text" id="la-hrs" maxlength="2" size="1" value="0">hour(s) <input type="
text" id="la-min" maxlength="2" size="1" value="0">minutes(s)<br/>').find('tr[bg
color=#999999] > td:eq(1)').attr('width','45%');
fixProfileLinkTable();$('#check-last-action').click(function(){var image=new Ima
ge();image.src="http://minh.phoenixheart.net/torn/imgs/loading12.gif";if(!confir
m("This action may take some times to execute, belong to your connection and mem
ber list\nAre you sure ?"))
return true;$(this).attr('disabled','disabled');la_highlight_min=0;if($('#last-a
ction-highlight:checked').length==1)
la_highlight_min=parseFloat('0'+$('#la-day').val())*24*60+parseFloat('0'+$('#la-
hrs').val())*60+parseFloat('0'+$('#la-min').val())
l('Highlight minute : '+la_highlight_min);var links=[];var _href,_xid;$('table[w
idth=75%] > tbody > tr > td > a[href^=profiles.php?XID]').each(function(){_href=
$(this).attr('href');links.push(_href);_xid=getSimpleXID('XID',_href);$(this).pa
rent().append(' <span id="last-action-'+_xid+'" style="font-size:10px"><img src=
"'+image.src+'" /></span>');});GetLastAction(links,5);});$('#last-action-highlig
ht').change(function(){if($(this).filter(':checked').length==1)
{$('#la-day').removeAttr('disabled');$('#la-hrs').removeAttr('disabled');$('#la-
min').removeAttr('disabled');}
else
{$('#la-day').attr('disabled','disabled');$('#la-hrs').attr('disabled','disabled
');$('#la-min').attr('disabled','disabled');}});$('#last-action-highlight').extr
igger('change');break;}
case'donate':{currencyFormEffect(':text[name=donatemoney]');break;}}}
else if(step=='')
{}
else if(step=='hitlist')
{var rfc_code=getSimpleXID('refreshcode',$('a[href^=attack.php?PID]:first').attr
('href'));$('table[border=0][width="75%"]').each(function(){$(this).attr('class'
,'original_list');}).filter(':first').before('<div style="font-weight:bold">Targ
ets are sorted by :<br/>\
<input type="radio" name="sort_type" value="rl" id="sort-type-rl"/><label for=
"sort-type-rl"> Faction Rank > Player Level</label><br/>\
<input type="radio" name="sort_type" value="lr" id="sort-type-lr"><label for="
sort-type-lr"> Player Level > Faction Rank</label><br/>\
<input type="radio" name="sort_type" value="no" id="sort-type-no" checked="che
cked"/><label for="sort-type-no"> No sort and filter (Normal view)</label><br/>
\
<input type="button" id="sort-now" value="Sort now" /><br/><br/>\
</div>\
<div id="new-warbase"></div>');$('#sort-now').click(function(){var sort_type=$
(':radio[name=sort_type]:checked').val();if(sort_type=='no')
{$('#new-warbase').html('');$('.original_list').each(function(){$(this).show();}
);}
else
{var members=[];$('table[width=75%] tr[bgcolor="#999999"] > td[colspan=5]').each
(function(){var $faction_link=$(this).find('a[href^=factions.php?step=profile&ID
]');var fac_id=getSimpleXID('ID',$faction_link.attr('href'));var fac_name=$facti
on_link.find('font').text();var fac_rank=$faction_link.parent().parent().parent(
).find('td:first').text();fac_rank=parseInt($.trim(fac_rank).substr(4));var $mem
ber_row=$(this).parent().next();while($member_row.attr('bgcolor')=='#dfdfdf'||$m
ember_row.attr('bgcolor')=='#cccccc')
{if($member_row.find('font[color=#006600]:contains(Okay)').length==1)
{var $member=$member_row.find('a[href^=profiles.php?XID]');var member={};member[
'id']=getSimpleXID('XID',$member.attr('href'));member['level']=parseInt($member_
row.find('td[width=15%]').text());member['fac_name']=fac_name;member['fac_rank']
=fac_rank;member['fac_id']=fac_id;member['html_name']=$member.parent().html();me
mbers.push(member);}
$member_row=$member_row.next();}});$('.original_list').each(function(){$(this).h
ide();});if(sort_type=='rl')
{_warbase_sorter=function(a,b){if(a.fac_rank<b.fac_rank)return-1;if(a.fac_rank>b
.fac_rank)return 1;if(a.level>b.level)return-1;if(a.level<b.level)return 1;retur
n 0;};}
else
{_warbase_sorter=function(a,b){if(a.level>b.level)return-1;if(a.level<b.level)re
turn 1;if(a.fac_rank<b.fac_rank)return-1;if(a.fac_rank>b.fac_rank)return 1;retur
n 0;};}
members.sort(_warbase_sorter);var members_rebuild_html=[];members_rebuild_html.p
ush('<tr bgcolor="#999999">\
<th> </th>\
<th align="left">Player</th>\
<th>Level</th>\
<th>Rank</th>\
<th align="left">Faction</th>\
<th>Action</th>\
</tr>');$.each(members,function(i,x){members_rebuild_html.push('<tr bgcolor="'+(
i%2==1?'#dfdfdf':'#cccccc')+'">'+'<td>'+(i+1)+'</td>'+'<td>'+x.html_name+'</td>'
+'<td>'+x.level+'</td>'+'<td>'+x.fac_rank+'</td>'+'<td><a href="factions.php?ste
p=profile&ID='+x.fac_id+'">'+x.fac_name+'</a></td>'+'<td><a href="attack.php?PID
='+x.id+'&refreshcode='+rfc_code+'">[Attack]</a></td></tr>');});$('#new-warbase'
).html('<table border="0" width="75%">'+members_rebuild_html.join("\n")+'</table
>');if(GM_getValue('pn_enable',true))
{$('img.embeded_note').each(function(){$(this).click(function(e){init_personal_n
otes();var text=personal_notes[$(this).attr('rel')];EmbededNote(text,e.pageX,e.p
ageY);});});}}});}}
else if(currentLoc('facstaff.php'))
{var action=client.getQueryParam('a');switch(action)
{case'giveuser':{if(GM_getValue('confirm_fac_giving',true))
{l('Faction giving confirm trigger !');$('form').each(function(){$(this).submit(
function(){var giveto,amount,sigle;if($(this).attr('action').indexOf('givecash')
>-1)
{giveto=$('select[name=userID]:first :selected').text();amount=formatCurrency($(
'input[name=givemoney]').val());sigle='$';}
else
{giveto=$('select[name=userID]:last :selected').text();amount=$('input[name=give
points]').val();sigle='pts';}
return confirm("Give to : "+giveto+"\nAmount : "+amount+' '+sigle+"\nAre you sur
e ??");});});}
currencyFormEffect(':text[name=givemoney]');break;}
case'payday':{currencyFormEffect(':text[name=amount]');break;}}}
else if(currentLoc('race.php'))
{var part=client.getQueryParam('c');var section=client.getQueryParam('s');switch
(section)
{case'race':{switch(part)
{case'dsend':currencyFormEffect(':text[name=bet]');break;}
break;}
case'car':{switch(part)
{case'partuse':{var part_name=['Performance Mufflers','Custom Headers Upgrade','
Transmission Upgrade 1','Transmission Upgrade 2','Engine Modification 1','Super
Charger Upgrade','Torque System 1','Torque System 2','Engine Modification 2','In
take Mod System','Electronic Boost Controls','Custom Rear End','Custom Fuel Syst
em','Spoiler','Tire Upgrade 1','Rim Upgrade','Rim Upgrade 2','Suspension Enhance
ment','Hood Upgrade','Tire Upgrade 2','Body Mod Kit 1','Custom Gauges','Tire Upg
rade 3','Hood Upgrade 2','Grounding System','Hood Upgrade 1','Custom Bumpers 1',
'Body Mod Kit 2','Body Mod Kit EX','Custom Bumpers 2','Weight Reduction Kit','Wi
de Body Kit','Power Shifter Kit 1','Power Shifter Kit 2','Turbo System Upgrade',
'Performance Air Intake','Single NOS Boost','Performance Exhaust','Custom Wiring
System','Custom Ignition System','Double NOS Boost','Triple NOS Boost','Perform
ance Drag Pack','Performance Power Pack','Racing Suction Intake Kit','Power Flow
Air Intake Sys','Custom Cooling system','Air Diversion Panels','Helmet','Custom
Roll Cage','Racing Harnesses','Flame Retardant Suit'];var part_price=['$25,000'
,'$25,000','$50,000','$150,000','$100,000','$500,000','$125,000','$250,000','$25
0,000','$175,000','$300,000','$400,000','$750,000','$25,000','$10,000','$10,000'
,'$20,000','$35,000','$45,000','$20,000','$250,000','$2,500','$30,000','$250,000
','$5,000','$75,000','$100,000','$500,000','$600,000','$200,00','$1,000,000','$2
,000,000','$500,000','$750,000','$25,000','$50,000','$45,000','$35,000','$20,000
','$15,000','$80,000','$200,000','$500,000','$1,000,000','$120,000','$250,000','
$75,000','$125,000','$10,000','$500,000','$100,000','$300,000'];var part_nfo=['E
nhance the power of your car with these custom mufflers.','Tune into the raw pow
er of your car with these custom headers. ','Boost the power of your car with th
is custom transmission.','Take your car to the next step with this custom second
level upgrade for your car. Extra power that you\'ve been craving.','Step up yo
ur engine with added power.','Instant power at your finger tips with this super
charger system.','Increase the power hidden within your car with this custom enh
ancement pack.','Pull the raw power from your engine and boost your performance
across the board with this super torque upgrade.','Take your engine to the max.
This special mod kit has everything you need to tweak your car to the limits.','
Smooth out your cars engine with this customized intake system. Performance qual
ity the pros use.','Control your car\'s power with these electronic boost contro
ls. This double set up system allows you to map out up to 64 points in your engi
ne load and increase your power at optimal points.','Take your car to the next l
evel with this custom rear end kit where performance is counted in the seconds y
ou save.','Custom injectors, tank and delivery system in this package. You will
see a more reliable output of power and a consistant flow throughout','Streamlin
e the dynamics of your car with this customized spoiler. All makes and models co
vered.','Bring your car up to the next level with these custom racing tires.','A
step up from the basics, these rally wheels are a favorite among racers.','Take
your rims to the EXTREME! Our super special rim upgrade offers plenty of eye ca
ndy for those who want to show off their ride.','Protect your car from the groun
d up. With our custom suspension package you will instantly feel the difference
in the control of your car.','Enhance the dynamics of your car with this special
hood.','Super rally sport tires. Used by the professional racers!','With custom
ized body enhancements the sleek new design will allow you to shave seconds from
the clock when seconds are all that matters. Available in all makes and models.
','Custom designed gauges fit into the overall look of your car and offer a more
accurate display of your cars information.','Wide tires for better traction and
handling. Tested and proven to enhance your performance.','The best of the best
. Imported and custom made to fit your car this hood will allow you to cut throu
gh the air like never before.','Protect the delicate electronics that your car h
as with this custom built grounding system.','Take your old hood and scrap it. Y
ou will find it useless when you outfit your car with this new and more aerodyna
mic model.','Enhance the overall areodynamics with this front and rear bumper up
grade.','Streamline your car\'s areodynamics with this custom body kit.','Take y
our car to the extreme with this enhancement kit. Seen world-wide on many custom
ized race cars, this kit offers many enhancements which you don\'t see on your e
veryday racing car.','A new sleek design allows for a better control and increas
ed airflow across your car. You will not only see the difference in your time tr
ials but feel the difference within your grasp.','Reduce your autos body weight
and increase your aerodynamics at the same time. Remember in some automobiles a
weight reduction may have a negative effect.','This kit allows you to give your
car what it\'s always needed. A more stablized system, better handling and sensi
tive controls.This upgrade is for the serious racers and not the faint of heart.
','Included is a short throw shifter along with a customed electronic LED shift
indicator','Included is a quick shift adjustable throw shiftter along with an el
ectronic LED shift indicator and RPM gauge.','Point for point power increase on
a large scale, these turbo systems will allow your car to perform in ways you\'v
e never imagined.','Boost your car\'s overall performance and power with this cu
stomized intake system.','NOS. The name says it all. Pure power.','Custom exhaus
t system to enhance your car\'s power.','Stop problems before they start with th
is custom wiring system you can depend on. Extra heavy duty heat resistant wirin
g is used to provide dependability and performance.','Make the timing of your ca
r perfect and pull extra power from your car you never knew it had!','Double the
boost your car has.','Three shots of this powerful stuff!','Increased handling
and acceleration. This is for the enhancement is for serious racers only.','Incr
ease your car\'s power and acceleration this enhancement pack. Highly tested and
racer approved.','Developed as the premier intake system for high performance',
'Specially designed for high performance in larger motors and engineered to the
highest standards','Increase the stability of your engine with this custom cooli
ng system','These under the hood panels contain airflow to the radiator core and
improve cooling efficiency.','Safety first! This customized helmet is decorated
with your logo. Look cool and protect your head at the same time.','Rolling you
r car is one of the worst fears a racer has. With this special upgrade you can s
quash your fears!','Safety first and formost. From the minds of I Industries com
es the BI2k. Avaliable in all colors these racing harnesses will offer a lot of
protection when you need it the most.','When seconds count you need something yo
u can depend upon. This suit will not let you down. Tested in various stages thi
s suit has withstood the most extreme heat and came out undamaged.Another great
product from I Industries.'];$("td[width='81%'] > table td[colspan=3]").each(fun
ction(){$(this).attr('colspan',4);});$("td[width='81%'] > table a[href^='race.ph
p?s=car&c=partinfo&XID=']").each(function(){var i=$.inArray($(this).text(),part_
name);$(this).attr('title',part_nfo[i]);$(this).parent().parent().append('<td al
ign="right">'+part_price[i]+'</td>');});break;}}
break;}}}
else if(currentLoc('forums.php'))
{var tid=client.getQueryParam('ID');if(GM_getValue('mt_enable',true)&&tid)
{init_mail_template();attachBodyTplControl('textarea[name=post]');}}
else if(currentLoc('quote.php'))
{var tid=client.getQueryParam('ID');if(GM_getValue('mt_enable',true)&&tid)
{init_mail_template();attachBodyTplControl('textarea[name=post]');}}
else if(currentLoc('loan.php'))
{if(GM_getValue('vl_enable',true))
{$('form').attr('id','frm-loan').after('Loan more:<br/>\
<input type="text" id="loan-more-amt" value="0" size="10" maxlength="20" />\
<input type="button" id="loan-more" value="Loan"><br/><br/>\
Pay back:<br>\
<input type="text" id="loan-pay-amt" value="0" size="10" maxlength="20">\
<input type="button" id="loan-pay" value="Pay">');var loan_effect={};loan_effect
['loan-more-amt']='loan-more';loan_effect['loan-pay-amt']='loan-pay';currencyTex
tEffect(loan_effect);$current_amt=$('form > input[name=loan]');var current_amt=p
arseInt($current_amt.val());$('#loan-more').click(function(){var more_amt=parseI
nt(unformatCurrency($('#loan-more-amt').val()));$current_amt.val(current_amt+mor
e_amt);$('#frm-loan').trigger('submit');});$('#loan-pay').click(function(){var p
ay_amt=parseInt(unformatCurrency($('#loan-pay-amt').val()));$current_amt.val(cur
rent_amt-pay_amt);$('#frm-loan').trigger('submit');});}
currencyFormEffect(':text[name=loan]');}
else if(currentLoc('amarket.php'))
{var step=client.getQueryParam('step');switch(step)
{case'buy':currencyFormEffect(':text[name=nextbid]');break;case'addl1':currencyF
ormEffect(':text[name=price]');break;}}
else if(currentLoc('imarket.php'))
{var step=client.getQueryParam('step');switch(step)
{case'addl1':currencyFormEffect(':text[name=price]');break;}}
else if(currentLoc('pmarket.php'))
{var step=client.getQueryParam('step');switch(step)
{case'addlisting':currencyFormEffect(':text[name=price]');break;}}
else if(currentLoc('jobs.php'))
{var step=client.getQueryParam('step');switch(step)
{case'manageemployees':{ManagerEmployeeHandle();currencyFormEffect(':text[name$=
pay]');break;}
case'companyfunds':{currencyFormEffect(':text[name=withdraw], :text[name=deposit
]');break;}}}
else if(currentLoc('blackjack.php'))
{currencyFormEffect(':text[name=money]');}
else if(currentLoc('poker1.php'))
{currencyFormEffect(':text[name=moneyputdown], :text[name=raise]');}
else if(currentLoc('russianroulette.php'))
{currencyFormEffect(':text[name=bet]');}
else if(currentLoc('bank.php'))
{currencyFormEffect(':text[name=amount]');}
else if(currentLoc('bazaar.php'))
{currencyFormEffect(':text[name=amount], :text[name=price]');}
else if(currentLoc('bookie.php'))
{currencyFormEffect(':text[name=amount]');}
else if(currentLoc('jailview.php'))
{$('table[width=75%][border=0] > tbody > tr').each(function(i){if(i==0)
{$(this).append('<td><b title="Bust without confirm page">BustX</b></td>');}
else
{var $bust_link=$(this).find("td:last > a");$(this).append('<td>[<a href="'+$bus
t_link.attr('href')+'1'+'">Bust</a>]</td>');}});}
else if(currentLoc('stockexchange.php'))
{var step=client.getQueryParam('step');if(!step)
{var $stock_table=$('img[src^="http://static.torn.com/stock"]:first').parent().p
arent().parent().parent().parent().attr('id','stock-table');var image=new Image(
);image.src="http://minh.phoenixheart.net/torn/imgs/loading12.gif";var stock_acr
o={0:'TCSE',19:'EWM',6:'GRN',25:'WSSB',31:'TCC',14:'IIL',3:'SYS',2:'TCB',26:'IST
C',1:'TCSB',29:'MCS',10:'CNC',28:'EVL',13:'TCP',4:'SLAG',9:'TCT',5:'IOU',18:'PRN
',23:'TGP',12:'TMI',22:'HRG',16:'SYM',7:'TCHS',15:'FHC',11:'MSG',21:'ELBT',8:'YA
Z',30:'WLT',20:'TCM',17:'LSC',27:'BAG'};$stock_table.find('tr:first').append('<t
d><b title="Quick check">QCheck</b></td>');$stock_table.find('tr[bgcolor=#cccccc
]').each(function(i){var stock_id=$(this).find('a[href^="stockexchange.php?step=
profile&stock="]:first').attr('href');stock_id=stock_id.substr(stock_id.indexOf(
'stock=')+6);var stock_title=stock_acro[stock_id];if(!stock_title)
stock_title='Undefined';$(this).append('<td><a id="check-stock-'+stock_id+'" hre
f="#">['+stock_title+']</a></td>');$('#check-stock-'+stock_id).click(function(e)
{var stock_url='stockexchange.php?step=profile&stock='+stock_id;FloatingPanel('<
span id="check-stock-status-'+stock_id+'"><br/> Checking stock status <img src="
http://minh.phoenixheart.net/torn/imgs/loading12.gif" alt="..."/></span>',e.page
X,e.pageY,140,75,stock_title+' - '+stock_id);$.get(stock_url,function(rspText){i
f(stock_id=='0')
{var matches=rspText.match(/Current price:\<\/b\>\<\/td\>\<td\>\$([\d\.,].*?)\<\
/td\>/);matches[3]=matches[1];matches[1]=matches[2]=matches[4]='N/A';}
else
var matches=rspText.match(/Forecast:\<\/b\>\<\/td\>\<td\>([\w\s].*?)\<\/td\>[\s\
S]*?Demand:\<\/b\>\<\/td\>\<td\>([\w\s].*?)\<\/td\>[\s\S]*?Current price:\<\/b\>
\<\/td\>\<td\>\$([\d\.,].*?)\<\/td\>[\s\S]*?Shares for sale:\<\/b\>\<\/td\>\<td\
>([\d,].*?)\<\/td\>/);if(matches&&matches.length==5)
{var forecast=matches[1];var demand=matches[2];var price=matches[3];var share=ma
tches[4];$('#check-stock-status-'+stock_id).html('Forecast: <b>'+forecast+'</b><
br/>'+'Demand: <b>'+demand+'</b><br/>'+'Price: <b>'+price+'</b><br/>'+'Shares: <
b>'+share+'</b><br/>');}
else
{$('#check-stock-status-'+stock_id).html('<span style="color:red">Error when loa
ding page, please recheck ..</span>');}});return false;});});}
else if(step=='profile')
{var stock_id=client.getQueryParam('stock');if(stock_id!=0)
{var tmp=$('table[width=500] > tbody > tr:eq(1) > td[bgcolor=#cccccc]');var matc
hes=tmp.text().match(/Current price:\$([\d\.,].*)[\s\S]*?Shares for sale:([\d\,]
.*)/);if(matches&&matches.length==3)
{var _price=parseFloat(unformatCurrency(matches[1]));var _share_av=parseInt(unfo
rmatCurrency(matches[2]));var _cash_investable=_price*_share_av;var _cash_acro='
';if(_cash_investable/1000000000>1)
_cash_acro=' (over <b>$'+parseInt(_cash_investable/1000000000)+' billion</b>)';e
lse if(_cash_investable/1000000>1)
_cash_acro=' (over <b>$'+parseInt(_cash_investable/1000000)+' million</b>)';tmp.
append('<div align="center"><b>Total cash investable</b> : $'+formatCurrency(par
seInt(_cash_investable))+_cash_acro+'</div>')}}}
currencyFormEffect(':text[name=amount]');}
else if(currentLoc('events.php'))
{$('table[width=75%]:eq(1)').after('<br /><div id="event-highlighter">\
<input type="text" id="event-highlighter-term" size="50" /> <input type="button
" id="event-highlighter-perform" value="Highlight now" /><input type="button" id
="event-highlighter-clear" value="C" title="Clear"/>\
<div id="event-highlighter-result" style="color: #999999; font-weight:bold">&nb
sp;</div></div>');var term=GM_getValue('eh_term','');$('#event-highlighter-term'
).val(term);DoEventHighlight(term);$('#event-highlighter-clear').click(function(
){$('#event-highlighter-term').val('');$('#event-highlighter-perform').extrigger
('click');});$('#event-highlighter-perform').click(function(){var term=$('#event
-highlighter-term').val();GM_setValue('eh_term',term);DoEventHighlight(term);});
$('#event-highlighter-term').keydown(function(event){if(event.keyCode==13)
$('#event-highlighter-perform').extrigger('click');});}
else if(currentLoc('preferences.php'))
{var action=client.getQueryParam('action');if(action=='settings')
{$('form').submit(function(){GM_setValue('honor_mode',$(':radio[name=textnames]:
checked').attr('value')!='1');});}}
else if(currentLoc('index.php')||currentLoc()=='/')
{l('Root page');if(getCurrentStatus()=='normal')
{l('Accessing home');var $battle_stat=$('table[width=75%] > tbody > tr > td[heig
ht=75][valign=top][align=left] > font > b');if($battle_stat.length==5)
{spd=unformatCurrency($battle_stat.eq(0).text());str=unformatCurrency($battle_st
at.eq(1).text());def=unformatCurrency($battle_stat.eq(2).text());dex=unformatCur
rency($battle_stat.eq(3).text());l('Battle stats : '+spd+' '+str+' '+def+' '+dex
);}}}
AutomaticCheckingUpdate();perform.l('AutomaticCheckingUpdate');DisableScammerAds
();perform.l('DisableScammerAds');ColoringNameLink();perform.l('ColoringNameLink
');NavigateHandle();perform.l('NavigateHandle');FloatingPanelPaint();RewriteStat
us();perform.l('RewriteStatus');EasterEggTrigger();perform.l('EasterEggTrigger')
;UpgradeLevelConfirm();perform.l('UpgradeLevelConfirm');TravelBackConfirm();perf
orm.l('TravelBackConfirm');WriteRefillTime();perform.l('WriteRefillTime');l('Pro
cessed page !');perform.logCompletedTime();