Results 1 to 4 of 4

Thread: Multi-Player help?

  1. #1
    Join Date
    Jul 2007
    Location
    California
    Posts
    252
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Multi-Player help?

    I need some help with implementing Multi-Player into my script.

    This is my main loop and I need to know where to put the Multi-Player. If you could explain too that would help that way I will know how to use it in different cases. Thank You

    SCAR Code:
    Begin
      SetupSrl;
      DeclarePlayers;
      ActivateClient;
      wait(750);
      repeat;
        HighestAngle;
        wait(750 + random(100))
        MakeCompass('n');
        FloorAutoColor;
          repeat;
            Cleardebug;
            StartProgressReport;
            SetRun(true);
            Bank1;
            WalkToBar;
            Flag;
              repeat;
                FindNpcSeller;
                wait(100+random(50));
                BuyStout;
                wait(1000+random(750));
                AntiRandom;
              until(InvFull);
            WalkToBank;
            Bank2;
            AntiRandom;
            AntiBan;
            EndProgressReport;
          until(Loads = Loadz1);
          if (Loads = Loadz1) then
          LogOut;
          Wait(1000 + random(100))
          NextPlayer(True);
          Loadz1:=0;
          Writeln('Switched players suceessfully!');
      until(False);
    end.


    Also how can I put consts in my DeclarePlayers Procedure, that way there can be different options for each player?


    SCAR Code:
    Procedure DeclarePlayers;
     begin
       HowManyPlayers := 4; //Number of PLAYERS. active or not.
       NumberOfPlayers(HowManyPlayers);
       CurrentPlayer := 0; //Player to start on.

        //set all user names, passwords and nicks correctly please.

       Players[0].Name := '';//Account name.
       Players[0].Pass := '';//Account password.
       Players[0].Nick := '';//3-4 non-capital letters of username.
       Players[0].Active := True;//Set true if you want this player to run.

       Players[1].Name := '';
       Players[1].Pass := '';
       Players[1].Nick := '';
       Players[1].Active := True;

       Players[2].Name := '';
       Players[2].Pass := '';
       Players[2].Nick := '';
       Players[2].Active := False;

       Players[3].Name := '';
       Players[3].Pass := '';
       Players[3].Nick := '';
       Players[3].Active := False;

       NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
     end;

  2. #2
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default

    Well first you should have this at the beginning of every procedure you use:

    SCAR Code:
    if(not(LoggedIn))then
    Exit;

    At the beginning of your main loop i would put in:

    SCAR Code:
    if(not(LoggedIn))then
    LoginPlayer;

    You want to do this whenever your script may mess up ex: (getting lost, didnt find color ect..) so like:

    SCAR Code:
    if(not(FindColor(x,y,Color,MSX1,MSY1,MSX2,MSY2))then
    begin
      Writeln('could not find color');
      NextPlayer(False); // The False means that the player is turned inactive
    end;

    When you have finished like X amount of loads or X amount of time for a player then you can use :

    SCAR Code:
    if(loads = loads1)then
    begin
      NextPlayer(True); // Player remains active after the switch
    end;

    for your actual declare players thing...

    there are a bunch of things you can use like:
    SCAR Code:
    Players[0].Integers[0] := ;
    Players[0].Booleans[0] := ;
    Players[0].Loc := ;
    Players[0].strings[0] := ;

    i know im forgetting some, but if you look in your SRL folder they are listed somewhere maybe in the globlals...

    anyways i hope this helps ya
    METAL HEAD FOR LIFE!!!

  3. #3
    Join Date
    Jul 2007
    Location
    California
    Posts
    252
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Alright thank you very much!!!

    Quote Originally Posted by gerauchert View Post

    there are a bunch of things you can use like:
    SCAR Code:
    Players[0].Integers[0] := ;
    Players[0].Booleans[0] := ;
    Players[0].Loc := ;
    Players[0].strings[0] := ;

    i know im forgetting some, but if you look in your SRL folder they are listed somewhere maybe in the globlals...

    anyways i hope this helps ya
    One other question. Does the [0] in Integers/Booleans/strings have to match the [0] in the Players or is the [0] make it so you can have more than one Integers/Booleans/strings?

  4. #4
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    made so you can have more than one.

    Join the fastest growing merchanting clan on the the net!

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. Multi-player
    By Rich in forum OSR Help
    Replies: 18
    Last Post: 12-07-2008, 06:51 PM
  3. Help with Multi-Player PLEASE!
    By Ultra in forum OSR Help
    Replies: 2
    Last Post: 02-16-2008, 01:41 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
  •