Hello, in "script can condition" put code like :
return wManager.Wow.ObjectManager.ObjectManager.Me.Level >= 5 && wManager.Wow.ObjectManager.ObjectManager.Me.Level <= 15;
Replace 5 by the minimum level, 15 by the maximum level (in the current code, the bot will buy your item if the level is equal to or bigger than 5 and equal to or lower than 15).
Hello,
No tested, but you can try this plugin : CastSpellByName to Cast Macro.cs
using robotManager.Helpful;
public class Main : wManager.Plugin.IPlugin
{
public void Initialize()
{
Logging.Write("CastSpellByName to /cast plugin loaded.");
robotManager.Events.Events.OnCustomEvent += OnEventsOnOnCustomEvent;
}
private void OnEventsOnOnCustomEvent(string name, object[] args, System.ComponentModel.CancelEventArgs cancelable)
{
if (name.StartsWith("SpellManager.CastSpellByName") &&
args.Length >= 1 &&
args[0] is string)
{
var spellName = (string)args[0];
if (!string.IsNullOrWhiteSpace(spellName)){
string luaUnit = null;
if (args.Length >= 2 &&
args[1] is string)
luaUnit = (string)args[1];
cancelable.Cancel = true;
if (!string.IsNullOrWhiteSpace(luaUnit) && luaUnit != "player")
{
Logging.WriteDebug("Casting " + spellName + " on " + luaUnit + " with macro /cast");
wManager.Wow.Helpers.Lua.RunMacroText("/cast [@" + luaUnit + "] " + spellName);
}
else
{
Logging.WriteDebug("Casting " + spellName + " with macro /cast");
wManager.Wow.Helpers.Lua.RunMacroText("/cast " + spellName);
}
}
}
}
public void Dispose()
{
robotManager.Events.Events.OnCustomEvent -= OnEventsOnOnCustomEvent;
}
public void Settings()
{
}
}
I haven't tested, but this plugin should enable fight classes that use the bot method "CastSpellByNameOn" (which is the case for most fight classes) to force the bot to use "/cast ..." instead. Therefore, use this plugin with your fight class configured normally (without using "/cast").