Cities: Skylines

Cities: Skylines

评价数不足
Automate adding all your items to a Collection.
由 Snacko 制作
Clicking each item that you want to add to a Collection can be annoying. Especially when you have thousands of items!! So, I made a AutoHotKey script that does it for you.

This guide shows you how to use AutoHotKey to automatically add all of your subscriptions to a Collection by using a AHK script. Automated mouse clicks and down scrolling arrow keystrokes. Just run it, Press F1, and walk away till it's done.
   
奖励
收藏
已收藏
取消收藏
1) Download AutoHotKey (Free)
If you don't know what AutoHotKey is, .. it's lets you write scripts to automate clicking, typing, mouse movement, and more. The script file is just a Text file, and you can open it and edit it in notepad.

Download AutoHotKey[www.autohotkey.com] and install it.
2) The AutoHotKey Script
Create a text file on your desktop and give it a name (CS Auto Add to Collection.txt). Name it how you want, the name doesn't matter.
  1. Open the text file in notepad and copy the code below and paste it into the file.
  2. Save the file.
  3. Rename the file from .txt to .ahk
NOTE:
This code will loop 1000 times. Feel free to change that and anything else that you want. I've made it to click 3 times, down (15 pixels) twice, and back up 30 pixels. This is because the down arrow key that it sends scrolls more than one line at a time. Making one click miss about every 4th item. So I made to just click more. It might miss 3-4 in a 1000, but that's still good. You can click those. ;-)
3) Run the script.


  1. Start by creating a new Collection in the Steam Workshop. When you get to the listbox of items to add..
  2. Run AutoHotKey. (it has no window. It will only show an icon in your SysTray.)
  3. Double-Click on my script file to start it running. (I doesn't start clicking and scrolling until you press F1.)
  4. Move your mouse over the 2nd or 3rd item in your Item list (to give it some room to move up and down)
  5. Press F1
  6. Don't touch your mouse!

It starts clicking and scrolling through your list.
Come back when it's done.
Script Code:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; CITIES SKYLINES WORKSSHOP SCRIPT / AUTOMATICALLY ADD ITEMS TO A COLLECTION. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SetKeyDelay, 10, 200 f1:: ; PRESS: F1 { ; How many times to loop?? 1000 times by default. ; OR Change it to whatever you like. When it gets to the end of the list ; it will just keep clicking until it reachs the limit and won't hurt anything. Just wait for it to end. Loop 1000 { ; 3 Mouse Clicks to try and catch everything. ; Click down 15 pixels, then down 15 more pixels, then back up to 30 where we started. mouseclick, left, 0, -15, 1, 0, , Relative Sleep, 100 ; 1000 = 1 second mouseclick, left, 0, -15, 1, 0, , Relative Sleep, 100 ; 1000 = 1 second mouseclick, left, 0, 30, 1, 0, , Relative Sleep, 100 ; 1000 = 1 second Send {Down} ; Send Down Arrow Key. Sleep, 100 ; 1000 = 1 second } } return ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; FEEL FREE TO TWEAK THIS HOWEVER YOU WANT!! ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8 条留言
HeadKillah 2021 年 8 月 10 日 下午 10:26 
Yeah i´ve found the same side 2 days before, tried it and it works perfectly :) But remember: You can ONLY add 1000 items per collection @once !!! So if you have more then 1000 assets, you have to run the script more then 1 times.
Snacko  [作者] 2021 年 8 月 8 日 上午 8:39 
Found this today on Reddit. It does the same thing and easier. Check it out..

https://www.reddit.com/r/CitiesSkylines/comments/8hrdsd/add_all_subscribed_items_to_steam_collections_at/
Snacko  [作者] 2021 年 8 月 5 日 上午 6:54 
@Tmac86, this just sends the down arrow key to scroll down one line, the sends clicks to click on the screen. It loops 1000 times, which is the max limit of any collection.

@saeni, There are many great collections already shared that you can access. Just go to Cities Skylines / Community Hub / Workshop / and click the Browse menu, and click Collections.
Tmac86 2021 年 6 月 28 日 下午 5:16 
Does this add all the subscribed items to that one collection? I have lots of collections broken down into different categories and trying to keep subscribed items organized it a pain.
saeni 2021 年 6 月 26 日 下午 9:29 
can someone share their mod collection?
TobbySkylines 2021 年 6 月 25 日 下午 11:40 
@Snacko Than this method for autoadding is an improvement of the ones I knew before. Nice job!
Snacko  [作者] 2021 年 6 月 25 日 下午 1:30 
@tobby_t Yes, I found out about the 1000 item limit later. So just set it to loop 1000 or less.

Also yes. Just create your new collection, and scroll down to your 1001th subscribed item and press F1. It should just go from there and go down the list.
TobbySkylines 2021 年 6 月 6 日 上午 2:45 
Hey Snacko, did you mind that there can only be 1000 items in one steam collection? Is it possible to continue with a new collection if the first is filled completely?