I definitely learned a lot from making this small script, and I only have one main question. How do I slow down this cracked out mouse lol. It moves way faster than I want it to and I haven't been able to slow it down through searching or google (everything I find is outdated). Besides that it runs pretty well, throw in some anti ban and it could probably be used normally. Also when making this script the login screen seems broken, so I removed logging in, as well as I could not get any banks to work so this specifically will work at the GE standing next to the bankers.
I did use some code from StickToTheScript's tutorial, which I mention in the comments before the procedure.
Code:
program EmeraldRingEnchanter;
{$I SRL/OSR.simba}
var
EmeraldRingDTM := DTMFromString('mrAAAAHic42BgYKhkZGAoBOIiIC4F4hogbgDiRiCuAuJEoJpYIE4G4iwgzgHiTCBOgor/vqMAJBnxYOoAAJqKCPY=');
RingOfDuelingDTM := DTMFromString('m6wAAAHic42ZgYMhnYmAoAuIMIE4B4nQmiFgxFJdCcTYQczAyMPwF6mEG0txALADEgkDMxwiRYwViBiBmAuLPV2UhHKIwzQEACfUIKg==');
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enchant the emerald rings in the inventory manually for faster xp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
function Enchant(): boolean;
var
o: int32;
items: array of int32;
begin
items := Inventory.FindDTM(EmeraldRingDTM);
if items = [] then
begin
result := False;
exit;
end else
o := items[0] - 1;
begin
while o < 27 do
begin
wait(randomRange(150, 500));
Spells.Cast(CAST_LVL2_ENCHANT);
wait(randomRange(150, 500));
Inventory.MouseSlot(items[o]);
wait(randomRange(50, 300));
Mouse.Click(mouse_Left);
wait(randomRange(650, 1000));
o += 1;
Result := True;
end else
result := False;
exit;
end;
end;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
StickToTheScript's cabbage finder from his tutorial, repurposed to find GE bank,
(when I made this i couldn't get the SRL banking to work
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
procedure findBanker();
var
TPA, Banker: TPointArray;
ATPA: T2DPointArray;
begin
if not SRL.isLoggedIn() then
TerminateScript;
if (SRL.FindColors(TPA, CTS2(7105908, 5, 0.51, 0.11), MainScreen.GetBounds) > 0) then //If we find colours at all then...
begin
ATPA := TPA.Cluster(2);
ATPA.FilterSize(100, 500);
ATPA.SortByIndex(MainScreen.GetMiddle);
for Banker in ATPA do
begin
Mouse.Move(Banker[Random(Length(Banker))]);
if MainScreen.IsUpText('Bank') and ChooseOption.Open() and ChooseOption.Select('Bank Banker') then //If the uptext is 'Cabbage', try to click it
begin
wait(randomRange(150, 300));
Break;
end;
end;
end;
end;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
open the bank, deposit all rings of dueling and withdraw more emerald rings,
then close the bank
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
function doBank(): boolean;
var
i: int32;
items: array of int32;
begin
findBanker
if BankScreen.IsOpen(5000) then
begin
wait(randomRange(150, 500));
items := Inventory.FindDTM(RingOfDuelingDTM, 1);
if items <> [] then
begin
wait(randomRange(150, 500));
BankScreen.DepositItem(items[0], TRUE);
writeln('in here');
end else
wait(randomRange(150, 500));
i := BankScreen.FindDTM(EmeraldRingDTM);
writeln(i);
wait(randomRange(150, 500));
bankscreen.Withdraw(i, -1, ['Emerald ring']);
BankScreen.Close();
Result := True;
end;
end;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main Loop, no end condition, run at your own risk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
begin
repeat
enchant;
doBank;
until(false);
end;