Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Pizbuyer;
- {$DEFINE SMART8}
- {$I SRL-OSR/SRL.Simba}
- {$I SRL-OSR/SRL/misc/al_functions.simba}
- {$I SRL-OSR/SRL/core/antirandoms/C_AntiRandoms.simba}
- {$I SRL-OSR/SRL/Reflection/Reflection.simba}
- var
- BankCord,shopcord:tpointarray;
- cx, cy, pizzasbought, potatobought, T, WorldsHopped, W: integer;
- Myloc:tpoint;
- const
- bankpin = '3389';
- BankIconColor = 2138555;
- BankIconTol = 25;
- BankIconHue = 0.11;
- BankIconSat = 1.15;
- BW1 = 308;
- Bw2 = 316;
- Bw3 = 325;
- Bw4 = 337;
- procedure playerSetup;
- begin
- HowManyPlayers := 1;
- NumberOfPlayers(HowManyPlayers);
- CurrentPlayer := 0;
- Players[0].Name := 'user';
- Players[0].Pass := 'pass';
- Players[0].Nick := 'nec';
- Players[0].Active := True;
- end;
- procedure MMouseRandom(x, y: integer);
- var
- Cx, Cy: Integer;
- begin
- GetMousePos(Cx, Cy);
- AL_SetMouseSpeed(20);
- case Random(5) of
- 0: AL_BrakeWindMouse(Cx, Cy, x, y, 15 + Random(10), 5 + Random(15), 5, 10, 5, True);
- 1: AL_HumanWindMouse(Cx, Cy, x, y, 15 + Random(10), 5 + Random(15), 5, 10, 5);
- 2: AL_AccurateMMouse(IntToPoint(x, y), 2, 2);
- 3: AL_HumanMMouse(IntToPoint(x, y), 2, 2);
- 4: AL_ShiftWindMouse(Cx, Cy, x, y, 15 + Random(10), 5 + Random(15), 5, 10, 20, 5);
- 5: AL_MissMouse(IntToPoint(x, y), 2, 2);
- end;
- end;
- procedure WaitHumanClick3;
- begin
- case random(600) of
- 1..450: Wait(RandomRange(3000, 5000));
- 451..570: Wait(RandomRange(5000, 5500));
- 571..590: Wait(RandomRange(6000, 6500));
- 591..600: Wait(RandomRange(7000, 7500));
- end;
- end;
- procedure myvars;
- begin
- BankCord := [point(2843, 3542)];
- shopcord := [point(2838, 3549)];
- end;
- procedure DebugPosition;
- begin
- repeat
- wait(400);
- Myloc := R_GetTileGlobal;
- writeln(Myloc);
- until (false);
- end;
- function GetGreenUptext: string;
- var
- WhiteT, BlueT, YellowT, OrangeT, GreenT, FoundText: string;
- begin
- WhiteT := GetTextAtExWrap(8, 8, 300, 21, 0, 5, 1, 14541281, 55, 'UpChars07');
- BlueT := GetTextAtExWrap(35, 8, 300, 21, 0, 5, 1, 13423640, 65, 'UpChars07');
- YellowT := GetTextAtExWrap(35, 8, 300, 21, 0, 5, 1, 1235160, 40, 'UpChars07');
- OrangeT := GetTextAtExWrap(35, 8, 300, 21, 0, 5, 1, 4687583, 53, 'UpChars07');
- GreenT := GetTextAtExWrap(8, 8, 300, 21, 0, 5, 1, 120577, 65, 'UpChars07');
- FoundText := WhiteT + ' ' + BlueT + YellowT + OrangeT + GreenT;
- FoundText := ReplaceWrap(FoundText, '.', '', [rfReplaceAll]);
- FoundText := ReplaceWrap(FoundText, '/', '', [rfReplaceAll]);
- FoundText := ReplaceWrap(FoundText, '\', '', [rfReplaceAll]);
- FoundText := ReplaceWrap(FoundText, ',', '', [rfReplaceAll]);
- FoundText := ReplaceWrap(FoundText, '*', '', [rfReplaceAll]);
- FoundText := ReplaceWrap(FoundText, '^', '', [rfReplaceAll]);
- FoundText := ReplaceWrap(FoundText, '"', '', [rfReplaceAll]);
- Result := FoundText;
- end;
- function IsUpTextMultiCustom2(Text: TStringArray): Boolean;
- var
- TheText: string;
- i, n: Integer;
- begin
- TheText := GetGreenUptext;
- n := High(Text);
- for i := 0 to n do
- if (Pos(Text[i], TheText) > 0) then
- begin
- Result := True;
- Exit;
- end;
- end;
- function WaitUpTextMulti2(S: TStringArray; Time: Integer): Boolean;
- var
- T: Integer;
- begin
- Result := false;
- T := GetSystemTime + Time;
- while (GetSystemTime < T) do
- begin
- if (IsUpTextMultiCustom2(S)) then
- begin
- Result := True;
- Exit;
- end;
- Wait(20 + Random(20));
- end;
- end;
- procedure WaitHumanClick;
- begin
- case random(600) of
- 1..450: Wait(RandomRange(400, 600));
- 451..570: Wait(RandomRange(400, 600));
- 571..590: Wait(RandomRange(600, 800));
- 591..600: Wait(RandomRange(800, 1000));
- end;
- end;
- procedure WaitHumanClick2;
- begin
- case random(600) of
- 1..450: Wait(RandomRange(1000, 1500));
- 451..570: Wait(RandomRange(1500, 2000));
- 571..590: Wait(RandomRange(2000, 2500));
- 591..600: Wait(RandomRange(2500, 3000));
- end;
- end;
- function FindObjExX(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray; Tol, CTS: integer; Hue, Sat: Extended; Step, xs, ys, xe, ye: Integer): Boolean;
- var
- MidX, MidY, i, j, k, x, y, width, height, HalfWidth, HalfHeight: Integer;
- ColorFound: Boolean;
- SearchBoxes: array of array of TBox;
- p: TPointArray;
- begin
- if (not (loggedin)) then
- exit;
- Result := False;
- for i := 0 to (GetArrayLength(Color) - 1) do
- begin
- ColorToleranceSpeed(CTS);
- SetColorSpeed2Modifiers(Hue, sat);
- if (FindColorSpiralTolerance(cx, cy, Color[i], xs, ys, xe, ye, Tol)) then
- begin
- ColorToleranceSpeed(1);
- SetColorSpeed2Modifiers(0.2, 0.2);
- ColorFound := True;
- Break;
- end;
- end;
- ColorToleranceSpeed(1);
- SetColorSpeed2Modifiers(0.2, 0.2);
- if not (ColorFound) then
- Exit;
- MidX := Round((xe - xs) / 2);
- MidY := Round((ye - ys) / 2);
- Width := Ceil(abs(xe - xs) / 2 / Step - 0.5) * 2 + 1;
- Height := Ceil(abs(ye - ys) / 2 / Step - 0.5) * 2 + 1;
- SetLength(SearchBoxes, Width);
- HalfWidth := Floor(Width / 2);
- HalfHeight := Floor(Height / 2) for x := - 1 * HalfWidth to HalfWidth do
- begin
- SetLength(SearchBoxes[x + HalfWidth], Height);
- for y := - 1 * HalfHeight to HalfHeight do
- SearchBoxes[x + HalfWidth][y + HalfHeight] := IntToBox(Max(xs, xs + Round(MidX + ((x - 0.5) * Step))), Max(ys, ys + Round(MidY + ((y - 0.5) * Step))), Min(xe, xs + Round(MidX + ((x + 0.5) * Step))), Min(ye, ys + Round(MidY + ((y + 0.5) * Step))));
- end;
- p := TPAFromBox(IntToBox(0, 0, Width - 1, Height - 1));
- SortTPAFrom(p, Point(floor(Width / 2), floor(Height / 2)));
- for k := 0 to High(Color) do
- for j := 0 to High(p) do
- begin
- ColorToleranceSpeed(CTS);
- SetColorSpeed2Modifiers(Hue, sat);
- if (FindColorTolerance(cx, cy, Color[k], SearchBoxes[p[j].x][p[j].y].x1, SearchBoxes[p[j].x][p[j].y].y1, SearchBoxes[p[j].x][p[j].y].x2, SearchBoxes[p[j].x][p[j].y].y2, Tol)) then
- begin
- ColorToleranceSpeed(1);
- SetColorSpeed2Modifiers(0.2, 0.2);
- MMouse(cx, cy, 3, 3);
- wait(randomrange(200, 300));
- if (WaitUptextMulti2(Text, 300)) then
- begin
- ColorToleranceSpeed(1);
- SetColorSpeed2Modifiers(0.2, 0.2);
- GetMousePos(cx, cy);
- Result := True;
- Exit;
- end;
- end;
- ColorToleranceSpeed(1);
- SetColorSpeed2Modifiers(0.2, 0.2);
- end;
- ColorToleranceSpeed(1);
- SetColorSpeed2Modifiers(0.2, 0.2);
- end;
- function onshopscreen: boolean;
- var
- tpa: tpointarray;
- begin
- result := FindColorsTolerance(tpa, 65535, 254, 60, 292, 82, 0);
- end;
- function ShopScreenS: Boolean;
- begin
- Result := (FindTextTPA(2070783, 10, 22, 30, 476, 52, 'Store', 'UpChars07', Nothing) or (GetColor(482, 36) = 65536));
- end;
- function BuyPizza(): integer;
- var
- s: string;
- PizzaCount: integer;
- begin
- wait(randomrange(200, 400));
- s := GetTextAtExWrap(160, 60, 200, 82, 0, 5, 1, 65535, 0, statchars07);
- PizzaCount := StrToIntDef(GetNumbers(s), - 1);
- writeln(PizzaCount);
- if (PizzaCount > 0) then
- begin
- IncEx(pizzasbought, pizzacount) mouse(randomrange(185, 190), randomrange(75, 83), 0, 0, mouse_right);
- wait(randomrange(200, 300));
- mouse(randomrange(145, 149), randomrange(150, 154), 0, 0, mouse_left);
- waithumanclick;
- end;
- end;
- function BuyPotato(): integer;
- var
- s: string;
- i, PizzaCount: integer;
- begin
- wait(randomrange(200, 400));
- s := GetTextAtExWrap(200, 60, 240, 82, 0, 5, 1, 65535, 0, statchars07);
- PizzaCount := StrToIntDef(GetNumbers(s), - 1);
- writeln(PizzaCount);
- if (PizzaCount > 0) then
- begin
- IncEx(potatobought, pizzacount) mouse(randomrange(235, 240), randomrange(75, 83), 0, 0, mouse_right);
- wait(randomrange(200, 300));
- mouse(randomrange(235, 240), randomrange(150, 154), 0, 0, mouse_left);
- waithumanclick;
- end;
- end;
- function Getpizza(): Integer;
- var
- ss, s: string;
- ii, i, potatocount, PizzaCount: integer;
- begin
- if shopscreens then
- begin
- waithumanclick2;
- BuyPizza;
- BuyPotato;
- waithumanclick;
- mouse(randomrange(486, 487), randomrange(40, 41), 0, 0, mouse_right);
- WaitOption('lose', 1000);
- waithumanclick2;
- if shopscreens then
- mouse(randomrange(486, 487), randomrange(40, 41), 0, 0, mouse_left);
- if InvFull then
- exit;
- if not (ExistsItem(28)) then
- begin
- repeat
- wait(400);
- logout;
- if shopscreens then
- mouse(randomrange(486, 487), randomrange(40, 41), 0, 0, mouse_left);
- logout;
- if not loggedin then
- exit;
- until (not loggedin);
- end;
- end;
- end;
- procedure ProgressReport;
- begin
- if (not (loggedin)) then
- exit;
- ClearDebug;
- WriteLn('* Pizza buyer');
- WriteLn('* Runtime: ' + TimeRunning);
- Writeln('*');
- writeln('* Worlds Hopped: ' + IntToStr(WorldsHopped));
- writeln('* Pizzas Bought: ' + IntToStr(pizzasbought));
- Writeln('* Potato Bought: ' + IntToStr(pizzasbought));
- end;
- procedure bankthings;
- begin
- if pinscreen then
- begin
- InPin(bankpin);
- waithumanclick;
- end;
- if bankscreen then
- begin
- QuickDeposit('inv');
- waithumanclick2;
- MouseBankSlot(1, mouse_Right);
- waithumanclick;
- if (WaitOption('ut-one', 500)) then
- writeln('we did it');
- waithumanclick;
- R_WalkPath(shopcord);
- end;
- end;
- function OpenWScreen: Boolean;
- var
- x, y: integer;
- begin
- Result := False;
- if WorldScreen then
- exit;
- if Loggedin then
- Exit;
- if not WorldScreen then
- begin
- Mmouse(54, 475, 1, 1);
- WaitHumanClick;
- ClickMouse2(Mouse_Left);
- waithumanclick;
- Result := True;
- end;
- end;
- function whitecolor:boolean;
- var
- Monster: TpointArray;
- TmpCts: Integer;
- begin
- tmpcts := GetColorToleranceSpeed;
- ColorToleranceSpeed(2);
- SetColorSpeed2Modifiers(0.22, 1.69);
- result := FindColorsTolerance(Monster, 9163999, 192, 67, 583, 469 , 4);
- ColorToleranceSpeed(tmpcts);
- SetColorSpeed2Modifiers(0.2, 0.2);
- //FindColorsTolerance(Monster, 92292279, 192, 67, 583, 469 , 17);
- end;
- procedure loginloop;
- begin
- OpenWorldScreen;
- repeat
- if whitecolor then break;
- if whitecolor then
- writeln('yeaya');
- if not whitecolor then
- writeln('yea22ya');
- case random(10) of
- 0..2: mouse(randomrange(397,554),randomrange(78,394),1,1,mouse_move);
- 3..4: mouse(randomrange(298,462),randomrange(200,392),1,1,mouse_move);
- 5..6: mouse(randomrange(205,555),randomrange(80,154),1,1,mouse_move);
- 7..10: mouse(randomrange(211,555),randomrange(246,367),1,1,mouse_move);
- end;
- until (whitecolor)
- if whitecolor then
- begin
- clickmouse2(mouse_left);
- waithumanclick;
- if not (CurrentWorldLS = 365) then
- begin
- loginplayer;
- exit;
- end;
- end;
- end;
- procedure getfood;
- begin
- MakeCompass('N');
- setangle(0);
- wait(400);
- if shopscreens then
- begin
- Getpizza;
- end
- else
- begin
- if not FindObjExX(cx, cy, ['Lidio', 'Lid', 'dio', 'idio', 'talk', 'talk-to', 'alk-t', 'alk-to', 'alk', 'to'], [6179915], 15, 2, 0.06, 0.09, 50, MSX1, MSY1, MSX2, MSY2) then
- begin
- R_WalkPath(shopcord);
- end;
- if FindObjExX(cx, cy, ['Lidio', 'Lid', 'dio', 'idio', 'talk', 'talk-to', 'alk-t', 'alk-to', 'alk', 'to'], [6179915], 15, 2, 0.06, 0.09, 50, MSX1, MSY1, MSX2, MSY2) then
- begin
- clickmouse2(mouse_right);
- waitoption('rade', 1000);
- waithumanclick3;
- end;
- end;
- end;
- procedure bankstuff;
- begin
- R_WalkPath(bankcord);
- if bankscreen then
- begin
- if pinscreen then
- begin
- InPin(bankpin);
- end;
- waithumanclick;
- bankthings;
- end
- else
- begin
- if not FindObjExX(cx, cy, ['jade', 'ade'], [6182999], 15, 2, 0.16, 0.06, 50, MSX1, MSY1, MSX2, MSY2) then
- begin
- R_WalkPath(bankcord);
- end;
- if FindObjExX(cx, cy, ['jade', 'ade'], [6182999], 15, 2, 0.16, 0.06, 50, MSX1, MSY1, MSX2, MSY2) then
- begin
- writeln('yes2');
- clickmouse2(mouse_right);
- waitoption('ank', 1000);
- waithumanclick3;
- if pinscreen then
- begin
- InPin(bankpin);
- waithumanclick;
- end;
- bankthings;
- end;
- if bankscreen then
- bankthings;
- end;
- end;
- procedure mainloop;
- begin
- if not loggedin then exit;
- findnormalrandoms;
- if pinscreen then
- begin
- InPin(bankpin);
- end;
- if (not(ExistsItem(28))) then
- getfood;
- if (ExistsItem(28)) then
- bankstuff;
- end;
- begin
- playerSetup;
- setupsrl;
- SetupReflection;
- BankCord := [point(2843, 3542)];
- shopcord := [point(2838, 3549)];
- addonterminate('progressreport');
- repeat
- wait(400);
- if not loggedin then
- loginloop;
- wait(400);
- if loggedin then
- mainloop;
- until (false);
- end.
- //[point(2843, 3542)]; bank cord
- //[point(2843, 3542)]; shop cord.
- //R_WalkPath(BankCord);
Advertisement
Add Comment
Please, Sign In to add comment