Ejemplo n.º 1
0
        protected override void CombatRoutine(GUnit Cible)
        {
            Cible.Target();
            deplacement(Cible);
            CastSpell("Attaque auto");
            int i = 0;

            //SendConsole("------", ConsoleLvl.High);
            //  showTargetlist();
            while (Cible.IsAlive && localPlayer.IsAlive)
            {
                if (BreakCurActionB == true)
                {
                    BreakCurActionB = false;
                    break;
                }
                LuaVM.DoString(LuaHelp.AttackingTarget);

                Repositionnement(Cible);

                Thread.Sleep(200);
                if (!Cible.inCombat || !localPlayer.inCombat)
                {
                    Cible.Target();
                    Thread.Sleep(100);
                    CastSpell("Attaque auto");
                }
                i++;
                TargetList.Sort();
            }
            //showTargetlist();
            // SendConsole("Something stopped : " + (TargetList[0].Target == Cible).ToString() + " " + i.ToString(), ConsoleLvl.High);
        }
Ejemplo n.º 2
0
        protected override void CombatRoutine(GUnit Cible)
        {
            if (waitTankPull)
            {
                if (BotHelper.CombatTime(Cible) < TimeSpan.FromMilliseconds(1000))
                {
                    // combat vien juste de commencer
                    Thread.Sleep(timeToWaitPull);
                }
            }

            while (Cible.IsAlive && localPlayer.IsAlive)
            {
                if (BreakCurActionB == true)
                {
                    BreakCurActionB = false;
                    break;
                }
                LuaVM.DoString(LuaHelp.AttackingTarget);

                Repositionnement(Cible);
                if (!Cible.inCombat || !localPlayer.inCombat)
                {
                    Cible.Target();
                    Thread.Sleep(100);
                }
                Thread.Sleep(200);

                TargetList.Sort();
            }
        }
Ejemplo n.º 3
0
 public void Close()
 {
     if (L != null)
     {
         L.Close();
         L = null;
     }
 }
Ejemplo n.º 4
0
    public void Launch()
    {
        TextAsset mainScript = Resources.Load(StartScriptPath) as TextAsset;
        string    mainText   = mainScript.ToString();

        TextAsset initScript = Resources.Load(InitScriptPath) as TextAsset;
        string    initText   = initScript.ToString();

        L = new LuaVM(mainText, initText);
        L.Start();
    }
Ejemplo n.º 5
0
        public static void InitLuaModule(LuaVM vm)
        {
            var script = vm.GetScriptObject();



            var t = new Table(script);

            t["GetTextFromFile"] = (Func <string, string>)(GetTextFromFile);
            t["IsDebug"]         = (Func <bool>)(IsDebug);

            vm.SetGlobal("UnityOs", t);
        }
Ejemplo n.º 6
0
        private void OnEnable()
        {
            if (this.L != null)
            {
                return;
            }

            var luaVM = LuaVM.Create();

            this.L = luaVM.L;

            ExposeNativeTypes(this.L);
        }
Ejemplo n.º 7
0
    private void Start()
    {
        Debug.Log("Start called");
        commandVM = new LuaVM(LuaVM.VMSettings.None);
        commandVM.AttachCustomAPI(typeof(CommandApi));

        Logger.OnLog += Logger_OnLog;
        Application.logMessageReceived += Application_logMessageReceived;
        Debug.Log("Attach logged");

        //Set commands as default (not cmd.simg but only simg)
        commandVM.ExecuteString("simg = cmd.simg");
        commandVM.ExecuteString("spawn = cmd.spawn");
    }
Ejemplo n.º 8
0
        protected override void HealRoutine(GUnit Cible)
        {
            Cible.Target();

            while (Cible.Health != 1.0)
            {
                if (BreakCurActionB == true)
                {
                    BreakCurActionB = false;
                    break;
                }
                LuaVM.DoString(LuaHelp.HealingTarget);
                Thread.Sleep(200);
            }
        }
Ejemplo n.º 9
0
 public static void InitLibraries(LuaVM vm)
 {
     UnityOs.InitLuaModule(vm);
     ModifiersManager.InitLuaModule();
     ChunkFinder.InitLuaModule();
     SimpleOrderManager.InitLuaModule();
     GameMoveManager.InitLuaModule();
     AI_Calculation.InitLuaModule();
     PathCalcManager.InitLuaModule();
     FlagManager.InitLuaModule();
     ProgressUnitBar.InitLuaModule();
     LuaChunkManager.InitLuaModule();
     ErrorBar_HTML.InitLuaModule();
     LuaHelper.InitLuaModule();
     ResearchManager.InitLuaModule();
 }
Ejemplo n.º 10
0
        void Awake()
        {
            Script.DefaultOptions.ScriptLoader = new UnityAssetsScriptLoader();


            Vm = new LuaVM(CoreModules.Preset_Complete, new string[]
            {
                "Assets/Resources/Scripts/LuaScripts/?",
                "Assets/Resources/Scripts/LuaScripts/?.txt",
                "Resources/Scripts/LuaScripts/?",
                "Resources/Scripts/LuaScripts/?.txt",
                "Scripts/LuaScripts/?",
                "Scripts/LuaScripts/?.txt",

                "Assets/Resources/Scripts/LuaScripts/?/?",
                "Assets/Resources/Scripts/LuaScripts/?/?.txt",
                "Resources/Scripts/LuaScripts/?/?",
                "Resources/Scripts/LuaScripts/?/?.txt",
                "Scripts/LuaScripts/?/?",
                "Scripts/LuaScripts/?/?.txt",

                "Assets/Resources/Scripts/LuaScripts/?/?/?",
                "Assets/Resources/Scripts/LuaScripts/?/?/?.txt",
                "Resources/Scripts/LuaScripts/?/?/?",
                "Resources/Scripts/LuaScripts/?/?/?.txt",
                "Scripts/LuaScripts/?/?/?",
                "Scripts/LuaScripts/?/?/?.txt",
            });
            ScriptObj = Vm.GetScriptObject();

            LuaLibrariesIniter.InitLibraries(Vm);

            //UnityOs.IsDebugCheck = true;

            var fileText  = UnityOs.GetTextFromFile("main");
            var EvoEngine = Vm.ExecuteString(fileText);
            var main      = EvoEngine.Table.Get("Main");

            InitForLua();

            Vm.Call(main);
        }
Ejemplo n.º 11
0
    /// <summary>
    /// Adds the API to lua instance.
    /// </summary>
    /// <param name="luaInstance">Lua instance.</param>
    public void AddAPIToLuaInstance(LuaVM luaInstance)
    {
        // Set our parent
        m_ParentVM = luaInstance;

        // Make a new table
        Table apiTable = m_ParentVM.AddGlobalTable(m_APIName);

        if (apiTable != null)
        {
            // Set the api table
            m_ApiTable = apiTable;

            // Hand over to the API derived type to fill in the table
            InitialiseAPITable();
        }
        else
        {
            Debug.Log($"Failed to Initilise API {m_APIName}");
        }
    }
Ejemplo n.º 12
0
        protected override void CombatRoutine(GUnit Cible)
        {
            while (Cible.IsAlive && localPlayer.IsAlive)
            {
                if (BreakCurActionB == true)
                {
                    BreakCurActionB = false;
                    break;
                }
                LuaVM.DoString(LuaHelp.AttackingTarget);

                Repositionnement(Cible);
                if (!Cible.inCombat || !localPlayer.inCombat)
                {
                    Cible.Target();
                    Thread.Sleep(100);
                }
                Thread.Sleep(200);

                TargetList.Sort();
            }
        }
Ejemplo n.º 13
0
 private void ReadBody()
 {
     bodySize = reader.ReadUInt32();
     var l = new LuaVM(reader.BaseStream);
 }
 // Use this for initialization
 void Start()
 {
     vm = new LuaVM();
     UserData.RegisterProxyType <LuaProxyGameObject, GameObject>(r => new LuaProxyGameObject(r));
 }
Ejemplo n.º 15
0
 public StdLib(LuaVM vm)
 {
     this.vm = vm;
     this.Init_package();
 }
 // Start is called before the first frame update
 void Start()
 {
     virtualM = new LuaVM();
     virtualM.ExecuteString(luaCode);
 }