Jump to content


Member Since 15 Aug 2014
Offline Last Active Feb 28 2017 11:13 PM

#1796098 [Guide] Setting up a script to highlight profitable items

Posted by Fourjacks on 21 August 2014 - 05:14 AM

Here is a screenshot showing how it looks with the script running. The highlighted items are not profit items, I just added them to the script to make the screenshot :-)


Thank you Bones, added the screenshot to the guide as well.



#1795877 [Guide] Setting up a script to highlight profitable items

Posted by Fourjacks on 20 August 2014 - 08:48 AM

Hello Everyone. I am a new member on these forums.

I am writing this guide to explain how you can set up a script to automatically highlight profitable items while restocking.


I am not the original author of the script, i have only made a few changes to the original script to make i useful for restocking. The original script is called MediaTriggerWords and it can be found at this website.


I am in no way experienced in programming, and found a way to make this work by trial and error. I am using Firefox with Greasemonkey to run the scripts, and I don't know if it can be used in other browsers.


What does the script do?
The script activates on refresh, searches for predefined words or "sentences" and marks those with a predefined color. Different colors can be used for different groups of predefined words or sentenced (= different colors for different profit margins).

You can make multiple scripts running in different shops.


Example of the fresh food shop, stocking 3 profitable items, each one marked in different color, which tells us which item is must profitable. (btw those items are not profit items, i just added them to my own script to make this screen shot)


Why do we want multiple scripts?
I used to only use one script which included items from 4 shops,
but as i restock 4 shops at a time, the item names from one shop could be part of the name of an item from another shop, marking the wrong items and generally making a mess. If you only want to restock in one shop only make one script.

Using multiple scripts takes a little more time to set up, but it is easier to maintain, as you can update one shop list at a time.

Setting up the script:
1. Open Firefox.
2. Install Greasemonkey. Download link.
3. Go to the shop where you wish to run your script.
3. Create a new userscript clicking the arrow next to the monkey.
3.1 Fill out the "name" and "namespace" field with what ever you like (it would make sense to use the name of the shop in which you want to restock...)
The field "include" will already have the URL of the shop. You will however need to add another URL, as shops seem to have two URLs each. Copy/paste the URL already there. You have to replace the part after the ? in the link you just added with whichever ending you don't have in the link already. (see the spoiler). You also have to change the number if you use a different shop.



Click "OK"
3.2 You will now see 7 or 8 lines of the script starting and ending with ==/UserScript==
Move down to line 10 and copy and paste the following:


This is our basic script.
Click "save" and close the script.

Now we have a script which will only run in the fresh foods shop (or whichever shop you chose).

Making the lists and reformatting the lists to use them in the script:

4. We now need to make a list (or 3 lists if you want to use different colors) with the items you want to buy from the shop.
I have been using this guide to make my lists. I have been making 3 lists for each shop I like to restock in.
One list for 100k+ profit item + items not yet valued, another for 10k-100k profit items and one for 2k-10k items. Paste the lists into a spreadsheet in column A, C and E.

The way an item have to be written in the script is:
"Item name",
For reformatting the above lists i have set up a Google Docs spreadsheet.
In the A, C and E columns i paste the lists i made above.
In the B column i use the following function: =CHAR(34)&A1&CHAR(34)&CHAR(44) (without the "")
TIP: paste the function to (1,B) and then click the bottom right corner of (1,B) (you should see a tiny blue box)
and then drag the function down as long as you need (you need to drag as far down as the list you just put in column A)
You repeat this for column D (using =CHAR(34)&C1&CHAR(34)&CHAR(44)) and column F (using =CHAR(34)&E1&CHAR(34)&CHAR(44))
If you did this correctly you will now have your lists formatted like this: "Item name", in column B, D and F.

This makes us ready for the last part of this exercise.

Finalizing the script:

5. Now we have to add the newly formatted lists to the script. (Column B, D and F)
Go to the shop you chose the script to run on.
Click the arrow next to the monkey.
In the bottom of the menu you should see the name of your script with a checkmark next to it.
Right-click the name of your script. The script should now open.
Find: "//    MSM "blue" words" in the script.
Between the lines"defwords([" and  "]," paste the list of items you want highlighted with blue by the script.
Now find:   "//    MSM "silver" words" which should be right below.
Between the lines"defwords([" and  "]," paste the list of items you want highlighted with silver by the script.
Finally find:   "//    MSM "gold" words" which should be right below.
Between the lines"defwords([" and  "]," paste the list of items you want highlighted with golden color by the script.    

Click save and close the script.

In the spoiler below you can see the script i currently use for the fresh food shop.


Enjoy the colorshow:
Now the script should be ready and running. All that's left for you to do now is click F5 and wait for a restock.

To make scripts for other shops simply repeat the steps above.

I know it seems like a lot of work, and you could just copy/paste the script in the spoiler above,
But prices tend to change a lot, which requires the lists to be updated regularly.

Feel free to ask any questions.