Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program GlowResourceMiner;
- {$DEFINE SMART}
- {$DEFINE SRL5}
- {$IFDEF SRL5}
- {$i srl/srl.simba}
- {$ELSE}
- {$i srl/srl.scar}
- {$ENDIF}
- {$i srl/srl/misc/paintsmart.simba}
- const
- Ore = 'iron';
- OrePrice = 330;
- userName = ''; //Username here. (needed to login)
- passWord = ''; //Pass here.
- nickName = ''; //3-4 lowercase letters from your username.
- bankPin = ''; //Bankpin here.
- World = 10;//World you want to login.
- LampXpIn = 'Farming';//Skill you want exp in from the genie.
- var
- resourceDTM, oreDTM, AColor, BColor, StartScript, StartXp, OresMined: Integer;
- procedure DeclarePlayers;
- begin
- HowManyPlayers := 1;
- NumberOfPlayers(HowManyPlayers);
- CurrentPlayer := 0;
- Players[0].Name := userName;
- Players[0].Pass := passWord;
- Players[0].Nick := nickName;
- Players[0].Active := True;
- Players[0].Pin := bankPin;
- Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];//Random event prices.
- end;
- procedure LoadInfo(Ore: String);
- begin
- Case (Lowercase(Ore)) of
- 'iron', 'iron ore':
- begin
- AColor := 2964582;
- BColor := 3294064;
- oreDTM := DTMFromString('mrAAAAHic42BgYKhlYmAoAuISIK4G4nYg7gbiRiAuBeLdjAwMe4D4CBCfBuKjjBCxDUC8DYgNZUUZfG21gSYxYcWsQBIfZiSAYQAAup0LRw==');
- end;
- end;
- end;
- procedure AntiRandoms;
- begin
- FindNormalRandoms;
- LampSkill := (LampXpIn);
- LevelUp;
- end;
- procedure StartUpClient;
- begin
- Smart_Server := World;
- Smart_Members := True;
- Smart_Signed := True;
- Smart_SuperDetail := False;
- SetupSRL;
- DeclarePlayers;
- ActivateClient;
- if not LoggedIn then
- LoginPlayer;
- if (StartScript = 0) then
- begin
- if not IsXPBarOpen then ToggleXPBar(true);
- StartXp := GetXPBarTotal;
- Inc(StartScript);
- end;
- end;
- function AtResource: boolean;
- var
- x, y: Integer;
- begin
- resourceDTM := DTMFromString('mbQAAAHicY2VgYOhnYmCYBcSLgLgdiNcDsRUjA4MTEFsCsSEQ+wHx5Pp4hqiIUDD+CFTT2TeTgR+oHx0zYsFgAADo8Aq8');
- if Length(GetMiniMapDots('npc')) >= 1 then
- if (PercentBlackMM >= 35) then
- if (DTMRotated(resourceDTM, x, y, MMX1, MMY1, MMX2, MMY2)) then
- begin
- result := true;
- end;
- FreeDTM(resourceDTM);
- end;
- function EnterResource: boolean;
- begin
- if (ClickObject(2175656, 4079680, 25, 25, 5, 'yster', 'nter', false)) then
- begin
- result := true;
- end;
- end;
- function ExitResource: boolean;
- begin
- if (ClickObject(2175656, 4079680, 25, 25, 5, 'yster', 'xit', false)) then
- begin
- result := true;
- end;
- end;
- Function Mining: Boolean; // thanks to flight explained me this ;D
- var
- PBox: TBox;
- begin
- PBox := IntToBox(245, 130, 285, 195);
- Result := (AveragePixelShift(PBox, 250, 500) > 400);
- end;
- function MineOre: boolean;
- begin
- AntiRandoms;
- while Mining do
- Wait(50+random(100));
- if (ClickObject(AColor, BColor, 25, 10, 5, 'ocks', 'ine', true)) then
- begin
- result := true;
- end;
- end;
- function CloseBankX: Boolean;// FRM SRL FOLDER
- var
- i, Timer: Integer;
- begin
- Result := False;
- if DepositScreen then
- begin
- Timer := GetTimeRunning + 8000;
- repeat
- Mouse(434, 42, 5, 5, mouse_left);
- for i := 0 to 30 do
- begin
- if not DepositScreen then
- begin
- Result:= True;
- Break;
- end;
- Wait(100);
- end;
- Wait(Random(100));
- until (GetTimeRunning > Timer) or Result;
- end;
- end;
- procedure Bank;
- var
- i, x, y: integer;
- box, box2: TBox;
- begin
- if not DepositScreen then exit;
- if (DepositScreen) then
- OresMined := OresMined + CountItemsIn('deposit box', 'dtm', oreDTM, []);
- begin
- for i := 1 to 28 do
- begin
- box := DepositItemBox(i);
- box2 := IntToBox(92, 29, 396, 54);
- if (FindDTM(oreDTM, x, y, box.X1, box.Y1, box.X2, box.Y2)) then
- begin
- QuickDeposit(SRL_DEPOSIT_ALL);
- wait(650 + random(350));
- end else
- CloseBankX;
- end;
- end;
- end;
- procedure Report;
- var
- XpGained, Profit: Integer;
- begin
- XpGained := GetXPBarTotal - StartXp;
- Profit := OresMined * OrePrice;
- Writeln('========= GlowResourceMiner ==========');
- Writeln('|= Time Running : ' + TimeRunning);
- Writeln('|= Xp gained : ' + IntToStr(XpGained));
- Writeln('|= Ores mined : ' + IntToStr(OresMined));
- Writeln('|= Profit : ' + IntToStr(Profit));
- Writeln('===================================================');
- end;
- function ClickObject(col, col2, height, width, tol: integer; uptext, action: String; LeftClick: boolean): boolean;
- var
- i, x, y, cts: Integer;
- tpa: TPointArray;
- //tb: TBox;
- atpa: T2DPointArray;
- pt: TPoint;
- begin
- cts := GetColorToleranceSpeed;
- ColorToleranceSpeed(2);
- FindColorsSpiralTolerance(MSCX, MSCY, tpa, col, MSX1, MSY1, MSX2, MSY2, tol);
- if Length(tpa) = 0 then FindColorsTolerance(tpa, col2, MSX1, MSY1, MSX2, MSY2, tol);
- ColorToleranceSpeed(cts);
- atpa := TPAtoATPAEx(tpa, height, width);
- SortATPAFrom(atpa, Point(MSCX, MSCY));
- for i := 0 to High(atpa) do
- begin
- pt := MiddleTPA(atpa[i]);
- //tb := PointToBox(Point(pt.x + 15, pt.y + 15), Point(pt.x - 15, pt.y - 15));
- //SMART_DrawBox(tb);
- MMouse(pt.x, pt.y, 4, 4);
- wait(300 + random(250));
- if (IsUpText(uptext)) then
- begin
- GetMousePos(x, y);
- if (not(LeftClick)) then
- begin
- Mouse(x, y, 0, 0, False);
- wait(500 + random(150));
- ChooseOption(action);
- if (DidRedClick) then
- wait(650 + random(350));
- result := true;
- Exit;
- end else
- if (LeftClick) then
- begin
- Mouse(x, y, 0, 0, true);
- if (DidRedClick) then
- wait(750 + random(350));
- result := true;
- Exit;
- end;
- end;
- end;
- end;
- procedure Loop;
- begin
- AntiRandoms;
- if DepositScreen then
- begin
- Bank;
- end;
- if not (InvFull) then
- begin
- if (AtResource) then
- begin
- ExitResource;
- end else
- MineOre;
- end else
- if not (AtResource) then
- begin
- EnterResource;
- end else
- ClickObject(6916508, 6581876, 20, 20, 5, 'deposit', 'eposit', false);
- end;
- begin
- StartUpClient;
- SMART_ClearCanvas;
- repeat
- AntiRandoms;
- SetAngle(SRL_ANGLE_HIGH);
- LoadInfo(Ore);
- Report;
- Loop;
- FreeDTM(oreDTM);
- until (false);
- end.
Add Comment
Please, Sign In to add comment