ESO bot 2.2.4.3 Scripting Fixes
Posted: Thu Apr 11, 2019 1:21 am
April 10, 2019 MMOViperBot Version 2.2.4.3
All Bots:
- Added: Scripting Event: OnNextTask -> Fired when a new patrol/campaign task is about to be executed.
- Bugfix: Adding Tasks to plugins works again, Add tasks, set NeedsToRun to be true if tasks.count > 0, bot will perform all tasks then take back control.
- Removed: Removed Scripting Events, OnRez, OnDeath
- Added: Scripting Event: OnBotStatusChanged -> Fired when the bot status changes. See ENUMS. ie. isPausesd, isDead, isRezzing, isRunningPlugin
- Fixed: Scaled Right Click Task (was pressing left click by mistake)
ESO Bot:
- Bugfix: Fixed crash bug when logging chat to window tab 2
Note: How to use OnNext task in your plugin:
private bool bNeedsToRun = false;
public bool NeedsToRun
{
get
{
//If plugin needs processing time from bot, edit bNeedsToRun to be true...
//Bot will then call DoRun below... Once done, it will flag needs to run as false again...
if (_Tasks.Count > 0)
bNeedsToRun = true;
//NeedsToRun = false in OnIdle -> Means we finished our _Tasks!
// Return true if plugin needs processor time
return bNeedsToRun;
}
}
public void OnBotStart(IGame bot)
{
// Instantiate the Bot Field
myGame = bot;
ITaskManager tm = myGame.GetTaskManager;
tm.OnNextTask += Tm_OnNextTask;
}
private void Tm_OnNextTask(ref string txtTask, ref bool bHandled)
{
if (bHandled)
return;
myGame.Log.WriteLine("Plugin OnNextTask -> " + txtTask + " : handled= " + bHandled);
if (txtTask.Contains("Pause"))
{
_Tasks.Add("Rest: 5000");
myGame.Log.WriteLine("PluginTask -> Adding Pause 5000");
bHandled = true;
}
}
public void OnIdle()
{
bNeedsToRun = false;
/* Do Nothing */
}
All Bots:
- Added: Scripting Event: OnNextTask -> Fired when a new patrol/campaign task is about to be executed.
- Bugfix: Adding Tasks to plugins works again, Add tasks, set NeedsToRun to be true if tasks.count > 0, bot will perform all tasks then take back control.
- Removed: Removed Scripting Events, OnRez, OnDeath
- Added: Scripting Event: OnBotStatusChanged -> Fired when the bot status changes. See ENUMS. ie. isPausesd, isDead, isRezzing, isRunningPlugin
- Fixed: Scaled Right Click Task (was pressing left click by mistake)
ESO Bot:
- Bugfix: Fixed crash bug when logging chat to window tab 2
Note: How to use OnNext task in your plugin:
private bool bNeedsToRun = false;
public bool NeedsToRun
{
get
{
//If plugin needs processing time from bot, edit bNeedsToRun to be true...
//Bot will then call DoRun below... Once done, it will flag needs to run as false again...
if (_Tasks.Count > 0)
bNeedsToRun = true;
//NeedsToRun = false in OnIdle -> Means we finished our _Tasks!
// Return true if plugin needs processor time
return bNeedsToRun;
}
}
public void OnBotStart(IGame bot)
{
// Instantiate the Bot Field
myGame = bot;
ITaskManager tm = myGame.GetTaskManager;
tm.OnNextTask += Tm_OnNextTask;
}
private void Tm_OnNextTask(ref string txtTask, ref bool bHandled)
{
if (bHandled)
return;
myGame.Log.WriteLine("Plugin OnNextTask -> " + txtTask + " : handled= " + bHandled);
if (txtTask.Contains("Pause"))
{
_Tasks.Add("Rest: 5000");
myGame.Log.WriteLine("PluginTask -> Adding Pause 5000");
bHandled = true;
}
}
public void OnIdle()
{
bNeedsToRun = false;
/* Do Nothing */
}