示例#1
0
 public GuidBot()
 {
     var token = ConfigurationManager.AppSettings["apiToken"];
     _bot = new Api(token);
     _state = BotState.Stopped;
     _offset = 0;
 }
示例#2
0
        public PetrolBot(Ship BotShip, Graphics BotCanvas, Random Rand, Point InitalLocation)
        {
            rand = Rand;

               //passed in ship\subject
               botShip = BotShip;

               botCanvas = BotCanvas;
               botColour = Color.FromArgb(rand.Next(255), rand.Next(255), rand.Next(255));
               botStartingLocation = InitalLocation;
               botCurrentlocation = InitalLocation;
               double radiansToship = 0;
               botVelovity = 10;

               botState = BotState.waiting;

               //Create delegate to assign a method we want to run when the assigned ship (to this petrol bot) rasies an event. Then Assign a
               //method to this delegate.(this event uses a system provided event handler.)
               EventHandler shipfull = new EventHandler(FullOfFuelEventhandler);

               //Create  delegate for our custom event handler that can pass a data bucket, when run the assigned ship event (to this petrol bot) rasies an event. Then Assign
               //method to this delegate.(this event uses a system provided event handler.)
               Ship.outOfFuelEventHandler shipempty = new Ship.outOfFuelEventHandler(OutOfFuelEventHandler);

               //Assigning delegate to event
               botShip.FullOfFuelEvent += shipfull;
               //Assigning delegate to event
               botShip.OutOfFuelEvent += shipempty;
        }
            public double Lifespan = 45d;       // seconds

            #region Public Methods

            public void BotAdded(IMapObject item)
            {
                lock (_parentLock)
                {
                    this.Bot = (ArcBotNPC)item;
                    this.Rules = GetRules(this.Bot);

                    this.State = BotState.Added;
                }
            }
        /// <summary>
        ///   Initializes a new instance of the <see cref="GateCampingBotBusinessLogic" /> class.
        /// </summary>
        /// <param name="state">The state.</param>
        /// <param name="engageRules"></param>
        public GateCampingBotBusinessLogic(BotState state, EngageRules engageRules)
        {
            CurrentBotState = state;
              EngageRules = engageRules;
              FrameActionScheduler = new FrameActionsScheduler(15);

              Entities = new ObservableCollection<EntityViewModel>();

              OneTimeSetup();
              AttachOnFrame();
        }
            public void BotRemoved()
            {
                lock (_parentLock)
                {
                    this.Bot.Dispose();
                    this.Bot = null;
                    // _rules was set to null immediately

                    this.State = BotState.None;
                }
            }
示例#6
0
        } // WaitReceive()

        public async Task SendMessage(String text)
        {
            if (MustRemove)
            {
                return;
            }
            System.Diagnostics.Debug.WriteLine($"Sending {text} to {ClientGuid}");
            var buffer = System.Text.Encoding.UTF8.GetBytes(text);

            try
            {
                await webSocket.SendAsync(new ArraySegment <byte>(buffer, 0, buffer.Length), WebSocketMessageType.Binary, true, CancellationToken.None);
            }
            catch (Exception err)
            {
                Console.WriteLine($"[COCKPIT ERROR] {err.Message}");
                State = BotState.Error;
            }
        }
    private void Move(Vector3 MoveDirection, float detaTime)
    {
        BotState = BotState.Moving;

        animat.SetInteger("condition", 1);


        moveDir = MoveDirection;
        Vector3 mD = MoveDirection;

        mD *= speed;
        mD  = transform.TransformDirection(mD);

        mD.y = 0;

        mD *= Time.deltaTime;

        transform.position = transform.position + mD;
    }
示例#8
0
        public FormDialogFromAdativeCard(ILogger <FormDialogFromAdativeCard> logger,
                                         UserState userState) : base(nameof(FormDialogFromAdativeCard))
        {
            _logger    = logger;
            _userState = userState;

            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new ConfirmPrompt(nameof(ConfirmPrompt)));
            AddDialog(new AttachmentPrompt(nameof(AttachmentPrompt)));
            var waterfallStepForm = new WaterfallStep[]
            {
                SendFormStepAsync,
                ReceiveFormStepAsync,
                SendInfoByEmailStepAsync
            };

            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), waterfallStepForm));
            InitialDialogId = nameof(WaterfallDialog);
        }
示例#9
0
        //public async Task Pause()
        //{
        //    _state = BotState.Stopped;
        //}
        //public async Task Resume()
        //{
        //    _state = BotState.Working;
        //    await Start();
        //}

        public async Task Start()
        {
            if (_state == BotState.Working)
            {
                throw new InvalidOperationException("Бот уже запущен");
            }
            _state = BotState.Working;
            const string defaultHelpText = "Send any text to generate new GUID.";

            while (State == BotState.Working)
            {
                var updates = await _bot.GetUpdates(_offset);

                foreach (var update in updates)
                {
                    var message     = update.Message;
                    var messageText = message.Text;
                    var chatId      = message.Chat.Id;
                    if (messageText != null)
                    {
                        var replyText = defaultHelpText;
                        if (messageText.ToUpper() != "/HELP" && messageText.ToUpper() != "HELP")
                        {
                            replyText = Guid.NewGuid().ToString();
                        }
                        await _bot.SendTextMessage(chatId, replyText);
                    }
                    var messageInfo = new MessageInfoEventArgs
                    {
                        ChatId   = chatId,
                        Text     = messageText,
                        UserName = message.From.Username,
                    };
                    await RaiseMessageReceivedEvent(messageInfo);

                    _offset = update.Id + 1;
                }

                await Task.Delay(1000);
            }
            _state = BotState.Stopped;
        }
示例#10
0
    private void Shooting()
    {
        RaycastHit hit;

        FireFlash.Play();
        BotState = BotState.Shooting;
        StartCoroutine(LaserAnimation(0.2f));
        //shooting = true;
        if (Physics.Raycast(rayOrgin.position, rayOrgin.TransformDirection(Vector3.forward), out hit, 700))
        {
            Debug.DrawRay(rayOrgin.position, rayOrgin.TransformDirection(Vector3.forward) * hit.distance * 700, Color.red);
            Debug.Log("hit");
            if (hit.transform.tag == "Player")
            {
                Debug.Log("player hit");
            }
            else if (hit.transform.tag == "Target")
            {
                if (botColor == BotColor.Green && photonView.IsMine)
                {
                    Debug.Log("TARGET hit at " + hit.transform.position + " sq number " + hit.transform.GetComponent <Gambetta>().sequence_number + " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
                    byte evCode = 3;
                    RaiseEventOptions raiseEventOptions = new RaiseEventOptions {
                        Receivers = ReceiverGroup.Others
                    };
                    SendOptions sendOptions = new SendOptions {
                        Reliability = true
                    };
                    Action hitInfo = new Action(hit.transform.position.x, hit.transform.position.y, hit.transform.position.z, 0, 0, sequence_number, PhotonNetwork.Time, 0, 0, true);
                    PhotonNetwork.RaiseEvent(evCode, hitInfo, raiseEventOptions, sendOptions);
                }
            }
        }
        else
        {
            Debug.DrawRay(rayOrgin.position, rayOrgin.TransformDirection(Vector3.forward) * hit.distance * 700, Color.white);
            Debug.Log("no hit");
        }
        animat.SetInteger("condition", 0);
        sequence_number++;
        currentAction.SetAction(transform.position, Vector3.zero, sequence_number, PhotonNetwork.Time, 2, transform.rotation.eulerAngles.y, true);
    }
示例#11
0
        /// <summary>
        /// Authenticates user to community
        /// </summary>
        private void UserWebLogOn()
        {
            try
            {
                if (mSteam.web.Authenticate(mSteam.uniqueId, mSteam.client, mSteam.nounce))
                {
                    mLog.Write(Log.LogLevel.Success, $"User authenticated!");
                    mBotState = BotState.LoggedInWeb;

                    /*If we should go online*/
                    if (mAccountSettings.ShowOnlineStatus)
                    {
                        mSteam.friends.SetPersonaState(EPersonaState.Online);
                    }

                    /*If we should join the steam group
                     * This is done mainly for statistical purposes*/
                    if (mAccountSettings.JoinSteamGroup)
                    {
                        var data = new NameValueCollection()
                        {
                            { "sessionID", mSteam.web.mSessionId },
                            { "action", "join" }
                        };

                        mSteam.web.Request(EndPoint.STEAM_GROUP_URL, "POST", data);
                    }

                    /*Start the timer to periodically refresh community connection*/
                    if (!mCommunityTimer.Enabled)
                    {
                        mCommunityTimer.Interval = TimeSpan.FromMinutes(15).TotalMilliseconds;
                        mCommunityTimer.Elapsed += new ElapsedEventHandler(VerifyCommunityConnection);
                        mCommunityTimer.Start();
                    }
                }
            }
            catch (Exception ex)
            {
                mLog.Write(Log.LogLevel.Error, $"Error on UserWebLogon: {ex.Message}");
            }
        }
示例#12
0
        //public async Task Pause()
        //{
        //    _state = BotState.Stopped;
        //}
        //public async Task Resume()
        //{
        //    _state = BotState.Working;
        //    await Start();
        //}

        public async Task Start()
        {
            if (_state == BotState.Working)
            {
                throw new InvalidOperationException("Бот уже запущен");
            }
            _state = BotState.Working;
            const string defaultHelpText = "Send any text to generate new GUID.";

            while (State == BotState.Working)
            {
                var updates = await _bot.GetUpdates(_offset);

                foreach (var update in updates)
                {
                    var message = update.Message;
                    var messageText = message.Text;
                    var chatId = message.Chat.Id;
                    if (messageText != null)
                    {
                        var replyText = defaultHelpText;
                        if (messageText.ToUpper() != "/HELP" && messageText.ToUpper() != "HELP")
                        {
                            replyText = Guid.NewGuid().ToString();
                        }
                        await _bot.SendTextMessage(chatId, replyText);
                    }
                    var messageInfo = new MessageInfoEventArgs
                    {
                        ChatId = chatId,
                        Text = messageText,
                        UserName = message.From.Username,
                    };
                    await RaiseMessageReceivedEvent(messageInfo);

                    _offset = update.Id + 1;
                }

                await Task.Delay(1000);
            }
            _state = BotState.Stopped;
        }
示例#13
0
        public DialogBot(
            ConversationState conversationState,
            UserState userState,
            T dialog,
            ILogger <DialogBot <T> > logger,
            IBotTelemetryClient telemetryClient,
            ConcurrentDictionary <string, ConversationReference> conversationReferences,
            IConfiguration configuration
            )
        {
            ConversationState      = conversationState;
            UserState              = userState;
            Dialog                 = dialog;
            Logger                 = logger;
            TelemetryClient        = telemetryClient;
            ConversationReferences = conversationReferences;
            Configuration          = configuration;

            tableService = new TableService(Configuration["DailyChallengeTableConnectionString"], Configuration["DailyChallengeTableName"]);
        }
示例#14
0
        public void Minimax_Xwin2()
        {
            var boardString = "OOO|OO.|.XX|OXX|O..|OOO|OXO|..O|.OO|OXX|OOO|.OO|XXX|OX.|OXX|.O.|O..|OXO|XOO|XXX|O.O|XX.|...|OX.|O.X|XXO|XXO";
            var macroboard  = "OOX|TO.|AX.";

            var bot   = new SmartBot();
            var state = new BotState();

            state.Field.MyId = 0;
            state.UltimateBoard.ParseFromString(boardString);
            state.UltimateBoard.ParseMacroboardFromString(macroboard);

            Console.Write(state.UltimateBoard);

            // X should be placed in [2,7] to win [0,2] microboard
            Move move = bot.GetMove(state);

            // More moves available in center-right of microboard
            Assert.IsTrue(move.X == 2 && move.Y == 7, "Actual move is " + move);
        }
示例#15
0
    /// <summary>
    /// Get bot state if present, or set it to the initial state.
    /// </summary>
    /// <param name="id">id of the bot to get</param>
    /// <param name="initial">the initial state to set if not present</param>
    /// <returns></returns>
    public BotState GetOrSetBotState(string id, Vector3 initialPosition, Quaternion initialRotation)
    {
        // NB: if no ID is specified, do not persist state.
        if (id != null && id != "")
        {
            var found = BotStates.Find(state => state.Id == id);

            if (found != null && !found.UseOriginalPosition)
            {
                return(found);
            }
        }

        BotState newState = new BotState {
            Id = id, Position = initialPosition, Rotation = initialRotation
        };

        BotStates.Add(newState);
        return(newState);
    }
示例#16
0
    // Start is called before the first frame update
    void Start()
    {
        history    = new List <Move>();
        controller = GetComponent <CharacterController>();
        animat     = GetComponent <Animator>();
        photonView = GetComponent <PhotonView>();
        rigidbody  = GetComponent <Rigidbody>();
        Destroy(playerCamera);
        Destroy(playerAudio);

        rigidbody.detectCollisions  = false;
        controller.detectCollisions = false;

        // logfile.WriteLine("Second test ");
        StartTime        = PhotonNetwork.Time;
        MyLocalTime      = Time.realtimeSinceStartup;
        fixedUpdateCount = 1;

        BotState = BotState.Standing;
    }
示例#17
0
        public void Minimax_XWin()
        {
            var boardString = "OOO|OO.|.XX|OXX|O..|OOO|OXO|..O|.OO|OXX|OOO|.OO|XXX|OX.|OXX|.O.|O..|OXO|XOO|XXX|O.O|X.X|...|OXX|O.X|XXO|XXO";
            var macroboard  = "OOX|TOX|AXA";

            var bot   = new SmartBot();
            var state = new BotState();

            state.Field.MyId = 0;
            state.UltimateBoard.ParseFromString(boardString);
            state.UltimateBoard.ParseMacroboardFromString(macroboard);

            Console.Write(state.UltimateBoard);

            Move move = bot.GetMove(state);

            // X wins
            Assert.IsTrue(move.X == 7 && move.Y == 6 && move.Score == 100,
                          "Actual move is " + move + " and score = " + move.Score);
        }
示例#18
0
        public void GetMove_FirstMoveBlankBoard()
        {
            var boardString = "...|...|...|...|...|...|...|...|...|...|...|...|...|...|...|...|...|...|...|...|...|...|...|...|...|...|...";
            var macroboard  = "AAA|AAA|AAA";

            var bot   = new SmartBot();
            var state = new BotState();

            state.Field.MyId = 1;
            state.UltimateBoard.ParseFromString(boardString);
            state.UltimateBoard.ParseMacroboardFromString(macroboard);

            Console.Write(state.UltimateBoard);

            Move move = bot.GetMove(state);

            // X moved to row 6 and col 7
            Assert.IsTrue(move.X == 1 && move.Y == 0 && move.Score == 0,
                          "Actual move is " + move + " and score = " + move.Score);
        }
示例#19
0
        public MainBot(ConversationState conversationState, UserState userState, T dialog, ILogger <MainBot <T> > logger)
        {
            if (conversationState == null)
            {
                throw new System.ArgumentNullException(nameof(conversationState));
            }

            if (logger == null)
            {
                throw new System.ArgumentNullException(nameof(logger));
            }

            _conversationState   = conversationState;
            _userState           = userState;
            _logger              = logger;
            _dialog              = dialog;
            _globalStateAccessor = _userState.CreateProperty <GlobalUserState>(nameof(GlobalUserState));

            _logger.LogTrace("Turn start.");
        }
        //If Spike retrace is greater than Level 1 but less than Level 2 set SL to last profit position entry price plus buffer
        override protected bool ExcuteRuleLogic()
        {
            if (BotState.OrdersPlaced && BotState.PositionsRemainOpen())
            {
                //Calculate spike retrace factor
                SpikeManager.CalculateRetraceFactor();

                //Set hard stop losses and activate Trail if Spike has retraced between than retraceLevel1 and retraceLevel2
                if (SpikeManager.IsRetraceBetweenLevel1AndLevel2())
                {
                    //If Hard SL has not been set yet
                    if (BotState.LastProfitPositionEntryPrice > 0)
                    {
                        StopLossManager.SetSLWithBufferForAllPositions(BotState.LastProfitPositionEntryPrice);
                        return(true);
                    }
                }
            }
            return(false);
        }
示例#21
0
 private void Stop(Exception exception = null)
 {
     EnsureIsNotDisposed();
     if (_state != BotState.Started)
     {
         return;
     }
     _processor?.Post(new BotStopped());
     _processor?.Complete();
     _exception = _exception ?? exception;
     if (_exception == null)
     {
         _subject.OnCompleted();
     }
     else
     {
         _subject.OnError(_exception);
     }
     _state = BotState.Stopped;
 }
示例#22
0
    private void LerpMovement(Action startPack, Vector3 endPostion)
    {
        if (startPack.rotationAngle != transform.rotation.eulerAngles.y)
        {
            transform.Rotate(new Vector3(0, (startPack.rotationAngle - transform.rotation.eulerAngles.y), 0));
        }

        if (startPack.shooting == true)
        {
            Shooting();
        }

        if (startPack.animationState == 0 || journeyLength == 0)
        {
            Debug.Log(" should stand !!!!!!!!!!!!################");
            if (BotState != BotState.Standing)
            {
                BotState = BotState.Standing;
                animat.SetInteger("condition", 0);
                sequence_number++;
                currentAction.SetAction(transform.position, startPack.getInput(), sequence_number, PhotonNetwork.Time, 0, transform.rotation.eulerAngles.y, false);
                Debug.Log("got stand");
            }
        }
        else
        {
            animat.SetInteger("condition", 1);
            // Distance moved equals elapsed time times speed..


            // Fraction of journey completed equals current distance divided by total distance.
            float   fractionOfJourney = distCovered / journeyLength;
            Vector3 finalPos          = Vector3.Lerp(startPack.getPostion(), endPostion, fractionOfJourney);
            Vector3 currentPos        = transform.position;

            // Set our position as a fraction of the distance between the markers.

            transform.position = finalPos;
            distCovered        = distCovered + Vector3.Distance(currentPos, finalPos);
        }
    }
示例#23
0
        private void Chase()
        {
            if (!Player)
            {
                State = BotState.IDLE;
                idleStrategy();
                return;
            }

            if (Vector3.Distance(Player.transform.position, transform.position) < 3)
            {
                agent.isStopped = true;
                State           = BotState.ATTACK;
            }
            else
            {
                agent.isStopped   = false;
                agent.destination = Player.transform.position;
                animator.SetBool("isWalking", true);
            }
        }
示例#24
0
        private void _changeTimer_Elapsed(object sender, ElapsedEventArgs e)
        {
            if (Bot.State == BotState.Stopped && Bot.AccountState == AccountState.CaptchaRequired)
            {
                OnOnCaptchaEvent(this, null);
            }

            if (!StateChanged())
            {
                return;
            }
            OnManagerChanged(this);
            _lastName         = Bot.AccountName;
            _lastAccountState = Bot.AccountState;
            _lasBotState      = Bot.State;
            _lastExpPerHour   = ExpPerHour;
            _lastLastLog      = LastLog;
            _lastRunTime      = RunTime;
            _lastTillLevelUp  = TillLevelUp;
            _lastLevel        = Level;
        }
示例#25
0
        public void Minimax_XLose2()
        {
            var boardString = "OOO|OO.|.XX|OXX|O..|OOO|OXO|..O|.OO|OXX|OOO|.OO|XXX|OX.|OXX|.O.|O..|OXO|XOO|XXX|O.O|X.X|...|OXX|O.X|XXO|XXO";
            var macroboard  = "OOX|TOA|.X.";

            var bot   = new SmartBot();
            var state = new BotState();

            state.Field.MyId = 0;
            state.UltimateBoard.ParseFromString(boardString);
            state.UltimateBoard.ParseMacroboardFromString(macroboard);

            Console.Write(state.UltimateBoard);

            // X can't win, so [1,7] is chosen first
            Move move = bot.GetMove(state);

            // X loses
            Assert.IsTrue(move.X == 6 && move.Y == 3 && move.Score == -100,
                          "Actual move is " + move + " and score = " + move.Score);
        }
        public MainMenuDialog(UserState userState) : base(nameof(MainMenuDialog))
        {
            _userState = userState;

            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new ChoicePrompt(nameof(ChoicePrompt)));
            AddDialog(new FoodCategories(userState));
            AddDialog(new DrinkCategories(userState));
            AddDialog(new ReviewOrderDialog(userState));
            AddDialog(new SwitchKB(userState));
            AddDialog(new LUISDemo(userState));
            AddDialog(new CardDemo());
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                MainMenuStepAsync,
                ReviewSelectionStepAsync,
                MainMenuFinalStepAsync
            }));

            InitialDialogId = nameof(WaterfallDialog);
        }
示例#27
0
        /// <summary>
        /// Handles the input change of the local player.
        /// Not all input is specified in the parameters.
        /// </summary>
        public void UpdateLocalInput(Vector3 trackedPosition)
        {
            Vector3 movementInput = new Vector3(Input.GetAxisRaw("Rightward"),
                                                Input.GetAxisRaw("Upward"), Input.GetAxisRaw("Forward"));

            byte[] payload = new byte[(BotState.InputSerializedBitsSize + 7) / 8];
            _sharedBuffer.ClearContents(payload);
            BotState.SerializePlayerInput(_sharedBuffer, movementInput, trackedPosition);

            if (NetworkUtils.IsServer)
            {
                BotCache.SetExtra(NetworkUtils.LocalId, BotCache.Extra.NetworkedPhysics, payload);
            }
            else
            {
                NetworkClient.UdpPayload = payload;
                long key = DoubleProtocol.TimeMillis + Mathf.RoundToInt(NetworkClient.UdpNetDelay + AverageNonNetDelayMillis);
                _guessedInputs.Remove(key);
                _guessedInputs.Add(key, new GuessedInput(movementInput));
            }
        }
示例#28
0
        public MainDialog(HospitalInfoRecognizer luisRecognizer, UserState userState, HospitalFindingDialog hospitalFindingDialog, LocalisationFindingDialog localisationFindingDialog, HospitalCaracteristicsFindingDialog hospitalCaracteristicsFindingDialog, ILogger <MainDialog> logger)
            : base(nameof(MainDialog))
        {
            _luisRecognizer = luisRecognizer;
            Logger          = logger;
            _userState      = userState;
            // The initial child Dialog to run.
            InitialDialogId = nameof(MainDialog);

            //Add Dialogs
            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(hospitalFindingDialog);
            AddDialog(localisationFindingDialog);
            AddDialog(hospitalCaracteristicsFindingDialog);
            AddDialog(new WaterfallDialog(InitialDialogId, new WaterfallStep[]
            {
                IntroStepAsync,
                ActStepAsync,
                FinalStepAsync,
            }));
        }
示例#29
0
        public void SetBreakEvenSLForAllPositions(double breakEvenTriggerPrice, bool withHardSLBuffer)
        {
            double SLBufferPips = 0;

            if (withHardSLBuffer)
            {
                SLBufferPips = HardStopLossBufferPips;
            }


            foreach (Position p in Bot.Positions)
            {
                try
                {
                    if (BotState.IsThisBotId(p.Label))
                    {
                        if (BotState.LastPositionTradeType == TradeType.Buy)
                        {
                            if (breakEvenTriggerPrice > p.EntryPrice)
                            {
                                Bot.ModifyPositionAsync(p, p.EntryPrice + SLBufferPips, p.TakeProfit, OnBreakEvenSLOperationComplete);
                            }
                        }

                        if (BotState.LastPositionTradeType == TradeType.Sell)
                        {
                            if (breakEvenTriggerPrice < p.EntryPrice)
                            {
                                Bot.ModifyPositionAsync(p, p.EntryPrice - SLBufferPips, p.TakeProfit, OnBreakEvenSLOperationComplete);
                            }
                        }
                    }
                }
                catch (Exception e)
                {
                    Bot.Print("FAILED to modify BreakEven Stop Loss:" + e.Message);
                }
            }
        }
示例#30
0
        private void onLoggedIn(SteamUser.LoggedOnCallback callback)
        {
            log.Debug("Logged on callback from Steam");
            if (callback.Result != EResult.OK)
            {
                State = BotState.Failed;

                if (callback.Result == EResult.AccountLogonDenied)
                {
                    log.ErrorFormat("SteamGaurd required for {0}", Logon.Username);
                }
                else
                {
                    log.ErrorFormat("Error logging in to Steam: {0}", callback.Result);
                }

                return;
            }

            PublicIP = callback.PublicIP;
            State    = BotState.LoggedIn;
        }
示例#31
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ActivityHelper{T}"/> class.
 /// </summary>
 /// <param name="logger">Instance to send logs to the Application Insights service.</param>
 /// <param name="userState">State management object for maintaining user conversation state.</param>
 /// <param name="teamStorageProvider">Provider for fetching information about team details from storage.</param>
 /// <param name="localizer">The current culture's string localizer.</param>
 /// <param name="dialog">Base class for all bot dialogs.</param>
 /// <param name="conversationState">State management object for maintaining conversation state.</param>
 /// <param name="teamMembershipHelper">Helper for team operations with Microsoft Graph API.</param>
 /// <param name="userProfileGraphApiHelper">Helper for user profile operations with Microsoft Graph API.</param>
 /// <param name="introductionStorageProvider">Provider for fetching information about new joiner introduction details from storage.</param>
 /// <param name="sharePointHelper">Helper for working with SharePoint.</param>
 /// <param name="introductionCardHelper">Helper for working with introduction cards.</param>
 /// <param name="graphUtility">Instance of Microsoft Graph utility helper.</param>
 /// <param name="welcomeCardFactory">Factory for working with welcome card attachments.</param>
 /// <param name="botOptions">A set of key/value application configuration properties for bot.</param>
 /// <param name="userStorageProvider">Provider for fetching information about user details from storage.</param>
 /// <param name="securityGroupSettings"> A set of key/value application configuration properties for AAD security group settings.</param>
 /// <param name="feedbackProvider">Provider for fetching information about new joiner feedbacks from storage.</param>
 /// <param name="imageUploadProvider">Provider for uploading user image to blob storage.</param>
 public ActivityHelper(
     ILogger <ActivityHelper <T> > logger,
     UserState userState,
     ITeamStorageProvider teamStorageProvider,
     IStringLocalizer <Strings> localizer,
     T dialog,
     ConversationState conversationState,
     ITeamMembership teamMembershipHelper,
     IUserProfile userProfileGraphApiHelper,
     IIntroductionStorageProvider introductionStorageProvider,
     ISharePointHelper sharePointHelper,
     IIntroductionCardHelper introductionCardHelper,
     IGraphUtilityHelper graphUtility,
     IWelcomeCardFactory welcomeCardFactory,
     IOptions <BotOptions> botOptions,
     IUserStorageProvider userStorageProvider,
     IOptions <AadSecurityGroupSettings> securityGroupSettings,
     IFeedbackProvider feedbackProvider,
     IImageUploadProvider imageUploadProvider)
 {
     this.logger                      = logger;
     this.userState                   = userState;
     this.teamStorageProvider         = teamStorageProvider;
     this.localizer                   = localizer;
     this.dialog                      = dialog;
     this.conversationState           = conversationState;
     this.teamOperationGraphApiHelper = teamMembershipHelper;
     this.userProfileGraphApiHelper   = userProfileGraphApiHelper;
     this.introductionStorageProvider = introductionStorageProvider;
     this.sharePointHelper            = sharePointHelper;
     this.introductionCardHelper      = introductionCardHelper;
     this.graphUtility                = graphUtility;
     this.welcomeCardFactory          = welcomeCardFactory;
     this.botOptions                  = botOptions ?? throw new ArgumentNullException(nameof(botOptions));
     this.userStorageProvider         = userStorageProvider;
     this.securityGroupSettings       = securityGroupSettings ?? throw new ArgumentNullException(nameof(securityGroupSettings));
     this.feedbackProvider            = feedbackProvider;
     this.imageUploadProvider         = imageUploadProvider;
 }
        internal void SetState(BotState state, bool ignoreExit = false)
        {
            if (CurrentState.Key == state)
            {
                // we are already in this state
                return;
            }

            LastState = CurrentState.Key;

            // this is used by the combat state because
            // it will override any existing state
            if (!ignoreExit)
            {
                CurrentState.Value.Exit();
            }

            CurrentState = States.First(s => s.Key == state);
            CurrentState.Value.Enter();

            OnStateMachineStateChanged?.Invoke();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="SubmitIdeaActivityHandler"/> class.
 /// </summary>
 /// <param name="logger">Instance to send logs to the logger service.</param>
 /// <param name="localizer">The current cultures' string localizer.</param>
 /// <param name="telemetryClient">The Application Insights telemetry client.</param>
 /// <param name="messagingExtensionHelper">Messaging Extension helper dependency injection.</param>
 /// <param name="userState">State management object for maintaining user conversation state.</param>
 /// <param name="teamPreferenceStorageHelper">Team preference storage helper dependency injection.</param>
 /// <param name="teamPreferenceStorageProvider">Team preference storage provider dependency injection.</param>
 /// <param name="botOptions">A set of key/value application configuration properties for activity handler.</param>
 /// <param name="teamStorageProvider">Provider for fetching information about team details from storage.</param>
 public SubmitIdeaActivityHandler(
     ILogger <SubmitIdeaActivityHandler> logger,
     IStringLocalizer <Strings> localizer,
     TelemetryClient telemetryClient,
     IMessagingExtensionHelper messagingExtensionHelper,
     UserState userState,
     ITeamPreferenceStorageHelper teamPreferenceStorageHelper,
     ITeamPreferenceStorageProvider teamPreferenceStorageProvider,
     IOptions <BotSettings> botOptions,
     ITeamStorageProvider teamStorageProvider)
 {
     this.logger                        = logger;
     this.localizer                     = localizer;
     this.telemetryClient               = telemetryClient;
     this.messagingExtensionHelper      = messagingExtensionHelper;
     this.userState                     = userState;
     this.teamPreferenceStorageHelper   = teamPreferenceStorageHelper;
     this.teamPreferenceStorageProvider = teamPreferenceStorageProvider;
     this.botOptions                    = botOptions ?? throw new ArgumentNullException(nameof(botOptions));
     this.curatorTeamId                 = botOptions.Value.CuratorTeamId;
     this.teamStorageProvider           = teamStorageProvider;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ActivityHandler{T}"/> class.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <param name="localizer">The current culture's string localizer.</param>
 /// <param name="telemetryClient">Instance of telemetry client. </param>
 /// <param name="userState">State management object for maintaining user conversation state.</param>
 /// <param name="adapter">Bot adapter used to handle bot framework HTTP requests.</param>
 /// <param name="conversationState">State management object for maintaining conversation state.</param>
 /// <param name="botOptions">A set of key/value application configuration properties for bot.</param>
 /// <param name="storageOptions">A set of key/value application configuration properties for storage.</param>
 /// <param name="teamStorageProvider">Provider for fetching information about team details from storage.</param>
 /// <param name="userStorageProvider">Provider for fetching information about user details from storage.</param>
 /// <param name="learningPlanHelper">Instance of learning plan helper.</param>
 /// <param name="introductionStorageProvider">Provider for fetching information about new hire introduction details from storage.</param>
 /// <param name="tokenHelper">Helper for JWT token generation and validation.</param>
 /// <param name="activityHelper">Helper for working with bot activity handler.</param>
 /// <param name="notificationCardHelper">Helper for working with bot notification card.</param>
 /// <param name="introductionCardHelper">Helper for working with introduction cards.</param>
 /// <param name="sharePointOptions">A set of key/value application configuration properties for SharePoint.</param>
 /// <param name="dialog">Base class for all bot dialogs.</param>
 public ActivityHandler(
     ILogger <ActivityHandler> logger,
     IStringLocalizer <Strings> localizer,
     TelemetryClient telemetryClient,
     UserState userState,
     IBotFrameworkHttpAdapter adapter,
     ConversationState conversationState,
     IOptions <BotOptions> botOptions,
     IOptions <StorageSettings> storageOptions,
     ITeamStorageProvider teamStorageProvider,
     IUserStorageProvider userStorageProvider,
     ILearningPlanHelper learningPlanHelper,
     IIntroductionStorageProvider introductionStorageProvider,
     ITokenHelper tokenHelper,
     IActivityHelper activityHelper,
     INotificationCardHelper notificationCardHelper,
     IIntroductionCardHelper introductionCardHelper,
     IOptions <SharePointSettings> sharePointOptions,
     T dialog)
 {
     this.logger                      = logger;
     this.localizer                   = localizer;
     this.telemetryClient             = telemetryClient;
     this.userState                   = userState;
     this.adapter                     = adapter;
     this.conversationState           = conversationState;
     this.botOptions                  = botOptions ?? throw new ArgumentNullException(nameof(botOptions));
     this.storageOptions              = storageOptions ?? throw new ArgumentNullException(nameof(storageOptions));
     this.teamStorageProvider         = teamStorageProvider;
     this.userStorageProvider         = userStorageProvider;
     this.learningPlanHelper          = learningPlanHelper;
     this.introductionStorageProvider = introductionStorageProvider;
     this.tokenHelper                 = tokenHelper;
     this.activityHelper              = activityHelper;
     this.notificationCardHelper      = notificationCardHelper;
     this.introductionCardHelper      = introductionCardHelper;
     this.sharePointOptions           = sharePointOptions ?? throw new ArgumentNullException(nameof(sharePointOptions));
     this.dialog                      = dialog;
 }
示例#35
0
        //internal BasicLuisDialog() { }

        protected override async Task MessageReceived(IDialogContext context,
                                                      IAwaitable <Microsoft.Bot.Connector.IMessageActivity> item)
        {
            var msg = await item;

            if (string.IsNullOrEmpty(context.UserData.Get <string>(SPAccessTokenKey)))
            {
                MicrosoftAppCredentials cred = new MicrosoftAppCredentials(
                    ConfigurationManager.AppSettings["MicrosoftAppId"],
                    ConfigurationManager.AppSettings["MicrosoftAppPassword"]);
                StateClient stateClient = new StateClient(cred);
                BotState    botState    = new BotState(stateClient);
                BotData     botData     = await botState.GetUserDataAsync(msg.ChannelId, msg.From.Id);

                context.UserData.SetValue <string>(SPAccessTokenKey, botData.GetProperty <string>(SPAccessTokenKey));
            }

            this.message = new PartialMessage {
                Text = msg.Text
            };
            await base.MessageReceived(context, item);
        }
        public ArtAccountUnlockWithLogin(UserState userstate) : base(nameof(ArtAccountUnlockWithLogin))
        {
            UserState1 = userstate;
            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new ConfirmPrompt(nameof(ConfirmPrompt)));
            AddDialog(new DateResolverDialog());
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                apiCallStep,
                apiCallStep1,
                apiCallStep2,
                confirmSte,
                confirmStep,
                confirmStep1,
                confirmStep3,
                confirmStep4,
                confirmStep5,
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
示例#37
0
 public void isBotAtShip()
 {
     if (((botCurrentlocation.X > shipLocation.X) && (botCurrentlocation.X < shipLocation.X + 50))
        && ((botCurrentlocation.Y > shipLocation.Y) && (botCurrentlocation.Y < shipLocation.Y + 50)))
        {
        //event is raised here when the box is at the ships location.
        OnAtShipLocation();
        botCurrentlocation = shipLocation;
        botState = BotState.waiting;
        }
 }
示例#38
0
 // This method is run when the  assigned\subject ship signals it is out of fuel
 public void OutOfFuelEventHandler(object o, ShipEventArgs e)
 {
     //The local ship location variable is updated with the jubject slocation from the passed in data bucket.
        shipLocation = e.ShipLocation;
        //and the bot starts sailing.
        botState = BotState.SailingtoShip;
 }
示例#39
0
        /// <summary>
        ///   Runs the specified bot state.
        /// </summary>
        /// <param name="botState">State of the bot.</param>
        public void Run(BotState botState)
        {
            GateCampingBotBusinessLogic.CurrentBotState = botState;

              RaisePropertyChanged("Active");
        }
示例#40
0
文件: Bot.cs 项目: Ezzpify/HourBoostr
        /// <summary>
        /// OnDisconnected Callback
        /// Fires when Client disconnects from Steam
        /// Will also fire when setting up an account to re-auth
        /// </summary>
        /// <param name="callback">SteamClient.DisconnectedCallback</param>
        private void OnDisconnected(SteamClient.DisconnectedCallback callback)
        {
            mDisconnectedCounter++;
            mBotState = BotState.LoggedOut;

            if (mIsRunning)
            {
                if (mDisconnectedCounter >= 5)
                {
                    /*If we get too many disconnects it can be because the user has logged on
                    their account and started playing, or steam is down. Either way we'll want
                    to pause so we don't get locked out from Steam due to too many requests in
                    a short period of time*/
                    mLog.Write(Log.LogLevel.Warn, $"Too many disconnects occured in a short period of time. Sleeping for 15 minutes.");
                    Thread.Sleep(TimeSpan.FromMinutes(15));
                    mDisconnectedCounter = 0;
                }

                mLog.Write(Log.LogLevel.Info, $"Reconnecting in 3s ...");
                Thread.Sleep(3000);

                Connect();
            }
        }
示例#41
0
 private void bot_OnStateChanged(BotState state)
 {
     Action refreshTextAction = () => flatStatusBar.Text = "Status : " + state;
     flatStatusBar.Invoke(refreshTextAction);
 }
示例#42
0
 public async Task Stop()
 {
     _state = BotState.Stopping;
 }
    public void MoveTo(Vector2i destination)
    {
        mStuckFrames = 0;

        Vector2i startTile = mMap.GetMapTileAtPoint(mAABB.Center - mAABB.HalfSize + Vector2.one * Map.cTileSize * 0.5f);
        
        if (mOnGround && !IsOnGroundAndFitsPos(startTile))
        {
            if (IsOnGroundAndFitsPos(new Vector2i(startTile.x + 1, startTile.y)))
                startTile.x += 1;
            else
                startTile.x -= 1;
        }

        List<Vector2i> path1 = null;
        var path = mMap.mPathFinder.FindPath(
                        startTile,
                        destination,
                        Mathf.CeilToInt(mAABB.HalfSizeX / 8.0f),
                        Mathf.CeilToInt(mAABB.HalfSizeY / 8.0f),
                        (short)mMaxJumpHeight, false);

        if (path != null)
        {
            path1 = new List<Vector2i>();
            path1.AddRange(path);
        }


        var path2 = mMap.mPathFinder.FindPath(
                        startTile,
                        destination,
                        Mathf.CeilToInt(mAABB.HalfSizeX / 8.0f),
                        Mathf.CeilToInt(mAABB.HalfSizeY / 8.0f),
                        (short)mMaxJumpHeight, true);

        path = path2;
        mGrabsLedges = true;

        if (mLazyLedgeGrabs && path1 != null && path1.Count <= path2.Count + 6)
        {
            path = path1;
            mGrabsLedges = false;
        }

        mPath.Clear();

        if (path != null && path.Count > 1)
        {
            for (var i = path.Count - 1; i >= 0; --i)
                mPath.Add(path[i]);

            mCurrentNodeId = 1;
            mReachedNodeX = false;
            mReachedNodeY = false;
            mCanGrabLedge = false;

            ChangeState(BotState.MoveTo);

            mFramesOfJumping = GetJumpFramesForNode(0, mGrabsLedges);
        }
        else
        {
            mCurrentNodeId = -1;

            if (mCurrentBotState == BotState.MoveTo)
                mCurrentBotState = BotState.None;
        }

        if (!Debug.isDebugBuild)
            DrawPathLines();
    }
示例#44
0
文件: Bot.cs 项目: Ezzpify/HourBoostr
        /// <summary>
        /// This will periodically 
        /// </summary>
        private void VerifyCommunityConnection(object sender, ElapsedEventArgs e)
        {
            if (mBotState != BotState.LoggedInWeb)
            {
                mCommunityTimer.Enabled = false;
                return;
            }

            if (!mSteam.web.VerifyCookies())
            {
                mLog.Write(Log.LogLevel.Warn, $"Cookies were out of date, requesting new user nonce ...");
                mSteam.user.RequestWebAPIUserNonce();
                mBotState = BotState.LoggedIn;
            }
        }
示例#45
0
 // Makes the bot walk to the specified destination
 public void WalkTo(ScenePresence presence, Vector3 destination)
 {
     if (!Util.IsZeroVector(destination - presence.AbsolutePosition))
     {
         walkTo(presence, destination);
         State = BotState.Walking;
         LastFlying = false;
     }
 }
示例#46
0
        // Makes the bot fly to the specified destination
        public void FlyTo(ScenePresence presence, Vector3 destination)
        {
            if (Util.IsZeroVector(destination - presence.AbsolutePosition) == false)
            {
                flyTo(presence, destination);
                State = BotState.Flying;
                LastFlying = true;
            }
            else
            {
                m_movementFlag = (uint)AgentManager.ControlFlags.AGENT_CONTROL_AT_POS;

                OnBotAgentUpdate(presence, Vector3.Zero, m_movementFlag, m_bodyDirection);
                m_movementFlag = (uint)AgentManager.ControlFlags.NONE;
            }
        }
示例#47
0
文件: BotAI.cs 项目: Keos027/source
    protected new void FixedUpdate()
    {
        if (death)
        {
            return;
        }

        if (botState == BotState.Idle)
            anim.CrossFade(IdleAnimation.name);
        else if (botState == BotState.Walk)
            anim.CrossFade(walkAnimation.name);
        else if (botState == BotState.Damage)
            anim.CrossFade(damageAnimation.name);
        else if (botState == BotState.Attack)
            anim.CrossFade(attackAnimation.name);
        else if (botState == BotState.Death)
            anim.CrossFade(deathAnimation.name);

        if (health <= 0)
        {
            botState = BotState.Death;
        }

        if (health <= 0 && !goToHeaven)
        {
            goToHeaven = true;
            tag = "Untagged";
            target = null;
            canMove = false;
            canSearch = false;
            botState = BotState.Death;
            StartCoroutine(Die());
            return;
        }

        if (!GameObject.FindWithTag("Player")) return;

        if (!death)
            target = GameObject.FindWithTag("Player").transform;
        else
            target = null;

        if (attack || damage) return;

        if (Vector3.Distance(transform.position, target.position) > distanceToPlayer && !attack && health > 0 && !damage)
        {
            anim.CrossFade(IdleAnimation.name);
            return;
        }
        else if (Vector3.Distance(transform.position, target.position) <= distanceToPlayer)
        {
            //Get velocity in world-space
            Vector3 velocity;
            if (canMove)
            {

                //Calculate desired velocity
                Vector3 dir = CalculateVelocity(GetFeetPosition());

                //Rotate towards targetDirection (filled in by CalculateVelocity)
                if (targetDirection != Vector3.zero)
                {
                    RotateTowards(targetDirection);
                }

                if (dir.sqrMagnitude > sleepVelocity * sleepVelocity)
                {
                    //If the velocity is large enough, move
                }
                else
                {
                    //Otherwise, just stand still (this ensures gravity is applied)
                    dir = Vector3.zero;
                }

                if (navController != null)
                    navController.SimpleMove(GetFeetPosition(), dir);
                else if (controller != null)
                    controller.SimpleMove(dir);
                else
                    Debug.LogWarning("No NavmeshController or CharacterController attached to GameObject");

                velocity = controller.velocity;
            }
            else
            {
                velocity = Vector3.zero;
            }
        }

        if (health > 0 && !damage && !attack && Vector3.Distance(transform.position, target.position) > 2)
            botState = BotState.Walk;
    }
示例#48
0
文件: BotAI.cs 项目: Keos027/source
 IEnumerator DoAttack()
 {
     attack = true;
     botState = BotState.Attack;
     yield return new WaitForSeconds(attackAnimation.length);
     attack = false;
 }
示例#49
0
 // This method is run when the  assigned\subject ship signals it is full of fuel.
 public void FullOfFuelEventhandler(object o, EventArgs e)
 {
     botCurrentlocation = botStartingLocation;
        botState = BotState.waiting;
 }
示例#50
0
文件: Bot.cs 项目: Ezzpify/HourBoostr
        /// <summary>
        /// Authenticates user to community
        /// </summary>
        private void UserWebLogOn()
        {
            try
            {
                if (mSteam.web.Authenticate(mSteam.uniqueId, mSteam.client, mSteam.nounce))
                {
                    mLog.Write(Log.LogLevel.Success, $"User authenticated!");
                    mBotState = BotState.LoggedInWeb;

                    /*If we should go online*/
                    if (mAccountSettings.ShowOnlineStatus)
                        mSteam.friends.SetPersonaState(EPersonaState.Online);

                    /*If we should join the steam group
                    This is done mainly for statistical purposes*/
                    if (mAccountSettings.JoinSteamGroup)
                    {
                        var data = new NameValueCollection()
                        {
                            { "sessionID", mSteam.web.mSessionId },
                            { "action", "join" }
                        };

                        mSteam.web.Request(EndPoint.STEAM_GROUP_URL, "POST", data);
                    }

                    /*Start the timer to periodically refresh community connection*/
                    if (!mCommunityTimer.Enabled)
                    {
                        mCommunityTimer.Interval = TimeSpan.FromMinutes(15).TotalMilliseconds;
                        mCommunityTimer.Elapsed += new ElapsedEventHandler(VerifyCommunityConnection);
                        mCommunityTimer.Start();
                    }
                }
            }
            catch (Exception ex)
            {
                mLog.Write(Log.LogLevel.Error, $"Error on UserWebLogon: {ex.Message}");
            }
        }
 public void ChangeState(BotState newState)
 {
     mCurrentBotState = newState;
 }
示例#52
0
文件: Bot.cs 项目: Ezzpify/HourBoostr
        /// <summary>
        /// OnLoggedOn Callback
        /// Fires when User logs in successfully
        /// </summary>
        /// <param name="callback">SteamUser.LoggedOnCallback</param>
        private void OnLoggedOn(SteamUser.LoggedOnCallback callback)
        {
            switch (callback.Result)
            {
                case EResult.AccountLogonDenied:
                    mLog.Write(Log.LogLevel.Text, $"Enter the SteamGuard code from your email:");
                    mSteam.loginDetails.AuthCode = Console.ReadLine();
                    return;

                case EResult.AccountLoginDeniedNeedTwoFactor:
                    mLog.Write(Log.LogLevel.Text, $"Enter your two-way authentication code:");
                    mSteam.loginDetails.TwoFactorCode = Console.ReadLine();
                    return;

                case EResult.InvalidPassword:
                    mLog.Write(Log.LogLevel.Warn, $"The password was not accepted.");
                    if (!mHasConnectedOnce && !string.IsNullOrWhiteSpace(mAccountSettings.Details.LoginKey))
                    {
                        /*Remove LoginKey if we haven't been logged in before*/
                        mLog.Write(Log.LogLevel.Info, $"Removed LoginKey for this account because it's invalid");
                        mSteam.loginDetails.LoginKey = string.Empty;
                        mAccountSettings.Details.LoginKey = string.Empty;
                    }
                    else if (string.IsNullOrWhiteSpace(mAccountSettings.Details.Password))
                    {
                        /*Re-input password if no password was set in settings*/
                        mLog.Write(Log.LogLevel.Text, $"Re-enter your Steam password:"******"Invalid two factor code! Try again:");
                    mSteam.loginDetails.TwoFactorCode = Console.ReadLine();
                    return;

                case EResult.Timeout:
                case EResult.NoConnection:
                case EResult.TryAnotherCM:
                case EResult.ServiceUnavailable:
                    mLog.Write(Log.LogLevel.Warn, $"Service unavailable. We'll force a pause here.");
                    mDisconnectedCounter = 4;
                    return;
            }

            /*We didn't account for what happened*/
            if (callback.Result != EResult.OK)
            {
                mLog.Write(Log.LogLevel.Warn, $"Unhandled EResult response. Please report this issue. --> {callback.Result}");
                return;
            }

            /*Logged in successfully*/
            mLog.Write(Log.LogLevel.Success, $"Successfully logged in!");
            mSteam.nounce = callback.WebAPIUserNonce;
            mBotState = BotState.LoggedIn;

            mHasConnectedOnce = true;
            mDisconnectedCounter = 0;
            mPlayingBlocked = false;

            LogOnSuccess();
        }
示例#53
0
文件: BotAI.cs 项目: Keos027/source
 IEnumerator DoDamage()
 {
     botState = BotState.Damage;
     yield return new WaitForSeconds(damageAnimation.length);
     damage = false;
 }
示例#54
0
文件: BotAI.cs 项目: Keos027/source
 public new void Start()
 {
     tag = "Enemy";
     botState = BotState.Idle;
     canMove = true;
     canSearch = true;
     //Call Start in base script (AIPath)
     health = defaultHealth;
     base.Start ();
 }