Example #1
0
 void Awake()
 {
     LogBot.AddLog("Start Bot.", LogType.Log);
     DontDestroyOnLoad(base.gameObject);
     my_players       = new List <int>();
     prioritet_player = new List <int>();
 }
Example #2
0
    void Start()
    {
        permament_memory = new Dictionary <string, List <string> >();
        ApledEngine();
        main_list = new List <MyMemory>();
        FileInfo info = new FileInfo(MemPath);

        if (info.Exists)
        {
            string[] text   = File.ReadAllLines(MemPath);
            bool     glag45 = false;
            foreach (string line in text)
            {
                if (line.Trim() != "")
                {
                    if (line.StartsWith("#permament_memory#"))
                    {
                        glag45 = true;
                    }
                    else if (line.StartsWith("#end_permament_memory#"))
                    {
                        glag45 = false;
                    }
                    if (glag45 && line.Contains("$-$"))
                    {
                        string[] dtt   = line.Split(new string[] { "$-$" }, StringSplitOptions.RemoveEmptyEntries);
                        string   key   = dtt[0].Trim();
                        string   value = dtt[1].Trim();
                        if (!permament_memory.ContainsKey(key))
                        {
                            permament_memory.Add(key, value.Split(new string[] { "\\" }, StringSplitOptions.RemoveEmptyEntries).ToList());
                        }
                        else
                        {
                            LogBot.AddLog("Repait Keys " + key, LogType.Error);
                        }
                    }
                    else if (line.Contains("-||-"))
                    {
                        string[] str1 = line.Split(new string[] { "-||-" }, StringSplitOptions.RemoveEmptyEntries);
                        MyMemory mm   = new MyMemory();
                        foreach (string vopr in str1[0].Split(new string[] { "\\" }, StringSplitOptions.RemoveEmptyEntries))
                        {
                            mm.Addvopros(vopr.Trim().ToLower());
                        }
                        foreach (string vopr in str1[1].Split(new string[] { "\\" }, StringSplitOptions.RemoveEmptyEntries))
                        {
                            mm.Addotvet(vopr.Trim());
                        }
                        main_list.Add(mm);
                    }
                }
            }
        }
        else
        {
            File.WriteAllText(MemPath, "", Encoding.UTF8);
        }
    }
Example #3
0
 void RemoveFocusedPlayer(int ID)
 {
     if (!my_players.Contains(ID))
     {
         my_players.Remove(ID);
         LogBot.AddLog("Remove Focused player " + ID, LogType.Log);
     }
     else
     {
         LogBot.AddLog("Contains Remove Focused player " + ID, LogType.Warning);
     }
 }
Example #4
0
 void AddFocusedPlayer(int ID)
 {
     if (!my_players.Contains(ID))
     {
         my_players.Add(ID);
         LogBot.AddLog("Focused player " + ID, LogType.Log);
     }
     else
     {
         LogBot.AddLog("Contains player in Focused player " + ID, LogType.Warning);
     }
 }
Example #5
0
 string list(string keys)
 {
     if (permament_memory.ContainsKey(keys))
     {
         if (permament_memory[keys].Count > 0)
         {
             return(permament_memory[keys][UnityEngine.Random.Range(0, permament_memory[keys].Count)]);
         }
         else
         {
             LogBot.AddLog("List Clean Key:" + keys, LogType.Error);
             return("");
         }
     }
     else
     {
         LogBot.AddLog("Key Not Found! Key:" + keys, LogType.Error);
         return("");
     }
 }
Example #6
0
 void SendMessage(string text, PhotonPlayer player = null)
 {
     FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, new object[] { text, myName });
     LogBot.AddLog("Send Message " + text, LogType.Log);
 }