Exemplo n.º 1
0
 // Charge is an idempotent function that never fails, so it does not need to be surrounded with try/catch.
 private void charge()
 {
     Console.WriteLine();
     Console.WriteLine("!!***** REFUEL *****!!");
     string parameter    = Hokyu.Charge(this.ship_list);
     string postResponse = this.kcp.proxy(Hokyu.CHARGE, parameter);
 }
Exemplo n.º 2
0
        public void runForOneShip(int ship_id, int run_times)
        {
            int morale = getMorale(this.portData, ship_id);

            Console.WriteLine("KANMUSU'S ID: " + ship_id);
            Console.WriteLine("INITIAL MORALE: " + morale);

            if (morale >= 81)
            {
                Console.WriteLine("Morale is " + morale + ". Skipping...");
                return;
            }

            int run_count = 0;

            while (run_times != run_count)
            {
                if (morale >= 81)
                {
                    Console.WriteLine("Morale is " + morale + ". Skipping the rest of iterations...");
                    break;
                }

                this.kcp.proxy(MapInfo.MAPINFO);
                Console.WriteLine("MapInfo done.");
                this.kcp.proxy(MapCell.MAPCELL, MapCell.Get(1, 1));
                Console.WriteLine("MapCell done.");

                this.kcp.proxy(Map.START, Map.Start(1, this.fleet_id, 1, 1));
                Console.WriteLine("STARTED.");

                Thread.Sleep(ONE_SECOND);
                this.kcp.proxy(Sortie.BATTLE, Sortie.Battle(1, 0));
                Console.WriteLine("First battle done.");
                Thread.Sleep(TEN_SECONDS);
                this.kcp.proxy(Sortie.BATTLERESULT);
                Console.WriteLine("First battle results get.");
                Thread.Sleep(FIVE_SECONDS);

                this.kcp.proxy(Ship3.SHIP2, Ship3.Ship2());
                Console.WriteLine("Ship2 get.");
                this.kcp.proxy(Map.NEXT, Map.Next());
                Console.WriteLine("NEXT.");
                Thread.Sleep(ONE_SECOND);

                this.kcp.proxy(Sortie.BATTLE, Sortie.Battle(1, 0));
                Console.WriteLine("Second battle done.");
                Thread.Sleep(TEN_SECONDS);
                this.kcp.proxy(Sortie.BATTLERESULT);
                Console.WriteLine("Second battle results get.");
                Thread.Sleep(FIVE_SECONDS);

                string port_data = this.kcp.proxy(ApiPort.PORT, ApiPort.port(this.member_id));
                this.portData = JsonConvert.DeserializeObject <KanColleAPI <Port> >(port_data).GetData();
                Console.WriteLine("Returned to port.");

                this.kcp.proxy(Hokyu.CHARGE, Hokyu.Charge(this.ship_list_string, ChargeKind.BOTH));
                Console.WriteLine("Refueled.");
                Thread.Sleep(ONE_SECOND);

                Console.WriteLine("ROUND {0} COMPLETE.", ++run_count);
                morale = getMorale(this.portData, ship_id);
                Console.WriteLine("CURRENT MORALE: " + morale + "\n");
            }
        }
Exemplo n.º 3
0
 private void charge(int fleet_id)
 {
     string parameter    = Hokyu.Charge(IntArrayToString(this.fleet_lists[fleet_id]));
     string postResponse = this.kcp.proxy(Hokyu.CHARGE, parameter);
 }
Exemplo n.º 4
0
 private void refuel()
 {
     string parameter    = Hokyu.Charge(string.Join(",", this.ShipList));
     string postResponse = this.Proxy.proxy(Hokyu.CHARGE, parameter);
 }