Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Reflection;
- using System.Text;
- using System.Threading.Tasks;
- namespace SwgohHelpApi
- {
- using ApiHelper = DareWare.SWGoH.Data.WebServices.SwgohHelp.ApiHelper;
- class Program
- {
- private static string ExeName => Assembly.GetEntryAssembly().Location.Split( Path.DirectorySeparatorChar ).Last();
- static void Main( string[] args )
- {
- if ( args.Length < 2 )
- {
- Console.WriteLine( "Usage: " + ExeName + " <ApiUserName> <ApiPassword> [<AllyCode>]" );
- return;
- }
- var api = new ApiHelper()
- {
- Username = args[0],
- Password = args[1]
- };
- var events = api.GetEvents();
- var heists = events.Where( e => e.id.Contains("CREDIT_HEIST") );
- if ( heists.Any() )
- {
- Console.WriteLine( "The next credit heist starts at " + heists.First().schedule.First().Start.ToLocalTime() );
- }
- else
- {
- Console.WriteLine( "No credit heists coming up" );
- }
- if ( args.Length >= 3 )
- {
- var me = api.GetPlayer( args[2] );
- Console.WriteLine( $"As of {me.Updated.ToLocalTime()}, {me.name} is #{me.arena._char.rank} in Squad Arena and #{me.arena.ship.rank} in Fleet Arena" );
- }
- Console.WriteLine( "Please press the any key to continue..." );
- Console.ReadKey();
- }
- }
- }
Add Comment
Please, Sign In to add comment