-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
73 lines (66 loc) · 2.9 KB
/
Copy pathProgram.cs
File metadata and controls
73 lines (66 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
using System;
using System.Diagnostics;
using System.Globalization;
using System.Net.Http;
using RestEase;
namespace ScheduledCallerClient
{
class Program
{
static void Main(string[] args)
{
// ICapnAPI capnApi =
// RestClient.For<ICapnAPI>("https://mfl-capn.herokuapp.com/Mfl/");
// IGMBotAPI gmApi =
// RestClient.For<IGMBotAPI>("https://capn-crunch-gm-bot.herokuapp.com/Bot/");
var time = DateTime.Now;
Console.WriteLine("Yo, WE OUT HERE!");
var gmBotWatch = new Stopwatch();
var transactionWatch = new Stopwatch();
var tradeBaitWatch = new Stopwatch();
gmBotWatch.Start();
transactionWatch.Start();
tradeBaitWatch.Start();
while (true)
{
if (gmBotWatch.Elapsed.Days > 0)
{
// CheckForTrades(gmApi);
try
{
using IGMBotAPI gmApi = RestClient.For<IGMBotAPI>("https://capn-crunch-gm-bot.herokuapp.com/Bot/");
var res = gmApi.GetPendingTrades().Result;
if(res.IsSuccessStatusCode) Console.WriteLine($"{DateTime.Now.ToString("G", CultureInfo.CreateSpecificCulture("en-US"))} called for trades");
gmBotWatch.Restart();
}
catch (HttpRequestException e)
{ Console.WriteLine(e.StatusCode); }
}
if (transactionWatch.Elapsed.Minutes > 19)
{
try
{
using ICapnAPI capnApi = RestClient.For<ICapnAPI>("https://mfl-capn.herokuapp.com/Mfl/");
var res = capnApi.GetTransactions().Result;
if(res.IsSuccessStatusCode) Console.WriteLine($"{DateTime.Now.ToString("G", CultureInfo.CreateSpecificCulture("en-US"))} called for transactions");
transactionWatch.Restart();
}
catch (HttpRequestException e)
{ Console.WriteLine(e.StatusCode); }
}
if (tradeBaitWatch.Elapsed.Days > 0)
{
try
{
using IGMBotAPI gmApi = RestClient.For<IGMBotAPI>("https://capn-crunch-gm-bot.herokuapp.com/Bot/");
var res = gmApi.GetTradeBait().Result;
if(res.IsSuccessStatusCode) Console.WriteLine($"{DateTime.Now.ToString("G", CultureInfo.CreateSpecificCulture("en-US"))} called for trade bait");
tradeBaitWatch.Restart();
}
catch (HttpRequestException e)
{ Console.WriteLine(e.StatusCode); }
}
}
}
}
}