More Awesome Than You!

TS3/TSM: The Pudding => Pudding Factory => Topic started by: Agret on 2009 June 11, 12:21:22



Title: Sims 3 Exchange Greasemonkey Script
Post by: Agret on 2009 June 11, 12:21:22
Here is a greasemonkey script I have created to make it so you can directly download content from the Sims 3 Exchange without having to login.

Code:
// ==UserScript==
// @name          Sims 3 Exchange Link Fixer
// @namespace     mailto:aliaszero2097@gmail.com
// @include       http://www.thesims3.com/*
// @include       https://www.thesims3.com/*
// @description   Repace Sims 3 Exchange Links
// ==/UserScript==

(function() {
  // Override the downloadAsset and loginAndDownload functions
  // which normally pop up a login box
  unsafeWindow.downloadAsset = function(assetId) {
      document.location='sims3://download/?assetId=' + assetId;
  }
  unsafeWindow.loginAndDownload = function(theAction,theAssetId) {
      document.location='sims3://download/?assetId=' + theAssetId;
  }

  // Override the "save file" link so that it is a direct link
  // to the Sims3Pack file :)
  function downloadFeaturedAssetsForMembers(assetId,downloadurl)
  {
    document.getElementById('saveToFileLinkId').href = downloadurl;
  }
  function updateDownloadCountOpenNewWindow(assetID,downloadurl)
  {
    document.getElementById('saveToFileLinkId').href = downloadurl;
  }
  var newline = '';
  var bodyTag = parent.wrappedJSObject.document.getElementsByTagName('body')[0];
  var allLines = bodyTag.innerHTML.split('\n');
  for (var i = 0; i < allLines.length; i++) {
    if (allLines[i].indexOf('updateDownloadCountOpenNewWindow') > -1) {
eval(allLines[i]);
}
if (allLines[i].indexOf('downloadFeaturedAssetsForMembers') > -1) {
eval(allLines[i].substring(3));
}
  }
})();

To install this you must be using Firefox, and have the Greasemonkey extension (https://addons.mozilla.org/en-US/firefox/addon/748) installed.

Copy the contents of the code box into notepad and save it as "sims3.user.js"
(be sure to change from "text document" to "all files" in the save as box)

Drag the text file into your firefox window and it will bringup the install prompt,
after installing you can delete the text file from wherever you saved it as a copy
is made into your Firefox user profile automatically.

Enjoy using the Sims 3 Exchange without having to manually run the launcher for each file :D


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: simluvr on 2009 June 12, 00:19:26
I would, but in previous Sims, I found the exchange stuff usually ended up corrupting my game. All I see there are recolors anyway, basically. Thanks anyway.

Does it work for MTS?


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: Erry on 2009 June 12, 06:26:50
I just tested it and it isn't working... I tried it on a separate sim page and on an exchange page.


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: matzok on 2009 June 12, 07:34:24
That don't work. Just opens the login page.


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: Agret on 2009 June 13, 11:27:05
Sorry I posted that in a hurry before school, if you check the script I accidentally put an extra } in, i'll update my post. Try the new one.


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: Zazu on 2009 June 13, 12:54:01
You don't need that script to download from the exchange without logging in or using the launcher.  It's actually very simple.  If you click on the picture of the item you want to download, another page loads that has a direct link to the Sims3Pack file and you right lick on it and can just save it to your desktop. 


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: Agret on 2009 June 13, 13:17:42
Just checked the exchange, they have changed the way the links work now and I have updated the script to work with the new system :)

I have also tested it on the site this time to make sure I didn't miss any brackets :P

Update:
Thanks to Zazu for pointing out about the direct link,
Wasn't too hard to find in the HTML source and I have updated the script to replace the "Save File" link so that it goes to the Sims3Pack now :)
(Whee, script has scroll bars, starting to get long ;))

In response to simluvr saying that all they see are recolors, that's true but you can also get some pretty cool Lots off of there :P


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: simangelgoth on 2009 June 19, 01:22:55
I am sure I am being a Dim Wit but I have tried every which way to Drag this into my Firefox window..
I am doing something wrong. It does not install or do anything.
Would love to install it.


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: feralamour on 2009 June 20, 06:35:48
I am sure I am being a Dim Wit but I have tried every which way to Drag this into my Firefox window..
I am doing something wrong. It does not install or do anything.
Would love to install it.
I am sure I am being a Dim Wit but I have tried every which way to Drag this into my Firefox window..
I am doing something wrong. It does not install or do anything.
Would love to install it.

You need the Greasemonkey firefox add-on in order to install this. Install that then drag the file you made into the window after restarting firefox.


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: Agret on 2009 June 20, 16:57:54
Edited my post to make it a bit more obvious  ;D


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: essiecab on 2009 June 21, 02:45:49
Okay, I think I'm dimwit also because I can't figure out how to work it. When I go to the Exchange and click to download something, it tells me to "Choose an application." I tried choosing Firefox, but it just opens up a blank page and as far as I can tell nothing happens.


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: Agret on 2009 June 21, 03:02:00
If you are clicking on:
(http://imageiso.com/out.php/i20855_addtogame.PNG)
Then you must open with Sims3Launcher from your Sims 3 folder.

If you are clicking on:
(http://imageiso.com/out.php/i20856_savefile.PNG)

Then you are downloading the Sims3Pack file directly and can open it with the Sims3Launcher,
or with another Sims 3 content manager that supports opening Sims3Pack files.

You can save all the packs you want into a folder and then batch add them with 3Viewer or similar package manager.


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: Flash on 2009 July 04, 04:14:06
Hi there, I have installed the script, however I think they changed it again and it will not work.
It will open Sims 3 Launcher but the item in the list is just empty, No name, no Type, Size 1kb. The install option is grayed out. Is it possible to have an update please?


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: Agret on 2009 July 04, 05:53:19
Just tested it on this page (http://www.thesims3.com/search/lotSearch.html?sortBy=recommendations&dateRange=today&pageSubmit=true&lotSearchCommand.zoneType=0000&lotSearchCommand.houseHoldSize=9999&lotSearchCommand.lotSize=0000&lotSearchCommand.description=) and this page (http://www.thesims3.com/assetDetail.html?assetId=169037), the "Add to Game" link worked fine on both. The "Save File" link is also working.

If you are unable to use the "Add to Game" button try using save file and installing it with a batch content adder or by individually opening each Sim3Pack file


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: Flash on 2009 July 04, 15:02:05
Hey.
Not sure why Add to Game is not working for me. Bassically it allows me to choose launch application, I launch it with Sims 3 Launcher, but in the launcher as I said, the item appears void (no name, no description, no picture, 1kb).
Now the save file works great. I save it in downloads and then with Sims 3 launcher I can install it (it has description, picture, good size, etc). So thank you very much, not sure why I didn't tried it before.
Also, what exactly do you mean by batch content adder?
In the end cheers. You made an awesome program!


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: newguy on 2009 July 04, 16:11:44
I registered to say, thank you for this amazing script!


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: unknownlUser on 2009 July 04, 16:12:39
I can confirm this works for me. I haven't been able to use the direct links or pasting the ID# in address bar method(s) as some had suggested, but this one works like a charm.

You have to restart Firefox twice:
- 1st for the add-on to be recognized and
- 2nd for the script [after loading the script, if you can see "Sims 3 Exchange Link Fixer" and the 2 links on the Included Pages, then a restart might not be needed.]

Steps I took:
- copy the code and save as directed
- download and install add-on; restart browser
- ensure that Greasemonkey add-on itself is enabled [Tools menu -> Greasemonkey] or next step won't work
- drag the .js file into a tab and click "Install script" when prompted, restart browser again
- go to Tools menu -> Add-ons -> Extension icon -> options button: ensure the script is listed in the "Manage user script window" and the 2 links on the Included Pages are listed
- click on the picture of the item on the EA TS3 Exchange site you wanted, until you can see the "Add to Game" and "Save File" links
- click or right-click either link to download the sim3pack file
- install as preferred via Launcher or the 3Viewer tool from jfade
- done

hth....  8)


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: Rizin on 2009 July 04, 16:47:04
Im really glad I found this post

worked perfectly!

It took me a minute to realize what you meant by "Drag the text file into your firefox window"

but I eventually got it

thanks


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: Agret on 2009 July 06, 07:31:00
I registered to say, thank you for this amazing script!
No problem :)


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: Shazaam on 2010 October 13, 05:39:02
Any update?


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: J. M. Pescado on 2010 October 13, 06:30:38
The user who made this is dead, so no. Does it no longer work?


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: dragonic on 2010 October 16, 03:11:57
This script basically automates the following:

- Go to the desired exchange item page
- View source
- Search for .Sims3Pack
- Copy the *.Sims3Pack link and download it

I didn't need a script for that. I've been doing it for eons.


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: Menchii on 2010 October 17, 15:37:22
I tested this script and it half works for me.  The Add to Game button works and bypasses the login box but the Save File link brings up the login box.  Can anyone else confirm or deny?  I can go back to doing the View Source way but Lazy Cat is Lazy.  I tried multiple kinds of downloads too. Sims, lots, recolors, etc.


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: Agret on 2010 October 27, 09:36:51
Script updated, was an easy fix.
For some reason they kept the old code in but commented it out,
I never understood how most commercial web developers think.  ::)

I'll see if I can update it to hook the new method on the site in case they remove the comment later.


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: Freezerburn on 2010 November 09, 09:34:12
This script basically automates the following:

- Go to the desired exchange item page
- View source
- Search for .Sims3Pack
- Copy the *.Sims3Pack link and download it

I didn't need a script for that. I've been doing it for eons.

Woot! I never think of this!


Title: Re: Sims 3 Exchange Greasemonkey Script
Post by: coolkips on 2013 February 16, 03:41:22
The way to download it NOW became easier:

AssetID on Exchange:
http://www.thesims3.com/assetDetail.html?assetId=xxxxxxx

Download Link:
http://llnw.thesims3.com/xxxxxxx.Sims3Pack