General Mq2MoveUtils not reading .ini ?
Reply
Mq2MoveUtils not reading .ini ?
I am having issues with MQ2MoveUtils in the UF classic build. I am trying to stick and chase down mobs that for whatever reason warp around the map pretty often. I keep getting the message that "Stick command has ended due to target warping out of BreakDist range." I have gone into the .ini file and changed the BreakDist range several times with no results. I have also tried turning off the option to have it break on warp. I have restarted mwq2 and reloaded the plugin also.

For whatever reason and I hope it is just me being silly and missing something it doesn't seem like mq2moveutils is reading its ini file.
Sun Mar 10, 2013 9:39 am
I'm still looking through the code but it looks like breakwarp defaults to true. Try not setting it to anything and give it a whirl.
Sun Mar 10, 2013 2:38 pm
Project Lead
It should look like:

[Stick]
BreakOnWarp=on
Sun Mar 10, 2013 2:41 pm
Project Lead
Heh, okay, this may be the issue.

c++
More +
GetPrivateProfileString("Stick",    "BreakOnWarp",     SET_S->BreakWarp   ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_S->BreakWarp = (!strnicmp(szTemp, "on", 3));
    if (SET_S->BreakWarp) SET_S->PauseWarp = false;
    GetPrivateProfileString("Stick",    "PauseOnWarp",     SET_S->PauseWarp   ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_S->PauseWarp = (!strnicmp(szTemp, "on", 3));
    if (SET_S->PauseWarp) SET_S->BreakWarp = false;


Basically if pausewarp is on breakwarp gets turned off. So try turning BreakOnWarp on and pauseonwarp off.
Sun Mar 10, 2013 2:44 pm
Project Lead
This is what my ini file contains. I tried turning Pause off and Break Warp on and am still having the issue with "Stick ending because target warped out of BreakDist range."

[Defaults]
AutoPause=off
ManualPause=off
PauseOnWarp=off
BreakOnWarp=on
BreakDist=9999999999900.0
BreakOnGate=off
Verbosity=1
stuckDist=0.01
turnDirection=-10.0
stuckCheck=5
StuckLogic=on
TryToJump=on
turnhalf=on
LeashLength=100.0
CampRadius=20.0
MinDelay=500
MaxDelay=5000
Sun Mar 10, 2013 5:39 pm
Sorry i've been over at my in-laws all night. I'll look through the code again, but the part I was looking at made it look like it went under "[stick]" and not under "[defaults]". I'm not authority on this plugin though, in fact I don't think I ever had to mess with the INI when I used it :)


Try adding a "stick" section with breakonwarp, breakdistance and pauseonwarp. I'll look through the code again when I get a chance.
Mon Mar 11, 2013 9:05 pm
Project Lead
Do you use MQ2Melee as well? MQ2Melee has settings that affects it's use of /stick.
Tue Mar 12, 2013 8:41 am
Senior Project Member
GetPrivateProfileString is a windows function that reads from ini files. You pass it info and it returns the text from the file. The info passed is in this format:

c++
More +
GetPrivateProfileString(SECTION, KEY, DEFAULT_VALUE, PLACE_TO_SAVE, MAX_STRING, FILE_NAME);



So to read this ini file:

ini
More +

[section1]
Key1=merrymaudigan


We would use:

c++
More +
GetPrivateProfileString("section1", "Key1", "not found", variablename, 256, "c:\myfile.ini");


Now the real file, expand this code window and search for "BreakOnWarp".

You'll see that it doesn't read it from [Default] but from [stick]. Alternatively it can readcharacters section named after your character, like [Maudigan]. The one with your name probably takes precedence. Meaning if it's populated it ignores the one under [stick]. So make sure that if there is a section for your character that it is set up correctly. Also make a [stick] section with the correct stuff under it--search for "stick" in the code below if you aren't sure. Make sure the pauseonwarp is off in both places too. Please, let me know if this helps and I'll update the ini file that's in the download.

c++
More +
void LoadConfig()
{
    char szTemp[MAX_STRING]     = {0};
    char szTempF[MAX_STRING]    = {0};
    bool bRewriteIni            = false; // re-save if bad values were read

    // default settings
    GetPrivateProfileString("Defaults", "AllowMove",       ftoa(SET->AllowMove, szTempF),   szTemp, MAX_STRING, INIFileName);
    if ((float)atof(szTemp) >= 10.0f)
    {
        SET->AllowMove = (float)atof(szTemp);
    }
    else
    {
        bRewriteIni = true;
    }
    GetPrivateProfileString("Defaults", "AutoPause",       SET->AutoPause   ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET->AutoPause = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("Defaults", "AutoSave",        SET->AutoSave    ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET->AutoSave = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("Defaults", "AutoUW",          SET->AutoUW      ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET->AutoUW = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("Defaults", "BreakKeyboard",   SET->BreakKB     ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET->BreakKB = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("Defaults", "BreakMouse",      SET->BreakMouse  ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET->BreakMouse = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("Defaults", "BreakOnGM",       SET->BreakGM     ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET->BreakGM = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("Defaults", "BreakOnSummon",   SET->BreakSummon ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET->BreakSummon = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("Defaults", "DistSummon",      ftoa(SET->DistSummon, szTempF),  szTemp, MAX_STRING, INIFileName);
    if ((float)atof(szTemp) >= 2.0f)
    {
        SET->DistSummon = (float)atof(szTemp);
    }
    else
    {
        bRewriteIni = true;
    }
    GetPrivateProfileString("Defaults", "FeignSupport",    SET->Feign       ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET->Feign = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("Defaults", "Heading", (SET->Head == H_TRUE) ? "true" : (SET->Head == H_LOOSE ? "loose" : "fast"), szTemp, MAX_STRING, INIFileName);
    SET->Head = H_FAST;
    if (!strnicmp(szTemp, "true", 5))
    {
        SET->Head = H_TRUE;
    }
    else if (!strnicmp(szTemp, "loose", 6))
    {
        SET->Head = H_LOOSE;
    }
    GetPrivateProfileString("Defaults", "KeyboardPause",   SET->PauseKB     ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET->PauseKB = (!strnicmp(szTemp, "on", 3));
    if (SET->PauseKB) SET->BreakKB = false;
    GetPrivateProfileString("Defaults", "MousePause",      SET->PauseMouse  ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET->PauseMouse = (!strnicmp(szTemp, "on", 3));
    if (SET->PauseMouse) SET->BreakMouse = false;
    GetPrivateProfileString("Defaults", "LockPause",       SET->LockPause   ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET->LockPause = (!strnicmp(szTemp, "on", 3));
    PAUSE->MaxDelay(GetPrivateProfileInt("Defaults", "PauseMaxDelay", PAUSE->Max, INIFileName));
    PAUSE->MinDelay(GetPrivateProfileInt("Defaults", "PauseMinDelay", PAUSE->Min, INIFileName));
    GetPrivateProfileString("Defaults", "SaveByChar",      SET->SaveByChar  ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET->SaveByChar = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("Defaults", "TurnRate",        ftoa(SET->TurnRate, szTempF),    szTemp, MAX_STRING, INIFileName);
    if ((float)atof(szTemp) >= 1.0f && (float)atof(szTemp) <= 100.0f)
    {
        SET->TurnRate = (float)atof(szTemp);
    }
    else
    {
        bRewriteIni = true;
    }
    GetPrivateProfileString("Defaults", "UseWindow",       SET->Window      ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET->Window = (!strnicmp(szTemp, "on", 3));
    // verbosity flag handling
    GetPrivateProfileString("Defaults", "Verbosity", (uiVerbLevel & V_VERBOSITY) == V_VERBOSITY ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    if (!strnicmp(szTemp, "on", 3))
    {
        uiVerbLevel |= V_VERBOSITY;
    }
    else
    {
        uiVerbLevel &= ~V_VERBOSITY;
    }
    // FullVerbosity is more frequent, detailed output, and differs from Verbosity
    // Setting one does not include the text of the other.
    GetPrivateProfileString("Defaults", "FullVerbosity", (uiVerbLevel & V_FULLVERBOSITY) == V_FULLVERBOSITY ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    if (!strnicmp(szTemp, "on", 3))
    {
        uiVerbLevel |= V_FULLVERBOSITY;
    }
    else
    {
        uiVerbLevel &= ~V_FULLVERBOSITY;
    }
    // Total Silence disables all output except extreme error messages and BreakOnSummon
    GetPrivateProfileString("Defaults", "TotalSilence", (uiVerbLevel == V_SILENCE) ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    if (!strnicmp(szTemp, "on", 3))
    {
        uiVerbLevel = V_SILENCE;
    }
    // do not need an else, just leaves flags alone if we arent silencing
    // if totalsilence is not set to 'on', set flags directly. if ini entry doesnt exist, default will have been set by verb/full reads above
    if (uiVerbLevel != V_SILENCE)
    {
        uiVerbLevel = GetPrivateProfileInt("Defaults", "VerbosityFlags", uiVerbLevel, INIFileName);
        GetPrivateProfileString("Defaults", "AutoPauseMsg", (uiVerbLevel & V_AUTOPAUSE) == V_AUTOPAUSE ? "on" : "off", szTemp, MAX_STRING, INIFileName);
        if (!strnicmp(szTemp, "on", 3))
        {
            uiVerbLevel |= V_AUTOPAUSE;
        }
        else
        {
            uiVerbLevel &= ~V_AUTOPAUSE;
        }
        GetPrivateProfileString("Defaults", "HideHelp", (uiVerbLevel & V_HIDEHELP) == V_HIDEHELP ? "on" : "off", szTemp, MAX_STRING, INIFileName);
        if (!strnicmp(szTemp, "on", 3))
        {
            uiVerbLevel |= V_HIDEHELP;
        }
        else
        {
            uiVerbLevel &= ~V_HIDEHELP;
        }
    }
    GetPrivateProfileString("Defaults", "WinEQ",           SET->WinEQ       ? "on" : "off",   szTemp, MAX_STRING, INIFileName);
    SET->WinEQ = (!strnicmp(szTemp, "on", 3));

    // stick settings
    GetPrivateProfileString("Stick",    "AlwaysUW",        SET_S->UW        ? "on" : "off",   szTemp, MAX_STRING, INIFileName);
    SET_S->UW = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("Stick",    "ArcBehind",       ftoa(SET_S->ArcBehind, szTempF),   szTemp, MAX_STRING, INIFileName);
    if ((float)atof(szTemp) > 5.0f && (float)atof(szTemp) < 260.0f)
    {
        SET_S->ArcBehind = (float)atof(szTemp);
    }
    else
    {
        bRewriteIni = true;
    }
    GetPrivateProfileString("Stick",    "ArcNotFront",     ftoa(SET_S->ArcNotFront, szTempF), szTemp, MAX_STRING, INIFileName);
    if ((float)atof(szTemp) > 5.0f && (float)atof(szTemp) < 260.0f)
    {
        SET_S->ArcNotFront = (float)atof(szTemp);
    }
    else
    {
        bRewriteIni = true;
    }
    GetPrivateProfileString("Stick",    "AwareNotAggro",   SET->Spin          ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET->Spin = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("Stick",    "BreakOnGate",     SET_S->BreakGate   ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_S->BreakGate = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("Stick",    "BreakOnHit",      SET_S->BreakHit    ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_S->BreakHit = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("Stick",    "BreakOnTarget",   SET_S->BreakTarget ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_S->BreakTarget = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("Stick",    "BreakOnWarp",     SET_S->BreakWarp   ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_S->BreakWarp = (!strnicmp(szTemp, "on", 3));
    if (SET_S->BreakWarp) SET_S->PauseWarp = false;
    GetPrivateProfileString("Stick",    "PauseOnWarp",     SET_S->PauseWarp   ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_S->PauseWarp = (!strnicmp(szTemp, "on", 3));
    if (SET_S->PauseWarp) SET_S->BreakWarp = false;
    GetPrivateProfileString("Stick",    "DelayStrafe",     SET_S->DelayStrafe ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_S->DelayStrafe = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("Stick",    "DistBackup",      ftoa(SET_S->DistBack, szTempF),    szTemp, MAX_STRING, INIFileName);
    if ((float)atof(szTemp) >= 1.0f)
    {
        SET_S->DistBack = (float)atof(szTemp);
    }
    else
    {
        bRewriteIni = true;
    }
    GetPrivateProfileString("Stick",    "DistBreak",       ftoa(SET_S->DistBreak, szTempF),   szTemp, MAX_STRING, INIFileName);
    if ((float)atof(szTemp) >= 1.0f)
    {
        SET_S->DistBreak = (float)atof(szTemp);
    }
    else
    {
        bRewriteIni = true;
    }
    GetPrivateProfileString("Stick",    "DistFlex",        ftoa(SET_S->DistFlex,  szTempF),   szTemp, MAX_STRING, INIFileName);
    if ((float)atof(szTemp) >= 2.0f && (float)atof(szTemp) <= 20.0f)
    {
        SET_S->DistFlex = (float)atof(szTemp);
    }
    else
    {
        bRewriteIni = true;
    }
    GetPrivateProfileString("Stick",    "DistMod",         ftoa(SET_S->DistMod, szTempF),     szTemp, MAX_STRING, INIFileName);
    if ((float)atof(szTemp) >= 0.0f)
    {
        SET_S->DistMod = (float)atof(szTemp);
    }
    else
    {
        bRewriteIni = true;
    }
    GetPrivateProfileString("Stick",    "DistMod%",        ftoa(SET_S->DistModP, szTempF),    szTemp, MAX_STRING, INIFileName);
    if ((float)atof(szTemp) >= 0.0f)
    {
        SET_S->DistModP = (float)atof(szTemp);
    }
    else
    {
        bRewriteIni = true;
    }
    GetPrivateProfileString("Stick",    "DistSnaproll",    ftoa(SET_S->DistSnap, szTempF),    szTemp, MAX_STRING, INIFileName);
    if ((float)atof(szTemp) >= 1.0f)
    {
        SET_S->DistSnap = (float)atof(szTemp);
    }
    else
    {
        bRewriteIni = true;
    }
    SET_S->MaxDelay(GetPrivateProfileInt("Stick", "StrafeMaxDelay", SET_S->Max, INIFileName));
    SET_S->MinDelay(GetPrivateProfileInt("Stick", "StrafeMinDelay", SET_S->Min, INIFileName));
    // end stick delays
    GetPrivateProfileString("Stick",    "RandomArc",       SET_S->Randomize   ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_S->Randomize = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("Stick",    "UseBackward",     SET_S->UseBack     ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_S->UseBack = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("Stick",    "UseFleeing",      SET_S->UseFleeing  ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_S->UseFleeing = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("Stick",    "UseFlex",         SET_S->Flex        ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_S->Flex = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("Stick",    "UseWalk",         SET_S->Walk        ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_S->Walk = (!strnicmp(szTemp, "on", 3));

    // makecamp settings
    GetPrivateProfileString("MakeCamp", "CampRadius",      ftoa(SET_CAMP->Radius, szTempF),   szTemp, MAX_STRING, INIFileName);
    if ((float)atof(szTemp) >= 5.0f)
    {
        SET_CAMP->SetRadius((float)atof(szTemp));
    }
    else
    {
        bRewriteIni = true;
    }
    SET_CAMP->MaxDelay(GetPrivateProfileInt("MakeCamp", "MaxDelay", SET_CAMP->Max, INIFileName));
    SET_CAMP->MinDelay(GetPrivateProfileInt("MakeCamp", "MinDelay", SET_CAMP->Min, INIFileName));
    GetPrivateProfileString("MakeCamp", "RealtimePlayer",   SET_CAMP->Realtime   ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_CAMP->Realtime = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("MakeCamp", "ReturnHaveTarget", SET_CAMP->HaveTarget ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_CAMP->HaveTarget = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("MakeCamp", "ReturnNoAggro",    SET_CAMP->NoAggro    ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_CAMP->NoAggro = (!strnicmp(szTemp, "on", 3));;
    GetPrivateProfileString("MakeCamp", "ReturnNotLooting", SET_CAMP->NotLoot    ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_CAMP->NotLoot = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("MakeCamp", "UseLeash",         SET_CAMP->Leash      ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_CAMP->Leash = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("MakeCamp", "LeashLength",      ftoa(SET_CAMP->Length, szTempF),     szTemp, MAX_STRING, INIFileName);
    if ((float)atof(szTemp) >= SET_CAMP->Radius)
    {
        SET_CAMP->SetLeash((float)atof(szTemp));
    }
    else
    {
        bRewriteIni = true;
    }
    // scatter configuration (makecamp)
    GetPrivateProfileString("MakeCamp", "UseScatter",       SET_CAMP->Scatter    ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_CAMP->Scatter = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("MakeCamp", "Bearing",          ftoa(SET_CAMP->Bearing, szTempF),    szTemp, MAX_STRING, INIFileName);
    SET_CAMP->Bearing = (float)atof(szTemp);
    GetPrivateProfileString("MakeCamp", "ScatDist",         ftoa(SET_CAMP->ScatDist, szTempF),   szTemp, MAX_STRING, INIFileName);
    if ((float)atof(szTemp) >= 1.0f)
    {
        SET_CAMP->ScatDist = (float)atof(szTemp);
    }
    else
    {
        bRewriteIni = true;
    }
    GetPrivateProfileString("MakeCamp", "ScatSize",         ftoa(SET_CAMP->ScatSize, szTempF),   szTemp, MAX_STRING, INIFileName);
    if ((float)atof(szTemp) >= 1.0f)
    {
        SET_CAMP->ScatSize = (float)atof(szTemp);
    }
    else
    {
        bRewriteIni = true;
    }

    // moveto settings
    GetPrivateProfileString("MoveTo",   "AlwaysUW",         SET_M->UW            ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_M->UW = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("MoveTo",   "ArrivalDist",      ftoa(SET_M->Dist, szTempF),          szTemp, MAX_STRING, INIFileName);
    if ((float)atof(szTemp) >= 1.0f)
    {
        SET_M->Dist = (float)atof(szTemp);
    }
    else
    {
        bRewriteIni = true;
    }
    GetPrivateProfileString("MoveTo",   "ArrivalDistX",     ftoa(SET_M->DistX, szTempF),         szTemp, MAX_STRING, INIFileName);
    if ((float)atof(szTemp) >= 1.0f)
    {
        SET_M->DistX = (float)atof(szTemp);
    }
    else
    {
        bRewriteIni = true;
    }
    GetPrivateProfileString("MoveTo",   "ArrivalDistY",     ftoa(MOVETO->DistY, szTempF),        szTemp, MAX_STRING, INIFileName);
    if ((float)atof(szTemp) >= 1.0f)
    {
        SET_M->DistY = (float)atof(szTemp);
    }
    else
    {
        bRewriteIni = true;
    }
    GetPrivateProfileString("MoveTo",   "BreakOnAggro",     SET_M->BreakAggro    ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_M->BreakAggro = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("MoveTo",   "BreakOnHit",       SET_M->BreakHit      ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_M->BreakHit = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("MoveTo",   "DistBackup",      ftoa(SET_M->DistBack, szTempF),       szTemp, MAX_STRING, INIFileName);
    if ((float)atof(szTemp) >= 1.0f)
    {
        SET_M->DistBack = (float)atof(szTemp);
    }
    else
    {
        bRewriteIni = true;
    }
    GetPrivateProfileString("MoveTo",   "MoveToMod",        ftoa(SET_M->Mod, szTempF),           szTemp, MAX_STRING, INIFileName);
    if ((float)atof(szTemp) >= 0.0f)
    {
        SET_M->Mod = (float)atof(szTemp);
    }
    else
    {
        bRewriteIni = true;
    }
    GetPrivateProfileString("MoveTo",   "UseBackward",      SET_M->UseBack       ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_M->UseBack = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("MoveTo",   "UseWalk",          SET_M->Walk          ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_M->Walk = (!strnicmp(szTemp, "on", 3));

    // circle settings
    GetPrivateProfileString("Circle",   "Backward",         SET_C->Backward      ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_C->Backward = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("Circle",   "CCW",              SET_C->CCW           ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_C->CCW = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("Circle",   "Drunken",          SET_C->Drunk         ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    SET_C->Drunk = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("Circle",   "RadiusSize",       ftoa(SET_C->Radius, szTempF),        szTemp, MAX_STRING, INIFileName);
    if ((float)atof(szTemp) >= 5.0f)
    {
        SET_C->SetRadius((float)atof(szTemp));
    }
    else
    {
        bRewriteIni = true;
    }

    // stuck logic related
    GetPrivateProfileString("StuckLogic", "StuckLogic",     STUCK->On            ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    STUCK->On = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("StuckLogic", "DistStuck",      ftoa(STUCK->Dist, szTempF),          szTemp, MAX_STRING, INIFileName);
    if ((float)atof(szTemp) > 0.0f)
    {
        STUCK->Dist = (float)atof(szTemp);
    }
    else
    {
        bRewriteIni = true;
    }
    sprintf(szTempF, "%uh", STUCK->Check);
    GetPrivateProfileString("StuckLogic", "PulseCheck",     szTempF,                             szTemp, MAX_STRING, INIFileName);
    if ((unsigned int)atoi(szTemp) > 1)
    {
        STUCK->Check = (unsigned int)atoi(szTemp);
    }
    else
    {
        bRewriteIni = true;
    }
    sprintf(szTempF, "%uh", STUCK->Unstuck);
    GetPrivateProfileString("StuckLogic", "PulseUnstuck",   szTempF,                             szTemp, MAX_STRING, INIFileName);
    if ((unsigned int)atoi(szTemp) > 1)
    {
        STUCK->Unstuck = (unsigned int)atoi(szTemp);
    }
    else
    {
        bRewriteIni = true;
    }
    GetPrivateProfileString("StuckLogic", "TryToJump",      STUCK->Jump          ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    STUCK->Jump = (!strnicmp(szTemp, "on", 3));
    GetPrivateProfileString("StuckLogic", "TurnHalf",       STUCK->TurnHalf      ? "on" : "off", szTemp, MAX_STRING, INIFileName);
    STUCK->TurnHalf = (!strnicmp(szTemp, "on", 3));

    // check if we want to explicitly ignore this char's custom ini
    GetPrivateProfileString(szCharName, "DisregardMe", "false", szTemp, MAX_STRING, INIFileName);
    if (SET->SaveByChar && strnicmp(szTemp, "true", 5))
    {
        // Character specific
        GetPrivateProfileString(szCharName, "AllowMove",    ftoa(SET->AllowMove, szTempF),       szTemp, MAX_STRING, INIFileName);
        if ((float)atof(szTemp) > 10.0f)
        {
            SET->AllowMove = (float)atof(szTemp);
        }
        else
        {
            bRewriteIni = true;
        }
        GetPrivateProfileString(szCharName, "ArcBehind",    ftoa(SET_S->ArcBehind, szTempF),     szTemp, MAX_STRING, INIFileName);
        if ((float)atof(szTemp) > 5.0f && (float)atof(szTemp) < 260.0f)
        {
            SET_S->ArcBehind = (float)atof(szTemp);
        }
        else
        {
            bRewriteIni = true;
        }
        GetPrivateProfileString(szCharName, "ArcNotFront",  ftoa(SET_S->ArcNotFront, szTempF),   szTemp, MAX_STRING, INIFileName);
        if ((float)atof(szTemp) > 5.0f && (float)atof(szTemp) < 260.0f)
        {
            SET_S->ArcNotFront = (float)atof(szTemp);
        }
        else
        {
            bRewriteIni = true;
        }
        GetPrivateProfileString(szCharName, "AutoSave",     SET->AutoSave        ? "on" : "off", szTemp, MAX_STRING, INIFileName);
        SET->AutoSave = (!strnicmp(szTemp, "on", 3));
        GetPrivateProfileString(szCharName, "AutoUW",       SET->AutoUW          ? "on" : "off", szTemp, MAX_STRING, INIFileName);
        SET->AutoUW = (!strnicmp(szTemp, "on", 3));
        GetPrivateProfileString(szCharName, "BreakOnGate",  SET_S->BreakGate     ? "on" : "off", szTemp, MAX_STRING, INIFileName);
        SET_S->BreakGate = (!strnicmp(szTemp, "on", 3));
        GetPrivateProfileString(szCharName, "BreakOnWarp",  SET_S->BreakWarp     ? "on" : "off", szTemp, MAX_STRING, INIFileName);
        SET_S->BreakWarp = (!strnicmp(szTemp, "on", 3));
        if (SET_S->BreakWarp) SET_S->PauseWarp = false;
        GetPrivateProfileString(szCharName, "PauseOnWarp",  SET_S->PauseWarp     ? "on" : "off", szTemp, MAX_STRING, INIFileName);
        SET_S->PauseWarp = (!strnicmp(szTemp, "on", 3));
        if (SET_S->PauseWarp) SET_S->BreakWarp = false;
        GetPrivateProfileString(szCharName, "LockPause",    SET->LockPause       ? "on" : "off", szTemp, MAX_STRING, INIFileName);
        SET->LockPause = (!strnicmp(szTemp, "on", 3));
        GetPrivateProfileString(szCharName, "DistBreak",    ftoa(STICK->DistBreak, szTempF),     szTemp, MAX_STRING, INIFileName);
        if ((float)atof(szTemp) >= 1.0f)
        {
            STICK->DistBreak = (float)atof(szTemp);
        }
        else
        {
            bRewriteIni = true;
        }
        GetPrivateProfileString(szCharName, "DistSnaproll", ftoa(SET_S->DistSnap, szTempF),      szTemp, MAX_STRING, INIFileName);
        if ((float)atof(szTemp) >= 1.0f)
        {
            SET_S->DistSnap = (float)atof(szTemp);
        }
        else
        {
            bRewriteIni = true;
        }
        GetPrivateProfileString(szCharName, "FeignSupport", SET->Feign           ? "on" : "off", szTemp, MAX_STRING, INIFileName);
        SET->Feign = (!strnicmp(szTemp, "on", 3));
        GetPrivateProfileString(szCharName, "Heading",      (SET->Head == H_TRUE ? "true" : (SET->Head == H_LOOSE ? "loose" : "fast")), szTemp, MAX_STRING, INIFileName);
        SET->Head = H_FAST;
        if (!strnicmp(szTemp, "true", 5))
        {
            SET->Head = H_TRUE;
        }
        else if (!strnicmp(szTemp, "loose", 6))
        {
            SET->Head = H_LOOSE;
        }
        GetPrivateProfileString(szCharName, "LeashLength",  ftoa(SET_CAMP->Length, szTempF),      szTemp, MAX_STRING, INIFileName);
        if ((float)atof(szTemp) >= SET_CAMP->Radius)
        {
            SET_CAMP->SetLeash((float)atof(szTemp));
        }
        else
        {
            bRewriteIni = true;
        }
        GetPrivateProfileString(szCharName, "UseLeash",     SET_CAMP->Leash      ? "on" : "off", szTemp, MAX_STRING, INIFileName);
        SET_CAMP->Leash = (!strnicmp(szTemp, "on", 3));
        GetPrivateProfileString(szCharName, "UseWindow",    SET->Window          ? "on" : "off", szTemp, MAX_STRING, INIFileName);
        SET->Window = (!strnicmp(szTemp, "on", 3));
        // verbosity flag handling
        GetPrivateProfileString(szCharName, "Verbosity", (uiVerbLevel & V_VERBOSITY) == V_VERBOSITY ? "on" : "off", szTemp, MAX_STRING, INIFileName);
        if (!strnicmp(szTemp, "on", 3))
        {
            uiVerbLevel |= V_VERBOSITY;
        }
        else
        {
            uiVerbLevel &= ~V_VERBOSITY;
        }
        // FullVerbosity is more frequent, detailed output, and differs from Verbosity
        // Setting one does not include the text of the other.
        GetPrivateProfileString(szCharName, "FullVerbosity", (uiVerbLevel & V_FULLVERBOSITY) == V_FULLVERBOSITY ? "on" : "off", szTemp, MAX_STRING, INIFileName);
        if (!strnicmp(szTemp, "on", 3))
        {
            uiVerbLevel |= V_FULLVERBOSITY;
        }
        else
        {
            uiVerbLevel &= ~V_FULLVERBOSITY;
        }
        // set flags directly, if no entry present use results of above reads
        uiVerbLevel = GetPrivateProfileInt(szCharName, "VerbosityFlags", uiVerbLevel, INIFileName);

        GetPrivateProfileString(szCharName, "CampRadius",   ftoa(SET_CAMP->Radius, szTempF),     szTemp, MAX_STRING, INIFileName);
        if ((float)atof(szTemp) >= 5.0f)
        {
            SET_CAMP->SetRadius((float)atof(szTemp));
        }
        else
        {
            bRewriteIni = true;
        }
        GetPrivateProfileString(szCharName, "RealtimePlayer", SET_CAMP->Realtime ? "on" : "off", szTemp, MAX_STRING, INIFileName);
        SET_CAMP->Realtime = (!strnicmp(szTemp, "on", 3));
        // scatter configuration (makecamp)
        GetPrivateProfileString(szCharName, "UseScatter",     SET_CAMP->Scatter  ? "on" : "off", szTemp, MAX_STRING, INIFileName);
        SET_CAMP->Scatter = (!strnicmp(szTemp, "on", 3));
        GetPrivateProfileString(szCharName, "Bearing",        ftoa(SET_CAMP->Bearing, szTempF),  szTemp, MAX_STRING, INIFileName);
        SET_CAMP->Bearing = (float)atof(szTemp);
        GetPrivateProfileString(szCharName, "ScatDist",       ftoa(SET_CAMP->ScatDist, szTempF), szTemp, MAX_STRING, INIFileName);
        if ((float)atof(szTemp) >= 1.0f)
        {
            SET_CAMP->ScatDist = (float)atof(szTemp);
        }
        else
        {
            bRewriteIni = true;
        }
        GetPrivateProfileString(szCharName, "ScatSize",      ftoa(SET_CAMP->ScatSize, szTempF),  szTemp, MAX_STRING, INIFileName);
        if ((float)atof(szTemp) >= 1.0f)
        {
            SET_CAMP->ScatSize = (float)atof(szTemp);
        }
        else
        {
            bRewriteIni = true;
        }
    }

    if (bRewriteIni) SaveConfig();
    // copy new setting defaults to active
    pMU->NewDefaults();
    // create window if needed
    if (SET->Window)
    {
        WINDOW->Create();
    }
    else
    {
        WINDOW->Destroy(true);
    }
}
[/syntax]
Wed Mar 13, 2013 6:56 pm
Project Lead
I woulda made the ini file myself but I'm on the iPad and I'm not a masochist :)
Wed Mar 13, 2013 7:03 pm
Project Lead
General Mq2MoveUtils not reading .ini ?
Reply