You'll want to set up a function that you call repeatedly, with incrementing inputs. Here's the one we use to build the featlist for the leveler. It starts at the last feat and goes foward, though we have far more feats than vanilla - around 4k rows at present (with a lot of blank saved ones). You'd want to start at 1100 or 1060 or whatever you're at at present - I forget the exact number of 'normal' feats.
#include "aps_include"
#include "zdlg_include_i"
#include "hgll_func_inc"
void BuildFeatList(int nStartFeat, int nInterval, float fDelay) {
object oPC = OBJECT_SELF;
int nFeat, nCount2;
if (nStartFeat < 0) {
string sList = "feat_select";
string sServer = GetLocalString(GetModule(), "ServerNumber");
int i, nCount = GetElementCount(sList, oPC);
SQLExecDirect("DELETE FROM sort_" + sServer);
string sSQL = "INSERT INTO sort_" + sServer + " VALUES (?, ?)";
for (i = 0; i < nCount; i++)
SQLExecStatement(sSQL, GetStringElement(i, sList, oPC), IntToString(GetIntElement(i, sList, oPC)));
SQLExecDirect("SELECT sort_key, sort_val FROM sort_" + sServer + " ORDER BY sort_key DESC");
while (SQLFetch() != SQL_ERROR) {
string sName = SQLDecodeSpecialChars(SQLGetData(1));
int nFeat = StringToInt(SQLGetData(2));
ReplaceIntElement(--i, nFeat, sList, oPC);
ReplaceStringElement(i, sName, sList, oPC);
}
if (i != 0) {
DeleteList(sList, oPC);
nCount = AddStringElement("An error occurred building the feat list. Please talk to a DM.", sList, oPC);
ReplaceIntElement(nCount - 1, -1000, sList, oPC);
} else {
nCount = AddStringElement("Return to first page ...", sList, oPC);
ReplaceIntElement(nCount - 1, -1000, sList, oPC);
}
return;
} else
DelayCommand(fDelay, BuildFeatList(nStartFeat-nInterval, nInterval, fDelay));
for (nFeat = nStartFeat; nFeat > (nStartFeat-nInterval); nFeat--) {
if (nFeat < 0)
return;
if (GetIsFeatAvailable(nFeat, oPC)) {
string sList = "feat_select";
string sMaster = Get2DAString("feat", "MASTERFEAT", nFeat);
int nMaster = StringToInt(sMaster);
if (nMaster > 0 || sMaster == "0") {
sList += IntToString(-(nMaster + 1));
if (GetElementCount(sList, oPC) == 0) {
nCount2 = AddStringElement("Main feat list ...", sList, oPC);
ReplaceIntElement(nCount2 - 1, -1, sList, oPC);
sMaster = GetStringByStrRef(StringToInt(Get2DAString("masterfeats", "STRREF", nMaster))) + " ...";
nCount2 = AddStringElement(sMaster, "feat_select", oPC);
ReplaceIntElement(nCount2 - 1, -(nMaster + 1), "feat_select", oPC);
}
}
nCount2 = AddStringElement(GetFeatName(nFeat), sList, oPC);
ReplaceIntElement(nCount2 - 1, nFeat, sList, oPC);
}
}
}
void main() {
BuildFeatList(3999, 25, 0.01);
}
Alternatively, if you're just inputting into MySQL, you can just do excel/googledoc coding, pasting in the repetitive INSERT statment segments into long columns, with the varying data in between. You can then do a couple large pastes to INSERT them all, since MySQL is very agreeable about parsing them properly. If you need more clarification on that, don't hesitate to ask.
Funky