Results 1 to 5 of 5

Thread: Procedure that SHOULD work, doing nothing?

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

    Default Procedure that SHOULD work, doing nothing?

    I'm pretty sure this should work, so I'm confused as to why it isn't doing anything.

    SCAR Code:
    program TryThis;
    {.include SRL/SRL.scar}

    var
      ArmorVar : Boolean;
      I : Integer;

    Procedure DoStuff;
    Begin
      ArmorVar := False;
      For I := 0 To 10 Do
      Begin
        Case I Of
          0 : If Not ArmorVar Then
                If Not GetColor(463, 127) = 144 Then
                  Mouse(463, 127, 15, 15, True);
          1 : If Not ArmorVar Then
                If Not GetColor(425, 162) = 144 Then
                  Mouse(425, 163, 15, 15, True);
          2 : If Not ArmorVar Then
                If Not GetColor(503, 167) = 144 Then
                  Mouse(503, 167, 15, 15, True);
          3 : If Not ArmorVar Then
                If Not GetColor(405, 207) = 144 Then
                  Mouse(463, 127, 15, 15, True);
          4 : If Not ArmorVar Then
                If Not GetColor(463, 207) = 144 Then
                  Mouse(463, 207, 15, 15, True);
          5 : If Not ArmorVar Then
                If Not GetColor(516, 208) = 144 Then
                  Mouse(516, 208, 15, 15, True);
          6 : If Not ArmorVar Then
                If Not GetColor(459, 249) = 144 Then
                  Mouse(463, 249, 15, 15, True);
          7 : If Not ArmorVar Then
                If Not GetColor(407, 285) = 144 Then
                  Mouse(407, 285, 15, 15, True);
          8 : If Not ArmorVar Then
                If Not GetColor(462, 286) = 144 Then
                  Mouse(463, 286, 15, 15, True);
          9 : If Not ArmorVar Then
                If Not GetColor(517, 287) = 144 Then
                  Mouse(517, 287, 15, 15, True);
        End;
      End;
    End;

    begin
      SetupSRL;
      DoStuff;
    end.

  2. #2
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    All the things like "If Not GetColor(463, 127) = 144 Then" should be "If Not(GetColor(463, 127) = 144) Then"

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

    Default

    I'll try that. Alright, thanks. That worked!

    Now I'm trying to implement an Array of Array of Boolean into that, so it'll work with the Player Array. It is, again, not working :/. Here's what I have. Probably a stupid error again lol :/.

    SCAR Code:
    program TryThis;
    {.include SRL/SRL.scar}

    var
      ArmorVar : Array[0..1 {Change to the amount of players you have}] of Array[0..9] of Boolean;
      I : Integer;

    procedure DeclarePlayers;    //Fill this in!
    begin
      HowManyPlayers :=1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name := ''; //username
      Players[0].Pass := ''; //password
      Players[0].Nick := ''; //3-4 letters from your username
      Players[0].integers[0]:=10; // attack
      ArmorVar[0] := [True, True, False, False, True, True, False, False, True];
    end;

    Procedure DoStuff;
    Begin
      For I := 0 To 10 Do
      Begin
        Case I Of
          0 : If Not (ArmorVar[CurrentPlayer][I]) Then
                If Not (GetColor(463, 127) = 144) Then
                  Mouse(463, 127, 15, 15, True);
          1 : If Not (ArmorVar[CurrentPlayer][I]) Then
                If Not (GetColor(425, 162) = 144) Then
                  Mouse(425, 163, 15, 15, True);
          2 : If Not (ArmorVar[CurrentPlayer][I]) Then
                If Not (GetColor(503, 167) = 144) Then
                  Mouse(503, 167, 15, 15, True);
          3 : If Not (ArmorVar[CurrentPlayer][I]) Then
                If Not (GetColor(405, 207) = 144) Then
                  Mouse(463, 127, 15, 15, True);
          4 : If Not (ArmorVar[CurrentPlayer][I]) Then
                If Not (GetColor(463, 207) = 144) Then
                  Mouse(463, 207, 15, 15, True);
          5 : If Not (ArmorVar[CurrentPlayer][I]) Then
                If Not (GetColor(516, 208) = 144) Then
                  Mouse(516, 208, 15, 15, True);
          6 : If Not (ArmorVar[CurrentPlayer][I]) Then
                If Not (GetColor(459, 249) = 144) Then
                  Mouse(463, 249, 15, 15, True);
          7 : If Not (ArmorVar[CurrentPlayer][I]) Then
                If Not (GetColor(407, 285) = 144) Then
                  Mouse(407, 285, 15, 15, True);
          8 : If Not (ArmorVar[CurrentPlayer][I]) Then
                If Not (GetColor(462, 286) = 144) Then
                  Mouse(463, 286, 15, 15, True);
          9 : If Not (ArmorVar[CurrentPlayer][I]) Then
                If Not (GetColor(517, 287) = 144) Then
                  Mouse(517, 287, 15, 15, True);
        End;
      End;
    End;

    begin
      SetupSRL;
      DeclarePlayers;
      DoStuff;
      For I := 0 To 9 Do
        If Not (ArmorVar[CurrentPlayer][I]) Then
          WriteLn('False');
    end.

  4. #4
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Whats the output?
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

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

    Default

    Successfully compiled (2288 ms)
    SRL Compiled in 15 msec
    Successfully executed

    That's all it says :/.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Procedure TypeSendRandom & Procedure AutoResponder!
    By Ultra in forum Research & Development Lounge
    Replies: 12
    Last Post: 01-08-2008, 07:04 PM
  2. Need help with Procedure
    By Venom666 in forum OSR Help
    Replies: 3
    Last Post: 07-05-2007, 10:03 PM
  3. Replies: 8
    Last Post: 05-24-2007, 11:57 PM
  4. Procedure that calls random procedure?
    By Secet in forum OSR Help
    Replies: 2
    Last Post: 03-03-2007, 03:56 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
  •