Jump to content

Drag items into steam chat


Dabombber

Recommended Posts

I'm not sure if this is possible, but being able to drag items from backpack.tf into chat in the same way you can drag them from steamcommunity.com would be quite nice.

Link to comment
Share on other sites

I'm not sure if this is possible, but being able to drag items from backpack.tf into chat in the same way you can drag them from steamcommunity.com would be quite nice.

i fail to see the benefit...

 

Theres nothing more annoying then when people try and buy/sell you something by sending you the link to the item in their inventory rather than just saying what it is.

Link to comment
Share on other sites

i fail to see the benefit...

 

Theres nothing more annoying then when people try and buy/sell you something by sending you the link to the item in their inventory rather than just saying what it is.

 

this

Link to comment
Share on other sites

Theres nothing more annoying then when people try and buy/sell you something by sending you the link to the item in their inventory rather than just saying what it is.

 

I would pay $20 to have this be the most annoying thing in trading.

Link to comment
Share on other sites

  • 2 weeks later...

i fail to see the benefit...

 

Theres nothing more annoying then when people try and buy/sell you something by sending you the link to the item in their inventory rather than just saying what it is.

 

It just occurred to me that perhaps your chat window was too narrow for you to notice this feature. When you drag an item from the steam inventory into chat, it shows a nice picture of it and you can hover over it for more details.7XboEKO.png

Link to comment
Share on other sites

It just occurred to me that perhaps your chat window was too narrow for you to notice this feature. When you drag an item from the steam inventory into chat, it shows a nice picture of it and you can hover over it for more details.7XboEKO.png

we all know about it, and the majority of people hate when others do it.

Link to comment
Share on other sites

we all know about it, and the majority of people hate when others do it.

 

I am ok with it. If you are trading with someone from Brazil, google translate will strugle with many items. I once had a pretty comical conversion with someone who wanted a S Persian Persuader.

Link to comment
Share on other sites

That's built in the steam client, we can't just drag random things there and create nifty-looking boxes, sorry.

Just hack steam.
Link to comment
Share on other sites

That's built in the steam client, we can't just drag random things there and create nifty-looking boxes, sorry.

If you change the href from "#" to the url of the item in the steam inventory, dragging it into the chat window will show the item. So instead of having

<a class="dropdown-toggle" data-name="Mann-Co.-Supply-Crate-Key" data-crate="0" data-effect="0" data-quality="6" data-defindex="5021" data-originalid="1872281541" data-priceindex="0" data-level="5" data-toggle="dropdown" data-showsell="1" onclick="showDropDown(this)" data-currentid="1879101518" href="#">

you would have

<a class="dropdown-toggle" data-name="Mann-Co.-Supply-Crate-Key" data-crate="0" data-effect="0" data-quality="6" data-defindex="5021" data-originalid="1872281541" data-priceindex="0" data-level="5" data-toggle="dropdown" data-showsell="1" onclick="showDropDown(this)" data-currentid="1879101518" href="http://steamcommunity.com/id/dabombber/inventory/#440_2_1879101518">
Link to comment
Share on other sites

yeah, i don't really want everyone who clicks an item in a backpack to be sent to steam community.

That would only happen if they had javascript disabled.

Link to comment
Share on other sites

Here it is in bookmarklet form. Make a new bookmark on your link toolbar, paste this into location, rename it "droppable bp.tf" OR WHATEVER, and click it when on a backpack page.

 

javascript:(function(){profile=$("a[href*=\"steamcommunity.com/profiles/\"]")[0].href;$("li.item a.dropdown-toggle").each(function(){this.href=profile+"/inventory/#440_2_"+$(this).data("currentid")})})();
Link to comment
Share on other sites

Thanks nakank :wub: . I'd still like this to be added by default though, especially since the auto refreshing will change it back.

Link to comment
Share on other sites

It's a little expensive to run on every page load, since it touches all items in every bp, but you can do it with a userscript (native to Chrome, need Greasemonkey extension on FF).

Save this as livenudez.user.js, open explorer and drag the file into chrome://extensions/ (chrome - you can't click that link, need to copy/paste it) or Greasemonkey's "Manage User Scripts" page (FF).

 

Chrome doesn't let you drag, because of some javascript BS I dunno.  Copy link address / paste into steamchat still works.

 

Auto-refreshing will still break it.  I didn't try to workaround this because I know from tf2b script development that it's an epic pain in the ass.  I did ask Brad to make auto-refresh optional, you can thank me by endorsing that feature in the thread.

// ==UserScript==
// @name droppable bp.tf
// @namespace localhost
// @description make bp.tf items droppable in steam chat
// @match http://backpack.tf/id/*
// @match http://backpack.tf/profiles/*
// @version 0.01
// @copyright public domain with no warranty
// ==/UserScript==

function makeDroppable() {
    profile = $("a[href*=\"steamcommunity.com/profiles/\"]")[0].href;
    $("li.item a.dropdown-toggle").each(function () {
        this.href = profile + "/inventory/#440_2_" + $(this).data("currentid")
    })
}

var script=document.createElement('script');
script.innerHTML=makeDroppable.toString() + ';makeDroppable()'
script.type='text/javascript';
document.body.appendChild(script);
Link to comment
Share on other sites

  • 5 months later...

As bookmarklet:

javascript:(function(){profile=$("a[href*=\"steamcommunity.com/profiles/\"]")[0].href;$("ul.itemlist > li:has('div.itemiconcontainer')").html(function(){return '<a href=' + profile + "/inventory/#440_2_" + $(this).data("itemid") + '>' + this.innerHTML + '</a>'})})();

As greasemonkey / userscript:

// ==UserScript==
// @name droppable bp.tf
// @namespace localhost
// @description make bp.tf items droppable in steam chat
// @match http://backpack.tf/id/*
// @match http://backpack.tf/profiles/*
// @version 0.01
// @copyright public domain with no warranty
// ==/UserScript==

function makeDroppable() {
    profile = $("a[href*=\"steamcommunity.com/profiles/\"]")[0].href;
    $("ul.itemlist > li:has('div.itemiconcontainer')").html(function(){return '<a href=' + profile + "/inventory/#440_2_" + $(this).data("itemid") + '>' + this.innerHTML + '</a>'})
}

var script=document.createElement('script');
script.innerHTML=makeDroppable.toString() + ';makeDroppable()'
script.type='text/javascript';
document.body.appendChild(script);


Link to comment
Share on other sites

  • 2 weeks later...

The javascript works when put into the console (ctrl+shift+k) but it doesn't seem to work as a bookmarklet, possibly because of the spaces.

Link to comment
Share on other sites

FF converted them to %20's for me, here's what it looks like there:

javascript:(function(){profile=$("a[href*=\"steamcommunity.com/profiles/\"]")[0].href;$("ul.itemlist%20>%20li:has('div.itemiconcontainer')").html(function(){return%20'<a%20href='%20+%20profile%20+%20"/inventory/#440_2_"%20+%20$(this).data("itemid")%20+%20'>'%20+%20this.innerHTML%20+%20'</a>'})})();
Link to comment
Share on other sites

Hmm, I disabled a few extensions which might have been causing problems, and it started working. Enabled them one by one to find out which was the problematic one, but it still works with all of them enabled again...

Link to comment
Share on other sites

  • 4 weeks later...
javascript:(function(){inv="<a\x20href="+$("a[href*=\"steamcommunity.com/profiles/\"]")[0].href+"/inventory/#440_2_";$("li.item").html(function(){return(inv+$(this).data("itemid")+'>'+this.innerHTML+'</a>')})})();

updated for current version of bp.tf.  This one has no spaces in it.

Link to comment
Share on other sites

  • 2 weeks later...

update the next

javascript:(function(){inv="<a\x20href="+$("a[href*=\"steamcommunity.com/profiles/\"]")[0].href+"/inventory/#440_2_";$("li.item").html(function(){return(inv+$(this).data("id")+'>'+this.innerHTML+'</a>')})})();
Link to comment
Share on other sites

  • 1 month later...

another update, steam profile isn't linked from bp page anymore(?!?!?)

javascript:(function(){inv="<a\x20href=http://steamcommunity.com"+$("a[href^='/profiles/']")[0].href.replace(/.*tf/,'')+"/inventory/#440_2_";$("li.item").html(function(){return(inv+$(this).data("id")+'>'+this.innerHTML+'</a>')})})();
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...