Results 1 to 16 of 16

Thread: Proggy help

  1. #1
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default Proggy help

    Ok, well my progress report isn't displaying my Xp Gained and Ivys cut right.
    Can someone help please?

    SCAR Code:
    Procedure Proggy;
    var
      i, loads, DoXpAndIvyCount, XPEnd, XPBegin, IvysNearlyCut, CurrentXP: integer;
      NewExpDiff, ReportExp : integer;
      s: string;
      XPGained, tmp, IvysCut : Extended;
    begin
      for i:= 0 to HowManyPlayers-1 do
      begin
        if i = CurrentPlayer then
        begin
          GameTab(22);
          CurrentXP := GetXP('woodcutting');
          Writeln(CurrentXP);
          NewExpDiff := CurrentXP - StartingXP;
          Writeln(NewExpDiff);
          ReportExp := NewExpDiff - LastExpDiff;
          Writeln(ReportExp);
          Players[CurrentPlayer].Extendeds[49] := ReportExp;
          IvysCut := (ReportExp / 332.5);
          Writeln(IvysCut);
          Players[CurrentPlayer].Extendeds[50] := IvysCut;
          IncEx(Stats_CustomVars[1], Ceil(IvysCut));
          IncEx(Stats_CustomVars[6], Ceil(ReportExp));
        end;
        TakePic;
        Players[CurrentPlayer].Worked := Players[CurrentPlayer].Worked + TimeFromMark(RestTime);
      end;

      ClearReport;
      SRLProgressReport(
        ResultDebugBox, 'ProIvy', 'The Man', Version,
        ['Time running', 'EXP Gained'],
        [TimeRunning, ReportExp]
        );
      s := SRLProgressReport(
        ResultString, 'ProWoodcutter', 'The Man', Version,
        ['Time running', 'EXP Gained'],
        [TimeRunning, ReportExp]
        );

      SRLPlayerReport(
        ResultDebugBox, 0, false,
        [true, true, false, false, false, true],
        ['Tree', 'EXP Gained', 'Ivy''s Cut'],
        [], [], [0], [49,50]
      );
      s := s + char(#13) + SRLPlayerReport(
        ResultString, 0, false,
        [true, true, false, false, false, true],
        ['Tree', 'EXP Gained', 'Ivy''s Cut'],
        [], [], [0], [49,50]
      );

      i := ReWriteFile(ScriptPath + ScriptName + '.txt', False);
      WriteFileString(i, s);
      CloseFile(i);
      writeln('Progress report saved to: ' + ScriptPath + ScriptName + '.txt');
      Players[CurrentPlayer].Worked := Players[CurrentPlayer].Worked - TimeFromMark(RestTime) + 5;
      Stats_SendReport;
      Stats_ManageAccounts;
      LastExpDiff := NewExpDiff;
    end;

    From the debug I get all negative figures.

    And yes, I do set Starting XP := GetXP('woodcutting');

    Cheers for any help.
    T~M

  2. #2
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    shouldn't it be:
    SCAR Code:
    GameTab(tab_Stats); //or something like that, instead of GameTab(22);?
    Ce ne sont que des gueux


  3. #3
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Same thing.
    Gametab works.

  4. #4
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    From what I see, you make an Extended variable XpGained but never give it any value...you could try making all the XP variables extended instead of Integers since I'm sure GetXP() returns the actual xp and not the rounded number you see when you hover the skill.

    ~Camo
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


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

    Default

    Quote Originally Posted by Camo Developer View Post
    From what I see, you make an Extended variable XpGained but never give it any value...you could try making all the XP variables extended instead of Integers since I'm sure GetXP() returns the actual xp and not the rounded number you see when you hover the skill.

    ~Camo
    When he calls the SRLProgressReport he has 49,50 which I assume are the extended indices and he sets the xp gained to extended index 49 so there should be no problem there.
    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"

  6. #6
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    ReportXP is an integer, so are all of the other XP variables except XPGained which is an extended. If GetXP() returns 123.4 the Integer can't use that. He's setting an extended variable equal to an integer, what's the point? Extended != Integer.

    He never sets XpGained to the extended variable...
    SCAR Code:
    Players[CurrentPlayer].Extendeds[49] := ReportExp; // ReportExp is an integer...

    ~Camo
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  7. #7
    Join Date
    Apr 2007
    Location
    Melbourne, Aus
    Posts
    202
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You have to use IntToStr or FloatToStr.
    example: Writeln(IntToStr(CurrentXP));

  8. #8
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    No you dont
    Check out RM's SRL Progress Report

  9. #9
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    Yeah I don't get why you don't use conversion functions..?

    edit:
    oh i get it, 3.23B can just handle stuff like:
    SCAR Code:
    WriteLn(5000);
    WriteLn(My_Any_Variable);
    Ce ne sont que des gueux


  10. #10
    Join Date
    Apr 2007
    Location
    Melbourne, Aus
    Posts
    202
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    pretty sure u do. why dont u try it. also give us a link to his report.

    E: Sorry man, your right you dont. i was just testing it without the variable in there. just writeln(GetXP('woodcutting')); and that didnt work so i just jumped to conclusions. do you have latest version of SCAR? and post the result of the proggy plz.
    Last edited by jimmy_mac; 01-24-2010 at 03:57 PM.

  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 Floor66 View Post
    Yeah I don't get why you don't use conversion functions..?

    edit:
    oh i get it, 3.23B can just handle stuff like:
    Code:
    WriteLn(5000);
    WriteLn(My_Any_Variable);
    That is only true when you are writing the variable by itself.
    SCAR Code:
    Writeln(5000 + 'wat');
    Wouldn't work.
    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
    Apr 2007
    Location
    Melbourne, Aus
    Posts
    202
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    why wouldn't this work?
    SCAR Code:
    writeln(GetXP('woodcutting'));

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

    Default

    Quote Originally Posted by jimmy_mac View Post
    why wouldn't this work? Code:
    writeln(GetXP('woodcutting'));
    That will work for SCAR versions 3.20+.
    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
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Wtf.. there is not IntToFloat...
    I think the problem is in LastExpDiff, but I haven't really checked, I just skimmed thought..

  15. #15
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    lol... IntToFloat = Round/Ceil/Floor
    Ce ne sont que des gueux


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

    Default

    Quote Originally Posted by Floor66 View Post
    lol... IntToFloat = Round/Ceil/Floor
    Don't forget Trunc .
    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"

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
  •