August 14, 20223 yr Hello everyone, especially DroidZ! How works subj under the hood? It used for like Usefuls.Latency => return Random(LatencyMin, LatencyMax) or Thread.Sleep(Random(LatencyMin, LatencyMax)) or smth? If Engine.StartEngine method has default 16fps framerate, so LatencyMax should be less than 625ms ? I want to understand, how to tune LatencyMin & Engine.framerate for lower CPU using, meanwhile fighting with lowest latency between hits.
August 15, 20223 yr Hello, It's more for network latency than the delay to interact with the game. In the bot, before/after action, I generally use code like "Sleep(Usefuls.Latency + XXms)". Actual code used to get "Latency" : /// <summary> /// Gets the latency (between <see cref="wManagerSetting.LatencyMax"/> and <see cref="wManagerSetting.LatencyMin"/>, to get real latency use <see cref="LatencyReal"/>). /// </summary> /// <value>The latency.</value> public static int Latency { get { lock (_lockLatency) { try { var real = LatencyReal; if (real > wManagerSetting.CurrentSetting.LatencyMax) real = wManagerSetting.CurrentSetting.LatencyMax; if (real < wManagerSetting.CurrentSetting.LatencyMin) real = wManagerSetting.CurrentSetting.LatencyMin; return real; } catch (Exception e) { Logging.WriteError("Latency: " + e); return 0; } } } } private static readonly Object _lockLatencyReal = new Object(); /// <summary> /// Gets the real latency (home+world)). /// </summary> /// <value>The real latency.</value> public static int LatencyReal { get { lock (_lockLatencyReal) { try { if (!_timerLatency.IsReady || !Conditions.InGameAndConnectedAndAlive) return _lastLatency; _timerLatency = new Timer(30 * 1000); var result = Lua.LuaDoString<int>("local _, _, lag = GetNetStats(); return lag;"); if (result > 0) _lastLatency = result; return _lastLatency; } catch (Exception e) { Logging.WriteError("LatencyReal: " + e); return 0; } } } }
August 16, 20223 yr Author So the only option for lower CPU consuming is engine's framerate ? Besides ingame performance
August 16, 20223 yr You can use low FPS in game. But you need to use optimised fightclass/plugins/profile (try to call lua codes between lock/unlockframe) You can also change settings : https://wrobot.eu/byme/doc/html/F-wManager.wManagerSetting.ReadObjectManagerFTS.htm https://wrobot.eu/byme/doc/html/F-robotManager.MemoryClass.Hook.SleepTimeWaitCalled.htm https://wrobot.eu/byme/doc/html/F-wManager.wManagerSetting.EventsLuaWithArgsWaitTime.htm And use code like robotManager.Events.FiniteStateMachineEvents.OnAfterRunState += (engine, state) => { Thread.Sleep(10); };
August 17, 20223 yr Author What is default values of them ? - nvm, I can read it )) What for engine.framerate then?
Create an account or sign in to comment