Page 1 of 2 12 LastLast
Results 1 to 25 of 29

Thread: How to Create a Progress Report(Proggy)

  1. #1
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default How to Create a Progress Report(Proggy)

    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:
    Simba Code:
    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...:
    Simba Code:
    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:
    Simba Code:
    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:
    Simba Code:
    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:
    Simba Code:
    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:
    Simba Code:
    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:
    Simba Code:
    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:
    Simba Code:
    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:
    Simba Code:
    XPPerhour :=(3600*(XPGain))/((TimeGone));
    For LoadsPerHour:
    Simba Code:
    LoadsPerhour :=(3600*(LoadsDone))/((TimeGone));
    For RunesPerHour:
    Simba Code:
    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:

    Simba Code:
    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
    Simba Code:
    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:
    Simba Code:
    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:
    Simba Code:
    Writeln('We have crafted ' + IntToStr(Runes)
    Writing the amount of XP Gained per hour would go like this:
    Simba Code:
    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 :

    Simba Code:
    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:
    Progress Report:
    ******************************************************************
    */////////---------- 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.
    Last edited by Abu; 04-19-2012 at 10:58 PM.

  2. #2
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Multiplayer Proggies

    If you do not know how to use Multiplayer: Go here

    Names and variables

    Before reading this part, make sure you understand fully how to create Single Player Proggies and how to use the functions. Now, for naming variables, we want to do it exactly the same way we did above, make a list of these we want to be updated on in the Proggy and pick an appropriate variable name for it, 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 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:
    Simba Code:
    Var
       CurrentXP, OriginalXP: Integer;
       XPGain, LoadsDone,  XPPerHour, Runes: Array of Integer;
       TimeGone, LoadsPerHour, RunesPerHour: Array of Integer;

    Because this is a Multiplayer Proggy, the variables need to be defined as an Array of Integer rather than just an integer like in the Single Player Proggies, with the exception of CurrentXP and OriginalXP. You should also take note

    - 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

    You should know these already, but if you skipped the Single Player Proggies section....

    Here are the main functions you will need to get your Proggy to work...:
    Simba Code:
    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 easy to do but it is also easy to forget. When using functions within your script on Multiplayer, you want to find out how well each player has done. You want to know how many loads each player did and how much xp each player gained.
    So we do this by adding:
    Simba Code:
    [CurrentPlayer]
    after all our variables so it only finds the variable for the current player. If you don't understand what this means, look at the example below:

    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:
    Simba Code:
    Inc(LoadsDone) // for single Player Proggies
    Inc(LoadsDone[CurrentPlayer]) // for Multiplayer Proggies
    So it would increase my LoadsDone by 1 for the Current Player I am using..

    Please not that the functions do not change, you simply add [CurrentPlayer] after your variable.


    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 and the function GetTimeRunning, but remember what we said about adding [CurrentPlayer] after our variables? We do it here too:
    Simba Code:
    TimeGone[CurrentPlayer] := (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, but in this case only we don't have to add [CurrentPlayer] as the we are not going to actually write in the CurrentXP, instead we're using it to find the XPGain.
    Simba Code:
    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:
    Simba Code:
    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:
    Simba Code:
    XPGain[CurrentPlayer] := (CurrentXP - OriginalXP);
    So this will tell us how much XP we have Gained since starting the script. However even though I didn't use [CurrentPlayer] for CurrentXP and OriginalXP, I must use it for XPGain as I will be writing that in in the Proggy.


    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. but also remember that here you must add [CurrentPlayer] after your variables.
    Like so:
    For XPPerHour:
    Simba Code:
    XPPerhour[CurrentPlayer] :=(3600*(XPGain[CurrentPlayer]))/((TimeGone[CurrentPlayer]));
    For LoadsPerHour:
    Simba Code:
    LoadsPerhour[CurrentPlayer] :=(3600*(LoadsDone[CurrentPlayer]))/((TimeGone[CurrentPlayer]));
    For RunesPerHour:
    Simba Code:
    RunesPerHour[CurrentPlayer] := (3600*(Runes[CurrentPlayer]))/((TimeGone[CurrentPlayer]));

    Finally, we have defined all of our variables. If you have done it right the start of your Proggy Should look like this:

    Simba Code:
    procedure ProggyTest;
    begin
      if LoadsDone[CurrentPlayer] mod 5=0 then
      ClearDebug;
      CurrentXP := GetXPBar(1);
      TimeGone[CurrentPlayer] := (GetTimeRunning/1000);
      XPGain[CurrentPlayer] := (CurrentXP - OriginalXP);
      XPPerhour[CurrentPlayer] :=(3600*(XPGain[CurrentPlayer]))/((TimeGone[CurrentPlayer]));
      LoadsPerhour[CurrentPlayer] :=(3600*(LoadsDone[CurrentPlayer]))/((TimeGone[CurrentPlayer]));
      RunesPerHour[CurrentPlayer] := (3600*(Runes[CurrentPlayer]))/((TimeGone[CurrentPlayer]));


    Writing the Proggy

    Here are two simple functions you will need to know to Write Proggies.
    Simba Code:
    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.

    The first thing you want to do when writing the Proggy for a Multiplayer Script is add the variable 'i' into the Proggy. Like this:
    Simba Code:
    procedure ProggyTest;
    var
      i: Integer;
    begin

    Then, after all those variables we just defined, on the next line we want to write begin and add:
    Simba Code:
    for i := 0 to HowManyPlayers - 1 do
    This will declare the player we are using. If we are using the first player in the script(Players[0]), then i=0. If we are using the player after that then i=1. You can change the values appropriately to the number of players your script supports.

    NOW, after adding this, we need to add[i] after all the variables we are writing in, that way it only writes the values for the player we are using (Players[0], Players[1] etc...) Writing the loads, unlike in Single Player Proggies now goes like this:
    Simba Code:
    Writeln('We have done: ' + IntToStr(LoadsDone[i]);
    So it writes in 'We have done: ' followed by the amount of LoadsDone followed by [i]. Simple right?

    Here are a few more examples:

    Writing the amount of Runes Crafted would go like this:
    Simba Code:
    Writeln('We have crafted ' + IntToStr(Runes[i])
    Writing the amount of Runes Crafted per hour would go like this:
    Simba Code:
    Writeln('We have crafted: ' + IntToStr(RunesPerHour[i]) + ' 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 :

    Simba Code:
    procedure ProggyTest;
    var
      i: Integer;
    begin
      if LoadsDone[CurrentPlayer] mod 5=0 then
      ClearDebug;
      CurrentXP := GetXPBar(1);
      TimeGone[CurrentPlayer] := (GetTimeRunning/1000);
      XPGain[CurrentPlayer] := (CurrentXP - OriginalXP);
      XPPerhour[CurrentPlayer] :=(3600*(XPGain[CurrentPlayer]))/((TimeGone[CurrentPlayer]));
      LoadsPerhour[CurrentPlayer] :=(3600*(LoadsDone[CurrentPlayer]))/((TimeGone[CurrentPlayer]));
      RunesPerHour[CurrentPlayer] := (3600*(Runes[CurrentPlayer]))/((TimeGone[CurrentPlayer]));
      begin
        Writeln('******************************************************************');
        Writeln('*/////////---------- Abu''s''AirKrafter Version 2 ----------\\\\\\\*');
        Writeln('*/////////----------____________________________----------\\\\\\\*');
        Writeln('******************************************************************');
        Writeln('');
        for i := 0 to HowManyPlayers - 1 do
          begin
          Writeln('*/////////--------- Proggy for the player: ' + Players[i].Nick + ' --------\\\\\\\\\*');
          Writeln('*/////////We have done: ' + IntToStr(LoadsDone[i]) + ' Loads / Thats ' + IntToStr(LoadsPerHour[i]) + ' loads per hour');
          Writeln('*/////////We have gained: ' + IntToStr(XPGain[i]) + ' xp / Thats ' + IntToStr(XPPerHour[i]) + ' xp per hour');
          Writeln('*/////////We have crafted ' + IntToStr(Runes[i]) + ' Runes / Thats ' + IntToStr(RunesPerHour[i]) + ' Runes Per Hour');
          Writeln('');
          end;
      end;
    end;


    And here is what it looks like in action:
    Progress Report:
    ******************************************************************
    */////////---------- Abu's'AirKrafter Version 2 ----------\\\\\\\*
    */////////----------____________________________----------\\\\\\\*
    ******************************************************************
    
    */////////--------- Proggy for the player: jwka --------\\\\\\\\\*
    */////////We have done: 1 Loads / Thats 23 loads per hour
    */////////We have gained: 140 xp / Thats 3230 xp per hour
    */////////We have crafted 142 Runes / Thats 3276 Runes Per Hour
    
    */////////--------- Proggy for the player: N/A. --------\\\\\\\\\*
    */////////We have done: 0 Loads / Thats 0 loads per hour
    */////////We have gained: 0 xp / Thats 0 xp per hour
    */////////We have crafted 0 Runes / Thats 0 Runes Per Hour



    One final thing

    The last thing you have to do, is set the lengths of your array. To do this simply make a procedure like this and set the lengths to HowManyPlayers:

    Simba Code:
    procedure SetArrayLengths;    //renamed to fit purpose
    begin
      SetLength(TimeGone,HowManyPlayers);
      SetLength(XPPerHour,HowManyPlayers);
      SetLength(LoadsPerHour,HowManyPlayers);
      SetLength(XPGain,HowManyPlayers);
      SetLength(LoadsDone,HowManyPlayers);
      SetLength(Runes,HowManyPlayers);
      SetLength(RunesPerHour,HowManyPlayers);
    end;

    And then load that in your mainloop after SetUpSRL;

    And that's how to make a Progress Report for a Single Player and Multiplayer Script!
    If you have any problems, simply read over the guide.

    If you want to go one step further and get your Progress Report Onscreen, then go here



    Special Thanks to:
    bolshak25 - for helping me understand how to use Proggies
    Last edited by Abu; 06-18-2012 at 08:57 PM.

  3. #3
    Join Date
    Dec 2011
    Location
    Kosovo
    Posts
    831
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Nice tutorial. I'd like to see how can I make for fighting.
    Goals:
    Understanding TPAs
    Making Proggy for fighting
    Getting on SRL members
    Get 500 posts

  4. #4
    Join Date
    Oct 2011
    Posts
    192
    Mentioned
    0 Post(s)
    Quoted
    17 Post(s)

    Default

    Great tutorial! I can tell a lot of work and effort went into creating it, and I like how in-depth it goes. I'll be sure to direct anyone here if they need any help creating progress reports!

  5. #5
    Join Date
    Dec 2011
    Location
    Berlin
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Great tutorial! It really explains it all!

    I will try to answer all Runescape related questions!

  6. #6
    Join Date
    Dec 2011
    Posts
    134
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default

    ok i copied your proggy exactly and changed it slightly for my fishing script, just to test it out, but it doesnt seem to count my xp?
    If i get xpbar(1) it starts on like -4000000xp, (2) it starts on +4000000xp, and (3) starts on 0xp gained and never rises?

    heres the code
    procedure Proggy;
    begin
    ClearDebug;
    TimeGone := (GetTimeRunning/1000);
    CurrentXP := GetXPBar(3);
    XPGain := (CurrentXP - OriginalXP);
    XPPerhour :=(3600*(XPGain))/((TimeGone));
    begin
    begin
    Writeln('***************************************** *************************');
    Writeln('*/////////---------- Stus Leap Fisher v0.1----- ----------\\\\\\\*');
    Writeln('***************************************** *************************');
    Writeln('');
    Writeln('*/////////--------- Proggy for the player: ' + Players[0].Nick + ' --------\\\\\\\\\*');
    Writeln('*//////////////////Running for: ' + IntToStr(TimeGone) + 'seconds' );
    Writeln('*/////////We have gained: ' + IntToStr(XPGain) + ' xp / Thats ' + IntToStr(XPPerHour) + ' xp per hour');
    end;
    end;

  7. #7
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Try using GetXPBarTotal instead.

  8. #8
    Join Date
    Dec 2011
    Posts
    134
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default

    that got the total xp on my xp counter as xp gained, rather than starting xp

    yeah no matter what i try it doesn't seem to subtract original xp
    Last edited by stu; 04-15-2012 at 07:02 PM.

  9. #9
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Did you get your OriginalXP variable to GetXPBarTotal when you started the script? I see you have CurrentXP - OriginalXP but from what you are saying OriginalXP is set to 0.

  10. #10
    Join Date
    Dec 2011
    Posts
    134
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default

    Quote Originally Posted by TotalKillz View Post
    Did you get your OriginalXP variable to GetXPBarTotal when you started the script? I see you have CurrentXP - OriginalXP but from what you are saying OriginalXP is set to 0.
    yeah i just realised i had written that part wrong when I saw this post
    thanks for all your help today with me being an idiot

  11. #11
    Join Date
    Jan 2012
    Posts
    296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    awsome, thanks to you, will use this tuto to do my first proggy, =F
    Sorry for my bad english, i'm french

  12. #12
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Quote Originally Posted by RightClick View Post
    awsome, thanks to you, will use this tuto to do my first proggy, =F
    Thanks for sorting that out for me

  13. #13
    Join Date
    Nov 2011
    Posts
    1,532
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    GetTextAtExWrap is not really necessary AFAIK.

    Bank items you should be able to get it through GetBankItemAmount, Inventory you should look into GetAmountBox(InvBox(slot_here)).

    I would let SRL do it for me unless these functions don't work.

    Nice tutorial though. My proggy skill is totally stuck at using getXPtotal to calculate the XP gain. IMO it's ghetto, but quick and dirty
    Current activity: Recovering from vacation
    - Nulla pars vitae vacare officio potest -
    SRL membership? Can I buy that?
    Scripts - AGS - SWF - WAR - EMS - W100S-EM
    If you need scripting help, you can pm me. Remember, if you need help you have to ask for it properly though

  14. #14
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Quote Originally Posted by Er1k View Post
    GetTextAtExWrap is not really necessary AFAIK.

    Bank items you should be able to get it through GetBankItemAmount, Inventory you should look into GetAmountBox(InvBox(slot_here)).

    I would let SRL do it for me unless these functions don't work.

    Nice tutorial though. My proggy skill is totally stuck at using getXPtotal to calculate the XP gain. IMO it's ghetto, but quick and dirty
    Thanks! I had no idea they exist but I'll definitely put them in

  15. #15
    Join Date
    Nov 2011
    Posts
    1,532
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Protip: You can even use getBankItemAmount to decide how many to withdraw in order to keep the placeholder for the item. I have a really ghetto one implemented in some of my scripts earlier, but I'm sure you can do a more robust "withdraw all but one" by checking the item amount and always keep the item at the same slot

    E: As a failsafe, remember to stall the bank loading until it sees bankamount > 0 in any slot you're checking. Bank loading can be laggy and it was a bug worth remembering because it's easy to forget about this exception.
    Last edited by Er1k; 04-17-2012 at 03:34 PM.
    Current activity: Recovering from vacation
    - Nulla pars vitae vacare officio potest -
    SRL membership? Can I buy that?
    Scripts - AGS - SWF - WAR - EMS - W100S-EM
    If you need scripting help, you can pm me. Remember, if you need help you have to ask for it properly though

  16. #16
    Join Date
    Feb 2012
    Location
    SRL Jail
    Posts
    1,319
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Very good tutorial! Very understandable and I just made a proggy for 2 of my scripts! Thanks!

  17. #17
    Join Date
    Mar 2012
    Location
    Shenzhen China
    Posts
    19
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    good tut!
    Very usefull report form,i will add this to my scripts.Thanks

  18. #18
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

  19. #19
    Join Date
    May 2012
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    procedure progressreport;
    begin
    ClearDebug;
    TimeGone := (getrunningtime/1000);
    CoalinInv := InvCount
    CurrentXp := GetXPBar(1);
    XpGain := (Currentxp-GetXPBarTotal);
    XpPerHour :=(3600*(xpgain))/((timegone));
    begin
    writeln('*Simple Powerminer version one*');
    writeln('*We have mined:' +IntToStr(CoalinInv) + 'coal*');
    writeln('*We have gained:' + IntToStr(XpGain) + 'xp / Thats' + IntToStr(XpPerHour)+ 'xp per hour*');
    writeln('*Total running time:' + IntToStr(getrunningtime/60000) + 'minutes*');
    end;
    end;

    keep getting divide by 0 error? :S

  20. #20
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

  21. #21
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    Attempting to implement multiplayer progress report into one of my scripts, but whenever I add
    Simba Code:
    IncEx(strung[CurrentPlayer],14);

    [Error] (560:15): Semicolon (';') expected at line 559
    Compiling failed.
    Does the [CurrentPlayer] addition only work for Inc instead of IncEx, or is there something else I am not adding?

    NB: without the [CurrentPlayer] the script compiles perfectly.

  22. #22
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Quote Originally Posted by p1ng View Post
    Does the [CurrentPlayer] addition only work for Inc instead of IncEx, or is there something else I am not adding?

    NB: without the [CurrentPlayer] the script compiles perfectly.
    Have you declared CurrentPlayer as an Array of Integer?

  23. #23
    Join Date
    May 2012
    Posts
    59
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    This is awesome just what I was looking for thanks very much for the work gone into the guide

  24. #24
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    Quote Originally Posted by abu_jwka View Post
    Have you declared CurrentPlayer as an Array of Integer?
    That'd be where I went wrong, thank-you very much!

    EDIT: Compiles fine and the script runs through right up until
    Simba Code:
    IncEx(strung[CurrentPlayer],14);
    then I get a
    Error: Out Of Range at line 575
    Any ideas?
    Last edited by P1ng; 05-30-2012 at 02:46 AM.

  25. #25
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Have you set the Array Lengths?

    I forgot to include this in the tutorial.

    Basically make a function like this:

    Simba Code:
    procedure SetArrayLengths;
    begin
      SetLength(TimeGone,HowManyPlayers);
      SetLength(XPPerHour,HowManyPlayers);
      SetLength(LoadsPerHour,HowManyPlayers);
      SetLength(XPGain,HowManyPlayers);
    end;

    You need to do that for every variable you use - in that case, I think it's 'strung'

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •