Results 1 to 19 of 19

Thread: Multi-player

  1. #1
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default Multi-player

    I understand multi-player, and I've almost got my Smithing script which uses multi-player finished. However, how would I do it so that the script stops repeating when all of the players are False? Here's my main loop
    SCAR Code:
    begin
      SetupSRL;
      SetUpSmithing;
      DeclarePlayers;
      repeat
        begin
          repeat
            begin
              WithdrawDeposit;
              WalkToAnvil;
              FindAnvilThenSmith;
              WalkToBank;
            end;
          until(Loads = LoadsToDo) or (Players[CurrentPlayer]:= False);
          Switch;
      until(Players[1..4:= False); //Would it be something like this???----------
    end.

    Thanks,
    Richard
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  2. #2
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    I would put before switch;

    if(AllPlayersInactive) then TerminateScript;

    or like

    SCAR Code:
    if(AllPlayersInactive) then
    begin
      Proggy;
      TerminateScript;
    end;

    something like that, but I would use allplayersinactive to see that no players are, well, active lol.

    EDIT:haha sorry noidea, but we both had pretty much same thing and at almost same time

  3. #3
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    I thnink its some thing like

    SCAR Code:
    Repeat
      ...
      ...
    until( AllPlayersInactive );

    Edit: Crap some one beat me to it...
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  4. #4
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Thanks guys!

    noidea, don't worry! You still got your extra post count!
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  5. #5
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    no problem, you helped me and I saw a thread where you needed help so I figured I'd return the favor like I said in the PM.

  6. #6
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    I've got one more question...Has InChatMulti been removed from SRL? I've included it in my script, and I'm getting
    Code:
    Unknown identifier 'InChatMulti
    I've included SRL, and the other SRL functions are working fine...

    Is this how I'm supposed to use it?
    SCAR Code:
    if InChatMulti('Yes', 'Ye', 'eah', 'Yea', 'Yup', 'Uh huh') then

    Thanks!
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  7. #7
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    you coul djust open up text.scar in your includes folder to find out but I did for you, and I found InChat, but I did not see InChatMulti, so I'm guessing it is but maybe you can do something like:

    SCAR Code:
    if InChat('Yes') or InChat('Ye') or InChat('eah') or InChat('Yea') or InChat('Yup') or InChat('Uh huh') then

    that help any?

    EDIT: or copy the function, but change in there

    function InChat(Text: string): Boolean;

    to

    function InChatMulti(Text: TStringArray): Boolean;

    that should work so that you can do InChatMulti

    then just paste it above the first procedure you want to use it in. I think this should work but I don't know, I haven't tried testing it, and I didn't really look it over, it just makes sense to me that it would work.

  8. #8
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    I've sorted that out now. I did
    SCAR Code:
    YesChats:= ['Yes', 'Ye', 'eah', 'Yea', 'Yup', 'Uh huh', 'Yep'];
    and
    SCAR Code:
    if InChat(YesChats[i]) then

    Hopefully, my last question! What it wrong with this line?
    SCAR Code:
    until((Loads = (Players[CurrentPlayer].Integers[1])) or ((Players[CurrentPlayer]):= False);

    I get
    Code:
    Line 557: [Error] (17051:82): Close round expected in script D:\Program Files\SCAR 3.15b\etc etc....
    Thanks, and sorry to bother you!
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  9. #9
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    Players[CurrentPlayer] should be Players[CurrentPlayer].Active at least that's what I think you're going for with that.

    EDIT: oh wait, it's a close round error, that's easy just change:

    SCAR Code:
    ((Loads = (Players[CurrentPlayer].Integers[1])) or ((Players[CurrentPlayer]):= False);

    to

    SCAR Code:
    ((Loads = (Players[CurrentPlayer].Integers[1]))) or ((Players[CurrentPlayer]):= False);

  10. #10
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    You need one more )
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  11. #11
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    I was sure that I counted the same amount of (s and )s...Oh well, I didn't...I tried what you both said, and I still can't get it to work! Can someone just type up that line for me please? I'm really getting frustrated now. It's asking for a close round even though it's there.

    Thanks!
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

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

    Default

    Quote Originally Posted by R1ch View Post
    I was sure that I counted the same amount of (s and )s...Oh well, I didn't...I tried what you both said, and I still can't get it to work! Can someone just type up that line for me please? I'm really getting frustrated now. It's asking for a close round even though it's there.

    Thanks!
    Are you doing what baked did? That shouldn't have a close round error. Is it still the same line?

    ~Camo

    P.s. I noticed you're working on a VWB smither as well...Nice, I started it but did other scripts first. Maybe I'll get that running and get some competition? Lol
    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
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    SCAR Code:
    until(Loads mod Players[CurrentPlayer].Integers[1] = 0) or (not(Players[CurrentPlayer].Active));

    I think that should work (and won't be limited to one run by the loads and player integers).
    :-)

  14. #14
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default Thank You!

    Thank You Everyone!

    The script now compiles and works as it should. Time to do some testing.

    Camo: Bring it on!

    Once again, thank you!
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  15. #15
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    just wondering, did you use my line or method's? I'm pretty sure mine should work, I just had to add an extra ")" for you cuz you had one more "(" than ")".

  16. #16
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    Quote Originally Posted by Baked0420 View Post
    just wondering, did you use my line or method's? I'm pretty sure mine should work, I just had to add an extra ")" for you cuz you had one more "(" than ")".
    Yours wouldn't work because you can't check if Players[CurrentPlayer] is false by itself. You have to check Players[CurrenPlayer].Active. Plus, you're using the assignment operator (:=) instead of the equals operator (=), so that would throw some errors too.
    :-)

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

    Default

    InChatArr:

    SCAR Code:
    function InChatArr(Text: array of string): Boolean;
    var
      I, H: integer;
      s: string;
    begin
      H := High(Text);
      if (not (GetLastChatText(s))) then
      LastChatter(s);
      for I := 0 to H do
      begin
        if (Pos(Lowercase(Text[i]), (Lowercase(s))) > 0) then
        begin
          Result := true;
          Exit;
          end;
      end;
    end;

    Not made by me.

    Use:

    SCAR Code:
    InChatArr(['oodcutting', 'oodcut', 'ishing', 'ish', 'ine', 'ining', 'hi', 'hello', 'sup', 'yo', 'lol', 'lmao', 'rofl', 'haha'])

  18. #18
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    oh, all I did was fix his close round error, I didn't fix any other errors wrong with his line, but I could've fixed those, in an earlier post I even said it should be .active after [currentplayer] if you scroll up some, but i didn't notice yet the : before the = sign, but yea it shouldn't be := it should be just = like you said.

  19. #19
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    I used a bit of both of yours, I used
    SCAR Code:
    until(Loads = Players[CurrentPlayer].Integers[1]) or (not(Players[CurrentPlayer].Active));

    I'd already sorted it SandStorm. Thanks for helping though
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help adding Multi-Player
    By Zeta in forum OSR Help
    Replies: 10
    Last Post: 02-25-2009, 04:24 PM
  2. Help with Multi-Player PLEASE!
    By Ultra in forum OSR Help
    Replies: 2
    Last Post: 02-16-2008, 01:41 AM
  3. Multi-Player help?
    By Dudenow12 in forum OSR Help
    Replies: 3
    Last Post: 11-22-2007, 03:22 AM

Posting Permissions

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