Killing Floor 2

Killing Floor 2

Not enough ratings
Javascript bookmarklet to grab workshop IDs from steam workshop collection to easily add maps to dedicated server
By klantfan
This guide contains a small javascript bookmarklet that you can add to your browser as a bookmark to quickly grab all workshop IDs of items listed on the current page and output a list including name of item that you can paste directly into PCServer-KFEngine.ini.

It will output lines like this:
ServerSubscribedWorkshopItems=1238893387 // KF-TRON-VR
And this:
[KF-TRON-VR KFMapSummary] MapName=KF-TRON-VR

This script can be easily modified to adjust the text it prints on each line.
   
Award
Favorite
Favorited
Unfavorite
Intro
How to:
  1. Grab the minified bookmarklet from the next section and add it as a bookmark in your browser.
  2. Go to any Steam Workshop page listing workshop items (for example: https://steamproxy.net/profiles/76561197991661951/myworkshopfiles/?p=1&numperpage=30)
  3. Click the bookmark you created earlier
  4. Answer Cancel to the question if your unsure
  5. Copy the first list into your PCServer-KFEngine.ini
  6. Copy the second list into your PCServer-KFGame.ini
Minified bookmarklet
javascript:var gameString="ServerSubscribedWorkshopItems=",URIS=[];jQuery("a").each(function(){var URI=jQuery(this).attr("href"),title=jQuery(this).find(".workshopItemTitle").text();-1!=URI.search(/filedetails\/\?id=[0-9]+/i)&&""!=title&&URIS.push({URI:gameString+URI.substr(URI.search(/\d{4}\d+/i)),TITLE:title})}),window.confirm("Output in developer console? (If not, list will replace current page!)")?(console.log("// Start of section going into PCServer-KFEngine.ini:\n\n"),URIS.forEach(function(item,index){console.log(item.URI+" // "+item.TITLE)}),console.log("// End of PCServer-KFEngine.ini section!\n\n"),console.log("// Start of section going into PCServer-KFGame.ini:\n\n"),URIS.forEach(function(item,index){console.log("["+item.TITLE+" KFMapSummary]"),console.log("MapName="+item.TITLE+"\n")}),console.log("\n\n// End of PCServer-KFEngine.ini section!\n\n")):(document.write("// Start of section going into PCServer-KFEngine.ini:<br/><br/>"),URIS.forEach(function(item,index){document.write(item.URI+" // "+item.TITLE+"<br/>")}),document.write("<br/><br/>// End of PCServer-KFEngine.ini section!<br/><br/>"),document.write("// Start of section going into PCServer-KFGame.ini:<br/><br/>"),URIS.forEach(function(item,index){document.write("["+item.TITLE+" KFMapSummary]<br/>"),document.write("MapName="+item.TITLE+"<br/><br/>")}),document.write("// End of PCServer-KFEngine.ini section!<br/><br/>"));
Non-minified bookmarklet
var gameString = 'ServerSubscribedWorkshopItems='; var URIS = []; jQuery('a').each(function () { var URI = jQuery(this).attr("href"); var title = jQuery(this).find('.workshopItemTitle').text(); if (URI.search(/filedetails\/\?id=[0-9]+/i) != -1 && title != "") { URIS.push({ URI: gameString + URI.substr(URI.search(/\d{4}\d+/i)), TITLE: title }); } }); if (window.confirm("Output in developer console? (If not, list will replace current page!)")) { console.log('// Start of section going into PCServer-KFEngine.ini:\n\n') URIS.forEach(function (item, index) { console.log(item.URI + " // " + item.TITLE); }); console.log('// End of PCServer-KFEngine.ini section!\n\n') console.log('// Start of section going into PCServer-KFGame.ini:\n\n') URIS.forEach(function(item, index) { console.log('[' + item.TITLE + " KFMapSummary]"); console.log('MapName=' + item.TITLE + '\n'); }); console.log('\n\n// End of PCServer-KFEngine.ini section!\n\n'); } else { document.write('// Start of section going into PCServer-KFEngine.ini:<br/><br/>'); URIS.forEach(function (item, index) { document.write(item.URI + " // " + item.TITLE + '<br/>'); }); document.write('<br/><br/>// End of PCServer-KFEngine.ini section!<br/><br/>'); document.write('// Start of section going into PCServer-KFGame.ini:<br/><br/>') URIS.forEach(function(item, index) { document.write('[' + item.TITLE + " KFMapSummary]<br/>"); document.write('MapName=' + item.TITLE + '<br/><br/>'); }); document.write('// End of PCServer-KFEngine.ini section!<br/><br/>'); }
1 Comments
frosty* 25 Nov, 2022 @ 11:18am 
good:)