I've made a new Userscript to go along with Tampermonkey/Greasemonkey. It has been approved by Hoofmaster, as it is not any form of automation and simply places a few convenient links and some data in your hand. Take a look below:
I've uploaded it to Google Code here so that you can also suggest improvements and/or point out bugs there as well as on the forum.
Usage:
Hovering over any player's name which shows a link (ie. is underlined) will display a tooltip. Initially the tooltip will show the player's name (which can be clicked on to bring you to the player's profile) and a few useful links:
[M] - Message the player in the standard JS popup.
[B] - Buff the player from a new window.
[AH] - View the player's auction house.
[ST] - Send the player a secure trade.
[T] - Send items to the player.
After a brief period, you will also see the following data:
Last Seen: Activity, in the form of #d(ays) #h(ours) #m(inutes) #s(econds)
Level: Current Level / Virtual Level
Joined: Join date
Attack: Attack, with bonuses in parenthesis
Defense: Defense, with bonuses in parenthesis
Armor: Armor, with bonuses in parenthesis
Damage: Damage, with bonuses in parenthesis
HP: HP, with bonuses in parenthesis
Gold: Gold on hand
Bank: Banked gold
Stamina: Current Stamina / Total Stamina, with bonuses in parenthesis
The tooltip will disappear when clicked or when you move your mouse away from the player name. In addition the tooltip will disappear when you click on any of the links inside.
Note: Data retrieved in a tooltip will be stored while on that webpage. This means that if you hover over another link pointing to the same player, the tooltip will display all of the info instantly, however the information will be the same as what was retrieved the first time. If you would like to fetch new data, simply refresh the page, or click on the link pointing to the player's page.
var setContent = function(event, api){ var player = api.get('content.attr').split(' '); var pID = 'player' + player[0] + player[1]; var msgID = 'msg' + player[0] + player[1]; var buffID = 'buff' + player[0] + player[1]; var ahID = 'ah' + player[0] + player[1]; var stID = 'st' + player[0] + player[1]; var sendID = 'send' + player[0] + player[1]; var seenID = 'seen' + player[0] + player[1]; var ajaxID = 'ajax' + player[0] + player[1]; var argumentPlayer = '
' + player[0] + '
'; var argumentMsg = '[M] '; var argumentBuff = '[B] '; var argumentAH = '[AH] '; var argumentST = '[ST] '; var argumentSend = '[T]'; var argumentSeen = '
if (data.search('This profile is no longer available.') > -1){ var ajaxContent = 'This player does not exist.'; $('.' + msgID).html(''); $('.' + buffID).html(''); $('.' + ahID).html(''); $('.' + stID).html(''); $('.' + sendID).html('');
if (!isMe){ var timeSeenArr = $(data).find(':contains("Last Activity")').last().html().split(/\D/); var timeSeen = new Array(); var tempIndex = 0; for (var i = 0, arrLen = timeSeenArr.length; i< arrLen; i++){ if (timeSeenArr[i] != ''){ timeSeen[tempIndex] = timeSeenArr[i]; tempIndex++; } } var seenContent = '
$(data).find('table:contains("Level")').children('tbody').children('tr').each(function(){ tempArray = $(this).text().split('\n'); for (var i = 0, size = tempArray.length; i < size; i++){ var letterStart = tempArray[i].search(/\w/); var colonPos; if (letterStart>-1){ colonPos = tempArray[i].search(':'); var key = tempArray[i].substring(letterStart,colonPos); var value; if (key === 'VL'){ value = tempArray[i].slice(colonPos+1); } else if (key === 'Level'){ value = tempArray[i].slice(colonPos+2); value.replace(',',''); } else{ value = tempArray[i].slice(colonPos+2); } stats[key] = value; } } });
Very cool! As there are so many not very nice people and perhaps I'm cautious, would love to see a screen shot of HCS/Hoof approving this script. Would that be possible?
Well or Hoof or Grim posting in this thread that they've approved it - that'll work too
Very cool! As there are so many not very nice people and perhaps I'm cautious, would love to see a screen shot of HCS/Hoof approving this script. Would that be possible?
Well or Hoof or Grim posting in this thread that they've approved it - that'll work too
I've sent Hoof a link to this thread, hopefully he'll see it soon and post in this thread saying it's alright .
Personally (just my opinion) I think this is a bit of a 'can of worms', where HCS starts allowing independent scripts here and there. If it was a feature which would add value to people, I would much rather it be added as an optional feature within FSH. That way it would remain the only third party script.
I have no problem with this being added to the fshelper, but yuuzhan seems to be busy and there is too much code in fshelper for me to try and figure it out. Alternatively, this could get added to the game code and severely reduce server calls
Personally (just my opinion) I think this is a bit of a 'can of worms', where HCS starts allowing independent scripts here and there. If it was a feature which would add value to people, I would much rather it be added as an optional feature within FSH. That way it would remain the only third party script.
That can of worms was already opened when they allowed FSH. Unless they're reviewing it every time it gets updated it, they don't know what's in it. I would much rather have useful features be added to the game itself, rather than 3rd party scripts.
If people find it useful we can look at updating the game to have similar functionality
Personally, I think it's a bit too much info for the tooltips. If you do add it, can it be a preference on whether or not to have basic/expanded tooltips for player mouseovers?
Also, Davros, this doesn't actually slow the game down significantly. Tooltips are lazy loaded which means the requests are made when you actually hover to fetch player data. The other links are made client side, and they are also generated when you hover. So, it shouldn't be much delay with a moderately fast computer.
I'd like to point out that I've pushed an update which will fix cross-site origin errors. What this means is that there won't be places where the tooltips just randomly break because you're on www.fallensword.com instead of fallensword.com or vice versa.
I think this is a good addition. I haven't used it much, but when i remember it's there, I can really optimize how I play. Especially with my crappy internet, I don't have to load a full page for someone's stats or other simple info.. It's nice. As for the "can of worms", meh, I'm sure for years people have been using signed (allowed) and unsigned additions to fallen sword for various reasons, good, and bad, but I do not think this harms anything. I think it was good they contacted HCS. I would hate to be questioned on a false-positive report.