ZephyrsFury
2009-04-16 15:06:54
With the release of the latest Public SRL Revision comes a new feature for scripters and script users. The UseRewardBox and supporting functions will open and select the desired reward items based the on preference of the script's users. This comes in the form of a new addition to the Players array:
The 'BoxRewards' variable is a TStringArray ie. array of string. This array contains the text or partial text of the reward item in order of preference. That is in the above example the items will be searched for in the order: Emote, Costume, XP Lamp, Gem, Mithril ore, Coal. Note however, the text you enter must appear exactly as it is in the Reward Box window. This includes capitalization.
NOTE: If you do not wish to open the box you may leave the variable as an empty array with a length of 0. ie:
If SRL comes across this it will not open the box.
For Script Users:
From Rev 32 onwards any script that has the above BoxRewards option will allow you to enter in your reward items in order of preference.
If the variable does not exist in the DeclarePlayers procedure then (unless there is a reason the scripter did not put it there) you can add the option yourself.
For Scripters:
All you need to do is go through your scripts and add Players[X].BoxRewards to your DeclarePlayers procedure. SRL will handle the rest.
Thanks to Nava2 for this wonderful new feature!
Enjoy,
SRL Development Team.
Players[0].Name := 'SRL Developers';
Players[0].Pass := 'WelcomeToRev32';
Players[0].Nick := 'eve';
Players[0].Active := True;
Players[0].Integers[0] := 0;
Players[0].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal'];
The 'BoxRewards' variable is a TStringArray ie. array of string. This array contains the text or partial text of the reward item in order of preference. That is in the above example the items will be searched for in the order: Emote, Costume, XP Lamp, Gem, Mithril ore, Coal. Note however, the text you enter must appear exactly as it is in the Reward Box window. This includes capitalization.
NOTE: If you do not wish to open the box you may leave the variable as an empty array with a length of 0. ie:
Players[0].BoxRewards := [];
If SRL comes across this it will not open the box.
For Script Users:
From Rev 32 onwards any script that has the above BoxRewards option will allow you to enter in your reward items in order of preference.
If the variable does not exist in the DeclarePlayers procedure then (unless there is a reason the scripter did not put it there) you can add the option yourself.
For Scripters:
All you need to do is go through your scripts and add Players[X].BoxRewards to your DeclarePlayers procedure. SRL will handle the rest.
Thanks to Nava2 for this wonderful new feature!
Enjoy,
SRL Development Team.