In regards to sharing these changes, is this something I can simply add to the discussion or would I need to clear any changes with GoldenFrog first? New to the community and don't know the policy on altering other peoples macros.
Since I didn't hear back from anyone on this I will share snippets of code for the changes I made:
[CODE title=":countdownloop (after line 93)"]
/if (${Ini[${MyIni},General,runOneTime]}) {
/call Log "Ending macro after one overseer check cycle (per configuration)."
/endmacro
}[/CODE]
[CODE title="AFTER: Sub Parameterized(string arg) (~line 162)"]| Get a randomized delay time in milliseconds to slow down macro execution and randomize UI interaction times so it's not so obvious these actions are a macro in any server logs.
| If useRandomDelay = 0, then this simply returns baseDelayTimeMilliseconds (the original behaviour).
Sub GetRandomizedDelayTimeMilliseconds(int baseDelayTimeMilliseconds)
/declare result int local ${baseDelayTimeMilliseconds}
/if (${useRandomDelay}) {
/declare randomizedDelay int local ${Math.Rand[${maxRandomDelayTimeMilliseconds}]}
/if (${randomizedDelay} < ${minRandomDelayTimeMilliseconds}) {
/varset randomizedDelay ${Math.Calc[${randomizedDelay}+${minRandomDelayTimeMilliseconds}]}
}
/varset result ${Math.Calc[${baseDelayTimeMilliseconds}+${randomizedDelay}]}
/call DebugLog 3 "Adding randomized delay of ${result} ms"
} else {
/call DebugLog 3 "Adding base delay of ${result} ms"
}
/return ${result}[/CODE]
[CODE title="UPDATE: Sub EnsureIniDefaults (~ line 1707)"] /if (${Ini[${MyIni},General].Length} == 0) {
| *** existing /ini ${MyIni} statements ***
/ini ${MyIni} "General" "useRandomDelay" "0"
/ini ${MyIni} "General" "minRandomDelayTimeMilliseconds" "500"
/ini ${MyIni} "General" "maxRandomDelayTimeMilliseconds" "5000"
/ini ${MyIni} "General" "runOneTime" "0"
} else /if (${Ini[${MyIni},General,ignoreConversionQuests].Equal[NULL]}) {
| *** existing /ini ${MyIni} statements ***
}
/if (${Ini[${MyIni},General,useRandomDelay].Equal[NULL]}) {
/ini ${MyIni} "General" "useRandomDelay" "0"
}
/if (${Ini[${MyIni},General,minRandomDelayTimeMilliseconds].Equal[NULL]}) {
/ini ${MyIni} "General" "minRandomDelayTimeMilliseconds" "500"
}
/if (${Ini[${MyIni},General,maxRandomDelayTimeMilliseconds].Equal[NULL]}) {
/ini ${MyIni} "General" "maxRandomDelayTimeMilliseconds" "5000"
}
/if (${Ini[${MyIni},General,runOneTime].Equal[NULL]}) {
/ini ${MyIni} "General" "runOneTime" "0"
}[/CODE]
[CODE title="UPDATE: Sub Initialize (after '/call EnsureIniDefaults' ~line 1822)"] /declare useRandomDelay int outer ${Ini[${MyIni},General,useRandomDelay]}
/declare minRandomDelayTimeMilliseconds int outer ${Ini[${MyIni},General,minRandomDelayTimeMilliseconds]}
/declare maxRandomDelayTimeMilliseconds int outer ${Ini[${MyIni},General,maxRandomDelayTimeMilliseconds]}[/CODE]
Once all of those changes are made the rest of the changes are to alter the '/delay' statements so they use the new Sub GetRandomizedDelayTimeMilliseconds.
Here are a few examples:
[CODE title="Examples:"]| Replace
/delay 1s
| With
/delay ${GetRandomizedDelayTimeMilliseconds[1000]}ms
| Replace
/delay 1s (${Window[OverseerWnd].Child[OW_Subwindows].Child[${Tabs[${tabIndex},2]}].Open})
| With
/delay ${GetRandomizedDelayTimeMilliseconds[1000]}ms (${Window[OverseerWnd].Child[OW_Subwindows].Child[${Tabs[${tabIndex},2]}].Open})
| Replace
/delay 5
| With (delay number alone means 10th second or 100 ms)
/delay ${GetRandomizedDelayTimeMilliseconds[500]}ms[/CODE]
All delays are in ms, so change all delays into corresponding milliseconds.
I did not change the delay between each cycle as that delay is in minutes, though thinking about it now it it might make sense to add a random delay of 5-15 minutes between cycles so overseer does not run immediately after one is finished. Not super efficient but then again doesn't look like it's a program either.
Finally, you can just add these settings to your INI file(s) to turn this on or off as well as change min/max delays or if you want it to only run once and exit.
[CODE lang="ini" title="Example INI changes"][General]
# existing lines
useRandomDelay=1
minRandomDelayTimeMilliseconds=500
maxRandomDelayTimeMilliseconds=5000
runOneTime=1[/CODE]
I hope this helps out anyone like me who wants it to run more randomly so it doesn't look like it's being done by a macro.
Something like that method I created would probably work to delay other functionality to make it less obvious it's a macro. I haven't looked into it because it's beyond my knowledge but my thought is if functionality like this could be added to the actual /delay method it could go a long way to making this all seem less robotic. I would think simply something like '/delay {minTimeInTimeUnits} {maxTimeInTimeUnits}' would be great. Add to that a base setting in main INI file that calculates maxTimeInTimeUnits for calls that do not provide it (ie. all legacy calls) and you could add a randomized delay anywhere a delay command is called and even give the end user the ability to tweak the delay timings.
Hope this is of some help. Also, if I am allowed to post the updated file I did, just let me know and I will.