From 102dc116a67a0ab91ab8e5ea2b1962fb59907be7 Mon Sep 17 00:00:00 2001 From: nooperation Date: Mon, 12 Sep 2022 15:58:31 -0400 Subject: [PATCH] Autostocker hotkey now runs start_rares instead of start (see new autostocker_misc.ini) --- .../autoStocker/Resources/autostockerMisc.ini | 3 +++ D2Hackit/Modules/autoStocker/main.cpp | 22 ++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/D2Hackit/Modules/autoStocker/Resources/autostockerMisc.ini b/D2Hackit/Modules/autoStocker/Resources/autostockerMisc.ini index fc2bbd8..c090878 100644 --- a/D2Hackit/Modules/autoStocker/Resources/autostockerMisc.ini +++ b/D2Hackit/Modules/autoStocker/Resources/autostockerMisc.ini @@ -1,5 +1,8 @@ [Autostocker] Hotkey=119 +HotkeyIncludesRares=1 +HotkeyIncludesSets=1 +HotkeyIncludesUniques=0 MaxUnidentifiedSCharmLvl=44 MaxUnidentifiedLCharmLvl=44 MaxUnidentifiedGCharmLvl=44 diff --git a/D2Hackit/Modules/autoStocker/main.cpp b/D2Hackit/Modules/autoStocker/main.cpp index a8ae928..c5a799e 100644 --- a/D2Hackit/Modules/autoStocker/main.cpp +++ b/D2Hackit/Modules/autoStocker/main.cpp @@ -10,6 +10,9 @@ AutoStocker autoStocker; bool settingHotkey = false; int hotkey = 0; +bool hotkeyIncludesRares = false; +bool hotkeyIncludesSets = false; +bool hotkeyIncludesUniques = false; CLIENTINFO ( @@ -179,7 +182,8 @@ BYTE EXPORT OnGameKeyDown(BYTE iKeyCode) { if(iKeyCode == hotkey) { - Start(NULL, 0); + std::unordered_set ignoredItemCodes; + autoStocker.StartRares(hotkeyIncludesSets, hotkeyIncludesRares, hotkeyIncludesUniques, false, ignoredItemCodes); } } @@ -196,14 +200,26 @@ BYTE EXPORT OnGameKeyDown(BYTE iKeyCode) void ReadConfig() { hotkey = GetPrivateProfileInt("Autostocker", "Hotkey", 0, CONFIG_FILE); + hotkeyIncludesRares = GetPrivateProfileInt("Autostocker", "HotkeyIncludesRares", 0, CONFIG_FILE); + hotkeyIncludesSets = GetPrivateProfileInt("Autostocker", "HotkeyIncludesSets", 0, CONFIG_FILE); + hotkeyIncludesUniques = GetPrivateProfileInt("Autostocker", "HotkeyIncludesUniques", 0, CONFIG_FILE); } void WriteConfig() { char configBuff[64]; - sprintf_s(configBuff, sizeof(configBuff)/sizeof(configBuff[0]), "%d", hotkey); - WritePrivateProfileString("Autostocker", "Hotkey", configBuff, CONFIG_FILE); + sprintf_s(&configBuff[0], sizeof(configBuff) / sizeof(configBuff[0]), "%d", hotkey); + WritePrivateProfileString("Autostocker", "Hotkey", &configBuff[0], CONFIG_FILE); + + sprintf_s(&configBuff[0], sizeof(configBuff)/sizeof(configBuff[0]), "%d", hotkeyIncludesRares ? 1 : 0); + WritePrivateProfileString("Autostocker", "HotkeyIncludesRares", &configBuff[0], CONFIG_FILE); + + sprintf_s(&configBuff[0], sizeof(configBuff)/sizeof(configBuff[0]), "%d", hotkeyIncludesSets ? 1 : 0); + WritePrivateProfileString("Autostocker", "HotkeyIncludesSets", &configBuff[0], CONFIG_FILE); + + sprintf_s(&configBuff[0], sizeof(configBuff)/sizeof(configBuff[0]), "%d", hotkeyIncludesUniques ? 1 : 0); + WritePrivateProfileString("Autostocker", "HotkeyIncludesUniques", &configBuff[0], CONFIG_FILE); } MODULECOMMANDSTRUCT ModuleCommands[]=