Results 1 to 3 of 3

Thread: Anti Randoms.. And stuff.

  1. #1
    Join Date
    May 2007
    Location
    Ohio
    Posts
    2,296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Anti Randoms.. And stuff.

    Added Book of Knowledge.. I know this will probably be denied.. But enjoy for who ever wanted it..

    Globals.scar:
    SCAR Code:
    Index: C:/Program Files (x86)/SCAR 3.22/Includes/SRL/SRL/core/Globals.scar
    ===================================================================
    --- C:/Program Files (x86)/SCAR 3.22/Includes/SRL/SRL/core/Globals.scar (revision 360)
    +++ C:/Program Files (x86)/SCAR 3.22/Includes/SRL/SRL/core/Globals.scar (working copy)
    @@ -25,10 +25,10 @@
       FriendChars, LoginChars: Integer;
     {$ENDIF}
       
    -{ var bmpAdmin, bmpMod, Lamp, BoxMask: Integer;
    -  Description: Global Bitmaps. Need to be Global because of SCAR Memory leaks. }

    +{ var bmpAdmin, bmpMod, Lamp, Book of Knowlage: Integer;
    +  Description: Global Bitmaps/DTMS. Need to be Global because of SCAR Memory leaks. }

     var
    -  bmpAdmin, bmpMod, Lamp: Integer;
    +  bmpAdmin, bmpMod, Lamp, BookoKnowledge: Integer;
     
     { var RoadColor, WaterColor, BankColor: Integer;
       Description: Three variables you will almost always use. :) }

    @@ -172,7 +172,7 @@
     {*******************************************************************************
     procedure LoadSRLBitMaps;
     By: SRL Dev Team
    -Description: Loads SRL Bitmaps into memory.
    +Description: Loads SRL Bitmaps/DTMs into memory.
     *******************************************************************************}

     
     procedure LoadSRLBitMaps;
    @@ -181,23 +181,28 @@
            'p0+HS6GR+KVwAgAGXFQr');
       bmpAdmin := BitmapFromString(9, 6, 'beNqbp/j9PwcZ6P//FiDJAA' +
            'bIjGvzFOFSaCR+KZwIALniVEk=');
    -    Lamp := DTMFromString('78DA639CC6C4C050C2C8800C664E1765F80FA' +
    -        '441A2FF8180B103A8A608550D030313988489322E01F24B09A899' +
    -        '0FE4971150331DC8AF24424D2E01355380FC7C026A6611A166129' +
    -        '05F4140CD1C22DCDC4BD82E00BB8011F9');
    +  Lamp := DTMFromString('78DA639CC6C4C050C2C8800C664E1765F80FA' +
    +       '441A2FF8180B103A8A608550D030313988489322E01F24B09A899' +
    +       '0FE4971150331DC8AF24424D2E01355380FC7C026A6611A166129' +
    +       '05F4140CD1C22DCDC4BD82E00BB8011F9');
    +  BookoKnowledge := DTMFromString('78DA637466626078C080028AF3F2189881342' +
    +       '310FF0702465BA09AAB0C6880094C3242798C6E40FE27026A8C81' +
    +       'FCD704D40400F93709A8F101F29F13506301E4DFC3AF060008B60' +
    +       'D74');
     end;
     
     {*******************************************************************************
     procedure FreeSRLBitMaps;
     By: Ron
    -Description: Frees SRL Bitmaps from memory.
    +Description: Frees SRL Bitmaps/DTMs from memory.
     *******************************************************************************}

     
     procedure FreeSRLBitmaps;
     begin
       FreeBitmap(bmpMod);
       FreeBitmap(bmpAdmin);
    -  FreeBitmap(Lamp);
    +  FreeDTM(Lamp);
    +  FreeDTM(BookoKnowledge);
     end;
     
     {*******************************************************************************

    GlobalStats.scar:
    SCAR Code:
    Index: C:/Program Files (x86)/SCAR 3.22/Includes/SRL/SRL/core/GlobalStats.scar
    ===================================================================
    --- C:/Program Files (x86)/SCAR 3.22/Includes/SRL/SRL/core/GlobalStats.scar (revision 360)
    +++ C:/Program Files (x86)/SCAR 3.22/Includes/SRL/SRL/core/GlobalStats.scar (working copy)
    @@ -45,6 +45,7 @@
         SGuard: Integer;
         Leos: Integer;
         Mollys: Integer;
    +    Knowledge: Integer;
       end;
     
     {var LastMins2: Integer;
    @@ -123,11 +124,12 @@
       rand_Mod = 19;
       rand_Fight = 20;
       rand_Lamp = 21;
    -  rand_BirdNest = 22;
    -  rand_Death = 23;
    +  rand_Knowledge = 22;
    +  rand_BirdNest = 23;
    +  rand_Death = 24;
     
     var
    -  RandSolved, RandFailed: array [0..23] of Integer;
    +  RandSolved, RandFailed: array [0..24] of Integer;
     
     {*******************************************************************************
     procedure SetLastCommitVars;
    @@ -142,7 +144,8 @@
       LastScriptReport.Boxes      := 0;//NewBoxes;
       LastScriptReport.Frogs      := RandSolved[rand_Frog];
       LastScriptReport.Plants     := 0;
    -  LastScriptReport.Lamps      := 0;
    +  LastScriptReport.Lamps      := RandSolved[rand_Lamp];//Lamps still exist...?
    +  LastScriptReport.Knowledge  := RandSolved[rand_Knowledge];
       LastScriptReport.Fights     := RandSolved[rand_Fight];
       LastScriptReport.Talks      := 0;
       LastScriptReport.Deaths     := RandSolved[rand_Death];
    @@ -243,6 +246,8 @@
            AddPostVariable ( SRLClient, 'Plants', IntToStr ( 0 - LastScriptReport.Plants ));
          if (RandSolved[rand_Lamp] - LastScriptReport.Lamps > 0 ) then
            AddPostVariable ( SRLClient, 'Lamps', IntToStr ( RandSolved[rand_Lamp] - LastScriptReport.Lamps ));
    +     if (RandSolved[rand_Knowledge] - LastScriptReport.Knowledge > 0 ) then
    +       AddPostVariable ( SRLClient, 'Books of Knowledge', IntToStr ( RandSolved[rand_Knowledge] - LastScriptReport.Knowledge ));
          if ( RandSolved[rand_Fight] - LastScriptReport.Fights > 0 ) then
            AddPostVariable ( SRLClient, 'Fights', IntToStr ( RandSolved[rand_Fight] - LastScriptReport.Fights ));
          if ( 0 - LastScriptReport.Talks > 0 ) then

    AntiRandoms.scar:
    SCAR Code:
    Index: C:/Program Files (x86)/SCAR 3.22/Includes/SRL/SRL/core/AntiRandoms/AntiRandoms.scar
    ===================================================================
    --- C:/Program Files (x86)/SCAR 3.22/Includes/SRL/SRL/core/AntiRandoms/AntiRandoms.scar (revision 360)
    +++ C:/Program Files (x86)/SCAR 3.22/Includes/SRL/SRL/core/AntiRandoms/AntiRandoms.scar (working copy)
    @@ -7,7 +7,8 @@
     // * function UseRewardBox: Boolean;                  // * by Nava2
     // * function FindMod: Boolean;                       // * by Stupid3ooo
     // * function FindFight: Boolean;                     // * by Stupid3ooo
    -// * function FindLamp(skill: String): Boolean;       // * by pups, Starblaster100 and PriSoner fixed by Lee Lok Hin
    +// * function FindLamp(skill: String): Boolean;       // * by: Pups, Starblaster100, PriSoner, Lee Lok Hin & Timer
    +// * function FindKnowledge(skill: String): Boolean;  // * by Timer and creators of FindLamp
     // * function FindDead : boolean;                     // * by Stupid3ooo and Cazax
     // * function Rand_GetRandomType: Integer;            // * by ZephyrsFury
     // * procedure LoadTeleRandoms;                       // * by ZephyrsFury
    @@ -51,7 +52,7 @@
       AddToReport('|     SRL ' + IntToStr(SRLVersionNumber) + ' Randoms Report    |');
       AddToReport('|       [url]www.villavu.com[/url]        |');
       AddToReport('|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|');
    -  For i := 0 to 44 do
    +  For i := 0 to 46 do
       Begin
         Case i of
           0: begin CurrentInt := SRL_Logs;                     Name := '| SRL Logs          :'; end;
    @@ -62,43 +63,45 @@
           5: begin CurrentInt := RandFailed[rand_Sandwich];    Name := '| Sandwiches Missed :'; end;
           6: begin CurrentInt := RandSolved[rand_Lamp];        Name := '| Lamps Solved      :'; end;
           7: begin CurrentInt := RandFailed[rand_Lamp];        Name := '| Lamps Missed      :'; end;
    -      8: begin CurrentInt := RandSolved[rand_Frog];        Name := '| Frog Solved       :'; end;
    -      9: begin CurrentInt := RandFailed[rand_Frog];        Name := '| Frog Missed       :'; end;
    -      10: begin CurrentInt := RandSolved[rand_Certer];     Name := '| Certers Solved    :'; end;
    -      11: begin CurrentInt := RandFailed[rand_Certer];     Name := '| Certers Missed    :'; end;
    -      12: begin CurrentInt := RandSolved[rand_Demon];      Name := '| Demons Solved     :'; end;
    -      13: begin CurrentInt := RandFailed[rand_Demon];      Name := '| Demons Missed     :'; end;
    -      14: begin CurrentInt := RandSolved[rand_Mod];        Name := '| Mods Found        :'; end;
    -      15: begin CurrentInt := RandSolved[rand_Maze];       Name := '| Mazes Solved      :'; end;
    -      16: begin CurrentInt := RandFailed[rand_Maze];       Name := '| Mazes Missed      :'; end;
    -      17: begin CurrentInt := RandSolved[rand_Mime];       Name := '| Mimes Solved      :'; end;
    -      18: begin CurrentInt := RandFailed[rand_Mime];       Name := '| Mimes Missed      :'; end;
    -      19: begin CurrentInt := RandSolved[rand_Death];      Name := '| Deaths            :'; end;
    -      20: begin CurrentInt := RandSolved[rand_Quiz];       Name := '| Quizes Solved     :'; end;
    -      21: begin CurrentInt := RandFailed[rand_Quiz];       Name := '| Quizes Missed     :'; end;
    -      22: begin CurrentInt := RandSolved[rand_ScapeRune];  Name := '| ScapeRunes Solved :'; end;
    -      23: begin CurrentInt := RandFailed[rand_ScapeRune];  Name := '| ScapeRunes Missed :'; end;
    -      24: begin CurrentInt := RandSolved[rand_BirdNest];   Name := '| Birds Nests       :'; end;
    -      25: begin CurrentInt := RandSolved[rand_Pinball];    Name := '| Pinballs Solved   :'; end;
    -      26: begin CurrentInt := RandFailed[rand_Pinball];    Name := '| Pinballs Missed   :'; end;
    -      27: begin CurrentInt := RandSolved[rand_PrisonPete]; Name := '| Petes Solved      :'; end;
    -      28: begin CurrentInt := RandFailed[rand_PrisonPete]; Name := '| Petes Missed      :'; end;
    -      29: begin CurrentInt := RandSolved[rand_Forester];   Name := '| Foresters Solved  :'; end;
    -      30: begin CurrentInt := RandFailed[rand_Forester];   Name := '| Foresters Missed  :'; end;
    -      31: begin CurrentInt := RandSolved[rand_Leo];        Name := '| Leo''s Solved      :'; end; //Another space due to the ''
    -      32: begin CurrentInt := RandFailed[rand_Leo];        Name := '| Leo''s Missed      :'; end;
    -      33: begin CurrentInt := RandSolved[rand_Molly];      Name := '| Molly''s Solved    :'; end;
    -      34: begin CurrentInt := RandFailed[rand_Molly];      Name := '| Molly''s Missed    :'; end;
    -      35: begin CurrentInt := RandSolved[rand_Pillory];    Name := '| Pillory''s Solved  :'; end;
    -      36: begin CurrentInt := RandFailed[rand_Pillory];    Name := '| Pillory''s Missed  :'; end;
    -      37: begin CurrentInt := RandSolved[rand_CapnArnav];  Name := '| Capn Arnav Solved :'; end;
    -      38: begin CurrentInt := RandFailed[rand_CapnArnav];  Name := '| Capn Arnav Missed :'; end;
    -      39: begin CurrentInt := RandSolved[rand_Beekeeper];  Name := '| Beekeepers Solved :'; end;
    -      40: begin CurrentInt := RandFailed[rand_Beekeeper];  Name := '| Beekeepers Missed :'; end;
    -      41: begin CurrentInt := RandSolved[rand_Abyss];      Name := '| Abysses Solved    :'; end;
    -      42: begin CurrentInt := RandFailed[rand_Abyss];      Name := '| Abysses Missed    :'; end;
    -      43: begin CurrentInt := RandSolved[rand_Mordaut];    Name := '| Mordauts Solved   :'; end;
    -      44: begin CurrentInt := RandFailed[rand_Mordaut];    Name := '| Mordauts Missed   :'; end;
    +      8: begin CurrentInt := RandSolved[rand_Lamp];        Name := '| Knowledge Solved  :'; end;
    +      9: begin CurrentInt := RandFailed[rand_Lamp];        Name := '| Knowledge Missed  :'; end;
    +      10: begin CurrentInt := RandSolved[rand_Frog];       Name := '| Frog Solved       :'; end;
    +      11: begin CurrentInt := RandFailed[rand_Frog];       Name := '| Frog Missed       :'; end;
    +      12: begin CurrentInt := RandSolved[rand_Certer];     Name := '| Certers Solved    :'; end;
    +      13: begin CurrentInt := RandFailed[rand_Certer];     Name := '| Certers Missed    :'; end;
    +      14: begin CurrentInt := RandSolved[rand_Demon];      Name := '| Demons Solved     :'; end;
    +      15: begin CurrentInt := RandFailed[rand_Demon];      Name := '| Demons Missed     :'; end;
    +      16: begin CurrentInt := RandSolved[rand_Mod];        Name := '| Mods Found        :'; end;
    +      17: begin CurrentInt := RandSolved[rand_Maze];       Name := '| Mazes Solved      :'; end;
    +      18: begin CurrentInt := RandFailed[rand_Maze];       Name := '| Mazes Missed      :'; end;
    +      19: begin CurrentInt := RandSolved[rand_Mime];       Name := '| Mimes Solved      :'; end;
    +      20: begin CurrentInt := RandFailed[rand_Mime];       Name := '| Mimes Missed      :'; end;
    +      21: begin CurrentInt := RandSolved[rand_Death];      Name := '| Deaths            :'; end;
    +      22: begin CurrentInt := RandSolved[rand_Quiz];       Name := '| Quizes Solved     :'; end;
    +      23: begin CurrentInt := RandFailed[rand_Quiz];       Name := '| Quizes Missed     :'; end;
    +      24: begin CurrentInt := RandSolved[rand_ScapeRune];  Name := '| ScapeRunes Solved :'; end;
    +      25: begin CurrentInt := RandFailed[rand_ScapeRune];  Name := '| ScapeRunes Missed :'; end;
    +      26: begin CurrentInt := RandSolved[rand_BirdNest];   Name := '| Birds Nests       :'; end;
    +      27: begin CurrentInt := RandSolved[rand_Pinball];    Name := '| Pinballs Solved   :'; end;
    +      28: begin CurrentInt := RandFailed[rand_Pinball];    Name := '| Pinballs Missed   :'; end;
    +      29: begin CurrentInt := RandSolved[rand_PrisonPete]; Name := '| Petes Solved      :'; end;
    +      30: begin CurrentInt := RandFailed[rand_PrisonPete]; Name := '| Petes Missed      :'; end;
    +      31: begin CurrentInt := RandSolved[rand_Forester];   Name := '| Foresters Solved  :'; end;
    +      32: begin CurrentInt := RandFailed[rand_Forester];   Name := '| Foresters Missed  :'; end;
    +      33: begin CurrentInt := RandSolved[rand_Leo];        Name := '| Leo''s Solved      :'; end; //Another space due to the ''
    +      34: begin CurrentInt := RandFailed[rand_Leo];        Name := '| Leo''s Missed      :'; end;
    +      35: begin CurrentInt := RandSolved[rand_Molly];      Name := '| Molly''s Solved    :'; end;
    +      36: begin CurrentInt := RandFailed[rand_Molly];      Name := '| Molly''s Missed    :'; end;
    +      37: begin CurrentInt := RandSolved[rand_Pillory];    Name := '| Pillory''s Solved  :'; end;
    +      38: begin CurrentInt := RandFailed[rand_Pillory];    Name := '| Pillory''s Missed  :'; end;
    +      39: begin CurrentInt := RandSolved[rand_CapnArnav];  Name := '| Capn Arnav Solved :'; end;
    +      40: begin CurrentInt := RandFailed[rand_CapnArnav];  Name := '| Capn Arnav Missed :'; end;
    +      41: begin CurrentInt := RandSolved[rand_Beekeeper];  Name := '| Beekeepers Solved :'; end;
    +      42: begin CurrentInt := RandFailed[rand_Beekeeper];  Name := '| Beekeepers Missed :'; end;
    +      43: begin CurrentInt := RandSolved[rand_Abyss];      Name := '| Abysses Solved    :'; end;
    +      44: begin CurrentInt := RandFailed[rand_Abyss];      Name := '| Abysses Missed    :'; end;
    +      45: begin CurrentInt := RandSolved[rand_Mordaut];    Name := '| Mordauts Solved   :'; end;
    +      46: begin CurrentInt := RandFailed[rand_Mordaut];    Name := '| Mordauts Missed   :'; end;
         end;
     
         if (CurrentInt < 1) then
    @@ -351,7 +354,7 @@
     
     {*******************************************************************************
     function FindLamp(skill: String): Boolean;
    -by: Pups, Starblaster100,PriSoner, Lee Lok Hin, Timer
    +by: Pups, Starblaster100, PriSoner, Lee Lok Hin & Timer
     Description: handles Genie. Results True if lamp found and handled.
     skill: Skill to use with lamp eg. 'strength', 'attack', etc.
     *******************************************************************************}

    @@ -418,6 +421,74 @@
     end;
     
     {*******************************************************************************
    +function FindKnowledge(skill: String): Boolean;
    +by: Timer and creators of FindLamp.
    +Description: Handles Book of Knowledge. Results True if the book is found and handled.
    +Skill: Skill to use with book eg. 'strength', 'attack', etc.
    +*******************************************************************************}

    +
    +function FindKnowledge(skill: String): Boolean;
    +var
    +  BookTime, X, Y, I: Integer;
    +begin
    +  GameTab(tab_Inv);
    +  if (FindDTM(BookoKnowledge, x, y, MIX1, MIY1, MIX2, MIY2)) then
    +  begin
    +    Result := True;
    +    Inc(RandSolved[rand_Knowledge]);
    +    TakeScreen('Book of Knowledge Random Solved');
    +    AddToSRLLog('******** SOLVED BOOK OF KNOWLEDGE RANDOM ********');
    +    WriteLn('******** SOLVED BOOK OF KNOWLEDGE RANDOM ********');
    +    Mouse(X, Y, 4, 4, True);
    +    Wait(1500 + Random(500));
    +    MarkTime(BookTime);
    +    for I := 1 to 4 do
    +    begin
    +      case (LowerCase(Skill)) of
    +        'attack': Mouse(81, 109, 12, 12, True);
    +        'strength': Mouse(139, 110, 12, 12, True);
    +        'ranged': Mouse(196, 113, 12, 12, True);
    +        'magic': Mouse(257, 117, 12, 12, True);
    +        'defence': Mouse(319, 109, 12, 12, True);
    +        'crafting', 'craft': Mouse(376, 111, 12, 12, True);
    +        'hitpoints', 'hp': Mouse(436, 112, 12, 12, True);
    +        'prayer', 'pray': Mouse(79, 166, 12, 12, True);
    +        'agility': Mouse(141, 166, 12, 12, True);
    +        'herblore': Mouse(199, 171, 12, 12, True);
    +        'thieving', 'thief': Mouse(258, 167, 12, 12, True);
    +        'fishing', 'fish': Mouse(325, 164, 12, 12, True);
    +        'runecraft', 'runecrafting': Mouse(375, 167, 12, 12, True);
    +        'slayer', 'slay': Mouse(436, 173, 12, 12, True);
    +        'farming', 'farm': Mouse(83, 224, 12, 12, True);
    +        'mining', 'mine': Mouse(137, 222, 12, 12, True);
    +        'smithing', 'smith': Mouse(197, 220, 12, 12, True);
    +        'hunting', 'hunt', 'hunter': Mouse(257, 222, 12, 12, True);
    +        'cooking', 'cook': Mouse(318, 227, 12, 12, True);
    +        'firemaking', 'fire': Mouse(378, 226, 12, 12, True);
    +        'woodcutting', 'wc': Mouse(439, 222, 12, 12, True);
    +        'fletching', 'fletch': Mouse(199, 275, 12, 12, True);
    +        'construction': Mouse(255, 277, 12, 12, True);
    +        'summoning': Mouse(323, 276, 12, 12, True);
    +      else
    +        Mouse(438, 113, 12, 12, True);
    +      end;
    +      Wait(500 + Random(200) + Random(100));
    +      if FindColorTolerance(X, Y, 5602449, 41, 75, 470, 302, 30) then Break;
    +      if (TimeFromMark(BookTime) > 10000) then
    +      begin
    +        Result := False;
    +        Logout;
    +        Players[CurrentPlayer].Rand := 'Book of Knowledge';
    +        Exit;
    +      end;
    +      ClickToContinue;
    +    end;
    +    Mouse(416, 281, 7, 1, True);
    +    Wait(500 + Random(150) + Random(150));
    +  end;
    +end;
    +
    +{*******************************************************************************
     function FindDead: Boolean;
     by: Stupid3ooo and Cazax
     Description: Checks for text "Oh dear you are dead".
    @@ -874,18 +945,19 @@
     var
       I: Byte;
     begin
    -  for I := 1 to 8 do
    +  for I := 1 to 9 do
       begin
         case I of
           1: Result := SolveTeleportRandoms;
           2: Respond;
           3: Result := FindDead;
           4: Result := FindLamp(LampSkill);
    -      5: Result :=  RC;
    -      6: Result := FindMod;
    -      7: if (SRL_Procs[srl_OnRandomCall] <> nil) then
    +      5: Result := FindKnowledge(LampSkill);
    +      6: Result :=  RC;
    +      7: Result := FindMod;
    +      8: if (SRL_Procs[srl_OnRandomCall] <> nil) then
                SRL_Procs[srl_OnRandomCall]();
    -      8: if High(Players[CurrentPlayer].BoxRewards) > -1 then
    +      9: if High(Players[CurrentPlayer].BoxRewards) > -1 then
                Result := UseRewardBox;
         end;
         if (Result) then

  2. #2
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Looks good, haven't tested. SRL could defiantly use this if it works, a lot of my bots were inactive for a long time and the information book kinda mucked them up.

  3. #3
    Join Date
    May 2007
    Location
    Ohio
    Posts
    2,296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It works fine!

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
  •