SRL Archive - First Scripts

First Superheater


bas

2012-04-22 07:50:34

Hello, This is my first script, a IRON SuperHeater.

Hate, rate & Comment :P

Start in LUMBRIDGE BANK.
Will change to SoulWars bank soon.

Added:
Anti-ban
-Made CloseBank;

Program SuperHeater;
{$Define SMART}
{$Include SRL/SRL/Misc/SMART.simba}
{$i SRL/SRL.simba}



Var

IronOre:integer;
CastSuperHeat:integer;
BankBooth:integer;
DepositIronBar:integer;
TakeOres:integer;
x,y:integer;

Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := ''; //Username
Players[0].Pass := ''; //Password
Players[0].Active := True;
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
LampSkill := 'Magic';
end;

Procedure LoadDTM;
Begin

TakeOres := DTMFromString('mWAAAAHicY2FgYIgD4hggjgfiRCD+BMTvoPgjEJvKizMYyIgyWChKMFgrSTGwAsWQMSMaBgEArGkHCg==');
IronOre := DTMFromString('mbQAAAHicY2VgYNjExMCwFYg3QDGI3cbIwNABxE1A3AnELUBsIi/OYKMizaAnI8pgKCsGplmB+tExIxYMBgCZ3ghT');
CastSuperHeat := DTMFromString('mrAAAAHic42BgYGhlYmBoA+JuIG4A4k4oDeI3A3ERIwNDBhAXQ3EZEOdBcSkQv3u9gWGzMBPDoQUCDH8fGjJ8mM/KYMfEzPCmhpnhy8QsBjmgHfgwIwEMAwC4bxTQ');
BankBooth := DTMFromString('mbQAAAHicY2VgYDBnZGBQA2I5INYEYn0gnsGAiqcD8YblCxjWLJ7NsGrBDDC9Yek8BlagODpmxILBAABYfQ2T');
DepositIronBar := DTMFromString('mbQAAAHicY2VgYJjGxMAwFYgXMEHYPUDszMjAYA/ETkDsAcQuQBzk58dgZ2MDxooKCmCaGagfHTNiwWAAAE88B9c=');


end;

Procedure FrDTMS;
Begin
FreeDTM(IronOre);
FreeDTM(CastSuperHeat);
FreeDTM(BankBooth);
FreeDTM(DepositIronBar);
FreeDTM(TakeOres);
end;

procedure AntiBan;
begin
if not(LoggedIn)then
Exit;
case Random(175)of
0: HoverSkill('Magic', false);
1: RandomRClick;
2: BoredHuman;
3: PickUpMouse;
4: RandomMovement;
5: HoverSkill('Smithing', false);
end;
end;

procedure Start;
begin
MakeCompass('N')
wait(300);
SetAngle(SRL_ANGLE_HIGH);
wait(300);
end;

Procedure SuperHeat;
Begin
if FindDTM(CastSuperHeat, x, y, MIX1, MIY1, MIX2, MIY2) then
Begin
MMouse(X, Y + 3, 0, 0);
ClearDebug;
If WaitUptextMulti(['Superheat', 'Item'], 500) Then
Begin

Writeln('--------------------------')
Writeln('------ SuperHeater -------')
Writeln('--------------------------')
Writeln ('Selected Superheat > NEXT')
ClickMouse2(true);

wait(300);


end;
end;
end;

Procedure Item;
Begin
if FindDTM(IronOre, x, y, MIX1, MIY1, MIX2, MIY2) then
Begin
MMouse(X, Y + 3, 0, 0);

If WaitUptextMulti(['Superheat', 'Item'], 500) Then
Begin
Writeln ('Superheating > Iron Ore.')
ClickMouse2(true);

wait(600);

end;
end;
end;


Procedure Bank;
Begin
if FindDTM(BankBooth, x, y, MSX1, MSY1, MSX2, MSY2) then
Begin
MMouse(X, Y + 3, 0, 0);

If WaitUptextMulti(['Bank', 'Booth'], 500) Then
Begin
Writeln ('BANK > Banking')
ClickMouse2(true);
wait(400);

end;
end;
end;

Procedure DepositeBars;
begin

if FindDTM(DepositIronBar, x, y, MIX1, MIY1, MIX2, MIY2) then
Begin
MMouse(X, Y + 3, 0, 0);

If WaitUptextMulti(['Iron bar'], 500) Then
Begin
Writeln ('BANK > Deposite Bars.')
ClickMouse2(false);
ChooseOption('all');

end;
end;
end;

Procedure TakesOresFromBank;
begin

if FindDTM(TakeOres, x, y, MSX1, MSY1, MSX2, MSY2) then
Begin
MMouse(X, Y + 3, 0, 0);

If WaitUptextMulti(['Iron ore'], 500) Then
Begin
Writeln ('BANK > Take Ore.')
ClickMouse2(false);
ChooseOption('all');

wait(120);
CloseBank;
wait(170);
GameTab(Tab_Magic);
wait(130);
end;
end;
end;


Begin
Smart_Server := 86;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
LoadDTM;

Writeln ('Waiting 10 Seconds before starting...')
wait(10000);
GameTab(Tab_Magic);
wait(400);
Start;
wait(100);

repeat


SuperHeat;
Item;
SuperHeat;
Item;
SuperHeat;
Item;
AntiBan;
SuperHeat;
Item;
SuperHeat;
Item;
SuperHeat;
Item;
AntiBan;
SuperHeat;
Item;
SuperHeat;
Item;
SuperHeat;
Item;
SuperHeat;
Item;
SuperHeat;
Item;
SuperHeat;
Item;
AntiBan;
SuperHeat;
Item;
SuperHeat;
Item;
SuperHeat;
Item;
SuperHeat;
Item;
SuperHeat;
Item;
AntiBan;
SuperHeat;
Item;
SuperHeat;
Item;
SuperHeat;
Item;
AntiBan;
SuperHeat;
Item;
SuperHeat;
Item;
SuperHeat;
Item;
AntiBan;
SuperHeat;
Item;
SuperHeat;
Item;
SuperHeat;
Item;
SuperHeat;
Item;
AntiBan;
SuperHeat;
Item;


//BANKING

Bank;
DepositeBars;
TakesOresFromBank;

FrDTMS;
wait(200);
until(false);

end.

Mark

2012-04-22 08:07:11

Hey mate grats on first script
I can't see the whole script atm but I notice you have a DTM for close bank there is actually a function for this already is SRL called CloseBank

Will update this post when I get on pc in 10 mins will look at the rest of your code

bas

2012-04-22 08:11:15

From: CRU1Z1N
Hey mate grats on first script
I can't see the whole script atm but I notice you have a DTM for close bank there is actually a function for this already is SRL called CloseBank

Will update this post when I get on pc in 10 mins will look at the rest of your code


Hey thanks! Will update the CloseBank + add anti-ban in a few mins :)

EDIT: Done, i guess they in the correct place? :P

Olly

2012-04-22 08:19:58

Use simba tags!

bas

2012-04-22 08:25:03

From: Ollybest
Use simba tags!


I did?…

Mark

2012-04-22 08:46:43

First thing your standards are a mess so ive fixed them for you
try not to copy and paste all your code we all do it but its not good practice

i've added a mainloop which should make it easier for you to operate things within your script
i also added a counter within the main loop which counts each cast you do rather than just repeating the command 28 times

Have a look thru the SRL DOCS for alot of functions made for us all to use.

http://docs.villavu.com/srl-5/srlref.html

Compare this one with yours
Program SuperHeater;
{$Define SMART}
{$Include SRL/SRL/Misc/SMART.simba}
{$i SRL/SRL.simba}

Var
IronOre:integer;
CastSuperHeat:integer;
BankBooth:integer;
DepositIronBar:integer;
TakeOres:integer;
i,x,y:integer;

Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := ''; //Username
Players[0].Pass := ''; //Password
Players[0].Active := True;
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
LampSkill := 'Magic';
end;

Procedure LoadDTM;
Begin
TakeOres := DTMFromString('mWAAAAHicY2FgYIgD4hggjgfiRCD+BMTvoPgjEJvKizMYyIgyWChKMFgrSTGwAsWQMSMaBgEArGkHCg==');
IronOre := DTMFromString('mbQAAAHicY2VgYNjExMCwFYg3QDGI3cbIwNABxE1A3AnELUBsIi/OYKMizaAnI8pgKCsGplmB+tExIxYMBgCZ3ghT');
CastSuperHeat := DTMFromString('mrAAAAHic42BgYGhlYmBoA+JuIG4A4k4oDeI3A3ERIwNDBhAXQ3EZEOdBcSkQv3u9gWGzMBPDoQUCDH8fGjJ8mM/KYMfEzPCmhpnhy8QsBjmgHfgwIwEMAwC4bxTQ');
BankBooth := DTMFromString('mbQAAAHicY2VgYDBnZGBQA2I5INYEYn0gnsGAiqcD8YblCxjWLJ7NsGrBDDC9Yek8BlagODpmxILBAABYfQ2T');
DepositIronBar := DTMFromString('mbQAAAHicY2VgYJjGxMAwFYgXMEHYPUDszMjAYA/ETkDsAcQuQBzk58dgZ2MDxooKCmCaGagfHTNiwWAAAE88B9c=');
end;

Procedure FrDTMS;
Begin
FreeDTM(IronOre);
FreeDTM(CastSuperHeat);
FreeDTM(BankBooth);
FreeDTM(DepositIronBar);
FreeDTM(TakeOres);
end;

procedure AntiBan;
begin
if not(LoggedIn)then
Exit;
case Random(175)of
0: HoverSkill('Magic', false);
1: RandomRClick;
2: BoredHuman;
3: PickUpMouse;
4: RandomMovement;
5: HoverSkill('Smithing', false);
end;
end;

procedure Start;
begin
MakeCompass('N')
wait(300);
SetAngle(SRL_ANGLE_HIGH);
wait(300);
end;

Procedure SuperHeat;
Begin
if FindDTM(CastSuperHeat, x, y, MIX1, MIY1, MIX2, MIY2) then
Begin
MMouse(X, Y + 3, 0, 0);
ClearDebug;
If WaitUptextMulti(['Superheat', 'Item'], 500) Then
Begin
Writeln('--------------------------')
Writeln('------ SuperHeater -------')
Writeln('--------------------------')
Writeln ('Selected Superheat > NEXT')
ClickMouse2(true);
wait(300);
end;
end;
end;

Procedure Item;
Begin
if FindDTM(IronOre, x, y, MIX1, MIY1, MIX2, MIY2) then
Begin
MMouse(X, Y + 3, 0, 0);
If WaitUptextMulti(['Superheat', 'Item'], 500) Then
Begin
Writeln ('Superheating > Iron Ore.')
ClickMouse2(true);
wait(600);
end;
end;
end;


Procedure Bank;
Begin
if FindDTM(BankBooth, x, y, MSX1, MSY1, MSX2, MSY2) then
Begin
MMouse(X, Y + 3, 0, 0);
If WaitUptextMulti(['Bank', 'Booth'], 500) Then
Begin
Writeln ('BANK > Banking')
ClickMouse2(true);
wait(400);
end;
end;
end;

Procedure DepositeBars;
begin
if FindDTM(DepositIronBar, x, y, MIX1, MIY1, MIX2, MIY2) then
Begin
MMouse(X, Y + 3, 0, 0);
If WaitUptextMulti(['Iron bar'], 500) Then
Begin
Writeln ('BANK > Deposite Bars.')
ClickMouse2(false);
ChooseOption('all');
end;
end;
end;

Procedure TakesOresFromBank;
begin
if FindDTM(TakeOres, x, y, MSX1, MSY1, MSX2, MSY2) then
Begin
MMouse(X, Y + 3, 0, 0);
If WaitUptextMulti(['Iron ore'], 500) Then
Begin
Writeln ('BANK > Take Ore.')
ClickMouse2(false);
ChooseOption('all');
wait(120);
CloseBank;
wait(170);
GameTab(Tab_Magic);
wait(130);
end;
end;
end;
//added a main loop
procedure MainLoop;
begin
repeat
repeat //----------v
SuperHeat;//-------|
Item;// Added an extra loop this will cast 28 then break
Inc(i);//----------|
Until(i > 28)//-----^
//BANKING
Bank;
DepositeBars;
TakesOresFromBank;
FrDTMS;
wait(200);
until(false);
end;

Begin
SetupSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
LoadDTM;
Writeln ('Waiting 10 Seconds before starting...')
wait(10000);
GameTab(Tab_Magic);
wait(400);
Start;
wait(100);
MainLoop;
end.
keep at it we was all noobs at one point

bas

2012-04-22 08:50:34

Thanks man! :D
So all my code was alright, but the loop was a failture? :)
So this mean if i use your MainLoop for all my scripts, im gonna be alright? :P

Mark

2012-04-22 09:04:13

Pretty much yeah now you should work on removing some of those WriteLn lines and making a proggy function instead

Also Look into using Timed Loops instead of waiting helps maximize Speed and efficiency is perfect for slow computers

Simba Code:
[LEFT]MarkTime(a);// dont forget to declare a: integer;
Repeat
wait(0);
Until(FindDTM(CastSuperHeat, x, y, MIX1, MIY1, MIX2, MIY2)or TimeFromMark(a)>15000)
if TimeFromMark(a)>15000 then
begin
//Failed to superheat do something
end else
//continue

[/LEFT]

bas

2012-04-22 09:09:13

Alright i look into it, thanks for your help :)

Going to try it all with a fresh start on a Dungeoneer Farmer.
Didnt saw a DungFarmer on Simba, hope i can make the community happy with it :)

Mark

2012-04-22 09:15:32

hmm whats the xp per hour on this im sure its been mentioned before

bas

2012-04-22 09:49:59

From: CRU1Z1N
hmm whats the xp per hour on this im sure its been mentioned before


I think about 15-20K/h

bas

2012-04-22 10:15:27

Nevermind, cant get it to work…

tehq

2012-04-22 10:22:53

From: kipjes bende
Nevermind, cant get it to work…


Keep trying and don't hesitate to ask for help, great scripts don't just come together in 30 minutes ;)

Gucci

2012-04-22 10:24:30

Looks pretty nice for a first script well done, what isn't working?

bas

2012-04-22 10:32:59

My second script isnt working :P A dungeoneer farmer. Guess i have to start with something easyer.
It moves mouse over the seed, but dont click it :S also it cant find the herb patch.
Awell, as i said guess i gotta start simple(r) first :P

Gucci

2012-04-22 10:38:08

Use ACA to find good colors on the patch and use a TPA to find the patch and the clicking is just probably missing something like after having it move the mouse and a function to click there Like ClickMouse2(True);

bas

2012-04-22 10:47:27

Ill look into it when i made a few easy scripts :)
Going to try simple scripts first. eg herb cleaner :P