Duplicate identifier???

Discussion in 'Archives' started by Alligaattor, Jun 10, 2007.

Duplicate identifier???
  1. Unread #1 - Jun 10, 2007 at 6:13 AM
  2. Alligaattor
    Joined:
    Mar 22, 2007
    Posts:
    30
    Referrals:
    0
    Sythe Gold:
    0

    Alligaattor Member

    Duplicate identifier???

    100: function FindNormalRandoms: Boolean;
    101: var
    102: i: Integer;
    103: begin
    104: for i := 1 to 16 do
    105: begin
    etc. ...
    _______________________________________________________________________
    Failed when compiling
    Line 100: [Error] (15220:10): Duplicate identifier 'FINDNORMALRANDOMS' in script
    _________________________________________________________________

    ____________________________________________________
    365: Procedure StoreStuff;
    366: Begin
    367: If InventoryCount > 1 then
    368: Begin
    369: Repeat
    370: ClickItemColorTol(65536, 10, False)

    ______________________________________________________________
    Failed when compiling
    Line 370: [Error] (15707:1): Unknown identifier 'ClickItemColorTol' in script
    _________________________________________________________________



    What is wrog??
    plz help!


    P.S. not same script
     
  3. Unread #2 - Jun 10, 2007 at 8:48 AM
  4. Town
    Joined:
    Jan 21, 2007
    Posts:
    3,776
    Referrals:
    3
    Sythe Gold:
    5

    Town Grand Master
    Scar Programmers

    Duplicate identifier???

    For the error, "Failed when compiling
    Line 370: [Error] (15707:1): Unknown identifier 'ClickItemColorTol' in script " use Scar 2.03 from www.freddy1990.com and SRL 3.6b from version 1.0 of PowerSkills.

    For the other error, post the script.
     
  5. Unread #3 - Jun 10, 2007 at 9:50 AM
  6. Alligaattor
    Joined:
    Mar 22, 2007
    Posts:
    30
    Referrals:
    0
    Sythe Gold:
    0

    Alligaattor Member

    Duplicate identifier???

    i have scar v 2.03 and srl 3.6...


    ________________________________________________________

    Code:
    {          _____________                    ____________
              [_____________EDGEVILLE YEW BANKER____________]
              [1. Have RS on Very Bright Setting.           ]
              [2. Start at Yew Trees, or in Edgeville Bank. ]
              [3. Set Nickname correctly, it helps alot.    ]
              [Info : The more loads you do before switcing ]
              [       players, the more likely you are to   ]
              [       get a random SRL can not solve.       ]
              [Extra : Declare Players, lines 30 +.         ]
               _____________                    ____________
              [_____________EDGEVILLE YEW BANKER____________]
    
    
    }
    { Example of a nickname... if your name is Fruit Cak3, put a nickname like...
      1. rui
      2. ak3
      3. uit       //DON'T use a capital letter.
    }
    
    PrOgRaM FourscapesEdgeYewCutter;
    {.include SRL/SRL.scar}
    {.include SRL\SRL\Skill\Woodcutting.SCAR}
    {.include SRL/SRL/Extended/xBank.scar}
    
    
    Const
      MyFlag = True; //käytetäänkö minun lippua
      LoadsWanted = 2; //kuinka monta kertaa hakkaamaan puita
    
    //-----------------------------------
    
    Procedure DeclarePlayers;
    begin
      Status('Loading Players')
    
      HowManyPlayers  := 1;
      NumberOfPlayers( HowManyPlayers );
      CurrentPlayer := 0;
    
         Players[0].Name      := 'Runescape Username';
         Players[0].Pass      := 'Runescape Password';
         Players[0].Nick      := 'Player Nickname'; // 2-4 kirjainta ukon nimestä
         Players[0].Active    := True;
         Players[0].Loc       := 'Bank';
    
    end;
    
    //-----------------------------------
    
    Var
      LogDTM, BrokenAxeDTM, Loads, DoorBitmap, AxeHandleDTM, RegularAxeDTM, AxeHeadMask : Integer;
      DoneSwitch : Boolean;
      LogCount, TotalLogs : Integer;
    
    //-----------------------------------
    
    Procedure LoadDTMs;
    
    begin
    Status('Loading DTM''s')
    
    LogDTM := DTMFromString('78DA632C666260E0646440067921460CFF813' +
           '448F43F103066314179C880118904D2354035FF19F0AB2905AA11' +
           '22604E23500D0F0135C94035DCF8D50000507909F5');
    
    BrokenAxeDTM := DTMFromString('78DA633CCAC4C090C1C8800C9A127919FE036' +
           '990E87F2060BC0C54938CAA06220B2381F445A09A04026A8E01D5' +
           'C41050B31FA8A698809AB384CD0100CBBD0D20');
    
    AxeHandleDTM := DTMFromString('78DA637CCFC4C0E0C6C8800CCA227819FE036' +
           '990E87F2060FC06546389AA06220B2381F473A09A00026ADE00D5' +
           'F81350F316A8C685809A97403541F8D50000D0090D3C');
    
    RegularAxeDTM := DTMFromString('78DA637461626060676440060DF1BC0CFF813' +
           '448F43F10300601D5FC6740038C482490F604AAF94D408D13500D' +
           '2B237E35F640358204D4F813618E1F50CD1F02EE0906AA61C26F0' +
           'E0099720B7E');
    
    AxeHeadMask := DTMFromString('78DA63EC656260F06040011DD5D50C5C409A1' +
           '188FF0301E3044C3579C929703520C0380353CD97375F2072503E' +
           '00CB9B0C31');
    
    DoorBitMap := BitmapFromString(1, 3, '6A5A26F000006A5A26');
    end;
    
    //-----------------------------------
    function FindNormalRandoms: Boolean;
    var
      i: Integer;
    begin
      for i := 1 to 16 do
      begin
        case I of
          1: CloseWindow;
          2: if FindTalk then
              Result := True;
          3: if FindDead then
              Result := True;
          4: if FindMod then
              Result := True;
          5: if FindMime then
              Result := True;
          6: if FindMaze then
              Result := True;
          7: if FindQuiz then
              Result := True;
          8: if FindDemon then
              Result := True;
          9: if FindScapeRune then
              Result := True;
          10: if FindTalk then
              Result := True;
          11: if FindLamp(LampSkill) then
              Result := True;
          12: if (FindNewBox) then
            begin
              Result := True;
              if (UseBoxSolver) then
                SolveBox
              else
                GambleNewBox;
            end;
          13: if FindTrade then
              Result := True;
          14:
            begin
              if NoGameTab then
              begin
                Result := True;
                Players[CurrentPlayer].loc := 'No GameTab';
                Logout;
                Exit;
              end;
            end;
          15: SaveToChatLog;
          16: if RC then
              Result := True;
        end;
        Wait(1);
      end;
    end;
    
    
    Function FoursFlag : Boolean;
    Var
      I : Integer;
      SFF : LongInt;
    Begin
      If (MyFlag) then
      Begin
        GameTab(4)
        MarkTime(SFF)
        Repeat
          If (FlagPresent) then
          Begin
            For I:= 1 to 3 do
            Begin
              Case I of
                1: MMouse(0 + Random(300), 0 + Random(300), 0 + Random(300), 0 + Random(300));
                2: FindNormalRandoms;
                3: FindTalk;
              end;
            end;
          end;
          Wait(600 + Random(400))
          If Not(LoggedIn) then NextPlayer(False);
        Until (Not(FlagPresent)) or (TimeFromMark(SFF)>10000)
      end else
      Begin
        Flag;
      end;
      Result := True;
      Wait(500 + Random(400))
    end;
    
    //-----------------------------------
    
    Function FOpenEdgeBank : Boolean;
    Var
      bbX, bbY, bbTries : Integer;
    Begin
     bbTries := 0
     ActivateClient;
     MakeCompass('N')
     ActivateClient;
     HighestAngle;
     If FindDTM(AxeHeadMask, bbX, bbY, MMX1, MMY1, MMX2, MMY2) then
     Begin
       Mouse(bbX, bbY + 7, 0, 0, True)
       FoursFlag;
     end;
     Repeat
      If FindObjMultiText(bbX, bbY, 'ank b', 'booth', 'Bank booth', 607324, 3) then
      Begin
        Mouse(bbX, bbY, 0, 0, False)
        Wait(100)
        ChooseOption(x, y, 'uick')
        Result := True;
        FoursFlag;
        Wait(5000+Random(1000))
      end else
      Begin
        bbTries := bbTries + 1
        WriteLn('Bank not found, tried ' + IntToStr(bbTries) + ' time[s]')
      end;
      If Not(LoggedIn) then NextPlayer(False);
     Until (Result) or (bbTries > 7)
     If (bbTries > 7) then
     Begin
       WriteLn('Took too many tries to find the bank.')
       Players[CurrentPlayer].Loc := 'Lost';
       LogOut;
       NextPlayer(False);
       Exit;
     end;
     Result := True;
     Wait(1000 + Random(1000))
    end;
    
    //-----------------------------------
    
    Function FCheckDoor : Boolean;
    Var
      dX, dY, m : Integer;
    Begin
      ActivateClient;
      MakeCompass('N')
      HighestAngle;
      m := 0;
      Repeat
        If FindObjMultiText(dX, dY, 'oor', 'Door', 'Doo', 2574956, 4) or
           FindObjMultiText(dX, dY, 'oor', 'Door', 'Doo', 2767952, 4) then
        Begin
          MMouse(dX, dY, 0, 0)
          Wait(100)
          If IsUpText('pen') then
          Begin
            Mouse(dX, dY, 0, 0, True)
            Result := True
            WriteLn('Opened door')
            FoursFlag;
          end else
          Begin
            Result := True;
            WriteLn('Door was open')
          end;
          m := m + 1
        end;
        If Not(LoggedIn) then NextPlayer(False);
      Until (Result) or (m > 4)
      If (m > 4) then
      Begin
        WriteLn('Couldn''t find the door')
        WriteLn('Going to try to enter room')
      end;
    end;
    
    //-----------------------------------
    
    Function FWalkToYew : Boolean;
    Var
      wX, wY : Integer;
    Begin
      ActivateClient;
      MakeCompass('N')
      If FindSymbol(wX, wY, 'Dungeon') then
      Begin
        Mouse(wX, wY - 3, 0, 0, True)
        SetRun(True)
        GameTab(4)
        FoursFlag;
        If FindBitMapToleranceIn(DoorBitMap, wX, wY, MMX1, MMY1, MMX2, MMY2, 9) then
        Begin
          Mouse(wX, wY, 3, 3, True)
          FoursFlag;
        end;
        FCheckDoor;
        If FindSymbol(wX, wY, 'Tree') then
        Begin
          If Distance(wX, wY, 648, 83) > 41 then
          Begin
            Mouse(wX + 7, wY + 6, 0, 0, True)
            FoursFlag;
          end else
          Begin
            Mouse(wX + 7, wY - 7, 0, 0, True)
            FoursFlag;
          end;
        end;
        Result := True;
      end else
      Begin
        Mouse(652, 150, 0, 0, True)
        SetRun(True)
        GameTab(4)
        FoursFlag;
        If FindSymbol(wX, wY, 'Dungeon') then
        Begin
          Mouse(wX, wY - 10, 0, 0, True)
          FoursFlag;
        end;
        FCheckDoor;
        If FindSymbol(wX, wY, 'Tree') then
        Begin
          Mouse(wX + 3, wY + 6, 0, 0, True)
          FoursFlag;
        end;
        Result := True;
      end;
    end;
    
    //-----------------------------------
    
    Function SwitchTrees : Boolean;
    Var
      tX, tY, sX, sY, Dist : Integer;
    
    Begin
      ActivateClient;
      MakeCompass('N')
      If Not FindObj(tX, tY, 'Yew', 1990736, 2) then
      Begin
        If FindSymbol(sX, sY, 'Dungeon') or
           FindMMColorTol(sX, sY, 5201919, 2) then
        Begin
          Dist := Distance(683, 68, sX, sY)
          If (Distance(648, 84, sX, sY) < 33) then
          Begin
            WriteLn('Distance = ' + IntToStr(Dist) + '.')
            WriteLn('Moving to northern tree.')
            Mouse(645, 57, 3, 3, True)
            FoursFlag;
            Result := True;
            DoneSwitch := True;
          end else
          Begin
            Dist := Distance(653, 116, sX, sY)
            WriteLn('Distance = ' + IntToStr(Dist) + '.')
            WriteLn('Moving to southern tree.')
            Mouse(652, 118, 3, 3, True)
            FoursFlag;
            Result := True;
            DoneSwitch := True;
          end;
        end;
      end;
    end;
    
    //-----------------------------------
    
    Var
      EX, EY : integer;
      FX, FY : integer;
      SafeEntWait : LongInt;
    Procedure EntChecker;
    Begin
      Status('Checking For Ent')
      If (FindObjMultiText(EX, EY, 'Yew', 'Yew', 'Yew', 1990736, 2)) then
      Begin
        MMouse(EX, EY, 0, 0)
        If FindColorTolerance( FX, FY, 55769, 85, 15, 115, 15, 20) then
        Begin
          Status('Ent Found');
          MouseFindFlag(645, 83, 2, 2);
          MarkTime(SafeEntWait)
          Repeat
            FTWait(5)
            FindNormalRandoms;
          If Not(LoggedIn) then NextPlayer(False);
          Until TimeFromMark(SafeEntWait) > 29000 + Random(10000)
          EntsAvoided := EntsAvoided + 1
        end;
      end;
    end;
    
    //-----------------------------------
    
    Var
      BX, BY, NX, NY : integer;
    Procedure IsAxeBroken;
    Begin
      Status('Checking for broken axe')
      GameTab(4)
      Wait(400 + Random (100))
      If (Not(FindDTM(BrokenAxeDTM, BX, BY, MIX1, MIY1, MIX2, MIY2 ))) then
      Begin
        Status('Axe Not Broken')
        Exit;
      end;
      Begin
        If (FindDTM(BrokenAxeDTM, BX, BY, MIX1, MIY1, MIX2, MIY2 )) and
           (Not(FindDTM(RegularAxeDTM, NX, NY, MIX1, MIY1, MIX2, MIY2))) then
        Begin
          Status('Broke an Axe')
          NextPlayer(False)
          end;
       end;
    end;
    
    //-----------------------------------
    
    Function SwitchTrees2 : Boolean;
    Var
      sX, sY, Dist : Integer;
    
    Begin
      ActivateClient;
      MakeCompass('N')
      Begin
        If FindSymbol(sX, sY, 'Dungeon') or
           FindMMColorTol(sX, sY, 5201919, 2) then
        Begin
          Dist := Distance(683, 68, sX, sY)
          If (Distance(648, 84, sX, sY) < 33) then
          Begin
            WriteLn('Distance = ' + IntToStr(Dist) + '.')
            WriteLn('Moving to northern tree.')
            Mouse(645, 57, 3, 3, True)
            FoursFlag;
            Result := True;
            DoneSwitch := True;
          end else
          Begin
            Dist := Distance(653, 116, sX, sY)
            WriteLn('Distance = ' + IntToStr(Dist) + '.')
            WriteLn('Moving to southern tree.')
            Mouse(652, 118, 3, 3, True)
            FoursFlag;
            Result := True;
            DoneSwitch := True;
          end;
        end;
      end;
    end;
    
    //-----------------------------------
    
    Procedure CompleteFix;
    Begin
      FindNormalRandoms;
      Wait(1)
      FindTalk;
      Wait(1)
      If (FindFight) then
      Begin
        SetRun(True)
        SwitchTrees2;
        FTWait(20)
        SwitchTrees;
      end;
      Wait(1)
      EntChecker;
      Wait(1)
      FindHead;
      Wait(1)
      IsAxeBroken;
      Wait(1)
      SwitchTrees;
    end;
    
    //-----------------------------------
    
    Var
      TX, TY : Integer;
      TreeTime, SafeWaiting : LongInt;
    Procedure StartChopping;
    Begin
      ActivateClient;
      MakeCompass('N')
      MarkTime(TreeTime)
      If ( Not (LoggedIn) ) Then
      Begin
        NextPlayer (False)
        Exit;
      end;
      Repeat
      Begin
        IsAxeBroken;
        Status('Looking for Yew')
        If (InvFull) then
        Begin
          Exit;
        end;
        EntChecker;
        ActivateClient;
        MakeCompass('N')
        If (FindObjMultiText(TX, TY, 'Yew', 'Yew', 'Yew', 1990736, 3)) then
        Begin
          Mouse(TX, TY, 1, 1, True)
          Wait( 1400 + Random (200))
          MarkTime(SafeWaiting)
          Repeat
            CompleteFix;
            If InvFull then
            Begin
              Exit;
            end;
            If DoneSwitch then
            Begin
              DoneSwitch := False;
              Break;
            end;
            Wait(10)
            If Not (LoggedIn) then NextPlayer(False);
          Until (TimeFromMark(SafeWaiting) > 25000 + Random(5000))
        end;
      end;
      If Not (LoggedIn) then NextPlayer(False);
     Until (InvFull) or (TimeFromMark(TreeTime)>60000 * (15 + Random(3)))
    end;
    
    //-----------------------------------
    
    Function WalkToEdgeBank : Boolean;
    Var
      gX, gY : Integer;
    
    Begin
      SetRun(False)
      ActivateClient;
      MakeCompass('N')
      If FindSymbol(gX, gY, 'Dungeon') then
      Begin
        Mouse(gX, gY - 3, 0, 0, True)
        GameTab(4)
        FoursFlag;
      end;
      If FindBitMapToleranceIn(DoorBitMap, gX, gY, MMX1, MMY1, MMX2, MMY2, 9) then
      Begin
        Mouse(gX, gY, 3, 3, True)
        FoursFlag;
      end;
      FCheckDoor;
      ActivateClient;
      MakeCompass('N')
      Mouse(625, 21, 5, 0, True)
      Wait(3000+Random(1000))
      FoursFlag;
      If FindDTM(AxeHeadMask, gX, gY, MMX1, MMY1, MMX1, MMY2) then
      Begin
        WriteLn('Found Mask')
        Mouse(gX - 5, gY, 0, 0, True)
        FoursFlag;
      end else
      If FindSymbol(gX, gY, 'Bank') or
      FindMMColorTol(gX, gY, 5492188, 3) then
      Begin
        WriteLn('Found Symbol/Color')
        Mouse(gX, gY + 4, 4, 4, True)
        FoursFlag;
      end else
      If FindSymbol(gX, gY, 'Cook') then
      Begin
        WriteLn('Used Cook Symbol')
        Mouse(gX + 67, gY - 2, 3, 3, True)
        FoursFlag;
      end;
      Result := True;
      WriteLn(' In The Bank ')
    end;
    
    //-----------------------------------
    
    Procedure StoreStuff;
    Begin
      If InventoryCount > 1 then
      Begin
        Repeat
         ClickItemColorTol(65536, 10, False)
         Wait(10)
         ChooseOption(x, y, 'All')
         Wait(1000 + Random(1000))
         If Not(LoggedIn) then NextPlayer(False);
        Until InventoryCount = 0
        Wait(1000 + Random (1000))
        Repeat
         If FindDtm(RegularAxeDTM, X, Y, MSX1, MSY1, MSX2, MSY2) then
         Begin
           Mouse(X, Y, 1, 1, True)
           Wait(1000 + Random(1000))
         end;
         If Not(LoggedIn) then NextPlayer(False);
        Until FindDtm(RegularAxeDTM, X, Y, MIX1, MIY1, MIX2, MIY2)
      end;
    end;
    
    //-----------------------------------
    
    Var
      LX, LY, Fourscape : Integer;
    
    Procedure BankLogs;
    Begin
      Status('Banking Logs')
      LogCount := CountItemDtm(LogDTM)
      Repeat
        If FindDTM(LogDTM, LX, LY, MIX1, MIY1, MIX2, MIY2) then
        Begin
          Mouse(LX, LY, 6, 6, False)
          ChooseOption(x, y, 'All')
          Wait(1000+Random(1000))
        end;
        If Not(LoggedIn) then NextPlayer(False);
      Until (Not(FindDTM(LogDTM, LX, LY, MIX1, MIY1, MIX2, MIY2)))
      Wait(100+Random(100))
      StoreStuff;
      CloseBank;
    end;
    
    //-----------------------------------
    
    Function FGetAxeColor : Boolean;
    Var
      inX, inY : Integer;
    Begin
      GameTab(4)
      If FindDTM(RegularAxeDTM, inX, inY, MIX1, MIY1, MIX2, MIY2) then
      Begin
        Head := GetColor(590, 220);
        Head2 := GetColor(587, 219);
        Head3 := GetColor(588, 218);
        Result := True;
      end else
      GameTab(5)
      If FindDTM(RegularAxeDTM, inX, inY, MIX1, MIY1, MIX2, MIY2) then
      Begin
        Head := GetColor(597, 294);
        Head2 := GetColor(600, 295);
        Head3 := GetColor(599, 298);
        Result := True;
      end;
      WriteLn('Axe head colors: ' + IntToStr(Head) + ' ' + IntToStr(Head2) + ' ' +
      IntToStr(Head3));
    end;
    
    //-----------------------------------
    
    Procedure FoursProgressReport;
    Begin
      TotalLogs := TotalLogs + LogCount;
      WriteLn('[===================================================]')
      WriteLn('[=====================PROGRESS======================]')
      WriteLn('[===================================================]')
      WriteLn('  Script time  : ' + TimeRunning)
      WriteLn('  Loads Banked : ' + IntToStr(Loads))
      WriteLn('  Logs Chopped : ' + IntToStr(TotalLogs))
      WriteLn('  Ents         : ' + IntToStr(EntsAvoided))
      WriteLn('[===================================================]')
      WriteLn('[=====================PROGRESS======================]')
      WriteLn('[===================================================]')
    end;
    
    
    //-----------------------------------
    
    
    begin
      ActivateClient;
      SetupSrl;
      Wait(3000)
      NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
      DeclarePlayers;
      LoadDTMs;
      ClearDebug;
      If Not (LoggedIn) then
      Begin
        LogInPlayer;
      end;
      Repeat
        Loads := 0;
        Repeat
          SetScreenName(Players[CurrentPlayer].Nick)
          FGetAxeColor;
          ActivateClient;
          Wait(1)
          ActivateClient;
          MakeCompass('E')
          PerfectNorth;
          FWalkToYew;
          SwitchTrees;
          StartChopping;
          WalkToEdgeBank;
          Repeat
            FOpenEdgeBank;
            Wait(1000+Random(1000))
          Until BankScreen;
          Wait(1000+Random(1000))
          BankLogs;
          Loads := Loads + 1;
          FoursProgressReport;
          If Not (LoggedIn) then Nextplayer(False);
        Until Loads >= LoadsWanted;
        LogOut;
        NextPlayer(True)
      Until False;
    end.
    ___________________________________________________________

    Dunno where i got it...
     
  7. Unread #4 - Jun 10, 2007 at 10:02 AM
  8. Town
    Joined:
    Jan 21, 2007
    Posts:
    3,776
    Referrals:
    3
    Sythe Gold:
    5

    Town Grand Master
    Scar Programmers

    Duplicate identifier???

    Code:
    {          _____________                    ____________
              [_____________EDGEVILLE YEW BANKER____________]
              [1. Have RS on Very Bright Setting.           ]
              [2. Start at Yew Trees, or in Edgeville Bank. ]
              [3. Set Nickname correctly, it helps alot.    ]
              [Info : The more loads you do before switcing ]
              [       players, the more likely you are to   ]
              [       get a random SRL can not solve.       ]
              [Extra : Declare Players, lines 30 +.         ]
               _____________                    ____________
              [_____________EDGEVILLE YEW BANKER____________]
    
    
    }
    { Example of a nickname... if your name is Fruit Cak3, put a nickname like...
      1. rui
      2. ak3
      3. uit       //DON'T use a capital letter.
    }
    
    PrOgRaM FourscapesEdgeYewCutter;
    {.include SRL/SRL.scar}
    {.include SRL\SRL\Skill\Woodcutting.SCAR}
    {.include SRL/SRL/Extended/xBank.scar}
    
    
    Const
      MyFlag = True; //käytetäänkö minun lippua
      LoadsWanted = 2; //kuinka monta kertaa hakkaamaan puita
    
    //-----------------------------------
    
    Procedure DeclarePlayers;
    begin
      Status('Loading Players')
    
      HowManyPlayers  := 1;
      NumberOfPlayers( HowManyPlayers );
      CurrentPlayer := 0;
    
         Players[0].Name      := 'Runescape Username';
         Players[0].Pass      := 'Runescape Password';
         Players[0].Nick      := 'Player Nickname'; // 2-4 kirjainta ukon nimestä
         Players[0].Active    := True;
         Players[0].Loc       := 'Bank';
    
    end;
    
    //-----------------------------------
    
    Var
      LogDTM, BrokenAxeDTM, Loads, DoorBitmap, AxeHandleDTM, RegularAxeDTM, AxeHeadMask : Integer;
      DoneSwitch : Boolean;
      LogCount, TotalLogs : Integer;
    
    //-----------------------------------
    
    Procedure LoadDTMs;
    
    begin
    Status('Loading DTM''s')
    
    LogDTM := DTMFromString('78DA632C666260E0646440067921460CFF813' +
           '448F43F103066314179C880118904D2354035FF19F0AB2905AA11' +
           '22604E23500D0F0135C94035DCF8D50000507909F5');
    
    BrokenAxeDTM := DTMFromString('78DA633CCAC4C090C1C8800C9A127919FE036' +
           '990E87F2060BC0C54938CAA06220B2381F445A09A04026A8E01D5' +
           'C41050B31FA8A698809AB384CD0100CBBD0D20');
    
    AxeHandleDTM := DTMFromString('78DA637CCFC4C0E0C6C8800CCA227819FE036' +
           '990E87F2060FC06546389AA06220B2381F473A09A00026ADE00D5' +
           'F81350F316A8C685809A97403541F8D50000D0090D3C');
    
    RegularAxeDTM := DTMFromString('78DA637461626060676440060DF1BC0CFF813' +
           '448F43F10300601D5FC6740038C482490F604AAF94D408D13500D' +
           '2B237E35F640358204D4F813618E1F50CD1F02EE0906AA61C26F0' +
           'E0099720B7E');
    
    AxeHeadMask := DTMFromString('78DA63EC656260F06040011DD5D50C5C409A1' +
           '188FF0301E3044C3579C929703520C0380353CD97375F2072503E' +
           '00CB9B0C31');
    
    DoorBitMap := BitmapFromString(1, 3, '6A5A26F000006A5A26');
    end;
    
    //-----------------------------------
    
    
    Function FoursFlag : Boolean;
    Var
      I : Integer;
      SFF : LongInt;
    Begin
      If (MyFlag) then
      Begin
        GameTab(4)
        MarkTime(SFF)
        Repeat
          If (FlagPresent) then
          Begin
            For I:= 1 to 3 do
            Begin
              Case I of
                1: MMouse(0 + Random(300), 0 + Random(300), 0 + Random(300), 0 + Random(300));
                2: FindNormalRandoms;
                3: FindTalk;
              end;
            end;
          end;
          Wait(600 + Random(400))
          If Not(LoggedIn) then NextPlayer(False);
        Until (Not(FlagPresent)) or (TimeFromMark(SFF)>10000)
      end else
      Begin
        Flag;
      end;
      Result := True;
      Wait(500 + Random(400))
    end;
    
    //-----------------------------------
    
    Function FOpenEdgeBank : Boolean;
    Var
      bbX, bbY, bbTries : Integer;
    Begin
     bbTries := 0
     ActivateClient;
     MakeCompass('N')
     ActivateClient;
     HighestAngle;
     If FindDTM(AxeHeadMask, bbX, bbY, MMX1, MMY1, MMX2, MMY2) then
     Begin
       Mouse(bbX, bbY + 7, 0, 0, True)
       FoursFlag;
     end;
     Repeat
      If FindObjMultiText(bbX, bbY, 'ank b', 'booth', 'Bank booth', 607324, 3) then
      Begin
        Mouse(bbX, bbY, 0, 0, False)
        Wait(100)
        ChooseOption(x, y, 'uick')
        Result := True;
        FoursFlag;
        Wait(5000+Random(1000))
      end else
      Begin
        bbTries := bbTries + 1
        WriteLn('Bank not found, tried ' + IntToStr(bbTries) + ' time[s]')
      end;
      If Not(LoggedIn) then NextPlayer(False);
     Until (Result) or (bbTries > 7)
     If (bbTries > 7) then
     Begin
       WriteLn('Took too many tries to find the bank.')
       Players[CurrentPlayer].Loc := 'Lost';
       LogOut;
       NextPlayer(False);
       Exit;
     end;
     Result := True;
     Wait(1000 + Random(1000))
    end;
    
    //-----------------------------------
    
    Function FCheckDoor : Boolean;
    Var
      dX, dY, m : Integer;
    Begin
      ActivateClient;
      MakeCompass('N')
      HighestAngle;
      m := 0;
      Repeat
        If FindObjMultiText(dX, dY, 'oor', 'Door', 'Doo', 2574956, 4) or
           FindObjMultiText(dX, dY, 'oor', 'Door', 'Doo', 2767952, 4) then
        Begin
          MMouse(dX, dY, 0, 0)
          Wait(100)
          If IsUpText('pen') then
          Begin
            Mouse(dX, dY, 0, 0, True)
            Result := True
            WriteLn('Opened door')
            FoursFlag;
          end else
          Begin
            Result := True;
            WriteLn('Door was open')
          end;
          m := m + 1
        end;
        If Not(LoggedIn) then NextPlayer(False);
      Until (Result) or (m > 4)
      If (m > 4) then
      Begin
        WriteLn('Couldn''t find the door')
        WriteLn('Going to try to enter room')
      end;
    end;
    
    //-----------------------------------
    
    Function FWalkToYew : Boolean;
    Var
      wX, wY : Integer;
    Begin
      ActivateClient;
      MakeCompass('N')
      If FindSymbol(wX, wY, 'Dungeon') then
      Begin
        Mouse(wX, wY - 3, 0, 0, True)
        SetRun(True)
        GameTab(4)
        FoursFlag;
        If FindBitMapToleranceIn(DoorBitMap, wX, wY, MMX1, MMY1, MMX2, MMY2, 9) then
        Begin
          Mouse(wX, wY, 3, 3, True)
          FoursFlag;
        end;
        FCheckDoor;
        If FindSymbol(wX, wY, 'Tree') then
        Begin
          If Distance(wX, wY, 648, 83) > 41 then
          Begin
            Mouse(wX + 7, wY + 6, 0, 0, True)
            FoursFlag;
          end else
          Begin
            Mouse(wX + 7, wY - 7, 0, 0, True)
            FoursFlag;
          end;
        end;
        Result := True;
      end else
      Begin
        Mouse(652, 150, 0, 0, True)
        SetRun(True)
        GameTab(4)
        FoursFlag;
        If FindSymbol(wX, wY, 'Dungeon') then
        Begin
          Mouse(wX, wY - 10, 0, 0, True)
          FoursFlag;
        end;
        FCheckDoor;
        If FindSymbol(wX, wY, 'Tree') then
        Begin
          Mouse(wX + 3, wY + 6, 0, 0, True)
          FoursFlag;
        end;
        Result := True;
      end;
    end;
    
    //-----------------------------------
    
    Function SwitchTrees : Boolean;
    Var
      tX, tY, sX, sY, Dist : Integer;
    
    Begin
      ActivateClient;
      MakeCompass('N')
      If Not FindObj(tX, tY, 'Yew', 1990736, 2) then
      Begin
        If FindSymbol(sX, sY, 'Dungeon') or
           FindMMColorTol(sX, sY, 5201919, 2) then
        Begin
          Dist := Distance(683, 68, sX, sY)
          If (Distance(648, 84, sX, sY) < 33) then
          Begin
            WriteLn('Distance = ' + IntToStr(Dist) + '.')
            WriteLn('Moving to northern tree.')
            Mouse(645, 57, 3, 3, True)
            FoursFlag;
            Result := True;
            DoneSwitch := True;
          end else
          Begin
            Dist := Distance(653, 116, sX, sY)
            WriteLn('Distance = ' + IntToStr(Dist) + '.')
            WriteLn('Moving to southern tree.')
            Mouse(652, 118, 3, 3, True)
            FoursFlag;
            Result := True;
            DoneSwitch := True;
          end;
        end;
      end;
    end;
    
    //-----------------------------------
    
    Var
      EX, EY : integer;
      FX, FY : integer;
      SafeEntWait : LongInt;
    Procedure EntChecker;
    Begin
      Status('Checking For Ent')
      If (FindObjMultiText(EX, EY, 'Yew', 'Yew', 'Yew', 1990736, 2)) then
      Begin
        MMouse(EX, EY, 0, 0)
        If FindColorTolerance( FX, FY, 55769, 85, 15, 115, 15, 20) then
        Begin
          Status('Ent Found');
          MouseFindFlag(645, 83, 2, 2);
          MarkTime(SafeEntWait)
          Repeat
            FTWait(5)
            FindNormalRandoms;
          If Not(LoggedIn) then NextPlayer(False);
          Until TimeFromMark(SafeEntWait) > 29000 + Random(10000)
          EntsAvoided := EntsAvoided + 1
        end;
      end;
    end;
    
    //-----------------------------------
    
    Var
      BX, BY, NX, NY : integer;
    Procedure IsAxeBroken;
    Begin
      Status('Checking for broken axe')
      GameTab(4)
      Wait(400 + Random (100))
      If (Not(FindDTM(BrokenAxeDTM, BX, BY, MIX1, MIY1, MIX2, MIY2 ))) then
      Begin
        Status('Axe Not Broken')
        Exit;
      end;
      Begin
        If (FindDTM(BrokenAxeDTM, BX, BY, MIX1, MIY1, MIX2, MIY2 )) and
           (Not(FindDTM(RegularAxeDTM, NX, NY, MIX1, MIY1, MIX2, MIY2))) then
        Begin
          Status('Broke an Axe')
          NextPlayer(False)
          end;
       end;
    end;
    
    //-----------------------------------
    
    Function SwitchTrees2 : Boolean;
    Var
      sX, sY, Dist : Integer;
    
    Begin
      ActivateClient;
      MakeCompass('N')
      Begin
        If FindSymbol(sX, sY, 'Dungeon') or
           FindMMColorTol(sX, sY, 5201919, 2) then
        Begin
          Dist := Distance(683, 68, sX, sY)
          If (Distance(648, 84, sX, sY) < 33) then
          Begin
            WriteLn('Distance = ' + IntToStr(Dist) + '.')
            WriteLn('Moving to northern tree.')
            Mouse(645, 57, 3, 3, True)
            FoursFlag;
            Result := True;
            DoneSwitch := True;
          end else
          Begin
            Dist := Distance(653, 116, sX, sY)
            WriteLn('Distance = ' + IntToStr(Dist) + '.')
            WriteLn('Moving to southern tree.')
            Mouse(652, 118, 3, 3, True)
            FoursFlag;
            Result := True;
            DoneSwitch := True;
          end;
        end;
      end;
    end;
    
    //-----------------------------------
    
    Procedure CompleteFix;
    Begin
      FindNormalRandoms;
      Wait(1)
      FindTalk;
      Wait(1)
      If (FindFight) then
      Begin
        SetRun(True)
        SwitchTrees2;
        FTWait(20)
        SwitchTrees;
      end;
      Wait(1)
      EntChecker;
      Wait(1)
      FindHead;
      Wait(1)
      IsAxeBroken;
      Wait(1)
      SwitchTrees;
    end;
    
    //-----------------------------------
    
    Var
      TX, TY : Integer;
      TreeTime, SafeWaiting : LongInt;
    Procedure StartChopping;
    Begin
      ActivateClient;
      MakeCompass('N')
      MarkTime(TreeTime)
      If ( Not (LoggedIn) ) Then
      Begin
        NextPlayer (False)
        Exit;
      end;
      Repeat
      Begin
        IsAxeBroken;
        Status('Looking for Yew')
        If (InvFull) then
        Begin
          Exit;
        end;
        EntChecker;
        ActivateClient;
        MakeCompass('N')
        If (FindObjMultiText(TX, TY, 'Yew', 'Yew', 'Yew', 1990736, 3)) then
        Begin
          Mouse(TX, TY, 1, 1, True)
          Wait( 1400 + Random (200))
          MarkTime(SafeWaiting)
          Repeat
            CompleteFix;
            If InvFull then
            Begin
              Exit;
            end;
            If DoneSwitch then
            Begin
              DoneSwitch := False;
              Break;
            end;
            Wait(10)
            If Not (LoggedIn) then NextPlayer(False);
          Until (TimeFromMark(SafeWaiting) > 25000 + Random(5000))
        end;
      end;
      If Not (LoggedIn) then NextPlayer(False);
     Until (InvFull) or (TimeFromMark(TreeTime)>60000 * (15 + Random(3)))
    end;
    
    //-----------------------------------
    
    Function WalkToEdgeBank : Boolean;
    Var
      gX, gY : Integer;
    
    Begin
      SetRun(False)
      ActivateClient;
      MakeCompass('N')
      If FindSymbol(gX, gY, 'Dungeon') then
      Begin
        Mouse(gX, gY - 3, 0, 0, True)
        GameTab(4)
        FoursFlag;
      end;
      If FindBitMapToleranceIn(DoorBitMap, gX, gY, MMX1, MMY1, MMX2, MMY2, 9) then
      Begin
        Mouse(gX, gY, 3, 3, True)
        FoursFlag;
      end;
      FCheckDoor;
      ActivateClient;
      MakeCompass('N')
      Mouse(625, 21, 5, 0, True)
      Wait(3000+Random(1000))
      FoursFlag;
      If FindDTM(AxeHeadMask, gX, gY, MMX1, MMY1, MMX1, MMY2) then
      Begin
        WriteLn('Found Mask')
        Mouse(gX - 5, gY, 0, 0, True)
        FoursFlag;
      end else
      If FindSymbol(gX, gY, 'Bank') or
      FindMMColorTol(gX, gY, 5492188, 3) then
      Begin
        WriteLn('Found Symbol/Color')
        Mouse(gX, gY + 4, 4, 4, True)
        FoursFlag;
      end else
      If FindSymbol(gX, gY, 'Cook') then
      Begin
        WriteLn('Used Cook Symbol')
        Mouse(gX + 67, gY - 2, 3, 3, True)
        FoursFlag;
      end;
      Result := True;
      WriteLn(' In The Bank ')
    end;
    
    //-----------------------------------
    
    Procedure StoreStuff;
    Begin
      If InventoryCount > 1 then
      Begin
        Repeat
         ClickItemColorTol(65536, 10, False)
         Wait(10)
         ChooseOption(x, y, 'All')
         Wait(1000 + Random(1000))
         If Not(LoggedIn) then NextPlayer(False);
        Until InventoryCount = 0
        Wait(1000 + Random (1000))
        Repeat
         If FindDtm(RegularAxeDTM, X, Y, MSX1, MSY1, MSX2, MSY2) then
         Begin
           Mouse(X, Y, 1, 1, True)
           Wait(1000 + Random(1000))
         end;
         If Not(LoggedIn) then NextPlayer(False);
        Until FindDtm(RegularAxeDTM, X, Y, MIX1, MIY1, MIX2, MIY2)
      end;
    end;
    
    //-----------------------------------
    
    Var
      LX, LY, Fourscape : Integer;
    
    Procedure BankLogs;
    Begin
      Status('Banking Logs')
      LogCount := CountItemDtm(LogDTM)
      Repeat
        If FindDTM(LogDTM, LX, LY, MIX1, MIY1, MIX2, MIY2) then
        Begin
          Mouse(LX, LY, 6, 6, False)
          ChooseOption(x, y, 'All')
          Wait(1000+Random(1000))
        end;
        If Not(LoggedIn) then NextPlayer(False);
      Until (Not(FindDTM(LogDTM, LX, LY, MIX1, MIY1, MIX2, MIY2)))
      Wait(100+Random(100))
      StoreStuff;
      CloseBank;
    end;
    
    //-----------------------------------
    
    Function FGetAxeColor : Boolean;
    Var
      inX, inY : Integer;
    Begin
      GameTab(4)
      If FindDTM(RegularAxeDTM, inX, inY, MIX1, MIY1, MIX2, MIY2) then
      Begin
        Head := GetColor(590, 220);
        Head2 := GetColor(587, 219);
        Head3 := GetColor(588, 218);
        Result := True;
      end else
      GameTab(5)
      If FindDTM(RegularAxeDTM, inX, inY, MIX1, MIY1, MIX2, MIY2) then
      Begin
        Head := GetColor(597, 294);
        Head2 := GetColor(600, 295);
        Head3 := GetColor(599, 298);
        Result := True;
      end;
      WriteLn('Axe head colors: ' + IntToStr(Head) + ' ' + IntToStr(Head2) + ' ' +
      IntToStr(Head3));
    end;
    
    //-----------------------------------
    
    Procedure FoursProgressReport;
    Begin
      TotalLogs := TotalLogs + LogCount;
      WriteLn('[===================================================]')
      WriteLn('[=====================PROGRESS======================]')
      WriteLn('[===================================================]')
      WriteLn('  Script time  : ' + TimeRunning)
      WriteLn('  Loads Banked : ' + IntToStr(Loads))
      WriteLn('  Logs Chopped : ' + IntToStr(TotalLogs))
      WriteLn('  Ents         : ' + IntToStr(EntsAvoided))
      WriteLn('[===================================================]')
      WriteLn('[=====================PROGRESS======================]')
      WriteLn('[===================================================]')
    end;
    
    
    //-----------------------------------
    
    
    begin
      ActivateClient;
      SetupSrl;
      Wait(3000)
      NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
      DeclarePlayers;
      LoadDTMs;
      ClearDebug;
      If Not (LoggedIn) then
      Begin
        LogInPlayer;
      end;
      Repeat
        Loads := 0;
        Repeat
          SetScreenName(Players[CurrentPlayer].Nick)
          FGetAxeColor;
          ActivateClient;
          Wait(1)
          ActivateClient;
          MakeCompass('E')
          PerfectNorth;
          FWalkToYew;
          SwitchTrees;
          StartChopping;
          WalkToEdgeBank;
          Repeat
            FOpenEdgeBank;
            Wait(1000+Random(1000))
          Until BankScreen;
          Wait(1000+Random(1000))
          BankLogs;
          Loads := Loads + 1;
          FoursProgressReport;
          If Not (LoggedIn) then Nextplayer(False);
        Until Loads >= LoadsWanted;
        LogOut;
        NextPlayer(True)
      Until False;
    end.
    Use Scar 2.03 from www.freddy1990.com and SRL 3.6b from version 1.0 of PowerSkills with this script too.
     
  9. Unread #5 - Jun 10, 2007 at 10:17 AM
  10. Alligaattor
    Joined:
    Mar 22, 2007
    Posts:
    30
    Referrals:
    0
    Sythe Gold:
    0

    Alligaattor Member

    Duplicate identifier???

    I have Scar 2.03, but why it haves to be it???
    SRL 3.6b is there 3.6a too??? confused!!!
    Could you explain more,please.
     
  11. Unread #6 - Jun 10, 2007 at 12:06 PM
  12. Town
    Joined:
    Jan 21, 2007
    Posts:
    3,776
    Referrals:
    3
    Sythe Gold:
    5

    Town Grand Master
    Scar Programmers

    Duplicate identifier???

    There are different procedures in each one. Have a Scar 2.03 with SRL 3.6b installed and Scar 3.06 with SRL 3.7 installed and all of your scripts should comiple on one of them. There was an SRL 3.6 and then SRL 3.6b was made shortly after with a few fixes, but you can get SRL 3.6b in the download I gave you.
     
  13. Unread #7 - Jun 10, 2007 at 2:24 PM
  14. Alligaattor
    Joined:
    Mar 22, 2007
    Posts:
    30
    Referrals:
    0
    Sythe Gold:
    0

    Alligaattor Member

    Duplicate identifier???

    Thanks mate!
    Working!!!
     
< Selling Levle 82 Main Rsc. | buy pbp 900k !!!ASAP!!! >

Users viewing this thread
1 guest


 
 
Adblock breaks this site