chr233 / ASFEnhance

ASF 扩展命令插件 / External commands for ASF
GNU Affero General Public License v3.0
489 stars 40 forks source link

Schedule claimitem daily #175

Closed Nuklon closed 5 months ago

Nuklon commented 8 months ago

Describe what feature you want / 描述需要加入的新功能 There are quite often free items to get with the claimitem command that require running this command daily to get all items. Would it be possible to add an option to do this automatically once a day?

chr233 commented 8 months ago

wip, maybe add in next version

azhuge233 commented 8 months ago

Before official support is available, this can already be achieved by setting up a cron job (or using Task Scheduler) that sends the CI [Bots] command to the ASF API.

Nuklon commented 8 months ago

Before official support is available, this can already be achieved by setting up a cron job (or using Task Scheduler) that sends the CI [Bots] command to the ASF API.

Not so easy under Windows.

azhuge233 commented 8 months ago

Before official support is available, this can already be achieved by setting up a cron job (or using Task Scheduler) that sends the CI [Bots] command to the ASF API.

A little more details, you can easily do this using bash or Powershell

bash (Linux or more)

curl -X POST \
  'http(s)://[your ASF instance domain or IP]/Api/Command' \
  --header 'Authentication: [your ASF IPC Password here]' \
  --header 'Content-Type: application/json' \
  --data-raw '{ "Command": "CI asf" }'

PowerShell (Windows)

Invoke-WebRequest -Method POST `
  -URI "http(s)://[your ASF instance domain or IP]/Api/Command" `
  -ContentType "application/json" `
  -Headers @{ 'Authentication' = '[your ASF IPC Password here]' } `
  -Body "{ 'Command': 'CI asf' }"

Under Linux, create a cron job with crontab -e to execute the command periodically (or save it as a script). Windows also comes with a Task Scheduler can do the same job as cron, you can save the above command as a .ps1 script, and execute it with powershell.exe.

chr233 commented 7 months ago

added, ASFEnhance will execute CLAIMITEM for bots which set AutoSteamSaleEvent to true, every 8 hours, after 2.0.8.0

psy0ch commented 7 months ago

I assume AutoSteamSaleEvent was made into AutoClaimItemBotNames ? Unfortunately there is no Steam Sale up so that I could check if it is working, but thank you for the added functionality!

chr233 commented 7 months ago

I assume AutoSteamSaleEvent was made into AutoClaimItemBotNames ? Unfortunately there is no Steam Sale up so that I could check if it is working, but thank you for the added functionality!

nope, AutoSteamSaleEvent now don't work for ASFEnhance, use AutoClaimItemBotNames to control which bot to enable this future

visualwind commented 6 months ago

I assume AutoSteamSaleEvent was made into AutoClaimItemBotNames ? Unfortunately there is no Steam Sale up so that I could check if it is working, but thank you for the added functionality!

nope, AutoSteamSaleEvent now don't work for ASFEnhance, use AutoClaimItemBotNames to control which bot to enable this future

请问具体怎么设置asf.json啊。如果我有连个bot:0和1,是写"AutoClaimItemBotNames": "0,1"吗?

chr233 commented 6 months ago

I assume AutoSteamSaleEvent was made into AutoClaimItemBotNames ? Unfortunately there is no Steam Sale up so that I could check if it is working, but thank you for the added functionality!

nope, AutoSteamSaleEvent now don't work for ASFEnhance, use AutoClaimItemBotNames to control which bot to enable this future

请问具体怎么设置asf.json啊。如果我有连个bot:0和1,是写"AutoClaimItemBotNames": "0,1"吗?

是的