Skip to content
TORNLIFE More

[Userscript] Chat filter

Started by Lugburz [2386297] on in Tools & Userscripts.

11 replies · 599 views · thread synced · 4 days ago · View on torn.com
About this thread

Posts archived: 12 / 12 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
12
Discussion span
→
People posting
8
Likes on archived posts
35
Posts by staff, officers and moderators
1
Authority score
57 / 100
Historical score
39 / 100
Story score
48 / 100
Engagement score
63 / 100

Most-liked replies

Lugburz [2386297]
Inspired by this suggestion: https://www.torn.com/forums.php#/p=threads&f=4&t=16151603&b=0&a=0

The scripts filters chats by a given keyword(s). The filter is applied as you type. Keyword matching is case insensitive, i.e. 'xanax' will match 'Xanax'. Filters are stored per chat so next time you open a chat the filter will be there.

The initial request was for the Trade chat only. Since the activity in Trade chat is so high, the script would be useful if you are looking for something specific which may easily be missed without the filtering.

Currently, all chats are supported: Global, Trade, Faction, Company, Travel, Hospital, Jail, New Players.

Version 0.2.4 adds support for AND/OR rules in query: "sell Xanax" in double quotes means that a message must contain both words in this particular order to be shown. sell Xanax without quotes means that it's enough to contain either of the words.

Version 0.2.5 adds support for NOT filter: use ! in front of a word to filter it out: !buy will hide all messages that contain "buy".
Remember that you can use multiple rules in the filter string and combine them as you wish!

https://github.com/f2404/torn-userscripts/raw/master/chat_filter.user.js

[image: i.imgur.com]

Mentions: QoL to the cluster f--- situation in Trade Chat

SMH [1208589]
I was wondering! if it's possible to highlight the specific word, just to make the script a little better!
Lugburz [2386297]
Version 0.2.4 add support for AND/OR queries.
Words that are inside double quotes ("") are treated as an AND rule: e.g., if you enter "sell Xanax" in quotes, only chat messages that contain these words in this exact order, with a single space between them, will be shown.
On contrary, words entered with no double quotes will be treated as an OR rule: thus, sell Xanax without quotes will show all messages that contain word 'sell' or word 'Xanax', in any order.