• 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 - Set Filters Macro

dum_as_f

Active member
Joined
Jun 28, 2016
RedCents
87¢
Sometimes my filters end up resetting to default, and I made a backup file that I could drop in when it happened but another player suggested that making a macro to do it from in game would be easier. All this does is take a couple pre-defined filter sets that I use and loop through the Filter list...anything that isn't specifically set to be set as show is set to hide by default. I don't know enough about macros to use an .ini file for this, so I hard coded the conditional check into the varset for filterSet. I also only coded it to set filter to show or hide, some of the options on the list have Show Me Only and Show Group Only, these could easily be added as well. These filters are the ones I use since I box 18 toons on an EMU server and pull well over 100 mobs at a time, necessitating not only EQ filter settings but MQ2 filters too. This is just an easier way to assign the settings to my main or my alts.

To execute it, it watches for trigger text tied to chat the chat text setfilters. There are only 2 pre-configured filter sets right now, main and alt. /echo setfilter main or /echo setfilter alt will trigger, /echo setfilter anythingElse should cause the trigger to fail with a message explaining the required syntax. After it loops through the filters, it exits the macro.

Code:
 #Event OptionsWindowFilters "#*#setfilters #1#"
 
|===============================================================================================
| SUB: Main
|===============================================================================================
 Sub Main()
  /echo Use the following syntax for executing one of the two pre-defined filter sets
  /echo '/echo setfilters main' or '/echo setfilters alt'
 :Primeloop
  /doevents
  /goto :Primeloop
 /return
 
|===============================================================================================
| SUB: Event_OptionsWindowFilters
|===============================================================================================
 Sub Event_OptionsWindowFilters(string Line, string Filterset)
 
  |Set a variable named filterSet to hold the pre-configured values
  /declare filterSet string local 
  /declare Proceed int local 0
  /declare index int local
  
  |Set up various Filterset values for preset filtering
  /if (${Filterset.Equal[main]}) {
   /noparse /varset filterSet ${index} == 1 || ${index} == 2 || ${index} == 3 || ${index} == 10 || ${index} == 11 || ${index} == 20 || ${index} == 23 || ${index} == 26 ||${index} == 27 || ${index} == 28 || ${index} == 33
   /varset Proceed 1
  } else /if (${Filterset.Equal[alt]}) {
   /noparse /varset filterSet ${index} == 1 || ${index} == 2 || ${index} == 3 || ${index} == 10 || ${index} == 11 || ${index} == 23 || ${index} == 26 || ${index} == 27 || ${index} == 28
   /varset Proceed 1
  } else {
   /echo You need to use one of the pre-defined filters to apply these changes
   /echo By default, the only pre-defined filter sets are either main or alt
   /return
  }
  
  |Loop through each index in the list of filter options
  /for index 1 to ${Window[OptionsWindow].Child[OFP_FilterList].Items}
   
   |Select the index at the value of the iterator named index
   /notify OptionsChatPage OFP_FilterList listselect ${Window[OptionsWindow].Child[OFP_FilterList].List[=${Window[OptionsWindow].Child[OFP_FilterList].List[${index}]}]}
   
   |Assign show to the indexes I want the setting to be Show for, if value of index doesn't match then set it to Hide
   |If you don't want to be spammed with the settings being applied, comment out the /bc commands, it was used for debugging
   /if (${Proceed} == 1) {
    /if (${filterSet}) {
     /notify OptionsChatPage OFP_FilterComboBox listselect ${Window[OptionsWindow].Child[OFP_FilterComboBox].List[=Show]}
     
     /bc Setting ${Window[OptionsWindow].Child[OFP_FilterList].List[${index}]} to Show
    } else {
     /notify OptionsChatPage OFP_FilterComboBox listselect ${Window[OptionsWindow].Child[OFP_FilterComboBox].List[=Hide]}
     
     /bc Setting ${Window[OptionsWindow].Child[OFP_FilterList].List[${index}]} to Hide
    }
    |Add a small delay of .3 seconds so people can see the changes being applied but not be spammed too fast to read
    |Feel free to increase or decrease this delay to a value that works for you
    /delay 3
   }
   
  /next index
  
  /echo Filter set ${Filterset} has been applied, exiting this macro
  
 /end
 

|1. Achievements          >Show< Show Mine Only      Hide
|2. Auctions          >Show<       Hide
|3. Bad Word          >Show<      Hide
|4. Bard Songs    Show  Show Mine Only          >Hide<
|5. Bard Songs on Pets   Show            >Hide<
|6. Damage Over Time   Show Show Mine Only Show Group Only        >Hide<
|7. Damage Shields   Show            >Hide<
|8. Fellowship Messages   Show            >Hide<
|9. Focus Effects   Show            >Hide<
|10.Group Chat          >Show<             Hide
|11.Guild Chat          >Show<      Hide
|12.Heal Over Time   Show  Show Mine Only          >Hide<
|13.Item Speech    Show            >Hide<
|14.Melee Criticals   Show Show Mine Only          >Hide<
|15.Mercenary Messages   Show            >Hide<
|16.Missed Me    Show            >Hide<
|17.My Misses    Show            >Hide<
|18.My Pet Hits    Show            >Hide<
|19.My Pet Misses   Show                   >Hide<
|20.NPC Spells          >Show<      Hide
|21.Others' Hits    Show            >Hide<
|22.Others' Misses   Show            >Hide<
|23.Out of Character         >Show<      Hide
|24.PC Spells    Show   Show Group Only        >Hide<
|25.Pet Spells    Show            >Hide<
|26.PvP Messages          >Show<      Hide
|27.Shouts          >Show<      Hide
|28.Socials          >Show<      Hide
|29.Spam     Show            >Hide<
|30.Spell Criticals   Show Show Mine Only          >Hide<
|31.Spell Damage    Show Show Mine Only          >Hide<
|32.Strikethrough Messages  Show            >Hide<
|33.Stun Messages         >Show<       Hide
|
|
|***** The above is an example of the filter list, optional settings and the
|***** settings I use in my main setup...yes I DO filter out almost everything
|***** except chat channels because of the sheer volume of messages on large pulls
|
|***** You can adjust these settings to be whatever you want, but it'll take some
|***** customization of the code to make it work.


Apologies for the formatting for the table in the comments, cleaned it up to better illustrate the settings of filter set main:
1. Achievements>Show< Show Mine OnlyHide
2. Auctions>Show<Hide
3. Bad Word>Show<Hide
4. Bard SongsShow Show Mine OnlyShow Group Only>Hide<
5. Bard Songs on PetsShow>Hide<
6. Damage Over TimeShow Show MineOnly Show Group Only >Hide<
7. Damage ShieldsShow>Hide<
8. Fellowship MessagesShow>Hide<
9. Focus EffecttsShow>Hide<
10. Group Chat>Show<Hide
11. Guild Chat>Show<Hide
12. Heal Over TimeShow>Hide<
13. Item SpeechShow>Hide<
14. Melee CriticalsShow>Hide<
15. Mercenary Messages Show>Hide<
16. Missed MeShow>Hide<
17. My MissesShow>Hide<
18. My Pet HitsShow>Hide<
19. My Pet MissesShow>Hide<
20. NPC Spells>Show<Hide
21. Others' HitsShow>Hide<
22. Others' MissesShow>Hide<
23. Out of Character>Show<Hide
24. PC SpellsShow>Hide<
25. Pet SpellsShow>Hide<
26. PvP Messages>Show<Hide
27. Shouts>Show<Hide
28. Socials>Show<Hide
29. SpamShow>Hide<
30. Spell CriticalsShow>Hide<
31. Spell DamageShow>Hide<
32. Strikethrough MessagesShow>Hide<
33. Stun Messages>Show<Hide
 
Nice, wonder if its possible to do the same with chat filters and which chat box # you want them to goto, so its standardized across all accounts, doing it over and over each time is a pita!
 
I've been working on figuring out how to make this a little more dynamic and useful with an Ini file and I think I have it working now if anyone wants to feedback it for me. The macro should look for SetFilters.ini when it first runs, if it doesn't find one, it will read your current filter settings and save them under a section named after the character running the macro.
To save a custom filter setting, set up the Filters on the options window to be how you want and then /echo savefilters NameToSaveAs.
To load a custom filter set from the Ini file, /echo loadfilters NameToLoad.

I've used this to set up filter sets for healers so they see what their heals are hitting for and filter out the rest of the spam, casters so they can ignore everything but their crits, etc. Again, I'm not sure that anyone else can benefit from this but I'd welcome feedback from anyone that tries it out.

Code:
| Use this to create and load filter sets to and from an ini file.
| /echo savefilters NameToSaveAs to save a filter set named NameToSaveAs to Ini
| /echo loadfilters NameToLoad to load filter set named NameToLoad from Ini
| There are 2 pre-configured sets that are hard coded into the macro from when it was first created.
| These can be accessed with /echo setupfilters main or /echo setupfilters alt
 #Event Help "[MQ2] setfilters help"
 #Event OptionsWindowFilters "[MQ2] setupfilters #1#"
 #Event SetNewFilterSet "[MQ2] savefilters #1#"
 #Event SaveBlankSet "[MQ2] savefilters"
 #Event ReadFromIni "[MQ2] loadfilters #1#"
 #Event ReadBlankSet "[MQ2] loadfilters"
 
|===============================================================================================
| SUB: Main
|===============================================================================================
 Sub Main()
  /echo SetFilters macro is running...please /echo setfilters help for help information
  /call CreateIni
 :Primeloop
  /doevents
  /goto :Primeloop
 /return
 
|===============================================================================================
| SUB: Event_Help
|===============================================================================================
 Sub Event_Help
  /bc Macro will build a default filter set if no Ini file is found.
  /bc main and alt are 2 pre-configured sets that you can use without modifying the Ini
  /bc /echo setupfilters main or /echo setupfilters alt to use these
  /bc /echo savefilters NameToSaveAs to save the current filter settings to Ini
  /bc /echo loadfilters NameToLoad to load a saved filter set from the Ini
  /bc If you can't figure out that NameToSaveAs and NameToLoad can be any name you want, please delete this macro and never reference it again
|===============================================================================================
| SUB: CreateIni
|===============================================================================================
 Sub CreateIni
  /declare thisFilterSet  string  outer
  /varset thisFilterSet ${Me}
 
  /if (${Ini[SetFilters.ini].Length}) /return
 
  /popup No Ini file found, creating a new one with ${Me} as default filter set
 
  /call FilterSetLoop
 
 /return
 
|===============================================================================================
| SUB: Event_OptionsWindowFilters
|===============================================================================================
 Sub Event_OptionsWindowFilters(Line, Filterset)
 
  |Set a variable named filterSet to hold the input value Filterset
  /declare filterSet string local
  /declare Proceed int local 0
  /declare index int local
 
  |Set up various Filterset values for preset filtering
  /if (${Filterset.Equal[main]}) {
   /noparse /varset filterSet ${index} == 1 || ${index} == 2 || ${index} == 3 || ${index} == 10 || ${index} == 11 || ${index} == 20 || ${index} == 23 || ${index} == 26 ||${index} == 27 || ${index} == 28 || ${index} == 33
   /varset Proceed 1
  } else /if (${Filterset.Equal[alt]}) {
   /noparse /varset filterSet ${index} == 1 || ${index} == 2 || ${index} == 3 || ${index} == 10 || ${index} == 11 || ${index} == 23 || ${index} == 26 || ${index} == 27 || ${index} == 28
   /varset Proceed 1
  } else {
   /echo You need to use one of the pre-defined filters to apply these changes
   /echo By default, the only pre-defined filter sets are either main or alt
   /return
  }
 
  |Loop through each index in the list of filter options
  /for index 1 to ${Window[OptionsWindow].Child[OFP_FilterList].Items}
   
   |Select the index at the value of the iterator named index
   /notify OptionsChatPage OFP_FilterList listselect ${Window[OptionsWindow].Child[OFP_FilterList].List[=${Window[OptionsWindow].Child[OFP_FilterList].List[${index}]}]}
   
   |Assign show to the indexes I want the setting to be Show for, if value of index doesn't match then set it to Hide
   |If you don't want to be spammed with the settings being applied, comment out the /bc commands, it was used for debugging
   /if (${Proceed} == 1) {
    /if (${filterSet}) {
     /notify OptionsChatPage OFP_FilterComboBox listselect ${Window[OptionsWindow].Child[OFP_FilterComboBox].List[=Show]}
     
     /bc Setting ${Window[OptionsWindow].Child[OFP_FilterList].List[${index}]} to Show
    } else {
     /notify OptionsChatPage OFP_FilterComboBox listselect ${Window[OptionsWindow].Child[OFP_FilterComboBox].List[=Hide]}
     
     /bc Setting ${Window[OptionsWindow].Child[OFP_FilterList].List[${index}]} to Hide
    }
    |Add a small delay of .3 seconds so people can see the changes being applied but not be spammed too fast to read
    |Feel free to increase or decrease this delay to a value that works for you
    /delay 3
   }
   
  /next index
 
  /echo Filter set ${Filterset} has been applied, exiting this macro
 
 /end
 
|=================================================================================================
| SUB: Event_SetNewFilterSet
|=================================================================================================
 Sub Event_SetNewFilterSet(Line, SetName)
 
  /varset thisFilterSet ${SetName}
 
  /call FilterSetLoop
 /return
 
|==================================================================================================
| SUB: SaveBlankSet
|==================================================================================================
 Sub Event_SaveBlankSet
  /echo This logic fails to execute unless a name parameter is entered after /echo savefilters
 /return
 
|==================================================================================================
| SUB: FilterSetLoop
|==================================================================================================
 Sub FilterSetLoop
 
  /declare i            int   local
 
  /for i 1 to ${Window[OptionsWindow].Child[OFP_FilterList].Items}
   /notify OptionsChatPage OFP_FilterList listselect ${Window[OptionsWindow].Child[OFP_FilterList].List[=${Window[OptionsWindow].Child[OFP_FilterList].List[${i}]}]}
   /echo Setting ${Window[OptionsWindow].Child[OFP_FilterList].List[${i}]} to: ${Window[OptionsChatPage].Child[OFP_FilterList].List[${i},2]}
   /ini "SetFilters.ini" "${thisFilterSet}" "${i}. ${Window[OptionsWindow].Child[OFP_FilterList].List[${i}]}" "${Window[OptionsChatPage].Child[OFP_FilterList].List[${i},2]}"
   
   /delay 2
   
  /next i
 
  /bc [ ${thisFilterSet} ] filter set has been created and/or updated in the SetFilters.ini file
 
 /return
 
|==================================================================================================
| SUB: Event_ReadFromIni
|==================================================================================================
 Sub Event_ReadFromIni(Line, FilterSetName)
  /echo In ReadFromIni
  /if (!${Defined[filterDescription]}) /declare filterDescriptions  string   outer  
  /declare i       int   local
  /declare thisDescription   string   local
  /declare descriptionSubstring string  local
  /declare filterSetting   string  local
  /declare loadFilterSet   string  local ${FilterSetName}
 
  /varset filterDescriptions ${Ini[SetFilters.ini,"${loadFilterSet}"]}
  /echo Reading Filter Set ${loadFilterSet}
 
  /for i 1 to ${Window[OptionsWindow].Child[OFP_FilterList].Items}
 
   |Filter select by name logic, read it from filterDescription and select it
   /varset thisDescription ${filterDescriptions.Arg[${i},|]}
   /varset descriptionSubstring ${thisDescription.Mid[4,${Math.Calc[${thisDescription.Length}-3]}]}
   /notify OptionsChatPage OFP_FilterList listselect ${Window[OptionsChatPage].Child[OFP_FilterList].List[=${descriptionSubstring}]}
   
   |With the filter highlighted, read the value from ini and select it
   /varset filterSetting ${Ini[SetFilters.ini,${loadFilterSet},${thisDescription}]}
   /notify OptionsChatPage OFP_FilterComboBox listselect ${Window[OptionsChatPage].Child[OFP_FilterComboBox].List[=${filterSetting}]}
   
   /delay 1
   
  /next i
 
  /bc [ ${loadFilterSet} ] filter settings have been applied.
 
 /return
|==================================================================================================
| SUB: Event_ReadBlankSet
|==================================================================================================
 Sub Event_ReadBlankSet
  /echo This logic fails to execute unless a name parameter is entered after /echo loadfilters
 /return
 

Attachments

Macro - Set Filters Macro

Users who are viewing this thread

Back
Top
Cart