Skip to content

Command line arguments zh HK

ArchiBot edited this page Sep 27, 2021 · 47 revisions

ๅ‘ฝไปคๅˆ—ๅƒๆ•ธ

ASF ๆ”ฏๆดไธ€ไบ›่ƒฝๅค ๅฝฑ้Ÿฟ็จ‹ๅผ้‹่กŒๆ™‚็š„ๅ‘ฝไปคๅˆ—ๅƒๆ•ธใ€‚ ้ซ˜็ดš็”จๆˆถๅฏไฝฟ็”จ้€™ไบ›ๅƒๆ•ธไปฅๅฎš็พฉ็จ‹ๅผ้‹่กŒๆ–นๅผใ€‚ ่ˆ‡ASF.json ้…็ฝฎๆ–‡ไปถ็š„้ ่จญๆ–นๅผ็›ธๆฏ”๏ผŒๅ‘ฝไปคๅˆ—ๅƒๆ•ธๅฏ็”จๆ–ผๆ ธๅฟƒๅˆๅง‹ๅŒ–๏ผˆไพ‹ๅฆ‚--path๏ผ‰ใ€ๅนณๅฐ็‰นๅฎš่จญ็ฝฎ๏ผˆไพ‹ๅฆ‚--system-required๏ผ‰ๆˆ–ๆ•ๆ„Ÿๆ€ง่ณ‡ๆ–™๏ผˆไพ‹ๅฆ‚--cryptkey๏ผ‰ใ€‚


ไฝฟ็”จๆ–นๆณ•

ไฝฟ็”จๆ–นๆณ•ๅ–ๆฑบๆ–ผๆ‚จ็š„ๆ“ไฝœ็ณป็ตฑๅ’ŒASF็‰ˆๆœฌใ€‚

Generic๏ผˆ้€š็”จ๏ผ‰:

dotnet ArchiSteamFarm.dll --ๅƒๆ•ธ -- ๅฆไธ€ๅ€‹ๅƒๆ•ธ

Windows:

.\ArchiSteamFarm.exe --ๅƒๆ•ธ--ๅฆไธ€ๅ€‹ๅƒๆ•ธ

Linux/OS X

./ArchiSteamFarm --ๅƒๆ•ธ--ๅฆไธ€ๅ€‹ๅƒๆ•ธ

ๅ‘ฝไปคๅˆ—ๅƒๆ•ธไนŸๅฏ็”จๆ–ผ้€š็”จๅŠฉๆ‰‹่…ณๆœฌไธญ๏ผŒไพ‹ๅฆ‚ArchiSteamFarm.cmdๆˆ–ArchiSteamFarm.shใ€‚ ้™คๆญคไน‹ๅค–, ๅฆ‚ๆˆ‘ๅ€‘็š„**Docker**โ€‹้ƒจๅˆ†ไธญๆ‰€่ฟฐ๏ผŒๅœจไฝฟ็”จๅŠฉๆ‰‹่…ณๆœฌๆ™‚, ๆ‚จ้‚„ๅฏไปฅไฝฟ็”จ ASF_ARGS ็’ฐๅขƒๅฑฌๆ€ง,ใ€‚

่‹ฅๆ‚จ็š„ๅƒๆ•ธๅŒ…ๅซ็ฉบๆ ผ๏ผŒ่ซ‹ๅ‹™ๅฟ…ไฝฟ็”จๅผ•่™Ÿๅฐ‡ๅ…ถๆ‹ฌไฝใ€‚ ๅ…ฉๅ€‹้Œฏ่ชค็คบไพ‹๏ผš

./ArchiSteamFarm --path /home/archi/My Downloads/ASF # Bad!
./ArchiSteamFarm --path=/home/archi/My Downloads/ASF # Bad!

ๅ…ฉๅ€‹ๆญฃ็ขบ็คบไพ‹๏ผš

./ArchiSteamFarm --path "/home/archi/My Downloads/ASF" # OK
./ArchiSteamFarm "--path=/home/archi/My Downloads/ASF" # OK

ๅƒๆ•ธ

--cryptkey<key>ๆˆ–--cryptkey=<key>โ”€โ”€ๅฐ‡ไฝฟ็”จๅ€ผ็‚บ<key>็š„่‡ช่จ‚ๅฏ†้‘ฐๅ•Ÿๅ‹• ASFใ€‚ ๆญค้ธ้ …ๆœƒๅฝฑ้Ÿฟ**ๅฎ‰ๅ…จๆ€ง**๏ผŒไธฆๅฐ‡ๅฐŽ่‡ดASFไฝฟ็”จๆ‚จ็š„่‡ช่จ‚ๅฏ†้‘ฐ <key>๏ผŒ่€Œไธๆ˜ฏ็กฌ็ทจ็ขผๅœจ็จ‹ๅผไธญ็š„้ ่จญๅ€ผใ€‚ Since this property affects default encryption key (for encrypting purposes) as well as salt (for hashing purposes), keep in mind that everything encrypted/hashed with this key will require it to be passed on each ASF run.

Due to the nature of this property, it's also possible to set cryptkey by declaring ASF_CRYPTKEY environment variable, which may be more appropriate for people that would want to avoid sensitive details in the process arguments.


--ignore-unsupported-environment - will cause ASF to ignore detection of unsupported environment, which normally is signalized with an error and forced exit. As of now, unsupported environment is classifed as running .NET Framework build on platform that could be running .NET Core build instead. Since we support generic-netf builds only in very limited scenarios (with Mono), using it for other cases (e.g. for launching on win-x64 platform) is not supported. Visit compatibility for more info.


--network-group <group> or --network-group=<group> - will cause ASF to init its limiters with a custom network group of <group> value. This option affects running ASF in multiple instances by signalizing that given instance is dependent only on instances sharing the same network group, and independent of the rest. Typically you want to use this property only if you're routing ASF requests through custom mechanism (e.g. different IP addresses) and you want to set networking groups yourself, without relying on ASF to do it automatically (which currently includes taking into account WebProxy only). Keep in mind that when using a custom network group, this is unique identifier within the local machine, and ASF will not take into account any other details, such as WebProxy value, allowing you to e.g. start two instances with different WebProxy values which are still dependent on each other.

Due to the nature of this property, it's also possible to set the value by declaring ASF_NETWORK_GROUP environment variable, which may be more appropriate for people that would want to avoid sensitive details in the process arguments.


--no-config-migrate - by default ASF will automatically migrate your config files to latest syntax. Migration includes conversion of deprecated properties into latest ones, removing properties with default values (as they have no effect), as well as cleaning up the file in general (correcting indentation and likewise). This is almost always a good idea, but you might have a particular situation where you'd prefer ASF to never overwrite the config files automatically. For example, you might want to chmod 400 your config files (read permission for the owner only) or put chattr +i over them, in result denying write access for everyone, e.g. as a security measure. Usually we recommend to keep the config migration enabled, but if you have a particular reason for disabling it and would instead prefer ASF to not do that, you can use this switch for achieving that purpose.


--no-config-watch - by default ASF sets up a FileSystemWatcher over your config directory in order to listen for events related to file changes, so it can interactively adapt to them. For example, this includes stopping bots on config deletion, restarting bot on config being changed, or loading keys into BGR once you drop them into the config directory. This switch allows you to disable such behaviour, which will cause ASF to completely ignore all the changes in config directory, requiring from you to do such actions manually, if deemed appropriate. Usually we recommend to keep the config events enabled, but if you have a particular reason for disabling them and would instead prefer ASF to not do that, you can use this switch for achieving that purpose.


--no-restartโ”€โ”€ๆญค้–‹้—œไธป่ฆ็”จๆ–ผ**Docker**โ€‹ๅฎนๅ™จไธฆๅฐ‡ AutoRestart ๅผทๅˆถ่จญ็ฝฎ็‚บ falseใ€‚ Unless you have a particular need, you should instead configure AutoRestart property directly in your config. This switch is here so our docker script won't need to touch your global config in order to adapt it to its own environment. ็•ถ็„ถ๏ผŒๅฆ‚ๆžœๆ‚จๅœจ่…ณๆœฌไธญ้‹่กŒ ASF๏ผŒไนŸๅฏไปฅไฝฟ็”จๆญค้–‹้—œ๏ผˆๅฆๅ‰‡ๆ‚จๆœ€ๅฅฝไฝฟ็”จๅ…จๅŸŸ้…็ฝฎๅฑฌๆ€ง๏ผ‰ใ€‚


--path <path>ๆˆ–--path=<path>โ”€โ”€ASFๅœจๅ•Ÿๅ‹•ๆ™‚ๅง‹็ต‚ๆœƒๅฐŽ่ˆช่‡ณ่‡ช่บซๆ‰€ๅœจ็š„็›ฎ้Œ„ใ€‚ By specifying this argument, ASF will navigate to given directory after initialization, which allows you to use custom path for various application parts (including config, plugins and www directories, as well as NLog.config file), without a need of duplicating binary in the same place. ๅฆ‚ๆžœๆ‚จๆƒณๅฐ‡ไบŒ้€ฒไฝๆช”ๆกˆๅ’Œๅฏฆ้š›้…็ฝฎๆช”ๆกˆๅˆ†้–‹๏ผŒ้€™ๅฏ่ƒฝๆœƒ้žๅธธๆœ‰็”จ๏ผŒ้กžไผผLinux ๆ‰“ๅŒ…ๆฉŸๅˆถโ€”โ€”้€™ๆจฃๆ‚จๅฐฑๅฏไปฅๅœจๅคšๅ€‹่จญ็ฝฎไธญๅ…ฑ็”จไธ€ๅ€‹๏ผˆๆœ€ๆ–ฐ็š„๏ผ‰ไบŒ้€ฒไฝๆช”ๆกˆใ€‚ ๆญค่ทฏๅพ‘ๆ—ขๅฏไปฅๆ˜ฏๅŸบๆ–ผ็•ถๅ‰ ASF ไบŒ้€ฒไฝๆช”ๆกˆๆ‰€ๅœจไฝ็ฝฎ็š„็›ธๅฐ่ทฏๅพ‘๏ผŒไนŸๅฏไปฅๆ˜ฏ็ต•ๅฐ่ทฏๅพ‘ใ€‚ Keep in mind that this command points to new "ASF home" - the directory that has the same structure as original ASF, with config directory inside, see below example for explanation.

Due to the nature of this property, it's also possible to set expected path by declaring ASF_PATH environment variable, which may be more appropriate for people that would want to avoid sensitive details in the process arguments.

If you're considering using this command-line argument for running multiple instances of ASF, we recommend reading our compatibility page on this manner.

็ฏ„ไพ‹:

dotnet /opt/ASF/ArchiSteamFarm.dll --path /opt/TargetDirectory # Absolute path
dotnet /opt/ASF/ArchiSteamFarm.dll --path ../TargetDirectory # Relative path works as well
ASF_PATH=/opt/TargetDirectory dotnet /opt/ASF/ArchiSteamFarm.dll # Same as env variable
โ”œโ”€โ”€ /opt
โ”‚     โ”œโ”€โ”€ ASF
โ”‚     โ”‚     โ”œโ”€โ”€ ArchiSteamFarm.dll
โ”‚     โ”‚     โ””โ”€โ”€ ...
โ”‚     โ””โ”€โ”€ TargetDirectory
โ”‚           โ”œโ”€โ”€ config
โ”‚           โ”œโ”€โ”€ logs (generated)
โ”‚           โ”œโ”€โ”€ plugins (optional)
โ”‚           โ”œโ”€โ”€ www (optional)
โ”‚           โ”œโ”€โ”€ log.txt (generated)
โ”‚           โ””โ”€โ”€ NLog.config (optional)
โ””โ”€โ”€ ...

--process-requiredโ”€โ”€้ ่จญๆƒ…ๆณไธ‹๏ผŒASF ๅฐ‡ๆœƒๅœจ็„กๆฉŸๆขฐไบบ้‹่กŒ็š„ๆƒ…ๆณไธ‹้—œ้–‰๏ผŒ่ฒๆ˜Žๆญค้–‹้—œๅฐ‡็ฆ็”จ้€™ไธ€่กŒ็‚บใ€‚ ้˜ปๆญข่‡ชๅ‹•้—œๆฉŸๅŠŸ่ƒฝๅœจๅ’Œ**IPC**้…ๅˆไธ‹็‰นๅˆฅๆœ‰็”จ๏ผŒๅคงๅคšๆ•ธ็”จๆˆถ้ƒฝๅธŒๆœ›ไป–ๅ€‘็š„ Web ๆœๅ‹™ๆญฃๅธธ้‹่กŒ๏ผŒ็„ก่ซ–ๅ•Ÿ็”จไบ†ๅคšๅฐ‘ๅ€‹ๆฉŸๆขฐไบบใ€‚ ๅฆ‚ๆžœๆ‚จๅœจไฝฟ็”จ IPC ๆˆ–่€…้œ€่ฆ ASF ้€ฒ็จ‹ๆŒ็บŒ้‹่กŒ็›ด่‡ณๆ‰‹ๅ‹•้—œ้–‰ๅฎƒ๏ผŒ้€™ๅฐฑๆ˜ฏๆญฃ็ขบ็š„้ธ้ …ใ€‚

ๅฆ‚ๆžœๆ‚จไธๆ‰“็ฎ—้‹่กŒ IPC๏ผŒๆญค้ธ้ …ๅฐๆ‚จไพ†่ชชๅฐ‡็›ธ็•ถ็„ก็”จ๏ผŒ ๅ› ็‚บๆ‚จๅฏไปฅๅœจ้œ€่ฆๆ™‚ๅ†ๆฌกๅ•Ÿๅ‹•่ฉฒ้Ž็จ‹ (่€Œไธๆ˜ฏ ASF ็š„ web ไผบๆœๅ™จ๏ผŒๅœจ้‚ฃ่ฃๆ‚จ้œ€่ฆๅฎƒไธ€็›ดๅต่ฝไปฅ็™ผ้€ๅ‘ฝไปค)ใ€‚


--service - this switch is mainly used by our systemd service and forces Headless of true. Unless you have a particular need, you should instead configure Headless property directly in your config. This switch is here so our systemd service won't need to touch your global config in order to adapt it to its own environment. Of course, if you have a similar need then you may also make use of this switch (otherwise you're better with global config property).


--system-requiredโ”€โ”€่ฒๆ˜Žๆญค้–‹้—œๅฐ‡ๅฐŽ่‡ด ASF ๅ˜—่ฉฆ้€š็Ÿฅๆ“ไฝœ็ณป็ตฑใ€Œๆญค้€ฒ็จ‹่ฆๆฑ‚็ณป็ตฑๅœจๅ…ถๅญ˜็•™ๆœŸๅ…ง่™•ๆ–ผๅ•Ÿๅ‹•็‹€ๆ…‹ไธฆๆญฃๅธธ้‹่กŒใ€ใ€‚ ็•ถๅ‰๏ผŒๆญค้–‹้—œๅƒ…ๅฐ Windows ้›ป่…ฆๆœ‰ๆ•ˆ๏ผŒๅช่ฆASF้€ฒ็จ‹ๆญฃๅœจ้‹่กŒ๏ผŒๅฎƒๅฐฑๆœƒ้˜ปๆญขๆ‚จ็š„็ณป็ตฑ้€ฒๅ…ฅ็ก็œ ๆจกๅผใ€‚ This can be proven especially useful when farming on your PC or laptop during night, as ASF will be able to keep your system awake while it's farming, then, once ASF is done, it'll shutdown itself like usual, making your system allowed to enter into sleep mode again, therefore saving power immediately once farming is finished.

่ซ‹ๆณจๆ„๏ผŒ่ฆ่ฎฉ ASFๆญฃ็ขบๅœฐ่‡ชๅ‹•้—œ้–‰๏ผŒๆ‚จ้‚„้œ€่ฆๅ…ถไป–่จญ็ฝฎโ”€โ”€็‰นๅˆฅๆ˜ฏ้ฟๅ… --process-required๏ผŒไธ”็ขบไฟๆ‰€ๆœ‰ๆฉŸๆขฐไบบ้ƒฝๅทฒๅ•Ÿ็”จ ShutdownOnFarmingFinishedใ€‚ ็•ถ็„ถ๏ผŒ่‡ชๅ‹•้—œๆฉŸๅชๆ˜ฏ้€™ๅ€‹ๅƒๆ•ธ็š„็”จๆณ•ไน‹ไธ€๏ผŒ่€Œ้žๅฟ…้œ€๏ผŒๅ› ็‚บๆ‚จ้‚„ๅฏไปฅๅฐ‡ๆญคๅƒๆ•ธ้…ๅˆ --process-required ไฝฟ็”จ๏ผŒๅพž่€Œๆœ‰ๆ•ˆๅœฐไฝฟๆ‚จ็š„็ณป็ตฑๅœจ ASF ๅ•Ÿๅ‹•ไน‹ๅพŒ็„ก้™้‹่กŒไธ‹ๅŽปใ€‚

Clone this wiki locally