Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Entire fight class in LUA?

Featured Replies

Hi there,

I have lots of experience in writing entire combat scripts in LUA, is it possible to do that with WRobot?

If I use the FightClass editor and call my script "Warlock" for example, can I then put an entire rotation in LUA and use the "Not spell, is lua script" option?

If so, is there a "template" or wrapper I should be using as a base for the rotations?

Many thanks

Ofrex35

Hello,

Yes you can  use fightclass editor with the option "Not spell, is lua script" with timer option to avoid spamming lua commands.

 

Or you can use C# fightclass (sample of structure) :

using System;
   using System.Threading;
   using System.Windows.Forms;
   using robotManager.Helpful;
   using wManager.Wow.Helpers;
   using wManager.Wow.ObjectManager;

   public class Main : ICustomClass
   {
       public float Range { get { return 4.5f; } }

       private bool _isLaunched;
       private ulong _lastTarget;

       public void Initialize()
       {
           _isLaunched = true;
           Logging.Write("[My fightclass] Is initialized.");
           Rotation();
       }

       public void Dispose()
       {
           _isLaunched = false;
           Logging.Write("[My fightclass] Stop in progress.");
       }

       public void ShowConfiguration()
       {
           MessageBox.Show("[My fightclass] No setting for this Fight Class.");
       }


       internal void Rotation()
       {
           Logging.Write("[My fightclass] Is started.");
           while (_isLaunched)
           {
               try
               {
                   if (Conditions.InGameAndConnectedAndProductStartedNotInPause)
                   {
                       if (ObjectManager.Me.IsAlive)
                       {
                           if (Fight.InFight &&
                               ObjectManager.Me.Target.IsNotZero())
                           {
                               OneTimePerCombatTasks();
                               CombatTasks();
                           }
                           else
                           {
                               OutOfCombatTasks();
                           }
                       }
                   }
               }
               catch (Exception e)
               {
                   Logging.WriteError("[My fightclass] ERROR: " + e);
               }

               Thread.Sleep(250); // Pause to reduce the CPU usage, you can increment sleep time.
           }
           Logging.Write("[My fightclass] Is now stopped.");
       }

       internal void OutOfCombatTasks()
       {
           if (ObjectManager.Me.IsMounted)
               return;
           
           Lua.LuaDoString(@"

--[[ Your Lua code here ]]--
print('Out of combat tasks');

        ");
           
       }
       internal void OneTimePerCombatTasks()
       {
           if (ObjectManager.Me.Target == _lastTarget)
               return;
           _lastTarget = ObjectManager.Me.Target;
           
           Lua.LuaDoString(@"

--[[ Your Lua code here ]]--
print('One time per combat tasks');

        ");
       }

       internal void CombatTasks()
       {
           Lua.LuaDoString(@"

--[[ Your Lua code here ]]--
print('Combat tasks');

        ");
       }
   }

 

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.