Results 1 to 14 of 14

Thread: Progress report help

  1. #1
    Join Date
    Apr 2007
    Posts
    373
    Mentioned
    2 Post(s)
    Quoted
    24 Post(s)

    Default Progress report help

    Hey,
    For some reason i can't get my progress report right.
    It report only the stats of the last round.
    But no of all the previous rounds

    Here is my script.
    http://villavu.com/forum/showthread.php?t=57191

    All works out fine now, thx for the help.
    Last edited by fre; 06-11-2010 at 07:34 AM.
    ~Fre

  2. #2
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    it should be

    SCAR Code:
    Players[CurrentPlayer].Integers[10] := Players[CurrentPlayer].Integers[10]+Gems;
    instead of
    SCAR Code:
    Players[CurrentPlayer].Integers[10] := Gems

    alternatively you can also do
    SCAR Code:
    IncEx(Players[CurrentPlayer].Integers[10], Gems)

    tell me if that works I looked at your script for all of 15 seconds.
    “Ignorance, the root and the stem of every evil.”

  3. #3
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    You don't set Players[CurrentPlayer].Integers[1], so everytime Proggy is called, TotalOres will be set to 0 (Players[CurrentPlayer].Integers[1] is 0 if not set) + Ores, so you'll always only get one load.

    You have to do something like:
    SCAR Code:
    IncEx(Players[CurrentPlayer].Integers[1], Ores); //will add 'Ores' to Integers[1];
    for i := 0 to High(Players) do
      IncEx(TotalOres, Players[i].Integers[1]); //will add each players ores to the total script ores

  4. #4
    Join Date
    Apr 2007
    Posts
    373
    Mentioned
    2 Post(s)
    Quoted
    24 Post(s)

    Default

    I had no idea the integers were set to 0 every time a procedures is called.

    PHP Code:
    procedure count;
    var
      
    a:integer;
    begin
      a
    :=0;
      
    repeat
      a
    :=a+1;
      
    writeln(inttostr(a));
      
    until(a>10)
    end
    Would this be the same as?

    PHP Code:
    procedure count;
    var
      
    a:integer;
    begin
      
    // not set a to 0 because this is done automatic?
      
    repeat
      a
    :=a+1;
      
    writeln(inttostr(a));
      
    until(a>10)
    end
    EDIT: after i posted it i wounder why i didnt test it myself ( i am lazy)

    But i did test it and it is indeed the same.
    Thx for the clarification tough.
    I ll let my code here for some ppl that might have the same issue.
    Last edited by fre; 06-08-2010 at 02:31 PM.
    ~Fre

  5. #5
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    I just want to clarify, it's only local variables that are automatically set to 0 when the procedure is called. Global variables are set to 0 when the script starts and is never reset to 0 (unless the scripter manually resets of course).

  6. #6
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    And it's good practice to "reset" local variables at the beginning of every procedure/function.

  7. #7
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    And it's good practice to "reset" local variables at the beginning of every procedure/function.
    Guess it depends who you talk to. I don't find it necessary to reset them when they're already done automatically. Just takes up lines for no real purpose. That's just me though.

  8. #8
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    Guess it depends who you talk to. I don't find it necessary to reset them when they're already done automatically. Just takes up lines for no real purpose. That's just me though.
    Sometimes it bugs out and they don't initialize automatically..
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  9. #9
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by Sex View Post
    Sometimes it bugs out and they don't initialize automatically..
    I've never had that problem that I know of, but I didn't know that.

  10. #10
    Join Date
    Feb 2009
    Location
    AZ, USA
    Posts
    460
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Sex View Post
    Sometimes it bugs out and they don't initialize automatically..
    What do you mean they don't initialize? They don't get set to 0? Then what would they equal?...
    Is your account in an old-school random? Help SRL-OSR solve randoms!

  11. #11
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Ogre View Post
    What do you mean they don't initialize? They don't get set to 0? Then what would they equal?...
    They equal whatever they were at the time the procedure ended last..
    Like you call a procedure one of the variables in it is set to like 5 and then it ends and you call the procedure again and instead of the variable starting as 0 it starts as 5 and messes shit up.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  12. #12
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    Quote Originally Posted by Sex View Post
    They equal whatever they were at the time the procedure ended last..
    Like you call a procedure one of the variables in it is set to like 5 and then it ends and you call the procedure again and instead of the variable starting as 0 it starts as 5 and messes shit up.
    That should probably be fixed inside of simba/scar then

    Scripts: Edgeville Chop & Bank, GE Merchanting Aid
    Tutorials: How to Dominate the Grand Exchange

    Quote Originally Posted by YoHoJo View Post
    I like hentai.

  13. #13
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    It is a problem with their interpreter..
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  14. #14
    Join Date
    Feb 2009
    Location
    AZ, USA
    Posts
    460
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    I reported in the bugs tracker. Also I heard this isn't a problem in SCAR?
    Is your account in an old-school random? Help SRL-OSR solve randoms!

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
  •