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