• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Macro command management into multiclass macro

moguay

Member
Joined
Jan 17, 2011
RedCents
1,190¢
I will try to explain to you how I build the order management of my bots.

The basic idea is to make it easier for the player to select which bot, type of bots he wants to launch a command and mix the possibilities as much as possible, without having to switch characters.

An example to engage melee on specific char:
/rog melee
/all melee
/me melee
/group1 melee

This command separation system greatly facilitates the management of complex raid combat.
On the other hand, for farming, it is possible to perform mass engages. Simply like this
/all atk
or /all farm
the latter automatically balances all the dps of the raid on all the xtargets. (sample 6groups with 6xtargets you have 6bots on each xtargets to perform a mass killing)

I'm already getting lost, so for the base the first command defined on which we launch a command. (/ all, / group, / class etc ..)
The second is the cmd
The third and more is the options.

I built the code in such a way that it parses the syntax and whether or not to have spaces between the main command and the options
so you can do /all pet summon or /all petsum. do exactly the same

The howto use it link for player: https://wiki.eqprofusion.com/en/Profusion_Macro/How-to-use

Sample with buff functions :
tg5IbfE.png


below the commands analysis function, and a little sample for tanking management (off,on,target,aoe) :

Code:
Sub Event_EQBC_NEW(line,EQBCSender,EQBCCommand)
|| REMOVE Me Name Fisrt ARG
    /if (${EQBCCommand.Token[1, ].Equal[${Me.CleanName}]}) {
        /varset EQBCCommand ${EQBCCommand.Right[-${Int[${Math.Calc[${EQBCCommand.Token[1, ].Length}+1]}]}]}
    }
    /if (!${Bool[${EQBCCommand.Token[1, ]}]}) /return
    | FILTER for new command system only
    /if (${EQBCCommand.Token[1, ].Count[:]} == 3) {
        | Disable to show help is empty cmd
        | /if (!${Bool[${EQBCCommand.Token[2, ]}]}) /return
|| DEFINED VAR
        | TEMP VAR
        /declare i              int     local
        /declare j              int     local
        | LIST VAR
        /declare CLASS_LIST     string  local war|clr|pal|rng|shd|dru|mnk|brd|rog|shm|nec|wiz|mag|enc|bst|ber
       
        /call varset BOTS_LIST  string  global ${NetBots.Client.Replace[ ,|]}
        | SELF VAR
        /declare ME_CLASS       string  local ${Me.Class.ShortName}
        /declare ME_NAME        string  local ${Me.CleanName}
        /declare ME_ZONE        string  local ${Zone.ID}
        /declare ME_POS         string  local ${Me.Y},${Me.X},${Me.Z},${Me.Heading.Degrees}
        | EQBC VAR
        /declare ParamCount     int     local 1
        /declare WHO            string  local ${EQBCSender}
        /declare FOR            string  local ${EQBCCommand.Token[${ParamCount}, ].Token[1,:]}
        /declare TARGET         int     local ${Int[${EQBCCommand.Token[${ParamCount}, ].Token[2,:]}]}
        /declare ZONE           int     local ${Int[${EQBCCommand.Token[${ParamCount}, ].Token[3,:]}]}
        /declare POS            string  local ${EQBCCommand.Token[${ParamCount}, ].Token[4,:]}
        /declare GROUP          int     local 0

        | CLASS VAR
        /declare bTANK          bool    local ${Bool[${Select[${ME_CLASS},WAR,SHD,PAL]}]}
        /declare bMELEE         bool    local ${Bool[${Select[${ME_CLASS},ROG,BER,BRD,MNK,RNG,WAR,PAL,SHD,BST]}]}
        /declare bSUP           bool    local ${Bool[${Select[${ME_CLASS},DRU,ENC,MAG,SHM]}]}

        /for i 1 to ${Math.Calc[${CLASS_LIST.Count[|]} + 1]}
            /declare b${CLASS_LIST.Arg[${i},|].Upper} bool local ${Bool[${Select[${ME_CLASS},${CLASS_LIST.Arg[${i},|].Upper}]}]}
        /next i
        | COMMAND VAR
        /varset EQBCCommand ${EQBCCommand.Right[-${Int[${Math.Calc[${EQBCCommand.Token[1, ].Length}+1]}]}]}
        /declare COMMAND        string  local
        /declare CMD            string  local ${EQBCCommand.Token[${ParamCount}, ]}
            | GROUP SET
            /if (${FOR.Find[group]} == 1) {
                /if (!${Raid.Members} && !${Group.Members}) /return
                /if (!${FOR.Equal[group]}) {
                    /varset GROUP ${Int[${FOR.Right[-5]}]}
                    /varset FOR group
                }
                /if (${Int[${CMD}]} > 0) {
                    /varset GROUP ${Int[${CMD}]}
                    /varset FOR group
                    /varcalc ParamCount ${ParamCount}+1
                    /varset CMD ${EQBCCommand.Token[${ParamCount}, ]}
                }
            }
            | COMMAND SET
            /if (${CMD.Find[/]} == 1) /varset CMD ${CMD.Right[-1]}
        | OPTIONS VAR
        /declare ARG            string  local
        /declare OPTION         string  local
        | BOTS VAR
        /declare ARG2           string  local
        /declare CONJONCTION    bool    local FALSE
|| STRUCTURE ARG AND ARG2
        :ARGLoop
        /varcalc ParamCount ${ParamCount}+1
        /if (${Bool[${EQBCCommand.Arg[${ParamCount}, ]}]}) {
            /if (${Select[${EQBCCommand.Arg[${ParamCount}, ]},but,and,not,nor,for,or,yet,so]}) {
                /varset CONJONCTION TRUE
                /goto :ARGLoop
            }
            /if ((${CONJONCTION} || ${EQBCCommand.Arg[${ParamCount}, ].Find[!]} == 1) && (${BOTS_LIST.Find[${EQBCCommand.Arg[${ParamCount}, ].Replace[!,]}]} || ${CLASS_LIST.Find[${EQBCCommand.Arg[${ParamCount}, ].Replace[!,]}]})) {
                /varset ARG2 ${ARG2}${If[${Bool[${ARG2}]},|,]}${EQBCCommand.Arg[${ParamCount}, ].Replace[!,]}
            } else {
                /varset ARG ${ARG}${If[${Bool[${ARG}]},|,]}${EQBCCommand.Arg[${ParamCount}, ]}
                | /varset ARG ${ARG}${EQBCCommand.Arg[${ParamCount}, ]}
            }
            /goto :ARGLoop
        }
       
|| Auto disable PULL mode
        /if (${CMD.Length} && ${PullType.Equal[GO]}) /varset PullType 0
        | Only this list can be casted in different zone, all other is blocked
        /if (!${Select[${CMD},rez,accept,zone,form,finditem,eq]} && ${ZONE}!=${ME_ZONE}) /return
|| GLOBAL FOR Exclusion
        /if (!${FOR.Equal[all]}) {
            | Exclude if not me
            /if (${FOR.Equal[me]} && !${WHO.Equal[${Me.CleanName}]}) {
                | exclude for prevent bad couple FOR/CMD
                /if (!${Select[${CMD},stick]}) /return
            | Exclude if not the classes
            } else /if (${CLASS_LIST.Find[${FOR}]} && !${FOR.Equal[${ME_CLASS}]}) {
                /return
            | Exclude not in group
            } else /if (${FOR.Find[group]} == 1) {
                /if (!${GROUP} && ${Group.Members}) {
                    | Find if in group
                    /varset j 0
                    /for i 0 to ${Group.Members}
                        /if (${Spawn[PC =${Group.Member[${i}].CleanName}].ID}==${Spawn[PC =${EQBCSender}].ID} && ${Spawn[PC =${EQBCSender}].Distance} < 300) /varset j ${i}
                    /next i
                    /if (!${j}) /return
                } else /if (${GROUP} && ${Raid.Members}) {
                    | Find if in group number
                    /if (${Raid.Member[${Me.CleanName}].Group} != ${GROUP}) /return
                } else {
                    /docommand /${echo} -GROUP CMD: ERROR no raid or group
                    /return
                }
            | Exclude if not target
            } else /if (${FOR.Equal[tar]} && ${Spawn[${EQBCCommand}].ID}) {
                /if (${WHO.Equal[${Me.CleanName}]}) /target ${EQBCCommand}
                /return
            | Exclude if not target
            } else /if (${FOR.Equal[tar]} && ${TARGET}!=${Me.ID}) {
                /return
            }
        }
|| CLASSES AND BOTS Exclusion
        /if (${Bool[${ARG2}]}) {
            /declare ANALYSIS_LIST  string  local
            /declare bEXCLUDE       string  local FALSE
            | Exclude if not the classes arg option
            /for i 1 to ${Math.Calc[${CLASS_LIST.Count[|]} + 1]}
                | Add explicit and implicit class in list
                /if (${ARG2.Find[|!${CLASS_LIST.Arg[${i},|]}|]} || (${CONJONCTION} && ${ARG2.Find[|${CLASS_LIST.Arg[${i},|]}|]})) {
                    /varset ANALYSIS_LIST ${ANALYSIS_LIST}!${CLASS_LIST.Arg[${i},|]}|
                    | Fast explicit out
                    /if (${ME_CLASS.Equal[${CLASS_LIST.Arg[${i},|]}]}) /return
                } else /if (${ARG2.Find[|${CLASS_LIST.Arg[${i},|]}|]}) {
                    /varset ANALYSIS_LIST ${ANALYSIS_LIST}${CLASS_LIST.Arg[${i},|]}|
                }
            /next i
            | Exclude if not the name arg option
            /for i 1 to ${NetBots.Counts}
                | Add explicit and implicit name in list
                /if (${ARG2.Find[|!${NetBots.Client[${i}]}|]} || (${CONJONCTION} && ${ARG2.Find[|${NetBots.Client[${i}]}|]})) {
                    /varset ANALYSIS_LIST ${ANALYSIS_LIST}!${NetBots.Client[${i}]}|
                    | Fast explicit out
                    /if (${ME_NAME.Equal[${NetBots.Client[${i}]}]}) /return
                } else /if (${ARG2.Find[|${NetBots.Client[${i}]}|]}) {
                    /varset ANALYSIS_LIST ${ANALYSIS_LIST}${NetBots.Client[${i}]}|
                }
            /next i
            /if (${Bool[${ANALYSIS_LIST}]}) {
                /for i 1 to ${Math.Calc[${ANALYSIS_LIST.Count[|]} + 1]}
                    | Analysis explicit exclude (not really necessary if Fast explicit out work)
                    /if (${ANALYSIS_LIST.Arg[${i},|].Find[!]} == 1) {
                        /if (${Select[${ANALYSIS_LIST.Arg[${i},|]},!${ME_CLASS},!${ME_NAME}]}) /return
                    | Analysis implicit exclude
                    } else {
                        /if (${Select[${ANALYSIS_LIST.Arg[${i},|]},${ME_CLASS},${ME_NAME}]}) {
                            /varset bEXCLUDE FALSE_FORCED
                        } else {
                            /if (${bEXCLUDE.NotEqual[FALSE_FORCED]}) /varset bEXCLUDE TRUE
                        }
                    }
                /next i
                /if (${bEXCLUDE.Equal[TRUE]}) /return
            }
        }
|| COMMANDS by CLASSES Exclusion
        /if (${CMD.Find[tank]}                                              && !${bTANK})  /return
        /if (${CMD.Find[mel]}                                               && !${bMELEE}) /return
        /if (${CMD.Find}                                               && !${bSUP})   /return
        /if ((${CMD.Find[wiz]} || ${CMD.Find[nuke]} || ${CMD.Find[aoe]})    && !${bWIZ})   /return
        /if (${CMD.Find[nec]}                                               && !${bNEC})   /return
        /if (${CMD.Find[mez]}                                               && !${bENC})   /return
        /if (${CMD.Find[stun]}                                              && !${bPAL})   /return
|| COMMAND AND OPTION Analysis
        /for i ${CMD.Length} downto 2
            /varset COMMAND ${CMD.Left[${i}]}
            /varset OPTION ${If[${CMD.Right[-${i}].Length},${CMD.Right[-${i}]}|${ARG},${ARG}]}
            /for j 1 to ${Math.Calc[${OPTION.Count[|]} + 1]}
                /if (${OPTION.Token[${j},|].Length}) {
                    /if (!${Defined[OPTION${j}]}) /declare OPTION${j} string  local
                    /varset OPTION${j} ${OPTION.Token[${j},|]}
                }
            /next j
            /varset j 1
            /if (!${Defined[OPTION${j}]}) /declare OPTION${j} string local NULL
           
| /echo debug -4 ${COMMAND} ${OPTION1} ${OPTION2}

|| Tank commands
            /if (${Select[${COMMAND},tank]}) {
                /declare TankTarget_LIST    string  local 0|${ME_NAME}  |${ME_NAME} |${ME_NAME} |${ME_NAME}
                /declare TankType_LIST      string  local 0|target      |target     |aoe        |target
                /if (${Select[${OPTION1},off]}) {
                                                        /varset PetHoldType GO
                                                        /interrupt
                                                        /attack off
                                                        /docommand /${echo} -${COMMAND.Upper} off
                } else {
                                                        /attack on
                                                        /varset Message 1
                                                        /docommand /${echo} -${COMMAND.Upper} ${If[!${Select[${OPTION1},off,on,target,aoe,NULL]},target,${TankType_LIST.Arg[${Select[${OPTION1},off,on,target,aoe,NULL]},|].Replace[ ,]}]}
                }
                                                        /varset TankTarget ${If[!${Select[${OPTION1},off,on,target,aoe,NULL]},${ME_NAME},${TankTarget_LIST.Arg[${Select[${OPTION1},off,on,target,aoe,NULL]},|].Replace[ ,]}]}
                                                        /varset TankType ${If[!${Select[${OPTION1},off,on,target,aoe,NULL]},target,${TankType_LIST.Arg[${Select[${OPTION1},off,on,target,aoe,NULL]},|].Replace[ ,]}]}
                /return
            }
etc...
 
Macro command management into multiclass macro

Users who are viewing this thread

Back
Top
Cart