SRL Archive - First Scripts

Emu's Mith Superheater


Emu

2012-02-17 08:32:14

Hey Guys! This is a really basic script i've been working on.

I didn't use 'chooseoption' because it doesn't work on my pc for some reason. All of the mouse moving case statements are pretty much in there to make the mouse look more human. (at least that's the idea)

any criticism/improvements are greatly appreciated - thanks!

http://www.youtube.com/watch?v=4oUmTluOEPQ&context=C3d03da9ADOEgsToPDskId8OUP-Wql6EtTfLoo8N51

Refer to vid for spellbook/bag layout/working location if you want to test it out.


program superheat;

{$i srl/srl.simba}

//Start at varrock N bank
//Have 5 mith bars in your inventory with nats on the last spot!
var
mith:integer;


procedure setupscript;
begin
mith:=5782330; //(581, 264) Get the color of mith ore at this spot!
end;

procedure fail;
begin
writeln('Failed - Looping Forever :(');
Logout;
repeat
wait(60000)
until(false);
end;

procedure natcheck;
var
nat, x, y:integer;
begin
writeln('Checking Inventory For Nats...');
nat:= BitmapFromString(2, 7, 'meJwTqRIUIQ4BALtHCLM=');
repeat
wait(50+random(10));
until(FindBitmapToleranceIn(nat, x, y, MIX1, MIY1, MIX2, MIY2, 10));
begin
writeln('Nats Found!');
freebitmap(nat);
end;
end;

procedure checkore;
var
ore, x, y:integer;
begin
writeln('Checking for any mith left in inventory');
ore := BitmapFromString(2, 17, 'meJxz0dN109d30dP1NDREJoGC3sZ' +
'GQIaviQmcBIowMTAAkZ5TEJDUdwmR1zE3co8EMow9o4HIzCceiMz9' +
'EoGkRUAKkGEZmAYkAU1JFxo=');
if FindBitmapToleranceIn(ore, x, y, MIX1, MIY1, MIX2, MIY2, 10) then
begin
writeln('Ore Found! - Must Have Misclicked');
Mouse(x,y,4,4,true);
wait(5+random(15));
Mouse(x,y,4,4,true);
freebitmap(ore);
end else
writeln('No Mith in Inventory :)');

end;

procedure checkmith;
var
ore, x, y:integer;
begin
writeln('Checking for Mith Before Clicking');
if (getcolor(724, 99)=mith) then
begin
writeln('Mith In Correct Spot!');
end else
begin
writeln('Mith Not Found :(');
fail;
end;
end;



Function BankBars:Boolean;
var
x,y: Integer;
begin

if FindObjCustom(x, y, ['Talk', '-to'], [4993336, 5716032], 2) then
begin
WriteLn('Found Banker...clicking');
begin
Mouse(x,y,1,2,False);
y:=(y+48+Random(5));
mouse(x, y, 40, 0, true);
end;
end;
end;




procedure BankBars2;
var
bar, x, y:integer;
begin
Case (random(10)) of
1..3: mmouse(522, 82, 80, 80);
4..6: mmouse(539, 200, 44, 66);
7..8: mmouse(387, 263, 20, 30);
end;
bar := BitmapFromString(8, 11, 'meJzzNDT0REXxDg5AhFUQTRwuiCy' +
'OLAgXRxMEIg1paSCikTjQRog4shRQMNHJEU0cIghEABkZQP4=');
repeat
wait(50+random(10));
until(FindBitmapToleranceIn(bar, x, y, MIX1, MIY1, MIX2, MIY2, 10));
begin
freebitmap(bar);
mmouse(x, y, 5, 5);
wait(200+random(200));
GetMousePos(x, y);
mouse(x, y, 0, 0, false);
wait(30+random(60));
y:=(y+39+Random(7));
mouse(x, y, 40, 2, true);
checkore;
end;
end;

Function WithdrawA:Boolean;
var
x, y, ore: Integer;
begin
ore := BitmapFromString(2, 17, 'meJxz0dN109d30dP1NDREJoGC3sZ' +
'GQIaviQmcBIowMTAAkZ5TEJDUdwmR1zE3co8EMow9o4HIzCceiMz9' +
'EoGkRUAKkGEZmAYkAU1JFxo=');
if FindBitmapToleranceIn(ore, x, y, MSX1, MSY1, MSX2, MSY2, 10) then
begin
mmouse(x, y, 5, 5);
WaitUpText('ore', 100+random(50))
WriteLn('Found mith Ore');
begin
Mouse(x,y,1,2,False);
y:=(y+39+Random(7));
mouse(x, y, 60, 1, true);
freebitmap(ore);
end;
end;
wait(20+random(50));
end;

Function WithdrawB:Boolean;
var
x, y, ore: Integer;
begin
ore := BitmapFromString(2, 11, 'meJwTk5WVVFAQwyCZGBiASMchAEj' +
'qOQXJapkauIYDGYbukUBk4hULRwAcYQtB');
if FindBitmapToleranceIn(ore, x, y, MSX1, MSY1, MSX2, MSY2, 10) then
begin
mmouse(x, y, 5, 5);
WaitUpText('oal', 100+random(50))
WriteLn('Found Coal');
begin
Mouse(x,y,1,2,False);
y:=(y+70+Random(10));
mouse(x, y, 60, 1, true);
freebitmap(ore);
closebank;
end;
end else
begin
FindBitmapToleranceIn(ore, x, y, MSX1, MSY1, MSX2, MSY2, 40)
mmouse(x, y, 5, 5);
WaitUpText('oal', 100+random(50))
WriteLn('Found Coal');
begin
Mouse(x,y,1,2,False);
y:=(y+70+Random(10));
mouse(x, y, 60, 1, true);
checkmith;
freebitmap(ore);
closebank;
end;
end;
end;




procedure smeltsteel;
var
x, y, c, t, v, b, k, l, h, j, heat, count, failure:integer;
begin
count:= 0;
heat := BitmapFromString(6, 5, 'meJxjXfCR2ecMI1cdI3c664KPbOo3' +
'gCST+CygCFt8s+Gjf8y1b3n3f4KIANHGN++BgkCSFawRiELvvAZy/' +
'/z5AySBioEIwgUAzHkuew==');
if FindbitmapToleranceIn(heat, x, y, MIX1, MIY1, MIX2, MIY2, 5) then
begin
writeln('Superheat Bitmap: Found!');
end else
begin
writeln('Could Not Find Superheat - Opening Tab');
Gametab(28);
wait(200+random(50));
FindbitmapToleranceIn(heat, x, y, MIX1, MIY1, MIX2, MIY2, 5);
end;
v:= x;
b:= y;
k:= x+random(5);
l:= y+random(5);
h:= x-random(5);
j:= y-random(5);
mmouse(x, y, 5, 5);
wait(200+random(150));
If WaitUpText('uperheat', 100+random(50)) then
begin
writeln('Superheat Co-ords saved correctly!');
end else
begin
writeln('Could Not Find Superheat :S - Attempting To Continue');

end;


repeat
failure:= 1
wait(100+random(50));
GetMousePos(x, y);
mouse(x, y, 0, 0, true);
begin
//This case will randomly 'overshoot' the mouse
//This will not allways occur and is a type of anti-ban
Case (random(100)) of
1..2: mmouse(608, 253, 20, 20);
20..29: mmouse(610, 250, 6, 3);
40..43: mmouse(611, 276, 10, 20);
96..99: mmouse(605, 270, 4, 5);
end;
end;

//579, 300 is the coords of the last iron ore - this click will never miss

repeat
begin
failure:=(failure+1)
Case (random(99)) of
1..25: mmouse(576, 256, 5, 5);
26..39: mmouse(582, 272, 6, 6);
40..75: mmouse(572, 265, 4, 5);
76..99: mmouse(578, 262, 4, 5);
end;
end;
until(WaitUpText('uperheat', 100+random(50)) or (failure=3));

wait(10+random(50));
WaitUpText('ith', 100+random(50))
wait(50+random(50));
GetMousePos(c, t);
mouse(c, t, 0, 0, true);

if (count<4) then
begin
// again this will overshoot/undershoot the superheat icon
// this will not allways happen
Case (random(100)) of
1..2: mmouse(v, b, 32, 80);
26..30: mmouse(k, l, 44, 66);
40..41: mmouse(h, j, 20, 30);
76..80: mmouse(k, j, 40, 60);
end;
Case (random(100)) of
1..25: mmouse(v, b, 4, 4);
26..39: mmouse(k, l, 2, 2);
40..75: mmouse(h, j, 1, 2);
76..99: mmouse(k, j, 2, 2);
end;
end;
repeat
wait(200+random(100));
until(FindbitmapToleranceIn(heat, x, y, MIX1, MIY1, MIX2, MIY2, 5));
begin
count:=(count+1);
wait(50+random(40));
end;
until(count=5);
begin
writeln('Smelted 5 Ores!');
Case (random(10)) of
1..3: mmouse(255, 174, 32, 80);
4..6: mmouse(262, 219, 44, 66);
7..8: mmouse(262, 117, 20, 30);
end;
end;
freebitmap(heat);
end;


begin

SetupSRL;
MouseSpeed := 10;
writeln('Starting Superheat!');
setupscript;
repeat
bankbars;
bankbars2;
withdrawA;
withdrawB;
smeltsteel;
until(false);

end.

tehq

2012-02-17 16:48:27

I'm not sure what to think of this. I looked over it quickly and i think i saw a procedure smeltsteel? Also saw many things strange things like
Case (random(10)) of
1..3: mmouse(522, 82, 80, 80);
4..6: mmouse(539, 200, 44, 66);
7..8: mmouse(387, 263, 20, 30);
end;

:confused:

Itankbots

2012-02-17 17:32:37

Looks like a butchered mix of other superheaters :s

Emu

2012-02-17 19:07:29

No, i wrote it myself - I didn't use other super heaters to write this.

The case statements do stuff like, move the mouse back to where the superheat icon is before the icon re-appears. The idea is to make it look more human, instead of reacting to the icon appearing, the script moves the mouse to where it was previously and waits for it.

edit: The smeltsteel procedure is there because it was going to smelt steel, until i realised mith/rune are more profitable.

tehq

2012-02-17 21:29:38

From: Emu
No, i wrote it myself - I didn't use other super heaters to write this.

The case statements do stuff like, move the mouse back to where the superheat icon is before the icon re-appears. The idea is to make it look more human, instead of reacting to the icon appearing, the script moves the mouse to where it was previously and waits for it.

edit: The smeltsteel procedure is there because it was going to smelt steel, until i realised mith/rune are more profitable.


Overall, a nice first script! I'd be interested to see how you update it seeing as my main script is a superheater. If you have any questions, feel free to pm me :)

Dark_Yaz

2012-02-18 04:13:21

Any1 know the xp per hour smithing wise with gold ore?