diff --git a/modules/perform.cpp b/modules/perform.cpp index 6d64ee7a..351c72f2 100644 --- a/modules/perform.cpp +++ b/modules/perform.cpp @@ -7,6 +7,7 @@ */ #include "User.h" +#include class CPerform : public CModule { public: @@ -70,8 +71,19 @@ public: } else if (sCmdName == "execute") { OnIRCConnected(); PutModule("perform commands sent"); + } else if (sCmdName == "swap") { + u_int iNumA = sCommand.Token(1).ToUInt(); + u_int iNumB = sCommand.Token(2).ToUInt(); + + if (iNumA > m_vPerform.size() || iNumA <= 0 || iNumB > m_vPerform.size() || iNumB <= 0) { + PutModule("Illegal # Requested"); + } else { + std::iter_swap(m_vPerform.begin() + (iNumA - 1), m_vPerform.begin() + (iNumB - 1)); + PutModule("Commands Swapped."); + Save(); + } } else { - PutModule("Commands: add , del , list, execute"); + PutModule("Commands: add , del , list, execute, swap "); } }