Abu
03-22-2012, 08:03 PM
Before you read:
-Go to Advanced Search
-Type in 'Proggy'
-Select 'Search Titles Only'
-Press ' Search Now'
-Wow.... a lot of people find it confusing right?
Introduction
Hello and welcome to my tutorial on how to create a Progress Report. For those of you who don't know what this is, a Progress Report is a nifty little thing that you can add to your script to tell you how your script is getting on. This tutorial will tell you everything you need to know to create a Single Player and Multiplayer Proggy for your script. When I asked for help on how to make one, this was the response I got:
just use:
writeln('put the text here');
writeln('put the text here' + ToStr(yourVar));
Now thats not very helpful if you have no knowledge on how to create a Proggy, is it ?
///---- Contents ----\\\
-Single Player Proggies
-Multiplayer Proggies
Single Player Proggies
Names and variables
To create a Single or Multiplayer Proggy the first thing you want to do is make a list of all the things you want to be updated on. For example, for a Runecrafting Script I would want to be updated on:
- How many Loads I've done
- How many Loads I've done per hour
- How much XP I've gained
- How much XP I've gained per hour
- How many Runes I've crafted
- How many Runes I've crafted per hour
Not that hard is it? I've simply made a list of all the things I want to include in my Progress Report. The next thing you want to do is create appropriate variables for each of them. So basically, if you don't know what that is, its simply what you want to name them in your script - and its called a variable because the value of it can change. You should put the variable in Camel-capped, WhichIsLikeThis.
So to do this I would simply put the variables alongside my list, like so:
- How many Loads I've done -- I'll name it LoadsDone
- How many Loads I've done per hour -- I'll name it LoadsPerHour
- How much XP I've gained -- I'll name it XPGain
- How much XP I've gained per hour -- I'll name it XPGainPerHour
- How many Runes I've crafted -- I'll name it Runes
- How many Runes I've crafted per hour -- I'll name it RunesPerHour
Now how bloomin easy is that!?
Now you just want to put these variables into your script. To do this, you declare them globally, so put 'var' at the start of your script just before you DeclarePlayers. Like so:
Var
XPGain, LoadsDone, TimeGone, Runes: Integer;
XPPerHour, LoadsPerHour, RunesPerHour, CurrentXP, OriginalXP: Integer;
Because this is a Single Player Proggy, you only need to define these variables as Integers like I have done so above. You will also need to take note that I have added three variables called:
- TimeGone, which I will use in the Proggy to help me find out at what rate I have done procedures e.g (RunesPerHour)
- OriginalXP, which I will use to tell me how much XP I had to start of with - needed to find XPGain
- CurrentXP, which I will use to tell me how much XP I have at the moment - needed to find XPGain
Now that we have successfully put these Variables into our Script we need to know how to use them.
Functions Needed
Here are the main functions you will need to get your Proggy to work...:
GetTimeRunning
Inc(variable)
IncEx(variable, amount)
GetXPBar(1,2 or 3)
InvCount
GetAmountBox(box: TBox): integer; // Thanks to Er1k!
GetBankItemAmount(const Row, Col: Integer): Integer; // Thanks to Er1k x2!
...and this is what they do:
GetTimeRunning - Gets how long you have been playing the Script in milliseconds
Inc(variable) - This increases the variable you put in the brackets by 1.
IncEx(variable, amount) - This increases the variable you put in the brackets by the amount you put in after the comma
GetXPBar(1,2 or 3) - Gets the amount of XP you currently have. You can put in the number 1, 2 or 3 depending on which one seems to work for your script
InvCount - Returns amount of items in your inventory
GetAmountBox - Returns the amount of an item at in the box ‘box’. Use this for counting stackable items in your inventory. For 'box' put InvBox(i), with i being the inventory box you want to search in.
GetBankItemAmount - Returns the amount of an item in the bank at bank screen coordinates. For the first number put in the row you're searching in and for the second put in the column.
Using Functions
Once you've learned what those functions do, you want to know where to use them in your script.
Using Functions within your Script
The variables used here: LoadsDone, Runes
This is really easy. The variables we use within our Script are the ones that change right after we have done the function and so you use them at the end of the required function . For example:
If I have just completed one load worth of Runecrafting. After I click the altar I would put this just before ending my Altar Clicking function:
Inc(LoadsDone)
So it would increase my LoadsDone by 1.
If I want to count how many Rune Essence is in my Inventory either before or after banking, I would use:
RuneEssence := InvCount
So it would get the amount of Essence I have in my inventory
And to find out how many Runes I have in my inventory, well I already showed you that earlier with the whole GetTextAtExWrap function didn't I?
Using functions in your proggy
The variables used here are: TimeGone, XPGain, XPPerHour, LoadsPerHour, RunesPerHour, CurrentXP, OriginalXP
These variables are the ones we can't just simply update after doing the function. Instead, we define them here in the Proggy so we can see how they have updated.
The first thing you want to do when creating your Proggy is find out how long the script has been running for and define it with our variable TimeGone. To do this we do:
TimeGone := (GetTimeRunning/1000);
Now we want to find out how much XP has been gained.
First we use the variable CurrentXP and the function GetXPBar(1) to find out how much XP we currently have, like so:
CurrentXP := GetXPBar(1);
Then we use the OriginalXP variable we included earlier and put it in the mainloop, right after you Log In, but before you start your actual script. Put it in like this:
OriginalXP := GetXPBar(1);
So far you've found the XP you had before actually running the script and the Current XP that the player has. Now you can use this to find the increase in XP.
To do this, we use the variable XPGain and minus the OriginalXP from the CurrentXP, like so:
XPGain := (CurrentXP - OriginalXP);
So this will tell us how much XP we have Gained since starting the script.
PerHour values require the TimeGone variable which we have already defined.
To find PerHour vales you simply divide the appropriate variables by the TimeGone and then times by 3600 to get the amount per hour.
Like so:
For XPPerHour:
XPPerhour :=(3600*(XPGain))/((TimeGone));
For LoadsPerHour:
LoadsPerhour :=(3600*(LoadsDone))/((TimeGone));
For RunesPerHour:
RunesPerHour := (3600*(Runes))/((TimeGone));
Finally, we have defined all of our variables. I you have done it right the start of your Proggy Should look like this:
procedure ProggyTest;
begin
ClearDebug;
TimeGone := (GetTimeRunning/1000);
CurrentXP := GetXPBar(1);
XPGain := (CurrentXP - OriginalXP);
XPPerhour :=(3600*(XPGain))/((TimeGone));
LoadsPerhour :=(3600*(LoadsDone))/((TimeGone));
RunesPerHour := (3600*(Runes))/((TimeGone));
Writing the Proggy
This is Probably the easiest part of the Proggy, all you need know for this part is two simple functions
WritLn('')
IntToStr()
-Writeln simply Writes a Line in the debug box. You put the text within apostrophes.
-IntToStr simply converts an integer into a string so it can be written in the debug box.
Writing the loads done go like this:
Writeln('We have done: ' + IntToStr(LoadsDone);
So it writes in 'We have done: ' followed by the amount of LoadsDone. Simple right?
Here are a few more examples:
Writing the amount of Runes Crafted would go like this:
Writeln('We have crafted ' + IntToStr(Runes)
Writing the amount of XP Gained per hour would go like this:
Writeln('We have crafted: ' + IntToStr(RunesPerHour) + ' Runes Per Hour')
So now that you now how to Write In your variables into your Proggy. You can begin begin to mess around with it to improve the appearance of it. Here is what the code of my Proggy looks like(note that I've improved the appearance of the Proggy so it more complicated - but all it is is stars :p:
procedure ProggyTest;
begin
ClearDebug;
TimeGone := (GetTimeRunning/1000);
CurrentXP := GetXPBar(1);
XPGain := (CurrentXP - OriginalXP);
XPPerhour :=(3600*(XPGain))/((TimeGone));
LoadsPerhour :=(3600*(LoadsDone))/((TimeGone));
RunesPerHour := (3600*(Runes))/((TimeGone));
begin
Writeln('***************************************** *************************');
Writeln('*/////////---------- Abu''s''AirKrafter Version 2 ----------\\\\\\\*');
Writeln('*/////////----------____________________________----------\\\\\\\*');
Writeln('***************************************** *************************');
Writeln('');
Writeln('*/////////--------- Proggy for the player: ' + Players[0].Nick + ' --------\\\\\\\\\*');
Writeln('*/////////We have done: ' + IntToStr(LoadsDone) + ' Loads / Thats ' + IntToStr(LoadsPerHour) + ' loads per hour');
Writeln('*/////////We have gained: ' + IntToStr(XPGain) + ' xp / Thats ' + IntToStr(XPPerHour) + ' xp per hour');
Writeln('*/////////We have crafted ' + IntToStr(Runes) + ' Runes / Thats ' + IntToStr(RunesPerHour) + ' Runes Per Hour');
Writeln('');
end;
end;
And here is what it looks like in action:
************************************************** ****************
*/////////---------- Abu's'AirKrafter Version 2 ----------\\\\\\\*
*/////////----------____________________________----------\\\\\\\*
************************************************** ****************
*/////////--------- Proggy for the player: jwka --------\\\\\\\\\*
*/////////We have done: 7 Loads / Thats 29 loads per hour
*/////////We have gained: 980 xp / Thats 4126 xp per hour
*/////////We have crafted 997 Runes / Thats 4197 Runes Per Hour
And that's how to make a Progress Report for a Single Player Script!
If you have any problems, simply read over the guide.
-Go to Advanced Search
-Type in 'Proggy'
-Select 'Search Titles Only'
-Press ' Search Now'
-Wow.... a lot of people find it confusing right?
Introduction
Hello and welcome to my tutorial on how to create a Progress Report. For those of you who don't know what this is, a Progress Report is a nifty little thing that you can add to your script to tell you how your script is getting on. This tutorial will tell you everything you need to know to create a Single Player and Multiplayer Proggy for your script. When I asked for help on how to make one, this was the response I got:
just use:
writeln('put the text here');
writeln('put the text here' + ToStr(yourVar));
Now thats not very helpful if you have no knowledge on how to create a Proggy, is it ?
///---- Contents ----\\\
-Single Player Proggies
-Multiplayer Proggies
Single Player Proggies
Names and variables
To create a Single or Multiplayer Proggy the first thing you want to do is make a list of all the things you want to be updated on. For example, for a Runecrafting Script I would want to be updated on:
- How many Loads I've done
- How many Loads I've done per hour
- How much XP I've gained
- How much XP I've gained per hour
- How many Runes I've crafted
- How many Runes I've crafted per hour
Not that hard is it? I've simply made a list of all the things I want to include in my Progress Report. The next thing you want to do is create appropriate variables for each of them. So basically, if you don't know what that is, its simply what you want to name them in your script - and its called a variable because the value of it can change. You should put the variable in Camel-capped, WhichIsLikeThis.
So to do this I would simply put the variables alongside my list, like so:
- How many Loads I've done -- I'll name it LoadsDone
- How many Loads I've done per hour -- I'll name it LoadsPerHour
- How much XP I've gained -- I'll name it XPGain
- How much XP I've gained per hour -- I'll name it XPGainPerHour
- How many Runes I've crafted -- I'll name it Runes
- How many Runes I've crafted per hour -- I'll name it RunesPerHour
Now how bloomin easy is that!?
Now you just want to put these variables into your script. To do this, you declare them globally, so put 'var' at the start of your script just before you DeclarePlayers. Like so:
Var
XPGain, LoadsDone, TimeGone, Runes: Integer;
XPPerHour, LoadsPerHour, RunesPerHour, CurrentXP, OriginalXP: Integer;
Because this is a Single Player Proggy, you only need to define these variables as Integers like I have done so above. You will also need to take note that I have added three variables called:
- TimeGone, which I will use in the Proggy to help me find out at what rate I have done procedures e.g (RunesPerHour)
- OriginalXP, which I will use to tell me how much XP I had to start of with - needed to find XPGain
- CurrentXP, which I will use to tell me how much XP I have at the moment - needed to find XPGain
Now that we have successfully put these Variables into our Script we need to know how to use them.
Functions Needed
Here are the main functions you will need to get your Proggy to work...:
GetTimeRunning
Inc(variable)
IncEx(variable, amount)
GetXPBar(1,2 or 3)
InvCount
GetAmountBox(box: TBox): integer; // Thanks to Er1k!
GetBankItemAmount(const Row, Col: Integer): Integer; // Thanks to Er1k x2!
...and this is what they do:
GetTimeRunning - Gets how long you have been playing the Script in milliseconds
Inc(variable) - This increases the variable you put in the brackets by 1.
IncEx(variable, amount) - This increases the variable you put in the brackets by the amount you put in after the comma
GetXPBar(1,2 or 3) - Gets the amount of XP you currently have. You can put in the number 1, 2 or 3 depending on which one seems to work for your script
InvCount - Returns amount of items in your inventory
GetAmountBox - Returns the amount of an item at in the box ‘box’. Use this for counting stackable items in your inventory. For 'box' put InvBox(i), with i being the inventory box you want to search in.
GetBankItemAmount - Returns the amount of an item in the bank at bank screen coordinates. For the first number put in the row you're searching in and for the second put in the column.
Using Functions
Once you've learned what those functions do, you want to know where to use them in your script.
Using Functions within your Script
The variables used here: LoadsDone, Runes
This is really easy. The variables we use within our Script are the ones that change right after we have done the function and so you use them at the end of the required function . For example:
If I have just completed one load worth of Runecrafting. After I click the altar I would put this just before ending my Altar Clicking function:
Inc(LoadsDone)
So it would increase my LoadsDone by 1.
If I want to count how many Rune Essence is in my Inventory either before or after banking, I would use:
RuneEssence := InvCount
So it would get the amount of Essence I have in my inventory
And to find out how many Runes I have in my inventory, well I already showed you that earlier with the whole GetTextAtExWrap function didn't I?
Using functions in your proggy
The variables used here are: TimeGone, XPGain, XPPerHour, LoadsPerHour, RunesPerHour, CurrentXP, OriginalXP
These variables are the ones we can't just simply update after doing the function. Instead, we define them here in the Proggy so we can see how they have updated.
The first thing you want to do when creating your Proggy is find out how long the script has been running for and define it with our variable TimeGone. To do this we do:
TimeGone := (GetTimeRunning/1000);
Now we want to find out how much XP has been gained.
First we use the variable CurrentXP and the function GetXPBar(1) to find out how much XP we currently have, like so:
CurrentXP := GetXPBar(1);
Then we use the OriginalXP variable we included earlier and put it in the mainloop, right after you Log In, but before you start your actual script. Put it in like this:
OriginalXP := GetXPBar(1);
So far you've found the XP you had before actually running the script and the Current XP that the player has. Now you can use this to find the increase in XP.
To do this, we use the variable XPGain and minus the OriginalXP from the CurrentXP, like so:
XPGain := (CurrentXP - OriginalXP);
So this will tell us how much XP we have Gained since starting the script.
PerHour values require the TimeGone variable which we have already defined.
To find PerHour vales you simply divide the appropriate variables by the TimeGone and then times by 3600 to get the amount per hour.
Like so:
For XPPerHour:
XPPerhour :=(3600*(XPGain))/((TimeGone));
For LoadsPerHour:
LoadsPerhour :=(3600*(LoadsDone))/((TimeGone));
For RunesPerHour:
RunesPerHour := (3600*(Runes))/((TimeGone));
Finally, we have defined all of our variables. I you have done it right the start of your Proggy Should look like this:
procedure ProggyTest;
begin
ClearDebug;
TimeGone := (GetTimeRunning/1000);
CurrentXP := GetXPBar(1);
XPGain := (CurrentXP - OriginalXP);
XPPerhour :=(3600*(XPGain))/((TimeGone));
LoadsPerhour :=(3600*(LoadsDone))/((TimeGone));
RunesPerHour := (3600*(Runes))/((TimeGone));
Writing the Proggy
This is Probably the easiest part of the Proggy, all you need know for this part is two simple functions
WritLn('')
IntToStr()
-Writeln simply Writes a Line in the debug box. You put the text within apostrophes.
-IntToStr simply converts an integer into a string so it can be written in the debug box.
Writing the loads done go like this:
Writeln('We have done: ' + IntToStr(LoadsDone);
So it writes in 'We have done: ' followed by the amount of LoadsDone. Simple right?
Here are a few more examples:
Writing the amount of Runes Crafted would go like this:
Writeln('We have crafted ' + IntToStr(Runes)
Writing the amount of XP Gained per hour would go like this:
Writeln('We have crafted: ' + IntToStr(RunesPerHour) + ' Runes Per Hour')
So now that you now how to Write In your variables into your Proggy. You can begin begin to mess around with it to improve the appearance of it. Here is what the code of my Proggy looks like(note that I've improved the appearance of the Proggy so it more complicated - but all it is is stars :p:
procedure ProggyTest;
begin
ClearDebug;
TimeGone := (GetTimeRunning/1000);
CurrentXP := GetXPBar(1);
XPGain := (CurrentXP - OriginalXP);
XPPerhour :=(3600*(XPGain))/((TimeGone));
LoadsPerhour :=(3600*(LoadsDone))/((TimeGone));
RunesPerHour := (3600*(Runes))/((TimeGone));
begin
Writeln('***************************************** *************************');
Writeln('*/////////---------- Abu''s''AirKrafter Version 2 ----------\\\\\\\*');
Writeln('*/////////----------____________________________----------\\\\\\\*');
Writeln('***************************************** *************************');
Writeln('');
Writeln('*/////////--------- Proggy for the player: ' + Players[0].Nick + ' --------\\\\\\\\\*');
Writeln('*/////////We have done: ' + IntToStr(LoadsDone) + ' Loads / Thats ' + IntToStr(LoadsPerHour) + ' loads per hour');
Writeln('*/////////We have gained: ' + IntToStr(XPGain) + ' xp / Thats ' + IntToStr(XPPerHour) + ' xp per hour');
Writeln('*/////////We have crafted ' + IntToStr(Runes) + ' Runes / Thats ' + IntToStr(RunesPerHour) + ' Runes Per Hour');
Writeln('');
end;
end;
And here is what it looks like in action:
************************************************** ****************
*/////////---------- Abu's'AirKrafter Version 2 ----------\\\\\\\*
*/////////----------____________________________----------\\\\\\\*
************************************************** ****************
*/////////--------- Proggy for the player: jwka --------\\\\\\\\\*
*/////////We have done: 7 Loads / Thats 29 loads per hour
*/////////We have gained: 980 xp / Thats 4126 xp per hour
*/////////We have crafted 997 Runes / Thats 4197 Runes Per Hour
And that's how to make a Progress Report for a Single Player Script!
If you have any problems, simply read over the guide.