· 6 years ago · Sep 30, 2019, 03:48 AM
1// ==UserScript==
2// @name Get DLC Info from SteamDB
3// @namespace sak32009-get-dlc-info-from-steamdb
4// @description Get DLC Info from SteamDB
5// @author Sak32009
6// @contributor https://cs.rin.ru/forum/
7// @version 3.8.0
8// @license MIT
9// @homepageURL https://github.com/Sak32009/GetDLCInfoFromSteamDB/
10// @supportURL http://cs.rin.ru/forum/viewtopic.php?f=10&t=71837
11// @updateURL https://github.com/Sak32009/GetDLCInfoFromSteamDB/raw/master/sak32009-get-dlc-info-from-steamdb.meta.js
12// @downloadURL https://github.com/Sak32009/GetDLCInfoFromSteamDB/raw/master/sak32009-get-dlc-info-from-steamdb.user.js
13// @icon https://github.com/Sak32009/GetDLCInfoFromSteamDB/raw/master/sak32009-get-dlc-info-from-steamdb-icon.png
14// @match *://steamdb.info/app/*
15// @run-at document-end
16
17// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.slim.min.js
18// @require https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.9.2/jquery.modal.min.js
19// @require https://cdnjs.cloudflare.com/ajax/libs/tabby/12.0.1/js/tabby.min.js
20// @require https://github.com/Sak32009/GetDLCInfoFromSteamDB/raw/master/sak32009-get-dlc-info-from-steamdb.compatibility.js
21
22// @resource tabby https://cdnjs.cloudflare.com/ajax/libs/tabby/12.0.1/css/tabby-ui.css
23// @resource jModal https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.9.2/jquery.modal.min.css
24// @resource mainStyle https://github.com/Sak32009/GetDLCInfoFromSteamDB/raw/master/sak32009-get-dlc-info-from-steamdb.css
25// @resource icon https://github.com/Sak32009/GetDLCInfoFromSteamDB/raw/master/sak32009-get-dlc-info-from-steamdb-icon.png
26
27// TamperMonkey & ViolentMonkey
28// @grant GM_xmlhttpRequest
29// @grant GM_getResourceURL
30// @grant GM_getResourceText
31// @grant GM_addStyle
32
33// GreaseMonkey
34// @grant GM.xmlHttpRequest
35// @grant GM.getResourceUrl
36
37// Violentmonkey
38// @inject-into content
39// ==/UserScript==
40
41// JQUERY MODAL SETTINGS
42$.modal.defaults.closeText = "X";
43
44// MAIN
45class Main {
46 // CONSTRUCTOR
47 constructor() {
48 // FORMATS
49 this.formats = {};
50 // STORAGE CLASS
51 this.storage = new Storage(GM_info.script.namespace);
52 // INFO
53 this.info = {
54 // STEAMDB URL
55 steamDB: "https://steamdb.info/app/",
56 // STEAMDB LINKED URL
57 steamDBLinked: "https://steamdb.info/search/?a=linked&q="
58 };
59 // STEAMDB
60 this.steamDB = {
61 // APPID
62 appID: "",
63 // APPID NAME
64 appIDName: "",
65 // APPID DLCS
66 appIDDLCs: {},
67 // APPID COUNT
68 appIDDLCsCount: 0
69 };
70 // OPTIONS
71 this.options = {
72 globalSaveLastSelection: {
73 title: "Save the last selected format",
74 type: "select",
75 options: {
76 "true": "Yes",
77 "false": "No"
78 },
79 default: "false"
80 },
81 globalIgnoreSteamDBUnknownApp: {
82 title: "Ignore DLCs 'SteamDB Unknown App'",
83 type: "select",
84 options: {
85 "true": "Yes",
86 "false": "No"
87 },
88 default: "false"
89 }
90 };
91 }
92 // GET DATA
93 async getData() {
94 // CHECK IF THE APPID HAS DLCs
95 if (!$("#dlc").length) {
96 return false;
97 }
98 // SELF
99 const self = this;
100 // SET APPID
101 this.steamDB.appID = $(".scope-app[data-appid]").data("appid");
102 // SET APPID NAME
103 this.steamDB.appIDName = $("td[itemprop='name']").text();
104 // GET APPID DLCS FROM TAB
105 $("tr.app[data-appid]").each((_index, _values) => {
106 const $this = $(_values);
107 const appID = $this.data("appid");
108 const appIDName = $this.find(`td:nth-of-type(2)`).text().trim();
109 // ADD DATA
110 self.steamDB.appIDDLCs[appID] = {
111 name: appIDName
112 };
113 // +1
114 self.steamDB.appIDDLCsCount += 1;
115 });
116 // GET APPID DLCS FROM REQUEST
117 await this.getHttpRequest(`${self.info.steamDBLinked + this.steamDB.appID}`, ({
118 responseText
119 }) => {
120 // APPS
121 const $apps = $($.parseHTML(responseText)).find("tr.app[data-appid]");
122 // FETCH APPS
123 $apps.each((_index, _values) => {
124 const $this = $(_values);
125 const appID = $this.attr("data-appid");
126 const appIDType = $this.find("td:nth-of-type(2)").text().trim();
127 const appIDName = $this.find("td:nth-of-type(3)").text().trim();
128 // CHECK IF EXISTS
129 if (!(appID in self.steamDB.appIDDLCs) && appIDType === "DLC") {
130 // ADD DATA
131 self.steamDB.appIDDLCs[appID] = {
132 name: appIDName
133 };
134 // +1
135 self.steamDB.appIDDLCsCount += 1;
136 }
137 });
138 // RUN
139 self.start();
140 });
141 }
142 // START
143 async start() {
144 // CREATE INTERFACE
145 await this.createInterface();
146 // LOAD OPTIONS
147 this.loadOptions();
148 // LOAD EVENTS
149 this.loadEvents();
150 }
151 // ADD CSS FROM URL
152 async addCssFromUrl(name) {
153 return await GM.addStyle(await GM.getResourceText(name));
154 }
155 // GET HTTP REQUEST
156 async getHttpRequest(httpURL, rtn) {
157 return await GM.xmlHttpRequest({
158 method: "GET",
159 url: httpURL,
160 headers: {
161 "Content-Type": "application/x-www-form-urlencoded"
162 },
163 onload: rtn
164 });
165 }
166 // DOWNLOAD ENCODE
167 dwlEncode(content) {
168 return window.URL.createObjectURL(new Blob([content.replace(/\n/g, "\r\n")], {
169 type: "application/octet-stream;charset=utf-8"
170 }));
171 }
172 // CREATE INTERFACE
173 async createInterface() {
174 // ADD JQUERY MODAL STYLE
175 this.addCssFromUrl("jModal");
176 // ADD TABBY STYLE
177 this.addCssFromUrl("tabby");
178 // ADD MAIN CSS STYLE
179 this.addCssFromUrl("mainStyle");
180 // ADD OPEN MODAL BUTTON
181 $(`<a href="#GetDLCInfofromSteamDB_modal" class="btn btn-primary" rel="modal:open">${GM_info.script.name} <b>v${GM_info.script.version}</b> <small>by ${GM_info.script.author} | 2016 - 2019</small></a>`).appendTo("body");
182 // ADD MODAL CONTAINER
183 $(`<div id="GetDLCInfofromSteamDB_modal" class="modal" style="display:none">
184 <div class="modal-header">
185 <img src="${await GM.getResourceUrl("icon")}" alt="${GM_info.script.name}" title="${GM_info.script.name}" crossorigin>
186 <h4>${GM_info.script.name} <b>v${GM_info.script.version}</b> <small>by ${GM_info.script.author} | 2016 - 2019</small></h4>
187 </div>
188 <hr>
189 <div class="modal-container">
190 <ul data-tabs>
191 <li><a href="#GetDLCInfofromSteamDB_donations" style="text-transform:uppercase;color:red;font-weight:bold">❤ Donations ❤</a></li>
192 <li><a data-tabby-default href="#GetDLCInfofromSteamDB_getDlcsList">Get DLCs List</a></li>
193 </ul>
194 <div>
195 <div id="GetDLCInfofromSteamDB_donations">
196<div style="text-align:center;font-size:16px"><b>Making a donation is an act of generosity. Your support, however modest it might be, is necessary.<br>Be it because you love or enjoy <i>Get DLC Info From SteamDB</i>. Your donations help to continue to support and improve this project!</b></div>
197<pre>
198Paypal: <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=U7TLCVMHN9HA2&source=url" target="_blank">Donate</a>
199BTC: 3H4ymRoamozbxgGxYA6g2ufbGK1FL2SuzG
200BCH: qpsa09t0fhd6s4zmjzch2ncllke3dx4sagnww3ryd9
201ETH: 0x4Bbe156f2C2958e74A7267081b9CBf8c50CFa4fd
202ETC: 0xbE55cA29751958cbbE0773613A20f6a4C2Bebbe6
203LTC: MVcCkF86nSHoz9Dt4vrzht567p56HsLgpQ
204ZRX: 0xBD4707ED3185c78630C162E57A21336973817b4D
205BAT: 0xd81b8436cCE7c2cD9DE4d26BC1d2cdeC6a25e42f
206USDC: 0xF54d52Bf3AC1f624b9Ea78643444AAC38AcBa8c1
207ZEC: t1J9A5E6aBnc8ro147WauiprCaoA33ANU3R
208DAI: 0x5A51ffd49Cdd34Cecf7ea4C50544386c19ad42b1
209LINK: 0xb223Ee2E72a8ba05B885acFcAa60aFF198f33e72
210XRP: rw2ciyaNshpHe7bCHo4bRWq6pqqynnWKQg | TAG: 1961927126
211REP: 0xadb199f82D462C2dECb7b56EBf0f4E093ef5c4E9
212XLM: GDQP2KPQGKIHYJGXNUIYOMHARUARCA7DJT5FO2FFOOKY3B2WSQHG4W37 | MEMO ID: 597823869
213EOS: coinbasebase | MEMO: 3037081371
214XTZ: tz1Su7o2bEybNKj6ofjV5pbizLK6vFSRBwhd
215</pre>
216 </div>
217 <div id="GetDLCInfofromSteamDB_getDlcsList">
218 <table class="table table-fixed">
219 <tbody>
220 <tr>
221 <td>
222 <select id="GetDLCInfofromSteamDB_selectInput"></select>
223 <button type="button" id="GetDLCInfofromSteamDB_submitInput" class="btn btn-primary"><i class="octicon octicon-clippy"></i> Get DLCs List</button>
224 </td>
225 <td style="text-align:right">
226 <a href="javascript:;" class="btn" id="GetDLCInfofromSteamDB_downloadFile"><i class="octicon octicon-file-symlink-file"></i> Download File</a>
227 <button type="button" class="btn btn-danger" id="GetDLCInfofromSteamDB_resetOptions"><i class="octicon octicon-trashcan"></i> Reset Options</button>
228 </td>
229 </tr>
230 </tbody>
231 </table>
232 <textarea id="GetDLCInfofromSteamDB_textareaOutput" rows="20" style="width:100%"></textarea>
233 </div>
234 </div>
235 </div>
236</div>`).appendTo("body");
237 // CREATE GLOBAL OPTIONS TAB
238 this.createTab("globalOptions", "Global Options", this.options);
239 // FILL SELECT FORMATS
240 this.fillSelectFormats();
241 }
242 // FILL SELECT FORMATS
243 fillSelectFormats() {
244 // SELF
245 const self = this;
246 // EACH
247 $.each(this.formats, (_index, _values) => {
248 const name = _values.name;
249 const options = _values.options
250 // ADD OPTION
251 const tag = $("<option>").attr("value", _index).text(name);
252 // ..... SAVE LAST SELECTION
253 if (self.storage.isChecked("globalSaveLastSelection") && self.storage.get("globalSaveLastSelectionValue") === _index) {
254 tag.prop("selected", true);
255 }
256 // .....
257 tag.appendTo("#GetDLCInfofromSteamDB_selectInput");
258 // CREATE TAB
259 self.createTab(_index, name, options);
260 });
261 }
262 // LOAD EVENTS
263 loadEvents() {
264 // SELF
265 const self = this;
266 // SUBMIT FORM
267 $(document).on("click", "#GetDLCInfofromSteamDB_submitInput", (e) => {
268 e.preventDefault();
269 // RESULT
270 let result = "";
271 // OPTION SELECTED
272 const optionSelected = $("#GetDLCInfofromSteamDB_selectInput option:selected").val();
273 // GET FORMAT DATA
274 const getFormatData = self.formats[optionSelected];
275 const getFormatName = getFormatData.name;
276 const getFormatHeaderView = getFormatData.header.view;
277 const GetFormatHeaderReplaceWith = getFormatData.header.replaceWith;
278 const getFormatCallback = getFormatData.callback(self);
279 // NO HEADER
280 if (getFormatHeaderView === false) {
281 result += `; ${GM_info.script.name} by ${GM_info.script.author} v${GM_info.script.version} | 2016 - 2019
282; Format: ${getFormatName}
283; AppID: ${self.steamDB.appID}
284; AppID Name: ${self.steamDB.appIDName}
285; AppID Total DLCs: ${self.steamDB.appIDDLCsCount}
286; SteamDB: ${self.info.steamDB}${self.steamDB.appID}
287; Homepage: ${GM_info.script.homepageURL}
288; Support: ${GM_info.script.supportURL}\n\n`;
289 if (GetFormatHeaderReplaceWith !== false) {
290 result = result.replace(/; /g, GetFormatHeaderReplaceWith);
291 }
292 }
293 // BBCODE TO TEXT
294 result += self.bbcode(getFormatCallback.text);
295 // WRITE RESULT
296 $("#GetDLCInfofromSteamDB_textareaOutput").text(result).scrollTop(0);
297 // SET DOWNLOAD FILE
298 $("#GetDLCInfofromSteamDB_downloadFile").attr({
299 href: self.dwlEncode(result),
300 download: getFormatCallback.name
301 });
302 // ..... SAVE LAST SELECTION
303 if (self.storage.isChecked("globalSaveLastSelection")) {
304 self.storage.set("globalSaveLastSelectionValue", optionSelected);
305 }
306 // .....
307 });
308 // SUBMIT OPTIONS
309 $(document).on("submit", "form#GetDLCInfofromSteamDB_submitOptions", (e) => {
310 e.preventDefault();
311 // STORAGE SET
312 $.each($(e.currentTarget).serializeArray(), (_index, {
313 name,
314 value
315 }) => {
316 self.storage.set(name, value);
317 });
318 // ALERT
319 window.alert("Options saved!");
320 });
321 // RESET OPTIONS
322 $(document).on("click", "#GetDLCInfofromSteamDB_resetOptions", (e) => {
323 e.preventDefault();
324 // CONFIRM
325 if (window.confirm("Do you really want to reset options?")) {
326 // CLEAR
327 self.storage.clear();
328 // LOAD OPTIONS
329 self.loadOptions();
330 // ALERT
331 window.alert("Restored default options!");
332 }
333 });
334 // TABBY EVENT TABS
335 const TabbyTabs = new Tabby("#GetDLCInfofromSteamDB_modal .modal-container ul[data-tabs]");
336 }
337 // LOAD OPTIONS
338 loadOptions() {
339 // SELF
340 const self = this;
341 // EACH
342 $("form#GetDLCInfofromSteamDB_submitOptions").find("input, select").each((_index, _values) => {
343 const $this = $(_values);
344 const name = $this.attr("name");
345 const type = $this.attr("type");
346 const tagName = $this.prop("tagName");
347 const item = self.storage.get(name);
348 if (tagName === "SELECT") {
349 const selected = self.storage.isValid(item) ? `value = '${item}'` : "selected";
350 $this.find(`option[${selected}]`).prop("selected", true);
351 } else if (type === "checkbox" && item === "true") {
352 $this.prop("checked", true);
353 } else {
354 $this.val(item);
355 }
356 });
357 }
358 // CREATE TAB
359 createTab(key, name, options) {
360 // CHECK IF OPTIONS IS EMPTY
361 if (Object.keys(options).length > 0) {
362 const id = `GetDLCInfofromSteamDB_${key}`;
363 // ADD LINK
364 $(`<li><a href="#${id}">${name}</a></li>`).appendTo("#GetDLCInfofromSteamDB_modal .modal-container ul");
365 // ADD CONTENT
366 $(`<div id="${id}">
367 <form id="GetDLCInfofromSteamDB_submitOptions" method="get">
368 <table class="table table-bordered table-fixed">
369 <tbody>${this.optionsToInput(options)}</tbody>
370 </table>
371 <button type="submit" class="btn btn-primary btn-block">Save Options</button>
372 </form>
373</div>`).appendTo("#GetDLCInfofromSteamDB_modal .modal-container > div");
374 }
375 }
376 // OPTIONS TO INPUT
377 optionsToInput(options) {
378 // RESULT
379 let result = "";
380 // EACH
381 $.each(options, (_index, _values) => {
382 // COMMON
383 const title = _values.title;
384 const type = _values.type;
385 // INPUT PLACEHOLDER
386 const placeholder = _values.placeholder || "";
387 // SELECT
388 const selectOptions = _values.options || {};
389 const selectDefault = _values.default || "";
390 // RESULT
391 result += `<tr><td>${title}</td><td>`;
392 switch (type) {
393 case "text": {
394 result += `<input type="text" class="input-block" name="${_index}" placeholder="${placeholder}">`;
395 break;
396 }
397 case "checkbox": {
398 result += `<input type="checkbox" name="${_index}">`;
399 break;
400 }
401 case "select": {
402 result += `<select class="input-block" name="${_index}">`;
403 $.each(selectOptions, (_index, _values) => {
404 result += `<option value="${_index}" ${selectDefault === _index ? "selected" : ""}>${_values}</option>`;
405 });
406 result += "</select>";
407 break;
408 }
409 }
410 result += "</td></tr>";
411 });
412 return result;
413 }
414 // DLC LIST
415 dlcList(str, indexFromZero, indexPrefix) {
416 // SELF
417 const self = this;
418 // RESULT
419 let result = "";
420 // INDEX START FROM ZERO
421 let index = indexFromZero ? 0 : -1;
422 // EACH
423 $.each(this.steamDB.appIDDLCs, (_index, _values) => {
424 const name = _values.name;
425 // ..... IGNORE DLCs 'SteamDB Unknown App'
426 if (!(self.storage.isChecked("globalIgnoreSteamDBUnknownApp") && name.includes("SteamDB Unknown App"))) {
427 index += 1;
428 result += self.dlcInfoReplace(str, {
429 "dlc_id": _index,
430 "dlc_name": name,
431 "dlc_index": self.dlcIDPrefix(index.toString(), parseInt(indexPrefix))
432 });
433 }
434 // .....
435 });
436 return result;
437 }
438 // DLC INFO REPLACE
439 dlcInfoReplace(str, values) {
440 $.each(values, (_index, _values) => {
441 str = str.replace(new RegExp(`{${_index}}`, "g"), _values);
442 });
443 return str;
444 }
445 // DLC ID PREFIX
446 dlcIDPrefix(index, prefix) {
447 return prefix > index.length ? "0".repeat(prefix - index.length) + index : index;
448 }
449 // BBCODE
450 bbcode(str) {
451 // DATA
452 let data = "";
453 // REGEX
454 const re = /\[(\w+)(?:=(.*))?]([^[]+)\[\/(\w+)]/g;
455 // EACH
456 while ((data = re.exec(str)) !== null) {
457 // GET DATA
458 const [bbcode, bbcodeOpen, bbcodeOpt, bbcodeVal, bbcodeClose] = data;
459 // CHECK
460 if (bbcodeOpen === bbcodeClose) {
461 const bbcodeOpts = typeof bbcodeOpt !== "undefined" ? bbcodeOpt.split(":") : [];
462 switch (bbcodeOpen) {
463 case "steamdb": {
464 str = str.replace(bbcode, this.steamDB[bbcodeVal]);
465 break;
466 }
467 case "option": {
468 str = str.replace(bbcode, this.storage.get(bbcodeVal));
469 break;
470 }
471 case "dlcs": {
472 str = str.replace(bbcode, this.dlcList(bbcodeVal, bbcodeOpts[0] === "true", bbcodeOpts[1] || 0));
473 break;
474 }
475 }
476 }
477 }
478 return str;
479 }
480};
481
482// CALL
483const main = new Main();
484// ADD FORMATS
485main.formats = {
486 // CREAMAPI 4.1.0.0
487 creamAPI_4_1_0_0: {
488 name: "CreamAPI v4.1.0.0",
489 header: {
490 view: false,
491 replaceWith: false
492 },
493 callback(main) {
494 return {
495 name: "cream_api.ini",
496 text: `[steam]
497; Application ID (http://store.steampowered.com/app/%appid%/)
498appid = [steamdb]appID[/steamdb]
499; Current game language.
500; Uncomment this option to turn it on.
501; Default is "english".
502;language = german
503; Enable/disable automatic DLC unlock. Default option is set to "false".
504; Keep in mind that this option is highly experimental and won't
505; work if the game wants to call each DLC by index.
506unlockall = false
507; Original Valve's steam_api.dll.
508; Default is "steam_api_o.dll".
509orgapi = steam_api_o.dll
510; Original Valve's steam_api64.dll.
511; Default is "steam_api64_o.dll".
512orgapi64 = steam_api64_o.dll
513; Enable/disable extra protection bypasser.
514; Default is "false".
515extraprotection = false
516; The game will think that you're offline (supported by some games).
517; Default is "false".
518forceoffline = false
519; Some games are checking for the low violence presence.
520; Default is "false".
521;lowviolence = true
522; Purchase timestamp for the DLC (http://www.onlineconversion.com/unix_time.htm).
523; Default is "0" (1970/01/01).
524;purchasetimestamp = 0
525
526[steam_misc]
527; Disables the internal SteamUser interface handler.
528; Does have an effect on the games that are using the license check for the DLC/application.
529; Default is "false".
530disableuserinterface = false
531
532[dlc]
533; DLC handling.
534; Format: <dlc_id> = <dlc_description>
535; e.g. : 247295 = Saints Row IV - GAT V Pack
536; If the DLC is not specified in this section
537; then it won't be unlocked
538[dlcs]{dlc_id} = {dlc_name}\n[/dlcs]`
539 };
540 },
541 options: {}
542 },
543 // CREAMAPI 3.4.1.0
544 creamAPI_3_4_1_0: {
545 name: "CreamAPI v3.4.1.0",
546 header: {
547 view: false,
548 replaceWith: false
549 },
550 callback(main) {
551 return {
552 name: "cream_api.ini",
553 text: `[steam]
554; Application ID (http://store.steampowered.com/app/%appid%/)
555appid = [steamdb]appID[/steamdb]
556; Current game language.
557; Uncomment this option to turn it on.
558; Default is "english".
559;language = german
560; Enable/disable automatic DLC unlock. Default option is set to "false".
561; Keep in mind that this option is highly experimental and won't
562; work if the game wants to call each DLC by index.
563unlockall = false
564; Original Valve's steam_api.dll.
565; Default is "steam_api_o.dll".
566orgapi = steam_api_o.dll
567; Original Valve's steam_api64.dll.
568; Default is "steam_api64_o.dll".
569orgapi64 = steam_api64_o.dll
570; Enable/disable extra protection bypasser.
571; Default is "false".
572extraprotection = false
573; The game will think that you're offline (supported by some games).
574; Default is "false".
575forceoffline = false
576; Some games are checking for the low violence presence.
577; Default is "false".
578;lowviolence = true
579; Installation path for the game.
580; Note, that you can use ..\\ to set the parent directory (from where executable file is located).
581; Maximum number of parent directories: 5 (..\\..\\..\\..\\..\\)
582; Default is the path to current working directory.
583;installdir = ..\\
584; Use DLC id as the appended installation directory.
585; e.g. <install_directory>\\480
586; Default is "true".
587;dlcasinstalldir = false
588; Purchase timestamp for the DLC (http://www.onlineconversion.com/unix_time.htm).
589; Default is "0" (1970/01/01).
590;purchasetimestamp = 0
591; Turn on the wrapper mode.
592; Default is "false".
593wrappermode = false
594
595[steam_misc]
596; Disables the internal SteamUser interface handler.
597; Does have an effect on the games that are using the license check for the DLC/application.
598; Default is "false".
599disableuserinterface = false
600; Disables the internal SteamUtils interface handler.
601; Does have an effect on the games that are checking for the actual AppId (only matters when "wrappermode" is set to "true").
602; Default is "false".
603disableutilsinterface = false
604; Disable the internal reserve hook of the "Steam_RegisterInterfaceFuncs" function.
605; Default is "false".
606disableregisterinterfacefuncs = false
607; Unlock/Lock Steam parental restrictions.
608; Default is "true".
609;unlockparentalrestrictions = false
610; SteamId64 to override. Note that this action could be risky !
611; This option can only work if "disableuserinterface = false".
612;steamid = 0
613; Bypass VAC signature check. Note that this action could be risky !
614; Default is "false".
615;signaturebypass = true
616
617[steam_wrapper]
618; Application ID to override (used when the wrapper mode is on)
619newappid = 0
620; Use the internal storage system.
621; Default is "false".
622wrapperremotestorage = false
623; Use the internal stats/achievements system.
624; Default is "false".
625wrapperuserstats = false
626; Use the internal workshop (UGC) system.
627; Default is "false".
628wrapperugc = false
629; Store the data in the current directory (incl. stats)
630; By default the data is stored at: %appdata%/CreamAPI/%appid%/
631; Default is "false".
632saveindirectory = false
633; Force the usage of a full save path instead of the relative one.
634; Default is "false".
635forcefullsavepath = false
636; Disable internal callbacks system.
637; Default is "false".
638;disablecallbacks = true
639; Disable/Enable a StoreStats callback. Takes effect only if "wrapperuserstats" is set to "true".
640; Default is "true".
641;storestatscallback = false
642; Fixed achievements count.
643; Some games can only work if this option is configured properly (e.g. Wolfenstein II).
644; Default is "0".
645achievementscount = 0
646
647[dlc]
648; DLC handling.
649; Format: <dlc_id> = <dlc_description>
650; e.g. : 247295 = Saints Row IV - GAT V Pack
651; If the DLC is not specified in this section
652; then it won't be unlocked
653[dlcs]{dlc_id} = {dlc_name}\n[/dlcs]
654[dlc_installdirs]
655; Installation path for the specific DLC (dependent from "installdir" option).
656; This section works only if "dlcasinstalldir" option is set to "false".
657; Format: <dlc_id> = <install_dir>
658; e.g. : 556760 = DLCRoot0
659
660[steam_ugc]
661; Subscribed workshop items.
662; This section works only if "wrappermode" and "wrapperugc" options are set to "true".
663; Format: <dlc_id> = <true/false>
664; e.g. : 812713531 = true
665; Please refer to __README_WORKSHOP_EN__.txt for more details.`
666 };
667 },
668 options: {}
669 },
670 // CREAMAPI v3.3.0.0
671 creamAPI_3_3_0_0: {
672 name: "CreamAPI v3.3.0.0",
673 header: {
674 view: false,
675 replaceWith: false
676 },
677 callback(main) {
678 return {
679 name: "cream_api.ini",
680 text: `[steam]
681; Application ID (http://store.steampowered.com/app/%appid%/)
682appid = [steamdb]appID[/steamdb]
683; Current game language.
684; Uncomment this option to turn it on.
685; Default is "english".
686;language = german
687; Enable/disable automatic DLC unlock. Default option is set to "false".
688; Keep in mind that this option is highly experimental and won't
689; work if the game wants to call each DLC by index.
690unlockall = false
691; Original Valve's steam_api.dll.
692; Default is "steam_api_o.dll".
693orgapi = steam_api_o.dll
694; Original Valve's steam_api64.dll.
695; Default is "steam_api64_o.dll".
696orgapi64 = steam_api64_o.dll
697; Enable/disable extra protection bypasser.
698; Default is "false".
699extraprotection = false
700; The game will think that you're offline (supported by some games).
701; Default is "false".
702forceoffline = false
703; Some games are checking for the low violence presence.
704; Default is "false".
705;lowviolence = true
706; Installation path for the game.
707; Note, that you can use ..\\ to set the parent directory (from where executable file is located).
708; Maximum number of parent directories: 5 (..\\..\\..\\..\\..\\)
709; Default is the path to current working directory.
710;installdir = ..\\
711; Use DLC id as the appended installation directory.
712; e.g. <install_directory>\\480
713; Default is "true".
714;dlcasinstalldir = false
715; Purchase timestamp for the DLC (http://www.onlineconversion.com/unix_time.htm).
716; Default is "0" (1970/01/01).
717;purchasetimestamp = 0
718; Turn on the wrapper mode.
719; Default is "false".
720wrappermode = false
721
722[steam_misc]
723; Disables the internal SteamUser interface handler.
724; Does have an effect on the games that are using the license check for the DLC/application.
725; Default is "false".
726disableuserinterface = false
727; Disables the internal SteamUtils interface handler.
728; Does have an effect on the games that are checking for the actual AppId (only matters when "wrappermode" is set to "true").
729; Default is "false".
730disableutilsinterface = false
731; Unlock/Lock Steam parental restrictions.
732; Default is "true".
733;unlockparentalrestrictions = false
734; SteamId64 to override. Note that this action could be risky !
735; This option can only work if "disableuserinterface = false".
736;steamid = 0
737; Bypass VAC signature check. Note that this action could be risky !
738; Default is "false".
739;signaturebypass = true
740
741[steam_wrapper]
742; Application ID to override (used when the wrapper mode is on)
743newappid = 0
744; Use the internal storage system.
745; Default is "false".
746wrapperremotestorage = false
747; Use the internal stats/achievements system.
748; Default is "false".
749wrapperuserstats = false
750; Use the internal workshop (UGC) system.
751; Default is "false".
752wrapperugc = false
753; Store the data in the current directory (incl. stats)
754; By default the data will is stored at: %appdata%/CreamAPI/%appid%/
755; Default is "false".
756saveindirectory = false
757; Disable internal callbacks system.
758; Default is "false".
759;disablecallbacks = true
760; Disable/Enable a StoreStats callback. Takes effect only if "wrapperuserstats" is set to "true".
761; Default is "true".
762;storestatscallback = false
763; Fixed achievements count.
764; Some games can only work if this option is configured properly (e.g. Wolfenstein II).
765; Default is "0".
766achievementscount = 0
767
768[dlc]
769; DLC handling.
770; Format: <dlc_id> = <dlc_description>
771; e.g. : 247295 = Saints Row IV - GAT V Pack
772; If the DLC is not specified in this section
773; then it won't be unlocked
774[dlcs]{dlc_id} = {dlc_name}\n[/dlcs]
775[dlc_installdirs]
776; Installation path for the specific DLC (dependent from "installdir" option).
777; This section works only if "dlcasinstalldir" option is set to "false".
778; Format: <dlc_id> = <install_dir>
779; e.g. : 556760 = DLCRoot0
780
781[steam_ugc]
782; Subscribed workshop items.
783; This section works only if "wrappermode" and "wrapperugc" options are set to "true".
784; Format: <dlc_id> = <true/false>
785; e.g. : 812713531 = true
786; Please refer to __README_WORKSHOP_EN__.txt for more details.`
787 };
788 },
789 options: {}
790 },
791 // CREAMAPI v3.0.0.3 Hotfix
792 creamAPI_3_0_0_3_hotfix: {
793 name: "CreamAPI v3.0.0.3 Hotfix",
794 header: {
795 view: false,
796 replaceWith: false
797 },
798 callback(main) {
799 return {
800 name: "cream_api.ini",
801 text: `[steam]
802; Application ID (http://store.steampowered.com/app/%appid%/)
803appid = [steamdb]appID[/steamdb]
804; Force the usage of specific language.
805; Uncomment this option to turn it on.
806;language = german
807; Enable/disable automatic DLC unlock. Default option is set to "false".
808; Keep in mind that this option is highly experimental and won't
809; work if the game wants to call each DLC by index.
810unlockall = false
811; Original Valve's steam_api.dll.
812; Default is "steam_api_o.dll".
813orgapi = steam_api_o.dll
814; Original Valve's steam_api64.dll.
815; Default is "steam_api64_o.dll".
816orgapi64 = steam_api64_o.dll
817; Enable/disable extra protection bypasser.
818; Default is "false".
819extraprotection = false
820; This option will force the usage of the default Steam user data folder.
821; Default is "true".
822;forceuserdatafolder = false
823; The game will think that you're offline (supported by some games).
824; Default is "false".
825forceoffline = false
826; Some games are checking for the low violence presence.
827; Default is "false".
828;lowviolence = true
829; Disables the internal SteamUser interface handler.
830; Does have an effect on the games that are using the license check for the DLC/application.
831; Default is "false".
832disableuserinterface = false
833; Disables the internal SteamUtils interface handler.
834; Does have an effect on the games that are checking for the actual AppId (only matters when "wrappermode" is set to "true").
835; Default is "false".
836disableutilsinterface = false
837; Turn on the wrapper mode.
838; Default is "false".
839wrappermode = false
840
841[steam_wrapper]
842; Application ID to override (used when the wrapper mode is on)
843newappid = 0
844; Use the internal storage system.
845; Default is "false".
846wrapperremotestorage = false
847; Use the internal stats/achievements system.
848; Default is "false".
849wrapperuserstats = false
850; Store the data in the current directory (incl. stats)
851; By default the data will is stored at: %appdata%/CreamAPI/%appid%/
852; Default is "false".
853saveindirectory = false
854; Disable/Enable a StoreStats callback. Takes effect only if "wrapperuserstats" is set to "true".
855; Default is "true"
856;storestatscallback = false
857
858[dlc]
859; DLC handling.
860; Format: <dlc_id> = <dlc_description>
861; e.g. : 247295 = Saints Row IV - GAT V Pack
862; If the DLC is not specified in this section
863; then it won't be unlocked
864[dlcs]{dlc_id} = {dlc_name}\n[/dlcs]`
865 };
866 },
867 options: {}
868 },
869 // CREAMAPI v2.0.0.7
870 creamAPI_2_0_0_7: {
871 name: "CreamAPI v2.0.0.7",
872 header: {
873 view: false,
874 replaceWith: false
875 },
876 callback(main) {
877 return {
878 name: "cream_api.ini",
879 text: `[steam]
880; Application ID (http://store.steampowered.com/app/%appid%/)
881appid = [steamdb]appID[/steamdb]
882; Force the usage of specific language.
883; Uncomment this option to turn it on.
884;language = german
885; Enable/disable automatic DLC unlock. Default option is set to "false".
886; Keep in mind that this option is highly experimental and won't
887; work if game wants to call each DLC by index.
888unlockall = false
889; Original Valve's steam_api.dll.
890; Default is "steam_api_o.dll".
891orgapi = steam_api_o.dll
892; Original Valve's steam_api64.dll.
893; Default is "steam_api64_o.dll".
894orgapi64 = steam_api64_o.dll
895; Enable/disable extra protection bypasser.
896; Default is "false".
897extraprotection = false
898; ExtraProtection level.
899; Default is "0".
900; Available options :
901; 0 = minimum, 1 = medium, 2 = maximum
902extraprotectionlevel = 0
903; Turn on the "light" wrapper mode.
904; Default is "false".
905wrappermode = false
906; Enable/disable logging of the DLC functions.
907; Default is "false".
908; If you use log_build, uncomment this option to turn it on.
909;log = false
910
911[steam_wrapper]
912; Application ID to override (used when the wrapper mode is on)
913newappid = 0
914; Load steam emulator library.
915; Default is "false".
916loademu = false
917; Emulator library that is used for the stats
918; and storage handling.
919; Default is "emu.dll".
920emudll = emu.dll
921; Use the emulator storage system.
922; Default is "false".
923wrapperremotestorage = false
924; Use the emulator stats/achievements system.
925; Default is "false".
926wrapperuserstats = false
927; Use the emulator utils system.
928; Default is "false".
929wrapperutils = false
930; User the emulator callbacks system.
931; Default is "false".
932wrappercallbacks = false
933
934[dlc_subscription]
935; This will check if the specifed
936; DLC is owned by the user.
937; Format: <dlc_id> = <true/false>
938; e.g. : 12345 = true
939; 12346 = true
940; 12347 = true
941; If the DLC is not specified in this section
942; then it won't be subscribed.
943; Also if the value is set to "false" the DLC
944; won't be subscribed either.
945[dlcs]{dlc_id} = true\n[/dlcs]
946[dlc_index]
947; DLC handling.
948; Format: <dlc_index> = <dlc_id>
949; e.g. : 0 = 12345
950; 1 = 12346
951; 2 = 12347
952[dlcs]{dlc_index} = {dlc_id}\n[/dlcs]
953[dlc_names]
954; Names for the DLCs index put above.
955; Use this only if needed.
956; Format: <dlc_index> = <dlc_name>
957; e.g. : 0 = DLC Name 0
958; 1 = DLC Name 1
959; 2 = DLC Name 2
960[dlcs]{dlc_index} = {dlc_name}\n[/dlcs]
961[dlc_timestamp]
962; Specifies a unique unix timestamp for the purchased DLC (http://www.onlineconversion.com/unix_time.htm).
963; By default returns the current date timestamp (if nothing was specified).
964; Format: <dlc_id> = <timestamp>
965; e.g. : 12345 = 1420070400`
966 };
967 },
968 options: {}
969 },
970
971 // GREENLUMA BATCH MODE
972 greenluma_batch_mode: {
973 name: "GreenLuma Reborn v1.7.3 [BATCH MODE]",
974 header: {
975 view: false,
976 replaceWith: ":: "
977 },
978 callback({
979 steamDB
980 }) {
981 return {
982 name: `greenluma_batch_mode_${steamDB.appIDName}.bat`,
983 text: `@ECHO OFF
984TITLE ${steamDB.appIDName} - ${GM_info.script.name} by ${GM_info.script.author} v${GM_info.script.version} | 2016 - 2019
985CLS
986
987:: WINDOWS WORKING DIR BUG WORKAROUND
988CD /D %~dp0
989
990:: CHECK APPLIST DIR
991IF EXIST .\\AppList\\NUL (
992 RMDIR /S /Q .\\AppList\\
993)
994
995:: CREATE APPLIST DIR
996MKDIR .\\AppList\\
997:: CREATE DLCS FILES
998:: ${steamDB.appIDName}
999ECHO ${steamDB.appID}> .\\AppList\\0.txt
1000[dlcs=true]::{dlc_name}\nECHO {dlc_id}> .\\AppList\\{dlc_index}.txt\n[/dlcs]
1001:: OPTION START GREENLUMA REBORN
1002IF EXIST .\\DLLInjector.exe GOTO :Q
1003GOTO :EXIT
1004
1005:Q
1006SET /P c=Do you want to start GreenLuma Reborn [Y/N]?
1007IF /I "%c%" EQU "Y" GOTO :START
1008IF /I "%c%" EQU "N" GOTO :EXIT
1009GOTO :Q
1010
1011:START
1012CLS
1013ECHO Launching Greenluma Reborn | APPID ${steamDB.appID} | APPNAME ${steamDB.appIDName}
1014TASKKILL /F /IM steam.exe
1015TIMEOUT /T 2
1016DLLInjector.exe -DisablePreferSystem32Images
1017
1018:EXIT
1019EXIT`
1020 };
1021 },
1022 options: {}
1023 },
1024 // LUMAEMU v1.9.7 (ONLY DLCs LIST)
1025 lumaemu_1_9_7_only_dlcs: {
1026 name: "LUMAEMU v1.9.7 (ONLY DLCs LIST)",
1027 header: {
1028 view: false,
1029 replaceWith: false
1030 },
1031 callback(main) {
1032 return {
1033 name: "LumaEmu_only_dlcs.ini",
1034 text: "[dlcs]; {dlc_name}\nDLC_{dlc_id} = 1\n[/dlcs]"
1035 };
1036 },
1037 options: {}
1038 },
1039 // CODEX (DLC00000, DLCName)
1040 codex_t: {
1041 name: "CODEX (DLC00000 = DLCName)",
1042 header: {
1043 view: false,
1044 replaceWith: false
1045 },
1046 callback(main) {
1047 return {
1048 name: "steam_emu.ini",
1049 text: "[dlcs=false:5]DLC{dlc_index} = {dlc_id}\nDLCName{dlc_index} = {dlc_name}\n[/dlcs]"
1050 };
1051 },
1052 options: {}
1053 },
1054 // 3DMGAME
1055 "3dmgame": {
1056 name: "3DMGAME",
1057 header: {
1058 view: false,
1059 replaceWith: false
1060 },
1061 callback(main) {
1062 return {
1063 name: "3DMGAME.ini",
1064 text: "[dlcs=true:3]; {dlc_name}\nDLC{dlc_index} = {dlc_id}\n[/dlcs]"
1065 };
1066 },
1067 options: {}
1068 },
1069 // SKIDROW
1070 skidrow: {
1071 name: "SKIDROW",
1072 header: {
1073 view: false,
1074 replaceWith: false
1075 },
1076 callback(main) {
1077 return {
1078 name: "steam_api.ini",
1079 text: "[dlcs]; {dlc_name}\n{dlc_id}\n[/dlcs]"
1080 };
1081 },
1082 options: {}
1083 },
1084 // NORMALLY (ID = NAME)
1085 normally_id_name: {
1086 name: "ID = NAME",
1087 header: {
1088 view: false,
1089 replaceWith: false
1090 },
1091 callback(main) {
1092 return {
1093 name: "dlcs_id_name.ini",
1094 text: "[dlcs]{dlc_id} = {dlc_name}\n[/dlcs]"
1095 };
1096 },
1097 options: {}
1098 }
1099};
1100// GET DATA
1101main.getData();