• 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

Question - Placing comments in the INI file?

Joined
Oct 7, 2015
RedCents
334¢
Is it possible to embed comments in a character's INI file? I'm already forgetting why I put some things in the file. Thought it might be nice to add a comment to explain my thinking at the time I did it. For example I made a change to my to my Bard this morning...

Rich (BB code):
DPS21=Lyrical Prankster|97
DPS22=command|97|pet qswarm
DPSCond1=${Target.Named}

I would maybe like to add a comment to the pet qswarm that I added it to ensure bard pets get on each new target... this is how I would do it in C#...

Rich (BB code):
DPS21=Lyrical Prankster|97
DPS22=command|97|pet qswarm //Invoke in-game command to make pets engage new target
DPSCond1=${Target.Named}
 
Rich (BB code):
DPS21=Lyrical Prankster|97
;Invoke in-game command to make pets engage new target
DPS22=command|97|pet qswarm
DPSCond1=${Target.Named}
 
Or if you want to use the "//" just replace your LoadIni routine with this. Not fully tested, but it should work.

Rich (BB code):
    Sub LoadIni(string sectionName, string varName, string varType, string varValue, string varArray, string varArray2, string FileName, string FileName2)
        /if (${Debug}) {
            /delay 2
            /echo \atDEBUG Sub Loadini S:${sectionName} V1:${varName} V2:${varType} V3:${varValue} V4:${varArray} V5:${varArray2} V6:${FileName} V7:${FileName2} \agLine#: ${Macro.CurLine}
        }
        /declare rkTemp                 string      local 
        /declare UtilInt                int         local        0 
        /declare FileName1              string      local        ${FileName}
        | Assign ini name to default ini if not defined
        /if (${FileName1.Length}==0  || ${FileName1.Equal[NULL]}) {
            /varset FileName1 ${IniFileName}
        }
        | Check if ini value is asking for an array ie buff1 to buff20
        
        /if (${Bool[${varArray}]}) {
            /if (${${varArray}.Size}>0) {
                /declare i int local
                /for i 1 to ${${varArray}.Size}
                    /if (!${Ini[${FileName1},${sectionName},${varArray}${i}].Length}) /ini "${FileName1}" "${sectionName}" "${varArray}${i}" "${varValue}"
                    /if (${Ini[${FileName1},${sectionName},${varArray}${i}].Length}) /varset ${varArray}[${i}] ${Ini[${FileName1},${sectionName},${varArray}${i}]}
                    /if (${${varArray}[${i}].Find[//]}>0) /varset ${varArray}[${i}] ${${varArray}[${i}].Left[${Math.Calc[${${varArray}[${i}].Find[//]}-1]}]}
                    /if (${Debug}) /echo \atDEBUG ${ConditionsOn} ${Int[${varArray2.Length}]} ${varArray2.Length} ${Bool[${varArray2.NotEqual[null]}]} ${varArray2}
                    /if (${Defined[ConditionsOn]}) {
                        /if (${ConditionsOn} && ${Int[${varArray2.Length}]}>0 && ${varArray2.NotEqual[null]}) {
                            | Check to see if the conditions file is a different file and update spell info.
                            /if (${FileName2.NotEqual[${FileName1}]}) /ini "${FileName2}" "${sectionName}" "${varName}${i}" "${${varArray}[${i}]}"
                            /if (!${Ini[${FileName2},${sectionName},${varArray2}${i}].Length}) {
                                /if (${${varArray}[${i}].NotEqual[null]}) {
                                    /ini "${FileName2}" "${sectionName}" "${varArray2}${i}" "TRUE"
                                } else {
                                    /ini "${FileName2}" "${sectionName}" "${varArray2}${i}" "FALSE"
                                }
                            }
                            /varset ${varArray2}[${i}]  ${Ini[${FileName2},${sectionName},${varArray2}${i},TRUE,noparse]}
                        } else /if (${Int[${varArray2.Length}]}>0 && ${varArray2.NotEqual[null]}) {
                            /varset ${varArray2}[${i}] TRUE
                        } 
                    } else {
                        /varset ${varArray2}[${i}] TRUE
                    }
                    /if (${${varArray}[${i}].NotEqual[null]}) {
                        | find out if there is a Rank and fix spell name.
                        /if (${varType.Equal[string]} && ${Int[${${varArray}[${i}].Left[1]}]}==0) {
                                /call SpellRankCheck "${${varArray}[${i}]}"
                            /varset ${varArray}[${i}] ${Macro.Return}
                        }
                        | code to fix the Heal PCT for those zones that knock your HPs down to 
                        /if (${sectionName.Equal[Heals]} && ${Select[${Zone.ID},795,796]}) {
                            /if (${Int[${${varArray}[${i}].Arg[2,|].Left[1]}]}>0) {
                                /varset UtilInt ${Int[${${varArray}[${i}].Arg[2,|]}]}
                                /varcalc UtilInt 70*(${UtilInt}/100)
                                /varset ${varArray}[${i}] ${${varArray}[${i}].Replace[|${${varArray}[${i}].Arg[2,|]},|${UtilInt}]}
                            }
                        } else /if (${sectionName.Equal[DPS]} && ${Int[${${varArray}[${i}].Arg[2,|].Left[1]}]}>0 && ${${varArray}[${i}].Arg[3,|].Equal[debuffall]}) {
                            /varcalc UtilInt ${Int[${${varArray}[${i}].Arg[2,|]}]}+100
                            /varset ${varArray}[${i}] ${${varArray}[${i}].Replace[|${${varArray}[${i}].Arg[2,|]},|${UtilInt}]}
                        }
                    }
                    /if (${Debug}) /echo  \atDEBUG Loadini ${i} - ${varArray}[${i}] - ${${varArray}[${i}]} - ${Macro.Return} - ${Me.AltAbility[${Macro.Return}]} \agLine#: ${Macro.CurLine}
                /next i
                /return
            }
        } else {
            /if (!${Defined[${varName}]} && ${Select[${varType},string,float,int]}>0) /declare ${varName} ${varType} outer 0
            |Using the varArray2 to tell if trying to find a conditional entry or not. False = conditional null = non-conditional
            /if (${varArray2.Length}==0 || ${varArray2.Equal[false]} || ${varArray2.Equal[NULL]}) {
                /if (!${Ini[${FileName1},${sectionName},${varName}].Length}) {
                    /if (${varValue.Length}) {
                        /ini "${FileName1}" "${sectionName}" "${varName}" "${varValue}"
                        /varset ${varName} ${varValue}
                        /if (${Debug}) /echo \atDEBUG Sub Loadini /varset ${varName} ${varValue} \agLine#: ${Macro.CurLine}
                    }
                } else {
                    /varset ${varName} ${Ini[${FileName1},${sectionName},${varName}]}
                    /if (${${varName}.Find[//]}>0) /varset ${varName} ${${varName}.Left[${Math.Calc[${${varName}.Find[//]}-1]}]}
                }
                /if (${FileName1.Equal[${IniFileName}]}) {
                    /varset rkTemp ${${varName}}
                    | find out if there is a Rank and fix spell name.
                    /if (${varType.Equal[string]} && ${Int[${rkTemp.Left[1]}]}==0 && !${varName.Find[Help]}) {
                        /call SpellRankCheck "${${varName}}"
                        /if (${Macro.Return.NotEqual[null]}) /varset ${varName} ${Macro.Return}
                    }
                }
            } else /if (${Defined[ConditionsOn]}) {
                /if (${ConditionsOn}) {
                    /if (!${Ini[${FileName1},${sectionName},${varName}].Length}) {
                        /if (${varValue.Length}) {
                            /ini "${FileName1}" "${sectionName}" "${varName}" "${varValue}"
                            /varset ${varName} ${varValue}
                            /if (${Debug}) /echo \atDEBUG Sub Loadini /varset ${varName} ${varValue} \agLine#: ${Macro.CurLine}
                        }
                    } else {
                        /varset ${varName} ${Ini[${FileName1},${sectionName},${varName}]}
                        /if (${${varName}.Find[//]}>0) /varset ${varName} ${${varName}.Left[${Math.Calc[${${varName}.Find[//]}-1]}]}
                    }
                } else {
                    /varset ${varName} ${varValue}
                }
            } else {
                /varset ${varName} ${varValue}
            }
            /if (${Debug}) /echo \atDEBUG Sub LoadIni: ${varName} - ${${varName}} \agLine#: ${Macro.CurLine}
            /varset rkTemp 
        }
        /if (${Debug}) /echo \atDEBUG Sub LoadIni: Leave \agLine#: ${Macro.CurLine}
    /return

Enjoy. Does not check conditional lines so do NOT use "//" in conditional lines.
 
lol ctaylor that was alot of work for that!
 
Question - Placing comments in the INI file?

Users who are viewing this thread

Back
Top
Cart