Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program New;
- {$DEFINE SMART}
- {$i SRL\SRL.scar}
- {$i SRL\SRL\Misc\Stats.Simba}
- const
- S_Mems = True; //Members?
- S_World = 38; //Smart world
- S_Signed = True; //Signed client?
- StatsUserName = ''; //SRL Stats username
- StatsPassword = ''; //SRL Stats password
- ShowDebug = False; //Show debugging?
- procedure DeclarePlayers;
- begin
- with Players[0] do
- begin
- Name := '';
- Pass := '';
- Pin := '';
- Active := True;
- Integers[0] := 0; //Time between breaks in minutes. Leave 0 to not take breaks.
- Integers[1] := 0; //Break time in minutes. Leave 0 to not take breaks.
- end;
- end;
- var
- StatsTimer, BreakTimer: Integer;
- Stats: TIntegerArray;
- const
- {script info}
- VERSION = '08';
- {player info enumerations}
- GLASS_MADE = 2;
- TIMES_CASTED = 3;
- LEVELS_MAGIC = 4;
- LEVELS_CRAFTING = 5;
- LAST_SAND_INDEX = 6;
- LAST_SEAWEED_INDEX = 7;
- LAST_SAND_TAB_INDEX = 9;
- LAST_SEAWEED_TAB_INDEX = 10;
- {SRL Stats enumerations}
- EXP = 0;
- LEVELS_GAINED = 1;
- MOLTENGLASS_MADE = 2;
- SUPERGLASS_CASTED = 3;
- {Counting type enumerations}
- GLASS = 1;
- SAND = 2;
- SEAWEED = 3;
- {sort type enumerations}
- sort_Level = 0;
- sort_Combat = 1;
- sort_Teleport = 2;
- {Hide/Show enumerations}
- hs_Combat = 0;
- hs_Teleport = 1;
- hs_Misc = 2;
- procedure Die(Reason: string);
- begin
- if BankScreen then
- CloseBank;
- FindNormalRandoms;
- Logout;
- Players[CurrentPlayer].Active := False;
- if (Players[CurrentPlayer].Status = '') then
- begin
- Players[CurrentPlayer].Status := Reason;
- Writeln('Player ' + IntToStr(CurrentPlayer) + ' set to false because: ' + Reason);
- end;
- end;
- procedure Debug(What: string; Levels: Integer);
- var
- Str: String;
- i: Integer;
- begin
- if not(ShowDebug) then
- Exit;
- for i := 0 to Levels do
- Str := Str + ' ';
- Str := Str + '>';
- Writeln(Str + What);
- end;
- function OpenVWBank: Boolean;
- var
- TPA, TPA1, TPA2: TPointArray;
- ATPA: T2DPointArray;
- CTS, x, y, i: Integer;
- HueMod, SatMod: Extended;
- begin
- if not(LoggedIn) then
- Exit;
- Debug('New procedure: OpenVWBank', 0);
- Debug('Finding TPA for Bankers', 1);
- CTS := GetColorToleranceSpeed;
- GetColorspeed2Modifiers(HueMod, SatMod);
- SetColorToleranceSpeed(2);
- SetColorspeed2Modifiers(3.20, 0.64); //Male mods
- FindColorsTolerance(TPA1, 4869442, MSX1, MSY1, MSX2, MSY2, 9); //Male col/tol
- SetColorspeed2Modifiers(0.07, 0.23); //Female mods
- FindColorsTolerance(TPA2, 4597555, MSX1, MSY1, MSX2, MSY2, 5); //Female col/tol
- SetColorSpeed2Modifiers(HueMod, SatMod);
- SetColorToleranceSpeed(CTS);
- TPA := MergeATPA([TPA1, TPA2]);
- if (Length(TPA) < 1) then
- Exit;
- Debug('Length of TPA: ' + IntToStr(Length(TPA)), 2);
- SortTPAFrom(TPA, IntToPoint(MSCX, MSCY));
- Debug('Splitting & Sorting ATPA', 1);
- ATPA := TPAtoATPAEx(TPA, 30, 30);
- SortATPAFromFirstPoint(ATPA, IntToPoint(MSCX, MSCY));
- Debug('Length of ATPA: ' + IntToStr(Length(ATPA)), 2);
- for i := 0 to High(ATPA) do
- begin
- Debug('Length of ATPA[' + IntToStr(i) + ']: ' + IntToStr(Length(ATPA[i])), 1);
- if (Length(ATPA[i]) < 60) then
- begin
- Debug('Length of ATPA[' + IntToStr(i) + '] Was less than 60, skipping to next TPA', 1);
- Continue;
- end;
- MiddleTPAEx(ATPA[i], x, y);
- if PointInBox(IntToPoint(x, y), IntToBox(232, 144, 281, 184)) then
- begin
- Debug('The middle of ATPA[' + IntToStr(i) + '] was on the character, skipping to next TPA', 1);
- Continue;
- end;
- Debug('ATPA[' + IntToStr(i) + '] was found to be suitable. Mousing', 1);
- MMouse(x - 3, y - 3, 6, 6);
- if WaitUptext('anke', 1200) then
- begin
- Debug('Uptext ''anke'' found on ATPA[' + IntToStr(i) + ']', 1);
- ClickMouse2(False);
- Wait(60 + Random(40));
- if WaitOption('ank B', 1200) then
- begin
- Debug('Option ''ank B'' was chosen, exiting loop', 1);
- Break;
- end;
- end;
- end;
- if FFlag(0) then
- Wait(800 + Random(400));
- Result := WaitFunc(@BankScreen, 5 + Random(5), 2200);
- if Result then
- Debug('OpenVWBank: success!', 1);
- end;
- {Attempts function func (Called like "@Function") Attempts # of times. If the function failse then
- it Rotates the camera by SwivelPer plus or minus 10 degrees}
- function AttemptAndSwivel(func: function: Boolean; Attempts, SwivelPer: Integer): Boolean;
- var
- i: Integer;
- begin
- for i := 1 to Attempts do
- begin
- if func() then
- begin
- Result := True;
- Exit;
- end;
- MakeCompass(rs_GetCompassAngleDegrees + (SwivelPer + Random(10) - Random(10)));
- Wait(800 + Random(80));
- end;
- end;
- function Count(Which: Integer): Integer;
- var
- i, x, y, BlackCount, Color, Tolerance, XMod, YMod: Integer;
- Box: TBox;
- begin
- if not(LoggedIn) then
- Exit;
- Debug('New function: Count(Which: Integer)', 0);
- Debug('Searching for item type ' + IntToStr(Which), 1);
- case Which of
- GLASS:
- begin
- BlackCount := 60;
- Color := 4024011;
- Tolerance := 4;
- XMod := 10;
- YMod := 11;
- end;
- SAND:
- begin
- BlackCount := 20;
- Color := 4879491;
- Tolerance := 12;
- XMod := 14;
- YMod := 14;
- end;
- SEAWEED:
- begin
- BlackCount := 120;
- Color := 3297035;
- Tolerance := 8;
- XMod := 12;
- YMod := 14;
- end;
- end;
- for i := 1 to 28 do
- begin
- Debug('Checking inventory spot ' + IntToStr(i), 1);
- Box := InvBox(i);
- if (CountColor(131072, Box.X1, Box.Y1, Box.X2, Box.Y2) > BlackCount) then
- begin
- Debug('More than ' + IntToStr(BlackCount) + ' black pixels foundon inventory spot ' + IntToStr(i) + ', checking for color too', 2);
- if FindColorTolerance(x, y, Color, Box.X1 + XMod, Box.Y1 + YMod, Box.X1 + XMod, Box.Y1 + YMod, Tolerance) then
- begin
- Debug('Item type ' + IntToStr(Which) + ' found at slot ' + IntToStr(i) + '!', 2);
- Inc(Result);
- end;
- end;
- end;
- Debug('Result of CountGlass: ' + IntToStr(Result), 1);
- end;
- function GetSortType: Integer;
- var
- i: Integer;
- begin
- if not(LoggedIn) or (GetCurrentTab <> tab_Magic) then
- Exit;
- Debug('New function: GetSortType', 0);
- for i := 0 to 2 do
- begin
- Debug('Checking for sort type ' + IntToStr(i), 1);
- if (GetColor(675 + (i * 19), 442) = 16711422) then
- begin
- Debug('Color found!', 2);
- Result := i;
- Break;
- end;
- end;
- Debug('Result of GetSortType: ' + IntToStr(Result), 1);
- end;
- function FixLunarSpellBook: Boolean;
- var
- i: Integer;
- begin
- if not(LoggedIn) then
- Exit;
- Debug('New function: FixLunarSpellBook', 0);
- if (GetCurrentTab <> tab_Magic) then
- if not(GameTab(tab_Magic)) then
- Exit;
- for i := hs_Combat to hs_Misc do
- begin
- Debug('checking button ' + IntToStr(i), 1);
- if (GetColor(589 + (i * 26), 442) <> 16711422) then
- begin
- Debug('Button ' + IntToStr(i) + ' was hidden, clicking button', 2);
- Mouse(589 + (i * 26), 442, 17, 17, True);
- end;
- end;
- Result := ((GetColor(589, 442) = 16711422) and (GetColor(615, 442) = 16711422) and (GetColor(641, 442) = 16711422))
- if Result then
- Debug('FixLunarSpellBook: Success!', 1);
- end;
- function CastGlassMake: Boolean;
- var
- SearchBox: TBox;
- ClickPoint: TPoint;
- begin
- if not(LoggedIn) then
- Exit;
- Debug('New function: CastGlassMake', 0);
- if (GetCurrentTab <> tab_Magic) then
- if not(GameTab(tab_Magic)) then
- Exit;
- if not(FixLunarSpellBook) then
- Exit;
- case GetSortType of
- sort_Level:
- begin
- SearchBox := IntToBox(561, 304, 580, 327);
- ClickPoint := IntToPoint(564, 307);
- end;
- sort_Combat:
- begin
- SearchBox := IntToBox(705, 275, 724, 296);
- ClickPoint := IntToPoint(708, 275);
- end;
- sort_Teleport:
- begin
- SearchBox := IntToBox(678, 305, 696, 325);
- ClickPoint := IntToPoint(676, 306);
- end;
- end;
- Debug('Searching the box (' + IntToStr(SearchBox.X1) + ', ' + IntToStr(SearchBox.Y1) + ', ' + IntToStr(SearchBox.X2) + ', ' + IntToStr(SearchBox.Y2) + ')', 1);
- if (CountColorTolerance(1574025, SearchBox.X1, SearchBox.Y1, SearchBox.X2, SearchBox.Y2, 74) > 45) then
- begin
- Debug('More than 45 red pixels found in box! Clicking spell.', 2);
- MMouse(ClickPoint.x, ClickPoint.y, 11, 16);
- if WaitUptext('pergl', 1400) then
- begin
- Debug('Uptext ''pergl'' found.', 1);
- ClickMouse2(True);
- end;
- end;
- GameTab(tab_Inv);
- Result := WaitInvMinCount(3, 2500); //astrals, fires, and at least 1 molten glass = at least 3 items
- if Result then
- Debug('CastGlassMake: Success!', 1);
- end;
- function DepositItem(Which: Integer): Boolean;
- var
- i, Slot, x, y, BlackCount, Color, XMod, YMod, Tolerance: Integer;
- Box: TBox;
- begin
- if not(LoggedIn) or not(BankScreen) then
- Exit;
- case Which of
- GLASS:
- begin
- BlackCount := 60;
- Color := 4024011;
- Tolerance := 4;
- XMod := 10;
- YMod := 11;
- end;
- SAND:
- begin
- BlackCount := 20;
- Color := 4879491;
- Tolerance := 12;
- XMod := 14;
- YMod := 14;
- end;
- SEAWEED:
- begin
- BlackCount := 120;
- Color := 3297035;
- Tolerance := 8;
- XMod := 12;
- YMod := 14;
- end;
- end;
- Debug('New function: Deposit', 0);
- if (Count(GLASS) = 0) then
- begin
- Debug('Item was not in the inventory. Setting true and exiting', 1);
- Result := True;
- Exit;
- end;
- for i := 3 to InvCount do
- begin
- Debug('checking for item in inventory spot ' + IntToStr(i), 1);
- Box := InvBox(i);
- if (CountColor(131072, Box.X1, Box.Y1, Box.X2, Box.Y2) > 60) then
- begin
- Debug('more than ' + IntToStr(BlackCount) + ' black pixels found, checking for color', 2);
- if FindColorTolerance(x, y, Color, Box.X1 + XMod, Box.Y1 + YMod, Box.X1 + XMod, Box.Y1 + YMod, Tolerance) then
- //if SimilarColors(GetColor(Box.X1 + 10, Box.Y1 + 11), 4024011, 3) then
- begin
- Debug('Found item!', 2);
- Slot := i;
- Break;
- end;
- end;
- end;
- if (Slot = 0) then
- begin
- Debug('Slot was found to be 0, exiting :(', 1);
- Exit;
- end;
- InvMouse(Slot, 2);
- Result := WaitOption('ll M', 1200);
- if Result then
- WaitInvCount(2, 2000, ExactCT);
- Debug('DepostGlass: success!', 1);
- end;
- function WaitFindTextTPA(Color, Tol, xs, ys, xe, ye: Integer; Txt, CharType: string; Action: fnct_ActionOptions; WaitBetween, MaxTime: Integer): Boolean;
- var
- T: Integer;
- begin
- T := GetSystemTime + MaxTime;
- repeat
- if FindTextTPA(Color, Tol, xs, ys, xe, ye, Txt, CharType, Action) then
- begin
- Result := True;
- Exit;
- end;
- Wait(WaitBetween);
- until(GetSystemTime > T);
- end;
- function WithdrawWhich(Which: Integer): Boolean;
- var
- x, y, i, Index, BlackCount, Color, XMod, YMod, Tolerance: Integer;
- UT, Option: string; ///*U*p*T*ext
- Box: TBox;
- begin
- if not(LoggedIn) or not(BankScreen) then
- Exit;
- case Which of
- SAND:
- begin
- BlackCount := 20;
- Color := 4879491;
- Tolerance := 12;
- XMod := 14;
- YMod := 14;
- UT := 'san';
- Option := '13 B'
- end;
- SEAWEED:
- begin
- BlackCount := 120;
- Color := 3297035;
- Tolerance := 8;
- XMod := 12;
- YMod := 14;
- UT := 'eaw';
- Option := '13 S';
- end;
- end;
- Debug('New function: WithdrawWhich', 0);
- FixBank;
- for i := 1 to 40 do
- begin
- Debug('Searching bank index ' + IntToStr(i), 1);
- Box := BankIndexToMSBox(i);
- if (CountColor(131072, Box.X1, Box.Y1, Box.X2, Box.Y2) > BlackCount) then
- begin
- Debug('More than ' + IntToStr(BlackCount) + ' black pixels found, checking for color', 2);
- if FindColorTolerance(x, y, Color, Box.X1 + XMod, Box.Y1 + YMod, Box.X1 + XMod, Box.Y1 + YMod, Tolerance) then
- begin
- Debug('Color found!', 2);
- Index := i;
- if (Index <> 0) then
- case Which of
- SAND: Players[CurrentPlayer].Integers[LAST_SAND_INDEX] := Index;
- SEAWEED: Players[CurrentPlayer].Integers[LAST_SEAWEED_INDEX] := Index;
- end;
- Break;
- end;
- end;
- end;
- if (Index) = 0 then
- begin
- Debug('Index was 0, trying last known index.', 1);
- case Which of
- SAND: Index := Players[CurrentPlayer].Integers[LAST_SAND_INDEX];
- SEAWEED: Index := Players[CurrentPlayer].Integers[LAST_SEAWEED_INDEX];
- end;
- end;
- Box := BankIndexToMSBox(Index);
- MMouse(Box.X1 + 4, Box.Y1 + 4, Box.X2 - Box.X1 - 4, Box.Y2 - Box.Y1 - 4);
- if WaitUptext(UT, 1200) then
- begin
- Debug('Uptext ' + UT + ' found', 1);
- ClickMouse2(False);
- Wait(150 + Random(100));
- if WaitOption('13 B', 1800) then
- begin
- Debug('Chose option ''13 B''', 1);
- Result := True;
- Wait(200 + Random(50));
- end;
- if not(Result) then
- begin
- Debug('Could not withdraw 13, "Withdraw-X"-ing', 1);
- Mouse(Box.X1, Box.Y1, Box.X2 - Box.X1, Box.Y2 - Box.Y1, False);
- if WaitOption(Option, 1800) then
- begin
- Debug('option ''' + Option + ''' chose.', 1);
- if WaitFindTextTPA(0, 12, 251, 393, 307, 411, 'n', 'UpChars', Nothing, 500 + Random(15), 2200) then
- begin
- Debug('Chat box found, typing 13', 1);
- TypeSendEx('13', True);
- Result := True;
- Wait(300 + Random(50));
- end;
- end;
- end;
- end;
- If Result then
- Debug('WithdrawSand: success!', 1);
- end;
- //Written by R1ch for SRL, Modified for this script.
- function LevelUpWhich(var WhichSkill: Integer): Boolean; //WhichSkill = 1 if Magic, 2 if crafting
- var
- X, Y : Integer;
- begin
- if (not(FindColor(X, Y, 0, 7, 460, 69, 474))) then
- Result:= FindNPCChatText('gratu', Nothing);
- if Result then
- begin
- if FindNPCChatText('rafting', Nothing) then
- WhichSkill := 2
- else
- if FindNPCChatText('gic', Nothing) then
- WhichSkill := 1;
- Result := ClickContinue(True, True);
- WriteLn(Players[CurrentPlayer].Name + ' leveled up');
- end;
- end;
- procedure CommitStats;
- var
- i: Integer;
- begin
- stats_IncVariable('Total EXP Gained', Stats[EXP]);
- stats_IncVariable('Total Levels Gained', Stats[LEVELS_GAINED]);
- stats_IncVariable('Molten Glass Made', Stats[MOLTENGLASS_MADE]);
- Stats_IncVariable('Superglass Casted', Stats[SUPERGLASS_CASTED]);
- if (TimeFromMark(StatsTimer) > 300000) then
- begin
- stats_Commit;
- MarkTime(StatsTimer);
- end;
- for i := 0 to High(Stats) do
- Stats[i] := 0;
- end;
- function WithdrawMaterials: Boolean;
- var
- Attempts: Integer;
- Bools: Array[0..1] of Boolean; //Bools[0] = SeaweedSuccess; Bools[1] = SandSuccess;
- Counts: array[0..1] of Integer; //Counts[0] = SeaweedCount; Counts[1] = SandCount;
- begin
- if not(LoggedIn) or not(BankScreen) then
- Exit;
- repeat
- if not(Bools[0]) then
- begin
- if WithdrawWhich(SEAWEED) then
- Bools[0] := True;
- Wait(200 + Random(300));
- end;
- if not(Bools[1]) then
- begin
- if WithdrawWhich(SAND) then
- Bools[1] := True;
- Wait(200 + Random(300));
- end;
- Counts[0] := Count(SEAWEED);
- Counts[1] := Count(SAND);
- Result := ((Counts[0] >= 1) and (Counts[0] <= 13)) and ((Counts[1] >= 1) and (Counts[1] <= 13));
- if Result then
- Break;
- if not(Bools[0]) then
- begin
- DepositItem(SEAWEED);
- Wait(800 + Random(100));
- end;
- if not(Bools[1]) then
- begin
- DepositItem(SAND);
- Wait(800 + Random(100));
- end;
- until(Attempts > 5);
- if not(Bools[0]) then
- Players[CurrentPlayer].Status := Players[CurrentPlayer].Status + 'Seaweed;';
- if not(Bools[1]) then
- Players[CurrentPlayer].Status := Players[CurrentPlayer].Status + 'Sand;';
- end;
- procedure TakeBreak;
- begin
- if (Players[CurrentPlayer].Integers[0] = 0) or (Players[CurrentPlayer].Integers[1] = 0) then
- Exit;
- if (GetSystemTime >= BreakTimer) then
- begin
- Logout;
- Wait(Players[CurrentPlayer].Integers[1] + RandomRange(60000, 180000));
- LogInPlayer;
- Wait(8000 + Random(4000));
- BreakTimer := (GetSystemTime + Players[CurrentPlayer].Integers[0] * 60000) + RandomRange(60000, 180000);
- end;
- end;
- procedure Report;
- //var
- //CastsHr, GlassHr, XpHr: Int64;
- begin {123456789|12 This is my ruler :p 123456789|12}
- Writeln('/---------------------------------------------------\');
- Writeln('| TomTuff''s Super Glass Maker |');
- Writeln('| Rev ' + VERSION + ' |');
- Writeln('|---------------------------------------------------|');
- Writeln('| Time Ran: ' + Padr(MsToTime(GetTimeRunning, Time_Short), 39) + '|');
- if (Players[0].Integers[LEVELS_MAGIC] > 0) then
- Writeln('| Magic Levels Gained: ' + Padr(IntToStr(Players[CurrentPlayer].Integers[LEVELS_MAGIC]), 28) + '|');
- if (Players[0].Integers[LEVELS_CRAFTING] > 0) then
- Writeln('| Crafting Levels Gained: ' + Padr(IntToStr(Players[CurrentPlayer].Integers[LEVELS_CRAFTING]), 25) + '|');
- Writeln('| Times Casted Superglass Make: ' + Padr(IntToStr(Players[CurrentPlayer].Integers[TIMES_CASTED]), 19) + '|');
- //CastsHr := Ceil((Players[0].Integers[TIMES_CASTED] * 60.0 * 60.0 * 1000.0) / PlayerWorked(0));
- //Writeln('| Times Casted per Hour: ' + Padr(Int64ToStr(CastsHr), 26) + '|');
- Writeln('| Molten Glass Made: ' + Padr(IntToStr(Players[CurrentPlayer].Integers[GLASS_MADE]), 30) + '|');
- //GlassHr := Ceil((Players[0].Integers[GLASS_MADE] * 60.0 * 60.0 * 1000.0) / PlayerWorked(0));
- // Writeln('| Molten Glass Made per Hour: ' + Padr(Int64ToStr(GlassHr), 21) + '|');
- Writeln('| Experience Gained: ' + Padr(IntToStr(Players[CurrentPlayer].Integers[TIMES_CASTED] * 78), 30) + '|');
- //XpHr := Ceil((Players[0].Integers[TIMES_CASTED * 78] * 60.0 * 60.0 * 1000.0) / PlayerWorked(0));
- //Writeln('| Experience Gained per Hour: ' + Padr(Int64ToStr(XpHr), 21) + '|');
- if (Players[0].Status <> '') then
- begin
- Writeln('| Reason for stopping: |');
- Writeln('| ' + Padr(Players[0].Status, 49) + '|');
- end;
- Writeln('\---------------------------------------------------/');
- end;
- procedure MainLoop;
- var
- Angle: Extended;
- i, WhichSkill: Integer;
- begin
- Smart_Members := S_Mems;
- Smart_Server := S_World;
- Smart_Signed := S_Signed;
- Smart_SuperDetail := False;
- SetupSRL;
- SetLength(Stats, 5);
- SetupSRLStats(31, StatsUserName, StatsPassword);
- HowManyPlayers := 1;
- NumberOfPlayers(HowManyPlayers);
- CurrentPlayer := 0;
- DeclarePlayers;
- ActivateClient;
- if (StatsPassword = '') or (StatsUsername = '') then
- begin
- Writeln('Please Get SRL Stats to avoid this 15 second wait (or dont be a noob and take it out yourself... but really, get stats)');
- for i := 15 downto 1 do
- begin
- Writeln(IntToStr(i) + '...');
- Wait(999);
- end;
- end;
- if not(LoggedIn) then
- begin
- LoginPlayer;
- Wait(2000 + Random(1000));
- end;
- MarkTime(StatsTimer);
- if not((Players[CurrentPlayer].Integers[0] = 0) or (Players[CurrentPlayer].Integers[1] = 0)) then
- BreakTimer := (GetSystemTime + Players[CurrentPlayer].Integers[0] * 60000) + RandomRange(60000, 180000);
- SetAngle(True);
- repeat
- repeat
- if LoggedIn then
- Players[CurrentPlayer].Status := '';
- FindNormalRandoms;
- if LevelUpWhich(WhichSkill) then
- begin
- Inc(Stats[LEVELS_GAINED]);
- case WhichSkill of
- 1: Inc(Players[CurrentPlayer].Integers[LEVELS_MAGIC]);
- 2: Inc(Players[CurrentPlayer].Integers[LEVELS_CRAFTING]);
- end;
- end;
- if AttemptAndSwivel(@OpenVWBank, 8, 45) then
- begin
- Wait(600 + Random(200));
- IncEx(Players[CurrentPlayer].Integers[GLASS_MADE], Count(GLASS));
- IncEx(Stats[EXP], Count(GLASS) * 10);
- IncEx(Stats[GLASS_MADE], Count(GLASS));
- if DepositItem(GLASS) then
- begin
- Wait(100 + Random(200));
- if WithdrawMaterials then
- begin
- Wait(200 + Random(50));
- if CloseBank then
- begin
- FindNormalRandoms;
- if (Random(9) = 0) then
- begin
- Angle := rs_GetCompassAngleDegrees;
- MakeCompass(Angle - 30 + Random(60));
- end;
- if (Random(19) = 0) then
- HoverSkill('magic', False);
- if CastGlassMake then
- begin
- Inc(Players[CurrentPlayer].Integers[TIMES_CASTED]);
- Inc(Stats[SUPERGLASS_CASTED]);
- IncEx(Stats[EXP], 78);
- if LevelUpWhich(WhichSkill) then
- begin
- Inc(Stats[LEVELS_GAINED]);
- case WhichSkill of
- 1: Inc(Players[CurrentPlayer].Integers[LEVELS_MAGIC]);
- 2: Inc(Players[CurrentPlayer].Integers[LEVELS_CRAFTING]);
- end;
- end;
- Wait(1500 + Random(400));
- end else
- Die('could not cast glass make');
- end else
- Die('could not close the bank');
- end else
- Die('Failed to withdraw: ' + Players[CurrentPlayer].Status);
- end else
- Die('could not deposit the glass');
- end else
- Die('could not open the bank');
- Report;
- CommitStats;
- TakeBreak;
- until(not(LoggedIn));
- until(AllPlayersInactive);
- Report;
- TerminateScript;
- end;
- begin
- MainLoop;
- end.
- {
- Revision History
- Revision 1:
- Release.
- Revision 2:
- [*] Modified Die() procedure to set the player to false, and not to re-set status
- if the status is already set.
- [*] Added FixLunarSpellBook(): Boolean;
- [*] Added a 10% chance to rotate the camera 30 degrees after banking for antiban
- [*] Fixed standards on Report();
- [*] Added most of the setup info to the actual thread rather than the script header
- [*] Changed the point color check for sand buckets to work when there's
- > 1k buckets (Yellow pixels block the oldpoint check).
- Revision 3:
- [*] Fixed some more stuff regarding Players[X].Status
- [*] Added FFlag(0) to OpenVWBank();
- [*] Added SRL Stats :3 (Thanks KongKing for his SRL-Stats-For-Dummies type explanation)
- [*] Added WaitFindTextTPA and Level counting (level counting also in SRL Stats)
- [*] Added breaking
- [*] Removed all the per hour stuff from reports until i get it working
- Revision 3QP:
- [*] Added some static wait times to the main loop
- Revision 4:
- [*] Fixed OpenVWBank to search for Males AND Females, and to require more points
- in a TPA before it checks it (10 ==> 90).
- [*] Fixed OpenVWBank to split the ATPA in to smaller boxes because some of the
- plantes behind the bankers were throwing it off (40x40 boxes ==> 30x30 boxes)
- [*] Removed SetAngle(True); from OpenVWBank and instead added it to the beginning
- of the main loop. To compensate for the wait time gained by using SetAngle,
- A longer static wait time was added after successfully casting the spell
- [*] Fixed a bug with the SRL Stats Implementation (forgot to re-mark time).
- Revision 5:
- [*] Extraneous function "Commit()" removed.
- [*] All enumerations gathered into one place
- [*] New constant SCRIPT_VER for proggie ("Writeln('Rev 05')" ==> "Writeln('Rev ' + SCRIPT_VER)")
- [*] Added 5% chance to hover the magic skill every loop
- Revision 5QP:
- [*] Changed color tolerance when searching for seaweed from 2 to 3
- Revision 6:
- [*] Added: procedure Debug(What: string; Levels: Integer);
- [*] Added debugging lines to all/most functions.
- Revision 7:
- [*] Changed OpenVWBank to sort the TPA from the center of the screen before
- splitting it to an ATPA
- [*] both withdrawing functions now record the last known bank index to use
- in case the bank index isn't found, so then the index is set to the last
- known.
- [*] Changed length check (90 ==> 60)
- [*] Removed script setup info from top of the script, see the thread if you
- need to.
- Revision 8:
- [*] Replaced CountGlass with Count(Which: Integer), and made it work for
- glass, seaweed, and sand.
- [*] Added AttemptAndSwivel(Func: function: Boolean; Attempts, SwivelPer: Integer)
- [*] Modified main loop to open the bank via AttemptAndSwivel
- [*] Modified DepositGlass to work for all 3 items.
- [*] New function WithdrawMaterials for failsafing, attempts withdrawing 5 times;
- replaced the individual functions being used in the main loop.
- [*] Merged WithdrawSeaweed and WithdrawSand to WithdrawItem(Which: Integer): Boolean;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement