Sir R. M8gic1an
2011-02-15 08:17:42
I'm calling it v2 cus a new TScriptRecord would infact break compatability.
This is not just so we call it v2, this is so we can better manage MSI :)
Records & Pointers are the main point behind the TScriptRecord.
and right now it is not finished, I am currently developing it as the ideas pop in my mind.
PreBank being any withdrawing or depositing that needs doing before going to location. PostBank being the same when you return to bank with a full load.
StartScript
repeat
– PreBank
——- Do Load
– PostBank
until(false)
PostBank does NOT close the bank, so that PreBank can check again that we have all the required materials.
Sounding good so far?
And so you guys know, there's also an item/inv/bank manager / item recognizer coming up, based on Nielsie's blacklists. :)
And I'll leave my ideas here for now, so I don't talk too much without code to back it up :p
The point of this TScriptRecord is so we can do this:
~RM
This is not just so we call it v2, this is so we can better manage MSI :)
Records & Pointers are the main point behind the TScriptRecord.
and right now it is not finished, I am currently developing it as the ideas pop in my mind.
type
TBankType = record;
BankGenre: integer; //const power / bank / deposit box
BankLoc: integer; //location const
Tile: TTile; //or TPoint
BankBounds: TBox; // ---> check InBank by Dynamite, pretty much same idea except hybrid
end;
//const Option_All --> OptionMenu consts --> should be in SRL
//bank actions
TBankAction = record;
Withdraw: boolean; //false for deposit
Items: TIntegerArray;
Quantity: TIntegerArray;
end;
TScriptRecord = record;
ScriptID: integer //script const
ScriptName: String;
Location: integer;
BankAt: TBankType;
PreBank: TBankAction;
ActivityAt: integer; //location const
Activities: TPointerArray;
PostBank: TBankAction;
end;
//walking & Obstacles to be dealt with later,
//Activities being a TPointerArray allows for a whole load of flexibility
//WalkTo(ESSENCE_MINE, [OBS_DOOR, OBS_AUBURY]);
//WalkTo(BankAt.BankLoc, [OBS_PORTAL]);
PreBank being any withdrawing or depositing that needs doing before going to location. PostBank being the same when you return to bank with a full load.
StartScript
repeat
– PreBank
——- Do Load
– PostBank
until(false)
PostBank does NOT close the bank, so that PreBank can check again that we have all the required materials.
Sounding good so far?
And so you guys know, there's also an item/inv/bank manager / item recognizer coming up, based on Nielsie's blacklists. :)
And I'll leave my ideas here for now, so I don't talk too much without code to back it up :p
The point of this TScriptRecord is so we can do this:
MSIPlayers[0].Scripts := [S_GUILD_MINER, S_FALLY_SMELTER, S_VARROCK_SMITHER];
MSIPlayers[0].Scripts[0].Objects := [ORE_COAL, ORE_MITH]; //this would be set by default and CAN be changed by user
MSIPlayers[0].Scripts[1].Objects := [BAR_MITH]; //BAR_ALL, BAR_HIGHEST
MSIPlayers[0].Scripts[2].Objects := [MITH_PLATE];
~RM