First off, thanks for the reply, Dewey. Had a couple follow up questions,
I've looked through the macro, checking for Ini statements, triggers, etc, but I'm not seeing much that would lead to such a drastic impact as what I believe I'm seeing. All my ${Ini[...]} statements are either called during startup, or by events that would be triggered by a user, for example "Check loot setting for X" would search the file for a given entry, but only on command. As far as triggers, most of the events in the macro are triggered by user commands, rather than game text like "You have been hit by" because of that, I don't think they would be causing the issue since they are only getting called rarely, if ever.
Would breaking the macro down into several includes rather than a few larger files have an impact? Is it better to have functions broken into small pieces and each piece being /called in turn, or is it more efficient to have everything in the same SUB? During the start of the macro, there is a list of functions imported from an ini, and then built into an array which is later parsed in the mainloop as a /for. Could having 2 /for loops, one with 10-15 lines the other with 15-20ish, be causing extra overhead that may not be necessary?
Not that I expect you to go digging through my macro, but if you wanted to get a better look at what I'm talking about, the macro can be found at,
https://code.google.com/p/e3-macro-builds/. There is a link on the home page to my google drive where the macro can be downloaded.
Here's an example of my mainloop of the macro revision that's causing issues,
Code: Select all
SUB Main(modeSelect)
/declare macroVersion string outer 5.1.36 (r8)
/declare i int local
/call e3_Setup "${modeSelect}"
:MainLoop
/if (${Debug}) /echo |- MainLoop ==>
| If my class is not set, I must not be in game, end the macro.
/if (!${Bool[${Me.Class}]}) {
/endmacro
} else {
| ************************************************************************************ |
| ******************************* Background Functions ******************************* |
| ************************************************************************************ |
/if (${ActionTaken}) /varset ActionTaken FALSE
/if (${currentZone} != ${Zone.ID}) /call check_Zone
/if (${Following} && !${Assisting}) /call check_Follow
/call check_Active
/call check_Combat
/call check_Idle
/call check_autoTribute
| If I'm not holding an item, check Life Support and Instant Buffs.
/if (!${Bool[${Cursor}]}) {
| Check if I'm casting
/if (!${Me.Casting.ID} || ${Me.Casting.ID} && ${Me.Class.ShortName.Equal[BRD]}) {
| Check LifeSupport
/if (${lifeSupport.Size} && ${Me.PctHPs} < 100) /call check_lifeSupport
| Check Instant buffs
/if (${BuffCheck} && ${InstantBuffs.Size} && ${Me.FreeBuffSlots} > ${MaxBuffs}) /call buffInstants
}
}
/call Background_Events
/doevents
| If I'm not active, call mainFunctions
/if (!${activeTimer}) {
| check for a pending item exchange
/if (${swapItemBack} && !${itemExchange_Timer}) /call completePendingExchange
| ****************************************************************************** |
| ******************************* Main Functions ******************************* |
| ****************************************************************************** |
/for i 1 to ${mainLoop_Array.Size}
/if (${Bool[${mainLoop_Array[${i}]}]}) /call ${mainLoop_Array[${i}]}
/if (!${ActionTaken}) /next i
| ********************************************************************************** |
| ******************************* Tertiary Functions ******************************* |
| ********************************************************************************** |
| MedBreak
/if (${medBreak}) /call check_MedBreak
| Maintain macro timers
/if (${timerArray.Size}) /call check_macroTimers
}
}
/if (${Debug}) {
/echo <== MainLoop -|
/delay 5
}
/goto :MainLoop
/RETURN
Here is an example of the list of functions called by the main loop,
[CLR Functions]
CLR Function#1=check_DivineArb
CLR Function#2=check_Yaulp
CLR Function#3=check_celestialRegen
CLR Function#4=check_healChain
CLR Function#5=check_Heals
CLR Function#6=check_CombatBuffs
CLR Function#7=check_Debuffs
CLR Function#8=check_Nukes
CLR Function#9=check_Buffs
And the second /for loop would use an array similar to this,
Include#1=background
Include#2=basics
Include#3=casting
Include#4=begForBuffs
Include#5=buffCheck
Include#6=buy
Include#7=pet
Include#8=heal
Include#9=healChain
Include#10=assist
Include#11=class
Include#12=corpseSummon
Include#13=loot
Include#14=sell
Include#15=smoothMoves
Include#16=Wait4Rez
And finally, here is a rebuild of the main loop which I tried to condense into one file to test performance impact. This is still a work in progress.
Code: Select all
SUB Main(modeSelect)
/declare macroVersion string outer 5.2.35 (r8)
/echo Initializing...
|
| Declare file paths ======================================================================================================
|
/declare botIni_Folder string outer e3 Bot Inis\
/declare altBotIni_Folder string outer e3 Bot Inis\Alternate Bot Inis\
/declare macroIni_Folder string outer e3 Macro Inis\
/declare MacroData_Ini string outer ${macroIni_Folder}Macro Data.ini
/declare genSettings_Ini string outer ${macroIni_Folder}General Settings.ini
/declare advSettings_Ini string outer ${macroIni_Folder}Advanced Settings.ini
/declare Character_Ini string outer ${botIni_Folder}${MacroQuest.Server}-${Me.CleanName}.ini
|
| Check Debug =============================================================================================================
|
/declare Debug bool outer ${Ini[${advSettings_Ini},Debug,Debug All]}
/declare Debug_Core bool outer ${Ini[${advSettings_Ini},Debug,Debug Core]}
/declare Debug_Setup bool outer ${Ini[${advSettings_Ini},Debug,Debug Setup]}
/declare Debug_Utilities bool outer ${Ini[${advSettings_Ini},Debug,Debug Utilities]}
|
| Check for Debug calls at startup
|
/if (${modeSelect.Find[/Debug|]} || ${modeSelect.Find[/Debug All|]}) {
/varset Debug TRUE
} else /if (${modeSelect.Find[/Debug Core|]}) {
/varset Debug_Core TRUE
} else /if (${modeSelect.Find[/Debug Setup|]}) {
/varset Debug_Setup TRUE
} else /if (${modeSelect.Find[/Debug Utilities|]}) {
/varset Debug_Utilities TRUE
}
|
/if (${Debug} || ${Debug_Setup}) /echo |- e3_Setup ==>
| Check Plugins
/if (!${pluginsVerified-${Me.CleanName}} || !${EQBC.Connected}) /call check_Plugins
| Create or Update Ini files ==============================================================================================
|
| Check for first time setup.
/if (!${Ini[${MacroData_Ini}].Length}) {
/echo Welcome to e3! Preforming first time setup...
} else /if (!${Ini[${MacroData_Ini},e3 Build,Version].Equal[${macroVersion}]}) {
/echo New version of e3 detected. Hold on to your nuggets!
}
| Macro Setting Inis
/if (!${Ini[${MacroData_Ini},e3 Build,Version].Equal[${macroVersion}]} || !${Bool[${Ini[${genSettings_Ini}]}]}) /call EVENT_make_MacroSettingsIni
| Character_Ini
/if (!${Ini[${MacroData_Ini},${MacroQuest.Server}-${Me.CleanName},Bot_Ini version].Equal[${macroVersion}]} || !${Bool[${Ini[${Character_Ini}]}]}) /call EVENT_make_CharacterSettingsIni
| Aliases
/if (!${Ini[${MacroData_Ini},e3 Build,Version].Equal[${macroVersion}]}) /call EVENT_updateAliases
| Update Macro Version if a new build is detected
/if (!${Ini[${MacroData_Ini},e3 Build,Version].Equal[${macroVersion}]}) /call WriteToIni "${MacroData_Ini},e3 Build,Version" "${macroVersion}" 1
|
| Declare Core Variables and Import Settings ==============================================================================
/declare ActionTaken bool outer FALSE
/declare ChatToggle string outer ${If[${Ini[${genSettings_Ini},General,Macro Output Channel].Length},${Ini[${genSettings_Ini},General,Macro Output Channel]},/bc]}
/declare currentZone int outer 0
/declare Old_cursorID int outer 0
|
/declare activeTimer timer outer
/declare combatTimer timer outer
/declare cursorTimer timer outer
/declare rebuffTimer timer outer
/declare spamTimer timer outer
|
/declare combatDelay int outer ${If[${Ini[${genSettings_Ini},General,Out of Combat Timer (Sec)].Length},${Ini[${genSettings_Ini},General,Out of Combat Timer (Sec)]},10]}
/declare inventoryTimer int outer ${If[${Ini[${genSettings_Ini},General,Auto-Inventory Timer (Sec)].Length},${Ini[${genSettings_Ini},General,Auto-Inventory Timer (Sec)]},30]}
/declare rebuffDelay int outer ${If[${Ini[${genSettings_Ini},General,Rebuff Delay Timer (Sec)].Length},${Ini[${genSettings_Ini},General,Rebuff Delay Timer (Sec)]},10]}
|
/if (!${Defined[idle]}) /declare idle bool global
/if (!${Defined[idleTimer]}) /declare idleTimer timer global
/declare idleInterval int outer ${If[${Ini[${genSettings_Ini},General,Idle Time Out (Min)].Length},${Ini[${genSettings_Ini},General,Idle Time Out (Min)]},10]}
|
| Setup Includes
|**
add code to run include setups
**|
| Complete a pending exchange =============================================================================================
/if (${Ini[${MacroData_Ini},${MacroQuest.Server}-${Me.CleanName},Pending Exchange].Length} && ${Ini[${MacroData_Ini},${MacroQuest.Server}-${Me.CleanName},Pending Exchange].NotEqual[NONE]} && !${itemExchange_Timer}) /call completePendingExchange
| Startup echos ===========================================================================================================
/echo e3 v${macroVersion} loaded.
/echo
/echo ** For updates, issues, suggestions, or donations, visit 'http://code.google.com/p/e3-macro-builds/'.
/echo ** For help using e3, use /e3help to learn about different basic functions and /comannds.
/if (${NetBots.Client.Find[Tackleberry]}) /echo Though you may find this message a bit 'extreme' so is bitching about a few lines of text which can easily be ignored.
/echo
/if (${Debug} || ${Debug_Setup}) {
/echo botIni_Folder=${botIni_Folder}
/echo altBotIni_Folder=${altBotIni_Folder}
/echo macroIni_Folder=${macroIni_Folder}
/echo MacroData_Ini=${MacroData_Ini}
/echo genSettings_Ini=${genSettings_Ini}
/echo advSettings_Ini=${advSettings_Ini}
/echo Character_Ini=${Character_Ini}
/echo Debug=${Debug}
/echo Debug_Core=${Debug_Core}
/echo Debug_Setup=${Debug_Setup}
/echo Debug_Utilities=${Debug_Utilities}
/echo ChatToggle=${ChatToggle}
/echo combatDelay=${combatDelay}
/echo rebuffDelay=${rebuffDelay}
/echo inventoryTimer=${inventoryTimer}
/echo idleInterval=${idleInterval}
/echo
/echo *** Debug_Mode ON ***
/echo The macro has paused so you can review setup information, type /mqpause to continue.
/echo
/mqpause
}
/if (${Debug} || ${Debug_Setup}) /echo <== e3_Setup -|
|**
:MainLoop
**|
:MainLoop
/if (${Debug} || ${Debug_Core}) /echo |- MainLoop ==>
| If my class is not set. I must not be in game, end the macro.
/if (${ActionTaken}) /varset ActionTaken FALSE
/if (!${Bool[${Me.Class}]}) {
/endmacro
} else {
| Check Background functions =================================================================================
| Update zone ID
/if (${currentZone} != ${Zone.ID}) /call check_Zone
| Check Follow
/if (${Following} && !${Assisting}) /call check_Follow
| Check Zoning
/if (!${SpawnCount[pc ${Me}]}) {
/varset activeTimer 15
/varset rebuffTimer 0
}
| Check Movement
/if (${Me.Moving} || ${Corpse.Open}) {
/varset activeTimer 5
/varset rebuffTimer ${rebuffDelay}
}
| Check Cursor
/if (${Cursor.ID}) {
| Destroy badItems.
/if (${Defined[badItems]}) {
/if (${Select[${Cursor},${badItems}]} || ${Select[${Cursor.ID},${badItems}]}) {
/echo Destroying ${Cursor}...
/destroy
}
}
| Check to see if I'm waiting to drop this item, or if I've picked up something new
/if (${Old_cursorID} != ${Cursor.ID}) {
/varset cursorTimer ${Math.Calc[${inventoryTimer} * 10].Int}
/varset Old_cursorID ${Cursor.ID}
} else {
/if (!${cursorTimer}) /call clearCursor
}
/varset activeTimer 5
/if (${rebuffTimer} < 30) /varset rebuffTimer 30
} else {
/if (${Old_cursorID}) {
/varset cursorTimer 0
/varset Old_cursorID 0
}
}
| Check AutoAttack
/if (${Me.Combat}) {
/if (!${Target.ID} || ${Target.Type.Equal[corpse]} && !${Assisting}|| ${Spawn[${Target.ID}].Type.Equal[PC]} && !${Toggle-PvP}) /attack off
}
| Check Casting
/if (${Me.Class.ShortName.NotEqual[BRD]} && ${Me.Casting.ID}) {
/if (${e3Casting}) /call e3_CastingChecks
/varset activeTimer 5
/varset rebuffTimer ${rebuffDelay}
}
| Check windows
/if (${Window[BigBankWnd].Open} || ${Window[MerchantWnd].Open} || ${Window[TradeWnd].Open} || ${Window[GuildBankWnd].Open} || ${Window[MerchantWnd].Open}) {
/varset activeTimer 30
/varset rebuffTimer ${rebuffDelay}
/doevents flush
}
| Check Feigning
/if (${Me.Feigning}) {
/if (!${Select[${Me.Class.ShortName},NEC,SHD,MNK]}) {
/stand
/if (${Assisting} && ${StickOn}) /attack on
} else {
/if (!${Defined[feign_Timer]}) {
/docommand ${ChatToggle} I AM FEIGNED.
/declare feign_Timer timer outer 15s
}
}
/varset activeTimer 30
/varset rebuffTimer ${rebuffDelay}
} else {
/if (${Defined[feign_Timer]}) /deletevar feign_Timer
}
| Check Combat
/call check_Combat
| Check to see if I have been active recently. If so, set Idle false, and update the idleTimer
/if (${activeTimer} || ${combatTimer}) {
/varset idleTimer ${idleInterval}m
/if (${idle}) /varset idle FALSE
} else {
| If I haven't been active, and the idleTimer is spent, set idle TRUE.
/if (!${idle} && !${idleTimer}) /varset idle TRUE
}
| If I'm not holding an item, check Life Support and Instant Buffs.
/if (!${Bool[${Cursor}]}) {
| Check if I'm casting
/if (!${Me.Casting.ID} || ${Me.Casting.ID} && ${Me.Class.ShortName.Equal[BRD]}) {
| Check LifeSupport
/if (${lifeSupport.Size} && ${Me.PctHPs} < 100) /call check_lifeSupport
| Check Instant buffs
/if (${BuffCheck} && ${InstantBuffs.Size} && ${Me.FreeBuffSlots} > ${MaxBuffs}) /call buffInstants
}
}
/if (${autoTribute}) /call check_autoTribute
/call Background_Events
/doevents
| If I'm not active, check mainLoop_Array functions
/if (!${activeTimer}) {
| check for a pending item exchange
/if (${swapItemBack} && !${itemExchange_Timer}) /call completePendingExchange
| ****************************************************************************** |
| ******************************* Main Functions ******************************* |
| ****************************************************************************** |
|**
This may need to be redesigned,
/for i 1 to ${mainLoop_Array.Size}
/if (${Bool[${mainLoop_Array[${i}]}]}) /call ${mainLoop_Array[${i}]}
/if (!${ActionTaken}) /next i
**|
| ********************************************************************************** |
| ******************************* Tertiary Functions ******************************* |
| ********************************************************************************** |
| MedBreak
/if (${medBreak}) /call check_MedBreak
| Maintain macro timers
/if (${timerArray.Size}) /call check_macroTimers
}
}
/if (${Debug} || ${Debug_Core}) {
/echo <== MainLoop -|
/delay 5
}
/goto :MainLoop
/RETURN
Again, any insight offered is greatly appreciated.
Thank you for the time, effort, and information.
-Kill