private void RandomMovingRoutin(Object threadContext) { if (null == m_owner) return; UpdateInfo result = new UpdateInfo(m_stepID, this); OnCmdUpdated.Invoke(result); while (!isToQuitRandomChating) { } }
public bool Execute() { if (null != m_owner.Client) { bool isCancel = (bool)m_owner.Bot.Assignment.GetStepByID(m_stepID).Params["isCancel"]; m_owner.Client.Self.Fly(!isCancel); UpdateInfo info = new UpdateInfo(m_stepID, this); info.Description = "Fly:" + isCancel.ToString(); info.Status = UpdateInfo.CommandStatus.CMD_SUCCESS; OnCmdUpdated.Invoke(info); } return false; }
public bool Execute() { bool ret = false; if (null != m_owner) { if (null != m_owner.Client) { string msg = (string)m_owner.Bot.Assignment.GetStepByID(m_stepID).Params["message"]; m_owner.Client.Self.Chat(msg, 0, ChatType.Shout); UpdateInfo info = new UpdateInfo(m_stepID, this); info.Description = "Chat:" + msg; info.Status = UpdateInfo.CommandStatus.CMD_SUCCESS; OnCmdUpdated.Invoke(info); } } return ret; }
public bool Execute() { bool ret = false; if (m_owner != null) { if (null != m_owner.Client) { m_owner.Client.Network.OnConnected += new NetworkManager.ConnectedCallback(OnConnected); LoginParams clientLogin = m_owner.Client.Network.DefaultLoginParams(m_owner.Bot.Info.Firstname, m_owner.Bot.Info.Lastname, m_owner.Bot.Info.Password, "OpenSimBot", "Test"); UpdateInfo info = new UpdateInfo(m_stepID, this); BotAgent.BotAssignment.TestStep step = m_owner.Bot.Assignment.GetStepByID(m_stepID); clientLogin.URI = step.Params["servURI"].ToString(); if (m_owner.Client.Network.Login(clientLogin)) { ret = true; m_loginEvent.WaitOne(LOGIN_TIMEOUT); m_log.Info("BOT:" + m_owner.Bot.Info.Firstname + " " + m_owner.Bot.Info.Lastname + "Successfully to connect with the remote simulator."); info.Status = UpdateInfo.CommandStatus.CMD_SUCCESS; } else { m_log.Error("BOT:" + m_owner.Bot.Info.Firstname + " " + m_owner.Bot.Info.Lastname + "Fail to connect with the remote simulator."); info.Status = UpdateInfo.CommandStatus.CMD_FAIL; } info.Description = m_owner.Client.Network.LoginMessage; OnCmdUpdated.Invoke(info); } } return ret; }
public bool Execute() { if (null != m_owner.Client) { ulong globalX = (ulong)m_owner.Bot.Assignment.GetStepByID(m_stepID).Params["globalX"]; ulong globalY = (ulong)m_owner.Bot.Assignment.GetStepByID(m_stepID).Params["globalY"]; float z = (float)m_owner.Bot.Assignment.GetStepByID(m_stepID).Params["z"]; m_owner.Client.Self.AutoPilot(globalX, globalY, z); UpdateInfo info = new UpdateInfo(m_stepID, this); info.Description = "Bot{" + m_owner.Bot.Info.Firstname + " " + m_owner.Bot.Info.Lastname + "}" + "move to {" + globalX.ToString() + "," + globalY.ToString() + "," + z.ToString() + "}"; info.Status = UpdateInfo.CommandStatus.CMD_SUCCESS; OnCmdUpdated.Invoke(info); } return false; }
private void RandomMovingRoutin(Object threadContext) { if (null == m_owner) return; UpdateInfo result = new UpdateInfo(m_stepID, this); OnCmdUpdated.Invoke(result); while (!isToQuitRandomMoving) { if (0 == (random.Next() % 2)) { m_owner.Client.Self.Movement.AlwaysRun = true; } else { m_owner.Client.Self.Movement.AlwaysRun = false; } Vector3 pos = new Vector3(random.Next(100), random.Next(100), random.Next(100)); m_owner.Client.Self.Movement.TurnToward(pos); m_owner.Client.Self.Movement.AtPos = true; Thread.Sleep(random.Next(2000, 100000)); m_owner.Client.Self.Movement.AtPos = false; } }