Advertisement
UchihaT3Alo

Mwa8ytAlslah.cs

Apr 2nd, 2024 (edited)
950
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.76 KB | Source Code | 0 0
  1. using System;
  2. using System.Net.Http;
  3. using Newtonsoft.Json;
  4. //These Codes Were Written By Mohammed Elbooshy And Modified For Alex Source (Steam Source) by Mahmoud Mohammed (Uchiha T3Alo)
  5. namespace GameServer
  6. {
  7.     public static class Mwa8ytAlslah
  8.     {
  9.         //These Codes Were Written By Mohammed Elbooshy And Modified For Alex Source (Steam Source) by Mahmoud Mohammed (Uchiha T3Alo)
  10.         public static uint SlaatAlfgrHour = 0;
  11.         public static uint SlaatAlfgrMinute = 0;
  12.  
  13.         public static uint SlaatAlzhrHour = 0;
  14.         public static uint SlaatAlzhrMinute = 0;
  15.  
  16.         public static uint SlaatAl3srHour = 0;
  17.         public static uint SlaatAl3srMinute = 0;
  18.  
  19.         public static uint SlaatAlmghrbHour = 0;
  20.         public static uint SlaatAlmghrbMinute = 0;
  21.  
  22.         public static uint SlaatAl3shaHour = 0;
  23.         public static uint SlaatAl3shaMinute = 0;
  24.  
  25.         public static DateTime LastSlah;
  26.         public static uint WaitingSlah;
  27.         public static bool SlahNow = false;
  28.  
  29.         //These Codes Were Written By Mohammed Elbooshy And Modified For Alex Source (Steam Source) by Mahmoud Mohammed (Uchiha T3Alo)
  30.         public static void LoadMwa8ytAlslah()
  31.         {
  32.             Console.Write("Loading Mwa8ytAlslah.....");
  33.             HttpClient httpClient = new HttpClient();
  34.             string uri = "http://api.aladhan.com/v1/timingsByCity?city=cairo&country=cairo&method=5";
  35.             HttpResponseMessage responseMessage = httpClient.GetAsync(uri).Result;
  36.             string response = responseMessage.Content.ReadAsStringAsync().Result;
  37.             dynamic resultObject = JsonConvert.DeserializeObject(response);
  38.             #region Alfgr
  39.             {
  40.                 string Alfgr = (string)resultObject.data.timings.Fajr;
  41.                 string[] Alfgrs = Alfgr.Split(':');
  42.                 SlaatAlfgrHour = Convert.ToByte(Alfgrs[0]);
  43.                 SlaatAlfgrMinute = Convert.ToByte(Alfgrs[1]);
  44.             }
  45.             #endregion
  46.             #region Alzhr
  47.             {
  48.                 string Alzhr = (string)resultObject.data.timings.Dhuhr;
  49.                 string[] Alzhrs = Alzhr.Split(':');
  50.                 SlaatAlzhrHour = Convert.ToByte(Alzhrs[0]);
  51.                 SlaatAlzhrMinute = Convert.ToByte(Alzhrs[1]);
  52.             }
  53.             #endregion
  54.             #region Al3sr
  55.             {
  56.                 string Al3sr = (string)resultObject.data.timings.Asr;
  57.                 string[] Al3srs = Al3sr.Split(':');
  58.                 SlaatAl3srHour = Convert.ToByte(Al3srs[0]);
  59.                 SlaatAl3srMinute = Convert.ToByte(Al3srs[1]);
  60.             }
  61.             #endregion
  62.             #region Almghrb
  63.             {
  64.                 string Almghrb = (string)resultObject.data.timings.Maghrib;
  65.                 string[] Almghrbs = Almghrb.Split(':');
  66.                 SlaatAlmghrbHour = Convert.ToByte(Almghrbs[0]);
  67.                 SlaatAlmghrbMinute = Convert.ToByte(Almghrbs[1]);
  68.             }
  69.             #endregion
  70.             #region Al3sha
  71.             {
  72.                 string Al3sha = (string)resultObject.data.timings.Isha;
  73.                 string[] Al3shas = Al3sha.Split(':');
  74.                 SlaatAl3shaHour = Convert.ToByte(Al3shas[0]);
  75.                 SlaatAl3shaMinute = Convert.ToByte(Al3shas[1]);
  76.             }
  77.             #endregion
  78.             /*Console.WriteLine("Alfgr: " + SlaatAlfgrHour + ":" + SlaatAlfgrMinute);
  79.             Console.WriteLine("Alzhr: " + SlaatAlzhrHour + ":" + SlaatAlzhrMinute);
  80.             Console.WriteLine("Al3sr: " + SlaatAl3srHour + ":" + SlaatAl3srMinute);
  81.             Console.WriteLine("Almghrb: " + SlaatAlmghrbHour + ":" + SlaatAlmghrbMinute);
  82.             Console.WriteLine("Al3sha: " + SlaatAl3shaHour + ":" + SlaatAl3shaMinute);*/
  83.             System.Console.WriteLine("     Complete!!");
  84.         }
  85.  
  86.         //These Codes Were Written By Mohammed Elbooshy And Modified For Alex Source (Steam Source) by Mahmoud Mohammed (Uchiha T3Alo)
  87.         public static void Mwa8ytAlslahh(Client.GameClient client)
  88.         {
  89.             if (SlahNow)
  90.             {
  91.                 if (!client.Player.OnAutoHunt)
  92.                     client.Socket.Disconnect();
  93.             }
  94.         }
  95.  
  96.         //These Codes Were Written By Mohammed Elbooshy And Modified For Alex Source (Steam Source) by Mahmoud Mohammed (Uchiha T3Alo)
  97.         public static void ShutDownLSlah()
  98.         {
  99.             #region Mwa8ytAlslah
  100.             if (DateTime.Now.Hour == Mwa8ytAlslah.SlaatAlfgrHour && DateTime.Now.Minute == Mwa8ytAlslah.SlaatAlfgrMinute ||
  101.                DateTime.Now.Hour == Mwa8ytAlslah.SlaatAlzhrHour && DateTime.Now.Minute == Mwa8ytAlslah.SlaatAlzhrMinute ||
  102.                DateTime.Now.Hour == Mwa8ytAlslah.SlaatAl3srHour && DateTime.Now.Minute == Mwa8ytAlslah.SlaatAl3srMinute ||
  103.                DateTime.Now.Hour == Mwa8ytAlslah.SlaatAlmghrbHour && DateTime.Now.Minute == Mwa8ytAlslah.SlaatAlmghrbMinute ||
  104.                DateTime.Now.Hour == Mwa8ytAlslah.SlaatAl3shaHour && DateTime.Now.Minute == Mwa8ytAlslah.SlaatAl3shaMinute)
  105.             {
  106.                 if (!SlahNow)
  107.                 {
  108.                     if (DateTime.Now.DayOfWeek == DayOfWeek.Friday && DateTime.Now.Hour == Mwa8ytAlslah.SlaatAlzhrHour && DateTime.Now.Minute == Mwa8ytAlslah.SlaatAlzhrMinute)
  109.                         WaitingSlah = 30;
  110.                     else
  111.                         WaitingSlah = 15;
  112.                     LastSlah = DateTime.Now;
  113.                     SlahNow = true;
  114.                 }
  115.             }
  116.             if (DateTime.Now > LastSlah.AddMinutes(WaitingSlah))
  117.             {
  118.                 if (SlahNow) SlahNow = false;
  119.             }
  120.             if (DateTime.Now.Hour == 01 && DateTime.Now.Minute == 00 && DateTime.Now.Second == 00)
  121.                 LoadMwa8ytAlslah();
  122.             #endregion
  123.         }
  124.  
  125.     }
  126. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement