Nexus Clash Interface Tweaks

Various Tweaks to the Nexus Clash Browser Game Interface

当前为 2014-05-31 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Nexus Clash Interface Tweaks
  3. // @namespace http://userscripts.org/users/125692
  4. // @description Various Tweaks to the Nexus Clash Browser Game Interface
  5. // @include http://nexusclash.com/modules.php?name=Game*
  6. // @include http://www.nexusclash.com/modules.php?name=Game*
  7. // @exclude http://nexusclash.com/modules.php?name=Game&op=disconnect
  8. // @exclude http://www.nexusclash.com/modules.php?name=Game&op=disconnect
  9. // @grant GM_getValue
  10. // @grant GM_setValue
  11. // @version 1.5.2
  12. // ==/UserScript==
  13. //for nexus clash. this script
  14. // -adds a checkbox for each drop button and disables the button until the checkbox is checked.
  15. // -adds a checkbox for each skill button and disables the button until the checkbox is checked.
  16. // -adds a checkbox for leave faction button and disables the button until the checkbox is checked.
  17. // -make the message box a bit bigger
  18. // -colours hits red and misses pink.
  19. // -1.5 added make message box bigger on login if there are lotsa messages
  20. //1.5.2 -bugfix for lock picking.
  21. (function() {
  22.  
  23. function addGlobalStyle(css) {
  24. var head, style;
  25. head = document.getElementsByTagName('head')[0];
  26. if (!head) { return; }
  27. style = document.createElement('style');
  28. style.type = 'text/css';
  29. style.innerHTML = css;
  30. head.appendChild(style);
  31. }
  32.  
  33. // got this off http://stackoverflow.com/questions/4009756/how-to-count-string-occurrence-in-string
  34. var timesCharExist=function(x,c){var t=0,l=0,c=c+'';while(l=x.indexOf(c,l)+1)++t;return t;};
  35. //Just some constants
  36. var SMWARNINGCOLOUR="red"; //colour for Sorcerers Might Status. To try and stop me wasting FAKs.
  37. var LOWAPWARNINGCOLOUR="gold"; //colour for background of headings to signify low ap.
  38. var LOWHPWARNINGCOLOUR="crimson"; //colour for background of heading when you have died (or are about to.)
  39. var LOWHPBACKGROUNDCOLOUR="crimson"; //colour for backgound of text of AP and HP when low.
  40. LOWAPBACKGROUNDCOLOUR="#fa8000";
  41. //AND ADD SOME STYLES
  42. addGlobalStyle("td.MageHealthBar {background-repeat:no-repeat;background-position:left bottom; margin-bottom:0px;position:relative;top:-10px; background-image:url(data:image/gif;base64,R0lGODlhAQAFAIABAACZAP%2F%2F%2FywAAAAAAQAFAAACAoRdADs%3D);}");
  43. addGlobalStyle("td.MageHealthBar2 {background-repeat:no-repeat;background-position:left bottom; margin-bottom:0px; background-image:url(data:image/gif;base64,R0lGODdhAQAFAIACAAAAAP8AACwAAAAAAQAFAEACAoxdADs=);}");
  44.  
  45. addGlobalStyle(".bar{line-height=:1px;height:5px;display:inline-block;margin: 0 0 0 0;padding: 0 0 0 0;position:absolute;top:20px;#bottom:1px;background-color:#ff0000;left:0px;}");
  46. addGlobalStyle(".bar2{line-height=:1px;height:5px;display:inline-block;margin: 0 0 0 0;padding: 0 0 0 0;position:absolute;top:20px;#bottom:1px;background-color:#00ff00;left:0px;}");
  47.  
  48. addGlobalStyle(".numberdiv{display:inline-block;padding:0 0 0 0;margin: 0 0 0 0;width:20px;position:relative;}");
  49. addGlobalStyle('td.MageNoWrap { white-space: nowrap ! important; }');
  50. addGlobalStyle('a.MageHide { display: none ! important; }');
  51. //style for hp ap mp bars
  52. addGlobalStyle('img.MageBarBck {position:absolute;left:1;top: 18;display:inline;z-index:0}');
  53. addGlobalStyle('img.MageBar {position:absolute;left:1;top: 18;display:inline;z-index:1}');
  54.  
  55. //styles for pet messages
  56. addGlobalStyle('div.MagePetHit {font-size:smaller;color:lightcoral ! important;padding-left:4em;}');
  57. addGlobalStyle('div.MagePetHitMe {font-size:smaller;color:red ! important;padding-left:4em;}');
  58. addGlobalStyle('div.MagePetKill {font-size:smaller;color:crimson;padding-left:4em;}');
  59. addGlobalStyle('div.MagePetMiss {font-size:smaller;color:#CAA083;padding-left:4em;}');
  60. addGlobalStyle('div.MagePetHealOthers {font-size:smaller;color:5050aa;padding-left:4em;}');
  61. addGlobalStyle('div.MagePetHealMe {font-size:smaller;color:0808aa;padding-left:4em;}');
  62. addGlobalStyle('div.MagePetRejuv {font-size:smaller;color:aa50aa;padding-left:4em;}');
  63. addGlobalStyle('div.MagePetDespawn {font-size:smaller;color:ff8000;padding-left:4em;}');
  64. //styles for player attack messages
  65. addGlobalStyle('div.MageAttackHit {color:red ! important;}');
  66. addGlobalStyle('div.MageAttackMiss {color:deeppink;}');
  67. addGlobalStyle('div.MageAttacked {color:red;font-weight:600}');
  68. //environmental damage
  69. addGlobalStyle('div.MageAttackedbyEnvironment {color:red;font-weight:100}');
  70. //player is healed
  71. addGlobalStyle('div.MageHealed {color:0808aa;}');
  72. //style for achievement messages
  73. addGlobalStyle('div.MageAchievement {font-size:smaller;padding-left:4em;}');
  74. addGlobalStyle('span.MageAchievementColour {color:aa0000;}');
  75. addGlobalStyle('div.MageSpeech {color:dodgerblue;}');
  76. addGlobalStyle('div.MageAction {color:aaaaff;}');
  77. addGlobalStyle('div.MageWhisper{color:MediumOrchid;}');
  78. addGlobalStyle('span.MageMe{color:darkblue;}');
  79. addGlobalStyle('div.MageReceivedSomething{color:ff8040;}');
  80. addGlobalStyle('div.MageCraft{color:8d4f9d;}');
  81. addGlobalStyle('div.MageSearchNothing{color:8c8c55;}');
  82. addGlobalStyle('div.MageSearchYay{color:8c8c00;}');
  83. addGlobalStyle('span.MageShadowText{color:dd0101;}');
  84. //this copied off the web
  85. //http://stackoverflow.com/questions/9447950/script-to-save-settings
  86. // for chrome
  87. if (!this.GM_getValue || (this.GM_getValue.toString && this.GM_getValue.toString().indexOf("not supported")>-1)) {
  88. this.GM_getValue=function (key,def) {
  89. return localStorage[key] || def;
  90. };
  91. this.GM_setValue=function (key,value) {
  92. return localStorage[key]=value;
  93. };
  94. this.GM_deleteValue=function (key) {
  95. return delete localStorage[key];
  96. };
  97. };
  98. var newbox;
  99. var acell;
  100. var loc=location+'';//lol cludgy
  101.  
  102.  
  103.  
  104.  
  105. /*
  106. var isstart = document.evaluate(
  107. "//h2[starts-with(.,'Welcome back to Nexus Clash!')]",
  108. document,
  109. null,
  110. XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
  111. null
  112. );
  113.  
  114. if (isstart.snapshotLength == 1) {
  115. //we on start screen.
  116. //Store max ap/hp/mp values.
  117. var charlinks = document.evaluate(
  118. "//a[starts-with(@href,'modules.php?name=Game&op=character&id=')]",
  119. document,
  120. null,
  121. XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
  122. null );
  123. //charlinks.snapshotLength; //find<th>Character</th>
  124. var charid;
  125. var charmaxhp=50;
  126. var charmaxap=50;
  127. var charmaxmp=30;
  128. if (charlinks.snapshotLength > 1) {//found some charlinks
  129. var charlink=0;
  130. for (i=0;charlink=charlinks.snapshotItem(i);i++){
  131. //alert(i);
  132. charid=charlink.href.match(/id=(\d+)/)[1];
  133. charlink=charlink.parentNode.nextElementSibling.nextElementSibling;
  134. charmaxap=charlink.textContent.match(/\/(\d+)/)[1];
  135. charlink=charlink.nextElementSibling;
  136. charmaxhp=charlink.textContent.match(/\/(\d+)/)[1];
  137. charlink=charlink.nextElementSibling;
  138. charmaxmp=charlink.textContent.match(/\/(\d+)/)[1];
  139. //now store em away
  140. GM_setValue("maxap"+charid,charmaxap);
  141. GM_setValue("maxhp"+charid,charmaxhp);
  142. GM_setValue("maxmp"+charid,charmaxmp);
  143. }
  144. }
  145. return; //as that is all we want to do as none of the other tweaks apply on the start screen
  146. }*/
  147.  
  148.  
  149.  
  150.  
  151.  
  152. //##############################################################################################################
  153. //tweak whatever the count is now. 12 I suppose. BUT THIS ONE HAS TO GO FIRST.
  154. //AS replacing HTML fubars eventlisteners
  155. //highlight shadow text
  156. //The occasional shadow can be glimpsed moving in the windows
  157. if(document.getElementById("CharacterInfo")){
  158. var elementtosearch=document.getElementById("CharacterInfo").parentNode;
  159. elementtosearch.innerHTML=elementtosearch.innerHTML.replace(/(There are several shadows moving in the windows|The occasional shadow can be glimpsed moving in the windows)/,"<span class='MageShadowText'>$1</span>")
  160. }
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168. //##############################################################################################################
  169. //TWEAK 1 - Drop Item Button Safeties
  170. //if (loc.match(/buyskills/)){
  171. //do the item drop first by assuming we are on the right page and just looking for things with the item_drop class
  172. var elementsDropButtons = document.getElementsByClassName('item_drop');
  173. var elementDropButton;
  174. for (i=0;i<elementsDropButtons.length;i++){
  175. elementDropButton=elementsDropButtons[i];
  176. if (!elementDropButton.hasAttribute('mageconfirmflag')){//see if flag not set
  177. elementDropButton.setAttribute('mageconfirmflag',1);//set flag
  178. newbox=document.createElement('input');
  179. newbox.type='checkbox';
  180. newbox.checked=false;
  181. var rchange=function(e) {
  182. var targetbutton=e.target.nextElementSibling;//button should be next element
  183. if(e.target.checked){
  184. //targetbutton.style.display='';
  185. targetbutton.style.visibility='visible';
  186. }
  187. else{
  188. //targetbutton.style.display='None';
  189. targetbutton.style.visibility='hidden';
  190. }
  191. }
  192. newbox.addEventListener("click",rchange,false);
  193. acell=elementDropButton.parentNode
  194. acell.className='MageNoWrap';//set class for nowrap so doesn't fubar page
  195. acell.align='left';
  196. acell.insertBefore(newbox,elementDropButton);
  197. //elementDropButton.style.display='None';
  198. elementDropButton.style.visibility='hidden';
  199. }
  200. }
  201.  
  202. //##############################################################################################################
  203. //TWEAK 2 - learn spell gem buttons safeties
  204. //now we do the spellgem learn buttons
  205. elementsDropButtons = document.getElementsByClassName('item_use');
  206. // elementDropButton;
  207. for (i=0;i<elementsDropButtons.length;i++){
  208. elementDropButton=elementsDropButtons[i];
  209. if (!elementDropButton.innerHTML.match(/Learn/)){
  210. continue;
  211. }
  212. if (!elementDropButton.hasAttribute('mageconfirmflag')){//see if flag not set
  213. elementDropButton.setAttribute('mageconfirmflag',1);//set flag
  214. newbox=document.createElement('input');
  215. newbox.type='checkbox';
  216. newbox.checked=false;
  217. var rchange=function(e) {
  218. var targetbutton=e.target.nextElementSibling;//button should be next element
  219. if(e.target.checked){
  220. //targetbutton.style.display='';
  221. targetbutton.style.visibility='visible';
  222. }
  223. else{
  224. //targetbutton.style.display='None';
  225. targetbutton.style.visibility='hidden';
  226. }
  227. }
  228. newbox.addEventListener("click",rchange,false);
  229. acell=elementDropButton.parentNode
  230. //acell.className='MageNoWrap';//set class for nowrap so doesn't fubar page
  231. acell.align='center';
  232. acell.insertBefore(newbox,elementDropButton);
  233. //elementDropButton.style.display='None';
  234. elementDropButton.style.visibility='hidden';
  235. }
  236. }
  237. /*//now we do the spellgem learn buttons
  238. elementsDropButtons = document.getElementsByClassName('item_use');
  239. elementDropButton;
  240. for (i=0;i<elementsDropButtons.length;i++){
  241. elementDropButton=elementsDropButtons[i];
  242. if (!elementDropButton.innerHTML.match(/Learn/)){
  243. continue;
  244. }
  245. if (!elementDropButton.hasAttribute('mageconfirmflag')){//see if flag not set
  246. elementDropButton.setAttribute('mageconfirmflag',1);//set flag
  247. newbox=document.createElement('input');
  248. newbox.type='checkbox';
  249. newbox.checked=false;
  250. var rchange=function(e) {
  251. var targetbutton=e.target.nextElementSibling;//button should be next element
  252. if(e.target.checked){
  253. //targetbutton.style.display='';
  254. targetbutton.style.visibility='visible';
  255. }
  256. else{
  257. //targetbutton.style.display='None';
  258. targetbutton.style.visibility='hidden';
  259. }
  260. }
  261. newbox.addEventListener("click",rchange,false);
  262. acell=elementDropButton.parentNode
  263. //acell.className='MageNoWrap';//set class for nowrap so doesn't fubar page
  264. acell.align='center';
  265. acell.insertBefore(newbox,elementDropButton);
  266. //elementDropButton.style.display='None';
  267. elementDropButton.style.visibility='hidden';
  268. }
  269. }
  270. */
  271.  
  272. //##############################################################################################################
  273. //TWEAK 3- craft button safety
  274. //and now we do craft button
  275. //elementsDropButtons = document.getElementsByClassName('item_use');
  276. var elementsCraftButtons = document.getElementsByTagName('input')//get all input
  277. var elementCraftButton;
  278. for (i=0;i<elementsCraftButtons.length;i++){
  279. elementCraftButton=elementsCraftButtons[i];
  280. if (elementCraftButton.type!="submit"||elementCraftButton.value!="Craft"){//but sometimes isn't
  281. continue;//well we tried to find it but couldn't so abort it all.
  282. }
  283. if (!elementCraftButton.hasAttribute('mageconfirmflag')){//see if flag not set
  284. elementCraftButton.setAttribute('mageconfirmflag',1);//set flag
  285. var craftbox=document.createElement('input');
  286. craftbox.type='checkbox';
  287. craftbox.checked=false;
  288. var rchange2=function(e) {
  289. //alert("running");
  290. var targetbutton=e.target.nextElementSibling;//button should be next element
  291. if(e.target.checked){
  292. //targetbutton.style.display='';
  293. //targetbutton.style.visibility='visible';
  294. targetbutton.disabled=false;
  295. }
  296. else{
  297. //targetbutton.style.display='None';
  298. //targetbutton.style.visibility='hidden';
  299. targetbutton.disabled=true;
  300. }
  301. }
  302. craftbox.addEventListener("click",rchange2,false);
  303. acell=elementCraftButton.parentNode
  304. //acell.className='MageNoWrap';//set class for nowrap so doesn't fubar page
  305. //acell.align='center';
  306. acell.insertBefore(craftbox,elementCraftButton);
  307. //elementCraftButton.style.display='None';
  308. //elementCraftButton.style.visibility='hidden';
  309. elementCraftButton.disabled=true;
  310. }
  311. }
  312. //}
  313. //##############################################################################################################
  314. //TWEAK 4-learn skill buttons safeties
  315. //if on buy skills page;
  316. //var loc=location+'';//lol cludgy
  317. //well in any event check if we are on the buyskills page and add saftey boxs to skill buttons
  318. //if this works the above code really should have been avoided by having some kind of test i suppose.
  319. if (loc.match(/buyskills/)||loc.match(/executepurchase/)){
  320. var elementsSkillButtons = document.getElementsByTagName('input')//get all input
  321. var elementSkillButton;
  322. for (i=0;i<elementsSkillButtons.length;i++){
  323. elementSkillButton=elementsSkillButtons[i];
  324. if (elementSkillButton.type!="submit"){//but sometimes isn't
  325. continue;//well we tried to find it but couldn't so abort it all.
  326. }
  327. if (!elementSkillButton.hasAttribute('mageconfirmflag')){//see if flag not set
  328. elementSkillButton.setAttribute('mageconfirmflag',1);//set flag
  329. //now check if we have a confirm button and if so make it red
  330. if (elementSkillButton.value.match(/Confirm/)){
  331. elementSkillButton.style.color='red'//make it red to hightlight it
  332. }//'Confirm (10 CP)'
  333. newbox=document.createElement('input');
  334. newbox.type='checkbox';
  335. newbox.checked=false;
  336. var rchange=function(e) {
  337. var targetbutton=e.target.nextElementSibling;//button should be next element
  338. if(e.target.checked){
  339. //targetbutton.style.display='';
  340. //targetbutton.style.visibility='visible';
  341. targetbutton.disabled=false;
  342. }
  343. else{
  344. //targetbutton.style.display='None';
  345. //targetbutton.style.visibility='hidden';
  346. targetbutton.disabled=true;
  347. }
  348. }
  349. newbox.addEventListener("click",rchange,false);
  350. acell=elementSkillButton.parentNode
  351. //acell.className='MageNoWrap';//set class for nowrap so doesn't fubar page
  352. //acell.align='left';
  353. acell.insertBefore(newbox,elementSkillButton);
  354. //elementDropButton.style.display='None';
  355. //elementDropButton.style.visibility='hidden';
  356. elementSkillButton.disabled=true;
  357. }
  358. }
  359. }
  360. //##############################################################################################################
  361. //TWEAK 5-leave faction button safety
  362. //or perhaps we are viewing the faction page
  363. else if (loc.match(/faction&do=view/)){//viewing faction page
  364. var elementsSkillButtons = document.getElementsByTagName('input')//get all input
  365. var elementSkillButton;
  366. for (i=0;i<elementsSkillButtons.length;i++){
  367. elementSkillButton=elementsSkillButtons[i];
  368. if (elementSkillButton.type!="submit"){//but sometimes isn't
  369. continue;//well we tried to find it but couldn't so abort it all.
  370. }
  371. if (!elementSkillButton.hasAttribute('mageconfirmflag')){//see if flag not set
  372. elementSkillButton.setAttribute('mageconfirmflag',1);//set flag
  373. if (elementSkillButton.value=="Leave Faction"){//just do the one button here. very ineffiecent code i think
  374. newbox=document.createElement('input');
  375. newbox.type='checkbox';
  376. newbox.checked=false;
  377. var rchange=function(e) {
  378. var targetbutton=e.target.nextElementSibling;//button should be next element
  379. if(e.target.checked){
  380. targetbutton.disabled=false;
  381. }
  382. else{
  383. targetbutton.disabled=true;
  384. }
  385. }
  386. newbox.addEventListener("click",rchange,false);
  387. acell=elementSkillButton.parentNode
  388. acell.insertBefore(newbox,elementSkillButton);
  389. elementSkillButton.disabled=true;
  390. }
  391. }
  392. }
  393. }
  394. //##############################################################################################################
  395. //TWEAK 6- revoke faction button
  396. //do the revoke faction button
  397. var factionbuttons= document.evaluate("//form[@name='stronghold']", document, null,
  398. XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  399. if (factionbuttons.snapshotLength>0){//if we have a faction box
  400. var factionbutton=factionbuttons.snapshotItem(0).firstElementChild.nextElementSibling;
  401. if (factionbutton.type=="submit"){//but sometimes isn't
  402. if (!factionbutton.hasAttribute('mageconfirmflag')){//see if flag not set
  403. factionbutton.setAttribute('mageconfirmflag',1);//set flag
  404. if (factionbutton.value.slice(0,17)=="Revoke Stronghold"){//just do the one button here.
  405. //alert("doing it")
  406. var anewbox=document.createElement('input');
  407. anewbox.type='checkbox';
  408. anewbox.checked=false;
  409. var rchange=function(e) {
  410. var targetbutton=e.target.nextElementSibling;//button should be next element
  411. if(e.target.checked){
  412. targetbutton.disabled=false;
  413. }
  414. else{
  415. targetbutton.disabled=true;
  416. }
  417. }
  418. anewbox.addEventListener("click",rchange,false);
  419. acell=factionbutton.parentNode
  420. acell.insertBefore(anewbox,factionbutton);
  421. factionbutton.disabled=true;
  422. }
  423. }
  424. }
  425. }
  426. //##############################################################################################################
  427. //TWEAK 7 Thin full health and mana bars
  428. var healthbarimages= document.evaluate("//img[@src='images/g/HealthBar_1.gif']", document, null,
  429. XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  430. for (var i=0,item;item=healthbarimages.snapshotItem(i) ;i++ ){
  431. //item.hidden='true';
  432. item.width='2';
  433. }
  434. var manabarimages= document.evaluate("//img[@src='images/g/MagicBar_1.gif']", document, null,
  435. XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  436. for (var i=0,item;item=manabarimages.snapshotItem(i) ;i++ ){
  437. //item.hidden='true';
  438. item.width='2';
  439. }
  440.  
  441. //##############################################################################################################
  442. //TWEAK 8 Color hits/misses (and make message box bigger and resizable)
  443. if(document.getElementById("Messages")){
  444. var messages=document.getElementById("Messages");
  445. if (!(messages.previousElementSibling.innerHTML.match(/This Week/))){//ensure we dont do this on log page
  446. //if we are loggin in and there is a long list of messages make the message box a tad bigger
  447. //the '|| []' in the length is to avoid error when for when the regex fails to match anything and is null
  448. //if((loc.match(/name=Game$/)) && ((messages.innerHTML.match(/^ -/) || []).length > 10)){
  449. if((loc.match(/name=Game(&op=connect)?$/)) && (timesCharExist(messages.innerHTML,"\n")>13)){
  450. messages.style.height="250px";
  451. }
  452. //messages.style.height="145px";//make the message box a bit bigger
  453. messages.style.resize = "vertical";//allow resizing
  454. }
  455. var alonglist=messages.innerHTML.split("\n");
  456. for (i=0;i<alonglist.length;i++){ //For each line
  457. //first check every string for the dreaded a(n) and fix them
  458. alonglist[i]=alonglist[i].replace(/( a)(\(?(n)\)?( [AEIOUaeiou])|\(?n\)?( [^AEIOUaeiou]))/g,'$1$3$4$5');
  459. //regex string for replacing a(n)
  460. //a.replace(/((a)\((n)\)( [AEIOUaeiou])|(a)\(()n\)( [^AEIOUaeiou]))/g,'$2$3$4$5$6$7')
  461.  
  462. //then fix dreaded double '' (not ") turning them into singles. to help with searching for quotes etc...
  463. alonglist[i]=alonglist[i].replace(/(\'\')/g,"'");//replace '' with '
  464.  
  465. //You attack and hit
  466. if(alonglist[i].match(/(- (\(\d+ times\) )?You attack .* with your .* and hit for .* damage..*)<br>/)){
  467. alonglist[i]="<div class='MageAttackHit'>"+alonglist[i]+"</div>";//colour hits red
  468. }
  469. //You attack and miss
  470. else if(alonglist[i].match(/(- (\(\d+ times\) )?You attack .* with your .* and miss..*)<br>/)){
  471. alonglist[i]="<div class='MageAttackMiss'>"+alonglist[i]+"</div>";//colour misses deeppink
  472. }
  473. //You defend
  474. else if(alonglist[i].match(/-( (\(\d+ times\) )?.* attacked you with .*)<br>/)){
  475. alonglist[i]="<div class='MageAttacked'>!"+alonglist[i].substr(1)+"</div>";
  476. }
  477. //Environmental damage
  478. else if(alonglist[i].match(/-( (\(\d+ times\) )?.* (Your action causes you to|You|you) take \d+ point(s)? of( \b[a-z]+\b)? damage(.|!)?.*)<br>/)){
  479. alonglist[i]="<div class='MageAttackedbyEnvironment'>!"+alonglist[i].substr(1)+"</div>";
  480. }
  481. //PET REJUVENATION
  482. //- Your pet, Judgemaster, has been rejuvenated. You spent 15 Magic Points. (2013-06-25 02:17:16).
  483. //FFS two spaces before 'You spent...'
  484. else if(alonglist[i].match(/(- (\(\d+ times\) )?Your pet, .* has been rejuvenated. You spent \d+ Magic Point.*)<br>/)){
  485. alonglist[i]="<div class='MagePetRejuv'>"+alonglist[i]+"</div>";
  486. }
  487. //Player is healed by pet
  488. //- Aethersprite, belonging to kiwimage, healed you. You gain 10 hit points. The poison affecting you has been cured. (2013-06-18 14:12:52).
  489. else if(alonglist[i].match(/(- (\(\d+ times\) )?.* belonging to .*, healed you. You gain \d+ hit point(s)?.*)<br>/)){
  490. alonglist[i]="<div class='MagePetHealMe'>"+alonglist[i]+"</div>";
  491. }
  492. //Player healed by will-o-wisp(possibly also wight)
  493. //- Will-O-Wisp, belonging to Mr Scavvy, has funneled life energy to you, healing you of 1 points of damage. (2013-06-25 02:38:02).
  494. else if(alonglist[i].match(/(- (\(\d+ times\) )?.* belonging to .*, has funneled life energy to you, healing you of \d+ points of damage.*)<br>/)){
  495. alonglist[i]="<div class='MagePetHealMe'>"+alonglist[i]+"</div>";
  496. }
  497. //PET HEAL OTHERS
  498. //- Aethersprite, belonging to kiwimage, healed German Shepherd for 10 hit points. (2013-06-18 07:44:32).
  499. else if(alonglist[i].match(/(- (\(\d+ times\) )?.*, belonging to .*, healed .* for \d+ hit point.*)<br>/)){
  500. alonglist[i]="<div class='MagePetHealOthers'>"+alonglist[i]+"</div>";
  501. }
  502. //PETS ATTACK
  503. else if(alonglist[i].match(/(- (\(\d+ times\) )?Your pet .* and hit for .*)<br>/)){
  504. alonglist[i]="<div class='MagePetHit'>"+alonglist[i]+"</div>";
  505. }
  506. //being hit by others pets made slightly more important.(though if you seeing this you are probably dead.)
  507. else if(alonglist[i].match(/(- (\(\d+ times\) )?.*, belonging to .* and hit for .*)<br>/)){
  508. alonglist[i]="<div class='MagePetHitMe'>!"+alonglist[i].substr(1)+"</div>";
  509. }
  510. else if(alonglist[i].match(/(- (\(\d+ times\) )?(Your pet |[^,].*, belonging to).*, killing them!.*)<br>/)){
  511. alonglist[i]="<div class='MagePetKill'>"+alonglist[i]+"</div>";
  512. }
  513. else if(alonglist[i].match(/(- (\(\d+ times\) )?(Your pet |[^,].*, belonging to).* and missed.*)<br>/)){
  514. alonglist[i]="<div class='MagePetMiss'>"+alonglist[i]+"</div>";
  515. }
  516. //others pets attacking
  517. else if(alonglist[i].match(/-( (\(\d+ times\) )?.* attacked your pet,.*and hit for .*)<br>/)){
  518. alonglist[i]="<div class='MagePetHit'}>!"+alonglist[i].substr(1)+"</div>";//colour pet getting hit bold red with exclamation mark
  519. }
  520. else if(alonglist[i].match(/(- (\(\d+ times\) )?.* attacked your pet,.* killing it!.*)<br>/)){
  521. alonglist[i]="<div class='MagePetKill'>"+alonglist[i]+"</div>";
  522. }
  523. else if(alonglist[i].match(/(- (\(\d+ times\) )?.* attacked .* killing it!.*)<br>/)){
  524. alonglist[i]="<div class='MagePetKill'>"+alonglist[i]+"</div>";//PET MESSAGES SEEM TO BE ODDLY BORKED IN COMPARISON TO OTHERS
  525. }
  526. else if(alonglist[i].match(/(- (\(\d+ times\) )?.* attacked your pet.* and missed.*)<br>/)){
  527. alonglist[i]="<div class='MagePetMiss'>"+alonglist[i]+"</div>";//NOTE NO COMMA FOR MISS MESSAGES!
  528. }
  529. //- Danny Noonan, a Ghoul, belonging to Mr Scavvy, was killed by a defensive aura projected by Mack Bolan! (2013-07-12 00:11:21).
  530. else if(alonglist[i].match(/(- (\(\d+ times\) )?.*, belonging to .*, was killed by a defensive aura projected by .*)<br>/)){
  531. alonglist[i]="<div class='MagePetKill'>"+alonglist[i]+"</div>";
  532. }
  533. //PET DESPAWN
  534. // - Your pet Lightspawn, a Ghoul, has despawned. (2013-06-21 19:00:07).
  535. //- Aethersprite, belonging to kiwimage, has despawned. (2013-06-18 07:49:21).
  536. //- Ghoul has despawned.
  537. //- Smoke Porterhouse, a Ghoul has despawned. (2013-06-26 06:09:22).
  538. //ffs so many different ways of saying it. depending on if it was killed or AP'ed out or MP'ed out....
  539. else if(alonglist[i].match(/(- (\(\d+ times\) )?(Your pet .*|.*, belonging to .*,|.*, a .*|\b\w+\b|Will-O-Wisp) has despawned.*)<br>/)){
  540. alonglist[i]="<div class='MagePetDespawn'>"+alonglist[i]+"</div>";
  541. }
  542. //ACHIEVEMENTS
  543. else if(alonglist[i].match(/((- (\(\d+ times\) )?)<font color="#DD0000">(<b>.*<\/b>)<\/font>(.*))<br>/)){
  544. alonglist[i]=alonglist[i].replace(/((- (\(\d+ times\) )?)<font color="#DD0000">(<b>.*<\/b>)<\/font>(.*))<br>/,'<div class="MageAchievement">$2<span class="MageAchievementColour">$4</span>$5</div>');//center annoucements
  545. }
  546. //SPEECH
  547. else if(alonglist[i].match(/(- (\(\d+ times\) )?)([^,].*)( said, )(\".*)<br>/)){
  548. //alonglist[i]="<div class='MageSpeech'>"+alonglist[i]+"</div>";
  549. alonglist[i]=alonglist[i].replace(/(- (\(\d+ times\) )?)([^,].*) (said, )(\".*)<br>/,"<div class='MageSpeech'>$1 $3<span class='MageMe'> $4</span>$5</div>");
  550. }
  551. else if(alonglist[i].match(/(- (\(\d+ times\) )?)([^,].*)( whispered to you, saying).(\".*)<br>/)){
  552. //alonglist[i]="<div class='MageSpeech'>"+alonglist[i]+"</div>";
  553. alonglist[i]=alonglist[i].replace(/(- (\(\d+ times\) )?)([^,].*) (whispered to you, saying).(\".*)<br>/,"<div class='MageSpeech'>$1 $3<span class='MageMe'> $4, </span>$5</div>");
  554. }
  555. //BULLHORN!
  556. else if(alonglist[i].match(/(- (\(\d+ times\) )?).*(Someone used a bullhorn to say: )(\'.*\')(.*)<br>/)){
  557. //alonglist[i]="<div class='MageSpeech'>"+alonglist[i]+"</div>";
  558. alonglist[i]=alonglist[i].replace(/(- (\(\d+ times\) )?).*(Someone used a bullhorn to say: )(\'.*\')(.*)<br>/,"<div class='MageSpeech'>$1<span class='MageMe'>$3</span>$4<span class='MageMe'>$5</span></div>");
  559. }
  560. else if(alonglist[i].match(/(- (\(\d+ times\) )?)(You say, )(\".*)<br>/)){
  561. alonglist[i]=alonglist[i].replace(/(- (\(\d+ times\) )?)(You say, )(\".*)<br>/,"<div class='MageSpeech'>$1<span class='MageMe'>$3</span>$4</div>");
  562. }
  563. else if(alonglist[i].match(/(- (\(\d+ times\) )?You whisper, \".*)<br>/)){
  564. //alonglist[i]="<div class='MageSpeech'>"+alonglist[i]+"</div>";
  565. //Due to wanting to make the you part black but still have the initial - blue doing it with a replace.
  566. alonglist[i]=alonglist[i].replace(/(- (\(\d+ times\) )?)(You whisper, )(\".*)<br>/,"<div class='MageSpeech'>$1<span class='MageMe'>$3</span>$4</div>");
  567. }
  568. else if(alonglist[i].match(/(- (\(\d+ times\) )?[^,].* (said|say), \".*)<br>/)){
  569. alonglist[i]="<div class='MageSpeech'>"+alonglist[i]+"</div>";
  570. }
  571. else if(alonglist[i].match(/(- (\(\d+ times\) )?[^,].* (whispered to you|whisper), saying \".*)<br>/)){
  572. alonglist[i]="<div class='MageSpeech'>"+alonglist[i]+"</div>";
  573. }
  574. //GIVENATION
  575. else if(alonglist[i].match(/-( (\(\d+ times\) )?[^,].* gave you a.*)<br>/)){
  576. alonglist[i]="<div class='MageReceivedSomething'>+"+alonglist[i].substr(1)+"</div>";
  577. }
  578. //CRAFTING
  579. else if(alonglist[i].match(/(- (\(\d+ times\) )?You call upon your crafting skills.*)<br>/)){
  580. alonglist[i]="<div class='MageCraft'>"+alonglist[i]+"</div>";
  581. }
  582. //SEARCHING
  583. else if(alonglist[i].match(/(- (\(\d+ times\) )?You search and find nothing.*)<br>/)){
  584. alonglist[i]="<div class='MageSearchNothing'>"+alonglist[i]+"</div>";
  585. }
  586. else if(alonglist[i].match(/(- (\(\d+ times\) )?You search and find a.*)<br>/)){
  587. alonglist[i]="<div class='MageSearchYay'>+"+alonglist[i].substr(1)+"</div>";
  588. }
  589. //HEALING You heal yourself and gain 10 hit points
  590. else if(alonglist[i].match(/(- (\(\d+ times\) )?.*(You heal yourself and|healed you. You) gain \d+ hit point(s)?.*)<br>/)){
  591. alonglist[i]="<div class='MageHealed'>"+alonglist[i]+"</div>";
  592. }
  593. //- You use the herb to heal Rachel Stone for 5 points of damage. You gain 5 experience points. They are now fully healed. (2013-07-01 12:35:31).
  594. //HEALING HERBS
  595. else if(alonglist[i].match(/(- (\(\d+ times\) )?.*You use the .* to heal .* for \d+ point(s)? of damage?.*)<br>/)){
  596. alonglist[i]="<div class='MageHealed'>"+alonglist[i]+"</div>";
  597. }
  598. //HEALING FAKS
  599. else if(alonglist[i].match(/(- (\(\d+ times\) )?.*You heal .* for \d+ point(s)? of damage?.*)<br>/)){
  600. alonglist[i]="<div class='MageHealed'>"+alonglist[i]+"</div>";
  601. }
  602. //EMOTES
  603. //fancy “ ”
  604. else if(alonglist[i].match(/(- (\(\d+ times\) )?)([^<>]*?)( \u201C.+\u201D)(.*)<br>/)){
  605. alonglist[i]=alonglist[i].replace(/(- (\(\d+ times\) )?)([^<>]*?)( \u201C.+\u201D)(.*)<br>/,"<div class='MageSpeech' >$1<span class='MageMe'>$3</span>$4<span class='MageMe'>$5</span></div>");
  606. }
  607. //then "
  608. else if(alonglist[i].match(/(- (\(\d+ times\) )?)(.*?)( \u0022.+\u0022)(.*)<br>/)){
  609. //alert(alonglist[i]);
  610. alonglist[i]=alonglist[i].replace(/(- (\(\d+ times\) )?)(.*?)( \u0022.+\u0022)(.*)<br>/,"<div class='MageSpeech' >$1<span class='MageMe'>$3</span>$4<span class='MageMe'>$5</span></div>");
  611. }
  612. //then '
  613. else if((alonglist[i].match(/(- (\(\d+ times\) )?)([^<>]*?)( \'.+\')([^<>]*)<br>/))&&!(alonglist[i].match(/(- (\(\d+ times\) )?)You read the book\..*<br>/))){
  614. alonglist[i]=alonglist[i].replace(/(- (\(\d+ times\) )?)([^<>]*?)( \'.+\')([^<>]*)<br>/,"<div class='MageSpeech' >$1<span class='MageMe'>$3</span>$4<span class='MageMe'>$5</span></div>");
  615. }
  616. //then fancy ‘ ’ unicode 2018 2019
  617. else if(alonglist[i].match(/(- (\(\d+ times\) )?)([^<>]*?)( \u2018.+\u2019)(.*)<br>/)){
  618. alonglist[i]=alonglist[i].replace(/(- (\(\d+ times\) )?)([^<>]*?)( \u2018.+\u2019)(.*)<br>/,"<div class='MageSpeech' >$1<span class='MageMe'>$3</span>$4<span class='MageMe'>$5</span></div>");
  619. }
  620. //try other catch fancy quotes
  621. else if(alonglist[i].match(/(- (\(\d+ times\) )?)(<.*>)(.*)( \u201C.+\u201D)(.*)<br>/)){
  622. alonglist[i]=alonglist[i].replace(/(- (\(\d+ times\) )?)(<.*>)(.*?)( \u201C.+\u201D)(.*)<br>/,"<div class='MageSpeech' >$1<span class='MageMe'>$3$4</span>$5<span class='MageMe'>$6</span></div>");
  623. }
  624. }
  625. messages.innerHTML=alonglist.join('');
  626. }
  627. //##############################################################################################################
  628. // TWEAK 9 Weapon boxes list raw dam/ap. Does not take into account soak.
  629. var weaponboxs= document.evaluate("//select[@name='attacking_with_item_id']", document, null,
  630. XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  631. if (weaponboxs.snapshotLength>0){//if we have a weapon box
  632. var test, weaponboxoptions,keeper;
  633. var best=0;
  634. for (var j=0,item;item=weaponboxs.snapshotItem(j) ;j++ ){//for each weapons box
  635. weaponboxoptions=item.getElementsByTagName('option');
  636. for (i=0;i<weaponboxoptions.length;i++ ){ //for each option of the box
  637. test=weaponboxoptions[i].text.match(/(\d+) dmg[^0-9]*(-?\d+)% to hit$/) // extract the last 2 numbers
  638. if (test){
  639. //alert(""+test[1]+":"+test[2]);
  640. weaponboxoptions[i].text+= " (dam/ap:"+test[1]*Math.min(Math.max(test[2],1),99)/100+")";
  641. if (best<(test[1]*test[2])){
  642. best=test[1]*test[2];
  643. keeper=i;
  644. }
  645. }
  646. //alert(weaponboxoptions[i].innerHTML.);
  647. if(weaponboxoptions[i].text.match(/Double-Barrelled /)){
  648. weaponboxoptions[i].text=weaponboxoptions[i].text.replace(/Double-Barrelled /,"");
  649. }
  650. }
  651. //item.selectedIndex=keeper;
  652. }
  653. }
  654.  
  655. //##############################################################################################################
  656. // TWEAK 10 Hatchet is default item to pick up (throwing knifes,rocks alternative default)
  657. var pickupforms= document.evaluate("//form[@name='pickup']", document, null,
  658. XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);//find the form with name=pickup
  659. if (pickupforms.snapshotLength==1){//We have one and only one candidate
  660. var test, pickupform,pickupbox;
  661. var best=0;
  662. var keeper=0;
  663. var hatchetkeeper=-1;
  664. var throwingknifekeeper=-1;
  665. var rockkeeper=-1;
  666. pickupform=pickupforms.snapshotItem(0);
  667. pickupbox=pickupform.lastElementChild;//select box is the second child of what should be two
  668. pickupboxoptions=pickupbox.getElementsByTagName('option');
  669. //doing it this way hoping its faster because less text comparing.
  670. for (i=0;i<pickupboxoptions.length;i++ ){ //for each option of the box
  671. test = pickupboxoptions[i].innerHTML;
  672. if (test=='Hatchet'){//we have a keeper
  673. hatchetkeeper=i;//so make it the default thing to pick up
  674. break;//can't do better so stop looking
  675. }
  676. if ((throwingknifekeeper==-1)&&test=='Throwing Knife'){
  677. throwingknifekeeper=i;
  678. }
  679. if ((rockkeeper==-1)&&test=='Rock'){
  680. rockkeeper=i;
  681. }
  682. }
  683. if (hatchetkeeper>-1){
  684. keeper=hatchetkeeper;
  685. }
  686. else if(throwingknifekeeper>-1){
  687. keeper=throwingknifekeeper;
  688. }
  689. else if(rockkeeper>-1){
  690. keeper=rockkeeper;
  691. }
  692. pickupbox.selectedIndex=keeper;
  693. }
  694.  
  695. //##############################################################################################################
  696. //Tweak 11 Higlight move buttons when ap<10
  697. if(document.getElementById("CharacterInfo")){
  698. var charinfodiv=document.getElementById("CharacterInfo");
  699. var charlinks = document.evaluate(
  700. ".//a[starts-with(@href,'modules.php?name=Game&op=character&id=')]",
  701. charinfodiv,
  702. null,
  703. XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
  704. null );
  705. /*
  706. var charid=0;
  707. if (charlinks.snapshotLength==1){
  708. charid=charlinks.snapshotItem(0).href.match(/id=(\d+)/)[1];
  709. }
  710. var charmax = new Array();
  711. charmax[0]=GM_getValue("maxap"+charid,0);
  712. charmax[1]=GM_getValue("maxhp"+charid,0);
  713. charmax[2]=GM_getValue("maxmp"+charid,0);
  714. */
  715. var firstfont=charinfodiv.getElementsByTagName("font")[0];
  716. var secondfont=charinfodiv.getElementsByTagName("font")[1];
  717. var thirdfont=charinfodiv.getElementsByTagName("font")[2];
  718.  
  719. /*if (charmax[0]&&charmax[1]&&charmax[2]){//only if all are true(ie we got a proper value)
  720.  
  721. for(i=0;i<3;i++){
  722. var anewspan=document.createElement('div');
  723. anewspan.className="numberdiv";
  724.  
  725. var font=charinfodiv.getElementsByTagName("font")[i];//get font
  726. charstat=font.innerHTML.match(/\d+/); //get ap/hp/mp
  727. var reddiv=document.createElement('div');
  728. reddiv.style.width='20px';
  729. reddiv.className="bar";
  730. if(i==1){
  731. reddiv.title=charstat+"/"+charmax[i]+" Need "+ (Number(charmax[i])-Number(charstat))+"hp healed";}
  732. else{
  733. reddiv.title = charstat+"/"+charmax[i]+" Full in "+
  734. (Number(charmax[i])-Number(charstat))/4+" hours";
  735. }
  736. var greendiv=document.createElement('div');
  737. var greenwidth=parseInt(20*(Number(charstat)/Number(charmax[i])));
  738. greendiv.className="bar2";
  739. greendiv.style.width=""+greenwidth+"px";//to make out of 20 as int;
  740. greendiv.title=charstat+"/"+charmax[i];
  741.  
  742. var firstcell=font.parentNode;
  743. if(i==0){//first time is nested deeper
  744. firstcell=font.parentNode.parentNode;
  745. }
  746. firstcell.width='20px';
  747. anewspan.insertBefore(greendiv,anewspan.firstChild);//put img in span
  748. anewspan.insertBefore(reddiv,anewspan.firstChild);//put img in span
  749. anewspan.insertBefore(font,anewspan.firstChild);//move the text into the new span
  750. firstcell.insertBefore(anewspan,firstcell.firstChild);//put span in table cell
  751. }
  752. }*/
  753. if(Number(secondfont.innerHTML.match(/\d+/))<20){
  754. //secondfont.parentNode.parentNode.style.backgroundColor=LOWHPBACKGROUNDCOLOUR;//set the ap to orange color
  755. secondfont.parentNode.style.border="3px solid "+LOWHPBACKGROUNDCOLOUR;
  756. secondfont.parentNode.parentNode.parentNode.parentNode.style.border="2px solid "+LOWHPBACKGROUNDCOLOUR;
  757. //secondfont.style.color='black';//set the HP text to black so it's not red on red
  758. //secondfont.style.fontWeight=900;
  759. secondfont.parentNode.parentNode.title="LOW HEALTH";
  760. //also color alll the pane titles gold so make sure waring is noticed.
  761. var panetitles=document.getElementsByClassName("panetitle");
  762. for (var i=0,temp=0;temp=panetitles[i] ;i++ ){
  763. temp.style.color=LOWHPWARNINGCOLOUR;
  764. temp.title='LOW HEALTH';
  765. }
  766. }
  767. else if(Number(firstfont.innerHTML.match(/\d+/))<10){
  768. //firstfont.parentNode.parentNode.style.backgroundColor=LOWHPBACKGROUNDCOLOUR;//set the ap to orange color
  769. firstfont.parentNode.parentNode.style.border="1px solid "+LOWAPBACKGROUNDCOLOUR;
  770. firstfont.parentNode.parentNode.style.borderTop="3px solid "+LOWAPBACKGROUNDCOLOUR;
  771. firstfont.parentNode.parentNode.style.borderBottom="3px solid "+LOWAPBACKGROUNDCOLOUR;
  772. firstfont.parentNode.parentNode.title="LOW AP";
  773. //also color alll the pane titles gold so make sure waring is noticed.
  774. var panetitles=document.getElementsByClassName("panetitle");
  775. for (var i=0,temp=0;temp=panetitles[i] ;i++ ){
  776. temp.style.color=LOWAPWARNINGCOLOUR;
  777. temp.title='LOW AP';
  778. }
  779. //now also set the move buttons to dark orange.
  780. /*
  781. var movebuttons= document.evaluate("//input[@value='Move']", document, null,
  782. XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  783. var temp;
  784. for (i=0;temp=movebuttons.snapshotItem(i) ;i++ ){
  785. temp.style.color='red';
  786. temp.style.fontWeight='bold';
  787. }
  788. */
  789. }
  790. else if(Number(secondfont.innerHTML.match(/\d+/))<50){
  791. var hiddensmbutton= document.evaluate("//input[@value='Sorcerers Might']", document, null,
  792. XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null).snapshotItem(0);
  793. if(hiddensmbutton){
  794. hiddensmbutton.nextElementSibling.style.color="red";
  795. }
  796. }
  797. }
  798. //HIGHLIGHT SM
  799. var SMtext= document.evaluate("//td[@colspan='7']", document, null,
  800. XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);//find the form with name=pickup
  801. var tempelement;
  802. if (SMtext.snapshotLength>=1){//We have one or more candidates
  803. for (var i=0;i<SMtext.snapshotLength;i++){
  804. tempelement=SMtext.snapshotItem(i);
  805. //if(tempelement.innerHTML.match(/Sorcerers Might/)){
  806. // tempelement.style.color=SMWARNINGCOLOUR;
  807. //}
  808. if(tempelement.innerHTML.match(/Sorcerers Might/)){
  809. tempelement.innerHTML=tempelement.innerHTML.replace(/(Sorcerers Might \([0-9]+ min\))/,'<span style="color:'+SMWARNINGCOLOUR+'">$1</span>');
  810. }
  811. }
  812. }
  813. /*
  814. //Replace grey MO icons with ying-yang symbol. Ugly but easier to distinguish.
  815. var SMtext= document.evaluate("//img[@src='images/g/morality/Grey50.png']", document, null,
  816. XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);//find the form with name=pickup
  817. var tempelement;
  818. if (SMtext.snapshotLength>=1){//We have one or more candidates
  819. for (var i=0;i<SMtext.snapshotLength;i++){
  820. //tempelement=SMtext.snapshotItem(i);
  821. //if(tempelement.innerHTML.match(/Sorcerers Might/)){
  822. // tempelement.style.color=SMWARNINGCOLOUR;
  823. //}
  824. //if(tempelement.innerHTML.match(/Sorcerers Might/)){
  825. // tempelement.innerHTML=tempelement.innerHTML.replace(/(Sorcerers Might \([0-9]+ min\))/,'<span style="color:'+SMWARNINGCOLOUR+'">$1</span>');
  826. //}
  827. //SMtext.snapshotItem(i).src='data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%0F%00%00%00%0F%08%06%00%00%00%3B%D6%95J%00%00%00%01sRGB%00%AE%CE%1C%E9%00%00%00%06bKGD%00%FF%00%FF%00%FF%A0%BD%A7%93%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%07tIME%07%DE%05%0D%11%180gL%E1%E0%00%00%00%9CIDAT%28%CF%ADS%D1%0D%03%21%08%7D6%B7%17l%D1%DB%A37%86%838%06L%C6%7Da%91%AB%8D%CD%F5%25D%85%3C%F0%99gAB%AB0L%B0%1F%28%F1%BCe%D2%F35%E5%02%28vi%D2%2A%EC%17%F8%A0%07%EE%20N%15%11%03%60"%B24%7D%8B%8D%98%B9%AFfo%ED%AA%DA%F7D%B4%3E%D9s%1E%5Ek%15%86V%E7%D7%CC%C4%D8%A0%93%3F%E9%8CD%AF%C5%DC%A0%99%99%21"%17%FDQ%E7%A07%9A%24%13"T%15D4%3C%5C%B6%E4r%FC%C5%24%25%7B%7B%3F%BE%1Aj%F8%20%E5%CE%AF%3A%01g%F6%0D%9B%CBn%AF%5D%00%00%00%00IEND%AEB%60%82';
  828. SMtext.snapshotItem(i).src='data:image/gif,GIF89a%0F%00%0F%00%C2%03%00%00%00%00%A8%8C%00%C0%C0%C0%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%21%F9%04%01%0A%00%04%00%2C%00%00%00%00%0F%00%0F%00%00%03BHJ%D1%1Ek%B5A%EBh%D2j%0A%D9%D6P%40%09%80%F0%5D%E2%00%AC%95%E0r%29i%0E%E4j6s%BB%EEBS%EA%BF%9A%AF%E4%DAUV%C3%1D%8F%86d%28%9FM%27T%D9a%04%A6%98%88%F5Q%25%24%00%00%3B';
  829. }
  830. }*/
  831.  
  832.  
  833. //bugfix try fix lock picking
  834. //<input type="submit" value="Pick Lock (1 AP)">
  835. var LPButton= document.evaluate("//input[@value='Pick Lock (1 AP)']", document, null,
  836. XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);//this is the misplace lockppick button
  837. if (LPButton.snapshotLength>=1){
  838. //<form method="POST" action="modules.php?name=Game&amp;op=door" name="doorattack"> //stsrt of door attack form
  839. //<form method="POST" action="modules.php?name=Game&amp;op=door" name="picklock"></form>
  840. var LPForm= document.evaluate("//form[@name='picklock']", document, null,
  841. XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  842. if (LPForm.snapshotLength>=1){
  843. LPForm.snapshotItem(0).appendChild(LPButton.snapshotItem(0))
  844. }
  845. //<input type="hidden" value="pick" name="action">
  846. var LPhButton= document.evaluate("//input[@value='pick']", document, null,
  847. XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  848. if (LPhButton.snapshotLength>=1){
  849. LPForm.snapshotItem(0).appendChild(LPhButton.snapshotItem(0))
  850. }
  851. //we not done.
  852. //we must now take put form in td with open door or else it won't show for unknown reasons(might be css?
  853. //<form method="POST" action="modules.php?name=Game&amp;op=door" name="dooropen">
  854. var ODform= document.evaluate("//form[@name='dooropen']", document, null,
  855. XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  856. if (ODform.snapshotLength>=1){
  857. ODform.snapshotItem(0).parentNode.insertBefore(LPForm.snapshotItem(0),ODform.snapshotItem(0))
  858. }
  859. }
  860.  
  861.  
  862. //EOF
  863. })();