Results 1 to 7 of 7

Thread: Compileing error and More :(

  1. #1
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Compileing error and More :(

    Right so my first scirpt (not counting the ones that never worked) has errors when complieing and im not sure if my main loops would work?
    So heres what i need help with
    1: whats not working
    2: Would the Mainloop work?
    3: Would the rest work?
    4: SomeOne please tell he how to check woodcutting level no matter how many times i ask no one answers
    5: Thanks for the help


    Edit: Does this work things to change can't test no time im in a rush to go out
    SCAR Code:
    Program RyasPowerMiner;
    {.include SRL/SRL/Misc/Smart.scar}
    {.include SRL/SRL.scar}

    Var x, y, Rock, FailedFinding, W, DropDTM, InvC, ha, LoadsDone, tt, ab,DTM1:integer;
      Colours: TIntegerArray;

    procedure DeclarePlayers;
    begin
      HowManyPlayers:= 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name        := ''; //username
      Players[0].Pass        := ''; //password
      Players[0].Nick        := ''; //3-4 letters of your username, no caps or first letter
      Players[0].Active      := True; //Active or not
      players[0].Integers[0]  := 10 //loads to do
      players[0].Strings[0]  := 'clay';


    end;

    Procedure SetupSmart;
    begin
      SMART_Server:= 4 //what rs world
      Smart_Members:= false; //members world?;
      Smart_Signed:= false; //signed java applet?;
      Smart_SuperDetail:= false; //High Detailed mode?
    end;


    {Procedure CheckLevels;
    Begin
    End;}


    Procedure AskLevels;
    Begin
      Inc(tt);
        Case Random(40) of
          0: TypeSend('Mining Lvls');
          1: TypeSend('Lvls');
          2: TypeSend('Whats your minning lvls');
          3: Begin
               TypeSend('Woodcutting Lvls?');
               TypeSend('soz Mining Lvls?');
             End;
          4: TypeSend('mining lv');
          5: TypeSend('Who has the best minning lvl?');
          6: TypeSend('Whats every body minning?');
        End;
    End;

    Procedure RandomTalk;
    Begin
      Inc(tt);
      Case Random(30) of
      0: TypeSend('I cant wait to mine faster');
      1: TypeSend('I like the mining skill cape');
      2: TypeSend('Why does levevling mining take for ever');
      3: TypeSend('Someone told me this was the best way to level up but it takes for ever');
      End;
    End;

    Procedure AntiBan;
    Begin
      Inc(ab);
      Case Random(100) of
         0..9: HoverSkill('Random', false);
         10..14: PickUpMouse;
         15..29: BoredHuman;
         30: AskLevels;
         31..40: RandomRClick;
         41..49: RandomMovement;
         50..79: Wait(5000+random(5000));
         80..99: MMouse(230,230,500,500);
         100: RandomTalk;
       End;
    End;

    Procedure SetRock;
    Begin
       Case lowercase(Players[CurrentPlayer].Strings[0]) Of
       'clay'     : Begin
                    Colours := [7646927,7581134]//need 2 colours  from rimm, two from varock
                    DropDTM := DTMFromString('78DA63CC676660E0626240063519AE609A11C' +
                               'A6704A9E1405503934551C347404D36500D3701352544A821C23D' +
                               '005B2D0432');
                    End;
       'copper'   : Begin
                    Colours := [4225234,5083387];
                    DropDTM := DTM1
                    End;
       'tin'      : Begin
                    Colours := [9935007,5329493];
                    DropDTM := DTM1
                    End;
       'iron '    : Begin
                    Colours := [2370368,2172731];
                    DropDTM := DTM1
                    End;
       'coal'     : Begin
                    Colours := [32545,35435];
                    DropDTM := DTM1
                    End;
       'gold'     : Begin
                    Colours := [2210023,2210538];
                    DropDTM := DTM1
                    End;

       End;
       DTM1 := DTMFromString('78DA639CC6CCC060C5C4800C623C8D19A4803' +
           '42310FF0702C689403536A86A20B2301248CF00AAB127428D3901' +
           '3520BB6C09A8990254E3805F0D0002EE0A03');
    End;

    Procedure WaitToFinish;
    Var Inv, TM:integer;
    Begin
      MarkTime(TM);
      Inv := InvCount
      Repeat
        If GetBlackChatMessage=('You m') then
         Exit;
        If not(Inv=InvCount) Then
         Exit;
        If (TimeFromMark(TM)=7000) Then
         Exit;
      Until(False);
    End;

    Procedure Click;
    Begin
    GetMousePos(x,y);
    Wait(100+random(600));
      If (Random(8)=4) Then
        Begin
        Mouse(x, y, 0, 0, False);
        ChooseOption('hop');
        End Else
        Mouse(x, y, 0, 0, True);
        WaitToFinish;
    End;

    procedure Drop;
    begin
      SetRock;
      ClickAllItems('dtm',DropDTM,'Drop',300,[])
      AntiBan;
      FindNormalRandoms;
      FreeDTM(DropDTM);
    end;

    Function FindRockTPA(Var Color: TIntegerArray): Boolean;
     Var
      MyTPA: TPointArray;
      MyPoint: TPoint;
      i, F: Integer;
    Begin
      SetRock;
      FreeDTM(DropDTM);
      If (GetArrayLength(Color) < 2) Then Exit;
      FindColorsSpiralTolerance(MSCx, MSCy, MyTPA, Color[0], MSx1, MSy1, MSx2, MSy2, 17);
      If Length(MyTPA) = 0 Then FindColorsTolerance(MyTPA, Color[1], MSX1, MSY1, MSX2, MSY2, 17);
      For i := 0 To High(MyTPA) Do
      Begin
        MyPoint := MyTPA[i]
        MMouse(MyPoint.x, MyPoint.y, 3, 3);
        If (IsUpTextMultiCustom(['ine', 'ore'])) Then
        Begin
          Result := True;
          Exit;
        End Else
        Inc(F);
        If (F=7) Then
        Result := False;
      End;
    End;

    Procedure Proggy;
    begin
      ClearDebug;
      Writeln('{============================================}');
      Writeln('{===== Time Running : ' + TimeRunning + '    =========}');
      Writeln('{===== Rocks Mined  : ' + IntToStr(Loadsdone*27) + '   =================}');
      Writeln('{===== Loads Done   : ' + IntToStr(LoadsDone) + '     =================}');
      Writeln('{===== Times Talked : ' + IntToStr(tt) + '    =================}');
      Writeln('{===== AntiBan used ' + IntToStr(ab) + ' times  ===============}');
      Writeln('{ Please Post Proggys to get things updated  }');
      Writeln('{============================================}');
    end;

    Procedure MiningLoop;
    Var LTD,ML:integer;
    Begin
      Repeat
      If not (LoggedIn) then Exit;
      LTD := 95+Random(100)
      Repeat
        if FindRockTPA(Colours) then
        Begin
          Repeat
          Click;
          WaitTofinish;
          Until((InvFull) Or (TimeFromMark(ML)>1200000))
          If (InvFull) Then
          Begin
            Drop;
            Proggy;
          End Else
            Players[CurrentPlayer].Active := False;
        End;
        Until( (LoadsDone=Players[CurrentPlayer].Integers[0]) or (TimeFromMark(ML)>3600000) or (LTD=LoadsDone))
        If (LTD=LoadsDone) Then
           NextPlayer(true);
        If (LoadsDone=Players[CurrentPlayer].Integers[0]) or (TimeFromMark(ML)>3600000) Then
          NextPlayer(False);
      Until(AllPlayersInactive);
    End;

    Procedure Intro;
    Begin
     Writeln('        __________     ____           ______        _______                             ');
     Wait(75);
     Writeln('       |         |     \    \        /     /       /      \                             ');
      Wait(75);
     Writeln('       |  ____   |      \    \      /     /       /   __   \                            ');
      Wait(75);
     Writeln('       |  |   |  |       \    \    /     /       /   /  \   \                           ');
      Wait(75);
     Writeln('       |  |___|  \        \    \  /     /       /   /    \   \                          ');
      Wait(75);
     Writeln('       |  _____   \        \    \/     /       /   /______\   \                         ');
      Wait(75);
     Writeln('       | |     \   \        \         /       /   /        \   \                        ');
      Wait(75);
     Writeln('       | |      \   \        \       /       /   /          \   \                       ');
      Wait(75);
     Writeln('       | |       \   \        \     /       /   /            \   \                      ');
      Wait(75);
     Writeln('       |_|        \ __\       /    /       /___/              \___\                     ');
      Wait(75);
     Writeln('                             /    /                                                     ');
      Wait(75);
     Writeln('                            /    /                                                      ');
      Wait(75);
     Writeln('                           /    /                                                       ');
      Wait(75);
     Writeln('                          /____/                                     __  ______         ');
      Wait(75);
     Writeln('                            _                                        || / ___  \        ');
      Wait(75);
     Writeln('                           |_|                           _____       | / /   \  \       ');
      Wait(75);
     Writeln('                            _         /\          / /   /  ___ \     |  |      \__\     ');
      Wait(75);
     Writeln('       /\        /\        | |       /  \        / /   /  /____\\    |  |               ');
      Wait(75);
     Writeln('      //\\      //\\       | |      //\  \      / /   /  ________\   |  |               ');
      Wait(75);
     Writeln('     //  \\    //  \\      | |     //  \  \    / /   /   /           |  |               ');
      Wait(75);
     Writeln('    //    \\  //    \\     | |    //    \  \  / /    |  /______      |  |               ');
      Wait(75);
     Writeln('   //      \\//      \\    |_|   //      \  \/ /      \_______\      |__|               ');
      Wait(75);
     Writeln('                    Please Post Progys and Bugs                                         ');
      Wait(75);
     Writeln('                        Have Fun Mining                                                 ');
      Wait(75);
     Writeln('                             Rya                                                        ');
     Wait(1000);
    End;

    Procedure ScriptTerminate;
    Begin
    Proggy;
    Logout;
    End;

    begin
      SetupSRL;
      DeclarePlayers;
      cleardebug;
      Intro;
      SetupSmart;
      MiningLoop;
      Proggy;
    end.
    ~Rya
    Last edited by rya; 11-03-2009 at 09:56 PM.
    I see Now, says the blind man

  2. #2
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    EDIT: Here it is, and it compiles: http://pastebin.com/m677a0766
    Line numbers on my notes below may be different than yours.
    Enjoy.

    SCAR Code:
    players[0].Strings[0]  := 10 //loads to do
    is a STRING
    so either make it
    SCAR Code:
    players[0].Strings[0]  := '10' //loads to do OR
     players[0].Integers[0]  := 10 //loads to do

    More coming after edit, I just don't wanna get ninja'd

    Next Error:
    Line 112: [Error] (20692:4): Unknown identifier 'IsBlackText' in script ((You also had an extra opening parenthesis)
    Change it to
    SCAR Code:
    If GetBlackChatMessage=('You m') then

    Line 139: [Error] (20719:1): Unknown identifier 'AntiRandoms' in script
    Changed to
    SCAR Code:
    FindNormalRandoms

    Line 172: [Error] (20752:9): Unknown identifier 'LogedIn' in script
    (forgot a g) changed to
    SCAR Code:
    LoggedIn

    Line 178: [Error] (20758:12): Invalid number of parameters in script
    You just have
    SCAR Code:
    FindRockTPA
    When the func needs a color
    SCAR Code:
    Function FindRockTPA(Var Color: TIntegerArray): Boolean;
    So make it like
    SCAR Code:
    FindRockTPA(Colours)
    (You also need to make a TIntegetArray of rock colors for it to find) (Edit: oh you have one " Colours: TIntegerArray;")


    Line 181: [Error] (20761:33): Unknown identifier 'ML' in script
    Just do
    SCAR Code:
    var ML:Integer;
    , you also need
    SCAR Code:
    MarkTime(ML);
    somwhere


    Line 185: [Error] (20765:1): Unknown identifier 'Proggy' in script
    Put your 'proggy' procedure BEFORE the MiningLoop procedure

    Line 201: [Error] (20781:43): Syntax error in script
    SCAR Code:
    (LoadsDone=Players[CurrentPlayer].Strings[0])
    LoadDone is an integer, and Players.Strings is a... string so change to Players[CurrentPlayer].Integer

    I don't even want to start explaining how much tinkering I had to do with your mainloop -.-, but here it is:
    SCAR Code:
    Procedure MiningLoop;
    Var LTD,ML:integer;
    Begin
      Repeat
      If not (LoggedIn) then Exit;
      LTD := 95+Random(100)
      Repeat
        if FindRockTPA(Colours) then
        Begin
          Repeat
          Click;
          WaitTofinish;
          Until((InvFull) Or (TimeFromMark(ML)>1200000))
          If (InvFull) Then
          Begin
            Drop;
            Proggy;
          End Else
            Players[CurrentPlayer].Active := False;
        End;
        Until( (LoadsDone=Players[CurrentPlayer].Integers[0]) or (TimeFromMark(ML)>3600000) or (LTD=LoadsDone))
        If (LTD=LoadsDone) Then
           NextPlayer(true);
        If (LoadsDone=Players[CurrentPlayer].Integers[0]) or (TimeFromMark(ML)>3600000) Then
          NextPlayer(False);
      Until(AllPlayersInactive);
    End;

    Re Woodcutting Levels:

    Begin
    SetupSRL;
    GetAllLevels;
    Writeln('Your attack level is ' +IntToStr(Players[i].level[1])+'!');
    End;

    Would do it level[1] is for attack [2] is for strength ect ect, so you'd have to log onto rs and count down the boxes to see which level is what.
    Last edited by YoHoJo; 11-03-2009 at 08:08 PM.

  3. #3
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Also, you have to place the DTM1 := ... line before you set something to it. Because it won't find any DTM as the DTM1 is 0 when you set DropDTM to it.

  4. #4
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok thats that was a lot of editing done thanks
    but now i run it and get
    Code:
    [Runtime Error] : Out Of Range in line 73 in script C:\Documents and Settings\Ryan.COMPUTER\Desktop\SRL\Minner\PowerMiner.scar
    And yes i have put
    SCAR Code:
    Players[0].Name        := ''; //username
      Players[0].Pass        := ''; //password
      Players[0].Nick        := ''; //3-4 letters of your username, no caps or first letter
      Players[0].Active      := True; //Active or not
      players[0].Integers[0]  := 10 //loads to do
      players[0].Strings[0]  := 'clay';
    the string in but i may have mucked up
    Last edited by rya; 11-03-2009 at 09:37 PM.
    I see Now, says the blind man

  5. #5
    Join Date
    Aug 2009
    Location
    Inside the Matrix...yes it has me, and it has you too.
    Posts
    1,896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    you could also use a with-do for your declare players on a side note...looks better :P
    NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN

  6. #6
    Join Date
    Oct 2006
    Posts
    500
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You aren't calling on DeclarePlayers, hence the Out Of Range Error.

  7. #7
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by r!ch!e View Post
    You aren't calling on DeclarePlayers, hence the Out Of Range Error.
    Thanks

    Does this work things to change can't test no time im in a rush to go out
    Edit: just posted new scirpt at top
    Last edited by rya; 11-03-2009 at 09:56 PM.
    I see Now, says the blind man

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
  •