Results 1 to 20 of 20

Thread: Multi person proggy?

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

    Default Multi person proggy?

    I've thinking of a way to get my proggy for my script to show what each person did. Wouldn't it be something like:
    SCAR Code:
    WriteLn('Player ' + Players[CurrentPlayer].Name(something like that) 'did '+ IntToStr(Loads) + ' loads and dropped '+ IntToStr(Drops) + ' Logs. You gained '+ IntToStr(Players[CurrentPlayer].Integers[2]) + ' Woodcutting levels');
    I know that's not the exact code but wouldn't it be something like that?

    ~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.


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

    Default

    Something like;
    SCAR Code:
    Var I : Integer;

    For I := 0 To GetArrayLength(Players) Do
    Begin
     WriteLn('Player: '+ Players[I].Name +' Chopped '{etc. etc.});
    End;

    EDIT:
    Corrected example:

    SCAR Code:
    program New;
    {.include SRL\SRL.scar}

    Var I : Integer;

    Procedure DeclarePlayers;
    Begin
      CurrentPlayer  := 0; // Starting player
      HowManyPlayers := 4; // How many players in total?
      NumberOfPlayers(HowManyPlayers);

      Players[0].Name        := '';              // Username
      Players[0].Pass        := '';              // Password
      Players[0].Nick        := '';              // Nickname, 3 - 4 letters of username
      Players[0].Active      := True;            // Use this player?

      Players[1].Name        := '';              // Username
      Players[1].Pass        := '';              // Password
      Players[1].Nick        := '';              // Nickname, 3 - 4 letters of username
      Players[1].Active      := True;            // Use this player?

      Players[2].Name        := '';              // Username
      Players[2].Pass        := '';              // Password
      Players[2].Nick        := '';              // Nickname, 3 - 4 letters of username
      Players[2].Active      := True;            // Use this player?

      Players[3].Name        := '';              // Username
      Players[3].Pass        := '';              // Password
      Players[3].Nick        := '';              // Nickname, 3 - 4 letters of username
      Players[3].Active      := True;            // Use this player?
    End;

    begin
     SetupSRL;
     DeclarePlayers;
     For I := 0 To High(Players) Do
     Begin
      WriteLn('Player '+ IntToStr(I) +': '+ Players[I].Name +' Chopped '{etc. etc.});
     End;
    end.
    Ce ne sont que des gueux


  3. #3
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Quote Originally Posted by floor66 View Post
    Something like;
    SCAR Code:
    Var I : Integer;

    For I := 0 To GetLength(Players) Do
    Begin
     WriteLn('Player: '+ Players[I].Name +' Chopped '{etc. etc.});
    End;
    Actually, it would be more like this:
    SCAR Code:
    Var
    I : Integer;
     
    For I := 0 To GetArrayLength(Players)-1 Do
    Begin
     WriteLn('Player: '+ Players[i].Name +' Chopped '{etc. etc.});
    End;

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

    Default

    Erm.. why -1?

    SCAR Code:
    Var I : Integer;
     
    For I := 0 To GetArrayLength(Players) Do //E.x if you have in DeclarePlayers 4 players (player 0 to 3), GetArrayLength will result in 4
    Begin
     WriteLn('Player: '+ Players[i].Name +' Chopped '{etc. etc.});
    End;
    Ce ne sont que des gueux


  5. #5
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Lets say it has a length of 10. That means it has the indexes 0..9. Simply putting GetArrayLength would cause the loop to run through 0..10. It would cause an error once it got to 10. The final index is 1 less than the length of the array, so that's why it's -1.

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

    Default

    No, It doesn't work like that:
    SCAR Code:
    program New;
    {.include SRL\SRL.scar}

    Var I : Integer;

    Procedure DeclarePlayers;
    Begin
      CurrentPlayer  := 0; // Starting player
      HowManyPlayers := 4; // How many players in total?
      NumberOfPlayers(HowManyPlayers);

      Players[0].Name        := '';              // Username
      Players[0].Pass        := '';              // Password
      Players[0].Nick        := '';              // Nickname, 3 - 4 letters of username
      Players[0].Active      := True;            // Use this player?

      Players[1].Name        := '';              // Username
      Players[1].Pass        := '';              // Password
      Players[1].Nick        := '';              // Nickname, 3 - 4 letters of username
      Players[1].Active      := True;            // Use this player?

      Players[2].Name        := '';              // Username
      Players[2].Pass        := '';              // Password
      Players[2].Nick        := '';              // Nickname, 3 - 4 letters of username
      Players[2].Active      := True;            // Use this player?

      Players[3].Name        := '';              // Username
      Players[3].Pass        := '';              // Password
      Players[3].Nick        := '';              // Nickname, 3 - 4 letters of username
      Players[3].Active      := True;            // Use this player?
    End;

    begin
     SetupSRL;
     DeclarePlayers;
     For I := 0 To High(Players) Do
     Begin
      WriteLn('Player '+ IntToStr(I) +': '+ Players[I].Name +' Chopped '{etc. etc.});
     End;
    end.

    This works 100%
    Ce ne sont que des gueux


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

    Default

    Floor, Senrath is correct on this one,

    SCAR Code:
    For I := 0 to (HowManyPlayers - 1) do

    is usually how i do my for loop.
    “Ignorance, the root and the stem of every evil.”

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

    Default

    Argh yeah I was thinking of High();
    Stooped me
    Ce ne sont que des gueux


  9. #9
    Join Date
    Jun 2008
    Location
    San Diego, California
    Posts
    276
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program New;
    {.include SRL\SRL.scar}
     
    Var I : Integer;
     
    Procedure DeclarePlayers;
    Begin
      CurrentPlayer  := 0; // Starting player
      HowManyPlayers := 4; // How many players in total?
      NumberOfPlayers(HowManyPlayers);
     
      Players[0].Name        := '';              // Username
      Players[0].Pass        := '';              // Password
      Players[0].Nick        := '';              // Nickname, 3 - 4 letters of username
      Players[0].Active      := True;            // Use this player?
     
      Players[1].Name        := '';              // Username
      Players[1].Pass        := '';              // Password
      Players[1].Nick        := '';              // Nickname, 3 - 4 letters of username
      Players[1].Active      := True;            // Use this player?
     
      Players[2].Name        := '';              // Username
      Players[2].Pass        := '';              // Password
      Players[2].Nick        := '';              // Nickname, 3 - 4 letters of username
      Players[2].Active      := True;            // Use this player?
     
      Players[3].Name        := '';              // Username
      Players[3].Pass        := '';              // Password
      Players[3].Nick        := '';              // Nickname, 3 - 4 letters of username
      Players[3].Active      := True;            // Use this player?
    End;
     
    begin
     SetupSRL;
     DeclarePlayers;
     For I := 0 To HowManyPlayers - 1 Do
     Begin
      WriteLn('Player '+ IntToStr(I) +': '+ Players[i].Name +' Chopped ' +IntToStr(Players[i].Integers[0])); {During script runtime when you
    count logs, have it go: Players[CurrentPlayer].Integers[0] := Players[CurrentPlayer].Integers[0] + (# of logs).}


     End;
    end.
    Current Project: All In 1 Falador Script - 20% DONE

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

    Default

    Ok, thanks all who responded! So my proggy would look something like this?
    SCAR Code:
    Procedure Proggy;
    Begin
      Writeln('==========AnyTreePowerCutter by Camo Kyle==========');
      Writeln('||===== Time Running : ' +TimeRunning);
    for I := 0 to (HowManyPlayers - 1) do
      Writeln('||===== Player '+ IntToStr(I) +':'+ Players[i].Name + ': '+left(booltostr(players[i].active),1)+' did '+ IntToStr(Loads) + ' loads and dropped '+ IntToStr(Drops) + ' logs and gained'+ IntToStr(Players[CurrentPlayer].Integers[2]) + ' woodcutting levels!');
      Writeln('===================================================');
      WriteLn('======= Don''t forget to Rep++ if you like ;) ======');
      Writeln('===================================================');
      Writeln('==============NO PROGGY''S NO UPDATES!=============');
      Writeln('===================================================');
    End;
    So that way each player that is declared gets listed on the proggy? Thanks again for the help.

    ~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.


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

    Default

    SCAR Code:
    Procedure Proggy;
    Begin
      Writeln('==========AnyTreePowerCutter by Camo Kyle==========');
      Writeln('||===== Time Running : ' +TimeRunning);
      For I := 0 to (HowManyPlayers - 1) Do
      Begin
        Writeln('||===== Player '+ IntToStr(I) +':'+ Players[i].Name + ': '+left(booltostr(players[i].active),1)+' did '+ IntToStr(Loads) + ' loads and dropped '+ IntToStr(Drops) + ' logs and gained'+ IntToStr(Players[CurrentPlayer].Integers[2]) + ' woodcutting levels!');
        Writeln('===================================================');
        WriteLn('======= Don''t forget to Rep++ if you like ;) ======');
        Writeln('===================================================');
        Writeln('==============NO PROGGY''S NO UPDATES!=============');
        Writeln('===================================================');
      End;
    End;

    Also indent properly (if you'd use this for SRL app, then indent for sure!)
    Ce ne sont que des gueux


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

    Default

    Sorry I don't have SCAR for this computer so I was using Notepad. Sorry Thanks tho.

    ~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.


  13. #13
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    The only problem there is that for all of them you'd end up printing out the same number of loads, etc. For a multiplayer proggy you'll need to store the values in Players[i].Integers[x] for each player. So loads could be, like, Integers[0], drops could be Integers[1], and you already have levels gained as Integers[2].

  14. #14
    Join Date
    Mar 2007
    Posts
    3,116
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by floor66 View Post
    SCAR Code:
    Procedure Proggy;
    Begin
      Writeln('==========AnyTreePowerCutter by Camo Kyle==========');
      Writeln('||===== Time Running : ' +TimeRunning);
      For I := 0 to (HowManyPlayers - 1) Do
      Begin
        Writeln('||===== Player '+ IntToStr(I) +':'+ Players[i].Name + ': '+left(booltostr(players[i].active),1)+' did '+ IntToStr(Loads) + ' loads and dropped '+ IntToStr(Drops) + ' logs and gained'+ IntToStr(Players[CurrentPlayer].Integers[2]) + ' woodcutting levels!');
        Writeln('===================================================');
        WriteLn('======= Don''t forget to Rep++ if you like ;) ======');
        Writeln('===================================================');
        Writeln('==============NO PROGGY''S NO UPDATES!=============');
        Writeln('===================================================');
      End;
    End;

    Also indent properly (if you'd use this for SRL app, then indent for sure!)
    No, he was right

  15. #15
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    SCAR Code:
    For i := 0 to High(HowManyPlayers) do

    This would do just fine. High is also a little faster than GetArrayLength(HowManyPlayers ) - 1. Also doing this -

    SCAR Code:
    Player := (GetArrayLength(HowManyPlayers ) - 1);
    For i := 0 to Player do

    Is also faster than doing GetArrayLength(HowManyPlayers ) - 1 in the for to do loop.

    But High is the fastest between them...May not be noticable but it is fractions faster.

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  16. #16
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    GetLength isn't the same as High.
    Senrath was right, when you use GetLength, Length, or GetArrayLength you need to use -1. When you use High you don't.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

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

    Default

    Thanks again for everybody's help! I do have a quick question, it's kinda on/off topic. For my range guilder I'm basically done(bout time right?) and I want the proggy to say how much gold was spent. Would this work for finding it? I'm using GetInvItemCount.

    SCAR Code:
    Writeln('||===== GP Spent : ' +IntToStr(GetCoinCount - GetCoinCount2));

    I don't know exactly how to do that. I just know that you can do that with levels. This is what a part of my main loop looks like:

    SCAR Code:
    GetCoinCount;
        FindJudge;
        TalkToJudge;
        EquipArrows;
        FireLoop;
        Games := Games +1;
        GetTicketCount;
        GetCoinCount2;
        Proggy;

    Anyhelp would be appreciated. Thanks again for all the responses.

    ~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.


  18. #18
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Whats the difference between GetCoinCount and GetCoinCount2?

    Anyway, you'll probably want to store them to variables when you call them, and then use those variables in the proggy. Calling them like you're doing in that writeln would cause them both to be called again, then have the arithmetic carried out. Which, depending on what the functions actually do, may end up always resulting in 0.

  19. #19
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You could also do something like Games * 200, because afaik each game is 200 gold per game.

    *Scuttles back into the darkness known as homework*

    ~Sandstorm

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

    Default

    Thanks, it works great!

    ~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.


Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Multi-User, Multi-Log, Multi-Bow Pro Fletcher
    By Foss in forum First Scripts
    Replies: 13
    Last Post: 07-16-2008, 08:54 AM
  2. srl person
    By srl person in forum Who Are You ? Who ? Who ?
    Replies: 6
    Last Post: 02-12-2008, 12:21 AM
  3. [Game] Ban The Person Above You
    By steveinater in forum News and General
    Replies: 2
    Last Post: 10-08-2007, 03:26 PM
  4. proggy help
    By HarryJames in forum OSR Help
    Replies: 8
    Last Post: 02-28-2007, 11:44 PM

Posting Permissions

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