using System.Runtime.InteropServices;
using System.Net;
using System.Text;
using System;
public class Program
{
// ↓↓↓↓↓↓↓↓ CHANGE THESE TO THE VARIABLES YOU WANT
const string message = "gathering Pine 10mins e_lol";
const string color = "255";
[DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section,string key,string def,StringBuilder retVal,int size,string filePath);
[DllImport("kernel32.dll")]
public static extern void GetSystemTimeAsFileTime(out long systemTimeAsFileTime);
public static void Main()
{
long time;
GetSystemTimeAsFileTime(out time);
var RetVal = new StringBuilder(255);
GetPrivateProfileString("settings", "webhook", "", RetVal, 255, "./config.ini");
string webhook_url = RetVal.ToString();
GetPrivateProfileString("last_collected", "planterssms", "", RetVal, 255, "./timer.ini");
long last = long.Parse(RetVal.ToString());
long tup = time - last ;
long left = 72000000000 - tup;
TimeSpan timespan = TimeSpan.FromSeconds(left / 10000000);
string duration = timespan.Hours.ToString() + ":" + timespan.Minutes.ToString();
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
WebClient wc = new WebClient();
wc.Headers[HttpRequestHeader.UserAgent] = "Jitbit";
wc.Headers[HttpRequestHeader.ContentType] = "application/json";
wc.UploadString(webhook_url, "{\"embeds\":[{\"description\":\"" + "" + " " +
message + "\",\"color\":\"" + color + "\",\"footer\":{\"text\":\"" + System.DateTime.Now.ToString("HH:mm") + "\"}}]}");
}
}