diff --git a/ArchiSteamFarm/ArchiSteamFarm.php b/ArchiSteamFarm/ArchiSteamFarm.php new file mode 100644 index 000000000..e9dd6c3c5 --- /dev/null +++ b/ArchiSteamFarm/ArchiSteamFarm.php @@ -0,0 +1,65 @@ +jar = new \GuzzleHttp\Cookie\CookieJar; // Uncomment if cookies need to be set + } + + public function test() + { + if(!isset($this->config->password)) + { + echo "Invalid password"; + return; + } + + $test = parent::appTest($this->url('status?password='.$this->config->password)); + echo $test->status; + } + + public function livestats() + { + if(!isset($this->config->password)) + return parent::getLiveStats("Inactive", []); + $status = 'inactive'; + $res = parent::execute($this->url('api/bot/asf?password='.$this->config->password)); + $details = json_decode($res->getBody()); + + $totalSecondsLeft = 0; + $cardToFarmLeft = 0; + foreach ($details->Result as $bot) { + foreach ($bot->CardsFarmer->GamesToFarm as $game) { + $cardToFarmLeft += $game->CardsRemaining; + } + if(preg_match("@([0-9].*).([0-9]+):([0-9]+):([0-9]+)@", $bot->CardsFarmer->TimeRemaining, $matches)) + { + $totalSecondsLeft += $matches[1] * 24 * 60 * 60; // Days + $totalSecondsLeft += $matches[2] * 60 * 60; // Hours + $totalSecondsLeft += $matches[3] * 60; // Minutes + $totalSecondsLeft += $matches[4]; // Seconds + } + } + + $d = Carbon::now(); + $d->addSeconds($totalSecondsLeft); + $data = [ + "time_left" => $d->diffForHumans(null, true, true, 3), + "cards_left" => $cardToFarmLeft, + ]; + return parent::getLiveStats($status, $data); + + } + public function url($endpoint) + { + $api_url = parent::normaliseurl($this->config->url).$endpoint; + return $api_url; + } +} diff --git a/ArchiSteamFarm/app.json b/ArchiSteamFarm/app.json new file mode 100644 index 000000000..55f0c9aa1 --- /dev/null +++ b/ArchiSteamFarm/app.json @@ -0,0 +1,10 @@ +{ + "appid": "7779bfb41003301f1b395c0691002423773d68c1", + "name": "ArchiSteamFarm", + "website": "https://github.com/JustArchiNET/ArchiSteamFarm", + "license": "Apache License 2.0", + "description": "ASF is a C# application with primary purpose of idling Steam cards from multiple accounts simultaneously. Unlike Idle Master which works only for one account at given time, while requiring Steam client running in the background and launching additional processes imitating \"game playing\" status, ASF doesn't require any Steam client running in the background, doesn't launch any additional processes and is made to handle unlimited Steam accounts at once. In addition to that, it's meant to be run on servers or other desktop-less machines, and features full cross-OS support, which makes it possible to launch on any operating system with .NET Core runtime, such as Windows, Linux and OS X. ASF is possible thanks to gigantic amount of work done in marvelous SteamKit2 library.\r\n\r\nToday, ASF is one of the most versatile Steam power tools, allowing you to make use of many features that were implemented over time. Apart from idling Steam cards, which remains the primary focus, ASF includes bunch of features on its own, such as a possibility to use it as Steam authenticator or chat logger. In addition to that, ASF includes plugin system, thanks to which anybody can further extend it to his/her needs.", + "enhanced": true, + "tile_background": "dark", + "icon": "archisteamfarm.png" +} \ No newline at end of file diff --git a/ArchiSteamFarm/archisteamfarm.png b/ArchiSteamFarm/archisteamfarm.png new file mode 100644 index 000000000..810ba1660 Binary files /dev/null and b/ArchiSteamFarm/archisteamfarm.png differ diff --git a/ArchiSteamFarm/config.blade.php b/ArchiSteamFarm/config.blade.php new file mode 100644 index 000000000..c92e58a35 --- /dev/null +++ b/ArchiSteamFarm/config.blade.php @@ -0,0 +1,15 @@ +