Skip to content

Commit

Permalink
- Fix issue with onclick attribute always returning 'null' in chrome.…
Browse files Browse the repository at this point in the history
….. probably need a more robust way of determining the userloc. Possibly based on the userloc variable and the index of each td in the nav grid...
  • Loading branch information
rbroker committed Aug 29, 2016
1 parent f78f3d1 commit 0168913
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions 1234_combat_script.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// @exclude http*://*.pardus.at/msgframe.php*
// @exclude http*://*.pardus.at/game.php*
// @exclude http*://*.pardus.at/menu.php*
// @version 18
// @version 19
// @downloadURL https://raw.githubusercontent.com/rbroker/pardus-keyboard-script/master/1234_combat_script.user.js
// @require https://raw.githubusercontent.com/rbroker/pardusmonkey-abstraction-layer/master/pal.js
// @author Richard Broker (Beigeman)
Expand Down Expand Up @@ -1407,8 +1407,6 @@ function UseBots()
var botBox = botInput.parentNode.childNodes[1];
var botAmount = calculateBotRequirement(currentArmor);
var currentBots = parseInt(botBox.parentNode.parentNode.childNodes[1].textContent, 10);

console.log(botBox.parentNode.parentNode.childNodes[1]);

if (currentBots < botAmount)
botAmount = currentBots;
Expand Down Expand Up @@ -1471,9 +1469,6 @@ function UseBotsNav()
var botsRequired = calculateBotRequirement(doc.getElementById('spanShipArmor').textContent);
var body = doc.body;
var div = doc.createElement('div');

console.log(botsRequired);
console.log(botsAvail);

if (botsAvail < botsRequired)
botsRequired = botsAvail;
Expand Down Expand Up @@ -1944,9 +1939,11 @@ function ShowOverlay()

if (PAL.PREnabled())
{
if (links[0].onclick !== null)
{
var linkUserloc = links[0].onclick.toString().match(/\d+/)[0];
var userlocMatch = links[0].outerHTML.match(/\d+/);

if (userlocMatch !== null)
{
var linkUserloc = userlocMatch[0];

for (var j = 0; j < overlayData.length; ++j)
{
Expand Down

0 comments on commit 0168913

Please sign in to comment.