Sims 3 Exchange Greasemonkey Script

(1/6) > >>

Agret:
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 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

simluvr:
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?

Erry:
I just tested it and it isn't working... I tried it on a separate sim page and on an exchange page.

matzok:
That don't work. Just opens the login page.

Agret:
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.

Navigation

[0] Message Index

[#] Next page