Consenting macro with ini support

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

Virtuoso65
a hill giant
a hill giant
Posts: 150
Joined: Wed Oct 15, 2003 2:29 pm

Consenting macro with ini support

Post by Virtuoso65 » Fri Apr 30, 2004 12:36 am

This is a macro to help reduce downtime on raids and group wipes. It can consent people on your list or group while you do things like load spells or afk. Usage is in the help sub of the macro, read it.

Code: Select all

|--- consent.mac V2.2 by Virtuoso65 ---
|--- MQ2Data & MQ2DataVars ready
#define inipath "consent.ini"
Sub Main
/declare rog outer
/declare a1 int outer
/varset a1 0
/declare e1 outer
/varset e1 0
|--------------------------------------------
        /if (!${Defined[Param0]}) {
                /call Consentlist
        }
        /if (${String[${Param0}].Equal[group]}) {
                /Call ConsentGroup
                /end
        }
        /if (${String[${Param0}].Equal[list]}) {
                /Call ListINI
                /end
        }
        /if (${String[${Param0}].Equal[help]}) {
                /call Help
                /end
        }
        /if (${Defined[Param0]}) {
                /goto :loop
        }

|++++++++Adds new people into the consent list++++++++++++++++++++++++++++++++++++++

:loop
/for a1 0 to 20
    /if (!${Bool[${Ini[inipath, consented, ${a1}]}]}) {
        /varset e1 ${a1}
        /goto :loop2
    }
/next a1

:loop2
/for a1 0 to 20
    /if (!${Defined[Param${a1}]}) {
        /end
    }
    /ini "inipath" consented ${Int[${e1}]} ${Param${a1}}
    /echo ${Int[${e1}]} - ${Param${a1}}, Is being appended to the ini.
    /varcalc e1 ${e1}+1
/next a1
/return

|-------Help for those who need it---------------------------------------

Sub Help
/echo If you add names by leaving params after mac call ie. /mac consent name1 name2 ...name(N).
/echo If you want to consent your group then /mac consent group.
/echo If you do not specify add params and it will consent the people in the ini.
/echo if you forgot who is on your consent list then type /mac consent list.
/return


|------Consents people on your list----------------------------------------

Sub Consentlist
/for a1 0 to 20
    /if (!${Bool[${Ini[inipath, consented, ${a1}]}]}) {
        /if (${a1}<0) {
            /echo There is noone on your consent list. Try /mac consent help.
            /end
        } else /end
    }
    /echo Consenting ${Ini[inipath, consented, ${a1}]}.
    /varset rog ${Ini[inipath, consented, ${a1}]}
    /consent ${rog}
    /delay 3s
/next a1
/return

|-------Consents people in your group---------------------------------------

Sub ConsentGroup
    /if (!${Me.Grouped}) {
        /echo You do not have a group, go find one.
        /end
    }
/for a1 1 to ${Group}
    /if (!${Me.Grouped}) /end
    /varset rog ${Group[${a1}]}
    /echo ${rog} is being consented.
    /delay 3s
    /consent ${rog}
/next a1
/return

|-------Lists people on your ini---------------------------------------

Sub ListINI
/echo Players on Consent.ini list.
/for a1 0 to 20
    /if (!${Bool[${Ini[inipath, consented, ${a1}]}]}) {
        /if (${a1}==0) {
            /echo There is noone on your consent list. Try /mac consent help.
            /end
        } else /end
    }
    /varset rog ${Ini[inipath, consented, ${a1}]}
    /echo ${rog}
/next a1
/return