SRL Archive - First Scripts

Auto Bolt Enchanter


SeanStar

2012-07-06 12:59:31

Profit up to 250k/h with 80k+ magic xp/h enchanting ruby bolts.
(I obviously prefer this to alching)

This script can enchant all crossbow bolts.
Just set which bolts you want to make, put the materials in your inventory and let it run.

This script has been made to try and maximize xp/h

Feedback appreciated, this it my first script.

20 Minute Proggy:


program BoltEnchanter;
{$DEFINE SMART}
{$i srl/srl.simba}

/////////////////////////////////////
// SeanStar's Bolt Enchanter //
/////////////////////////////////////

Var
EnchantBolt,BoltCount,XP,XPRates,StartTime,StartingExperience,BoltsPH,XPH,Timeout,Failed: Integer;

Const
BoltType = 7; // 1 for Opal, 2 for Sapphire, 3 for Jade, 4 for Pearl, 5 for Emerald,
//6 for Red Topaz, 7 for Ruby, 8 for Diamond, 9 for Dragonstone, 10 for Onyx

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

Players[0].Name :=''; //Username
Players[0].Pass :=''; //Password
Players[0].Active:=True;
end;

Procedure EnchantBolts;
var
x, y: Integer;
begin
EnchantBolt := DTMFromString('78DA6374606260B80CC448E0CFB749609A1188FF0301A30750FE14AA9AD54D6E703560DA02287F1AB73960DA06287F9D801A905DB709A871C45493E4C687E99E4BF8D50000C886189A');
Wait(350 + RandomRange(200, 324));
repeat
if (not Gametab(Tab_Magic)) then
Gametab(Tab_Magic);
until (Gametab(Tab_Magic));
begin
if WaitFindDTM(x, y, EnchantBolt, 5000) then
Mouse(x, y, 6, 6, mouse_left);
wait(150 + RandomRange(200, 348));

Case BoltType Of
1: begin XPRates := 9; MMouse(70, 118, 8, 9); end;
2: begin XPRates := 17; MMouse(160, 118, 8, 9); end;
3: begin XPRates := 19; MMouse(250, 118, 8, 9); end;
4: begin XPRates := 29; MMouse(340, 118, 8, 9); end;
5: begin XPRates := 37; MMouse(430, 118, 8, 9); end;
6: begin XPRates := 33; MMouse(70, 248, 8, 9); end;
7: begin XPRates := 59; MMouse(160, 248, 8, 9); end;
8: begin XPRates := 67; MMouse(250, 248, 8, 9); end;
9: begin XPRates := 78; MMouse(340, 248, 8, 9); end;
10: begin XPRates := 97; MMouse(430, 248, 8, 9); end;
end;

ClickMouse2(False);

if WaitOptionMulti(['Enchant 10', '10 stacks', 'stacks of'], 500) then
begin
FindNormalRandoms;
Gametab(Tab_Magic);
Wait(20000 + RandomRange(7, 586));
Failed := 0;
end else
begin
Inc(Failed);
WriteLn('Failed selection ' + IntToStr(Failed));
end;
if (Failed = 3) then
begin
WriteLn('Out of bolts/runes, script complete.');
FreeDTM(EnchantBolt);
Logout;
TerminateScript;
end;
end;
FreeDTM(EnchantBolt);
end;

Procedure ProgressReport;
begin

XP := (GetXPBarTotal - StartingExperience);
XPH := Round(XP * (3600.0 / (GetTimeRunning / 1000.0)));
BoltCount := Round((XP) / ((XPRates) / 10.0));
BoltsPH := Round((BoltCount * (3600.0 / (GetTimeRunning / 1000.0))));

Writeln('=========BoltEnchanter==========');
Writeln('Time Running: ' + TimeRunning);
Writeln('Experience Earned: ' + IntToStr(XP));
Writeln('Experience/Hour: ' + IntToStr(XPH));
Writeln('Bolts/H: ' + IntToStr(BoltsPH));
Writeln('Bolts Enchanted: ' + IntToStr(BoltCount));
Writeln('================================');

MarkTime(Timeout);
end;

Procedure FreeDMTs;
begin
FreeDTM(EnchantBolt);
end;

Procedure Setup;
begin
Smart_Server := 10;
Smart_Members := True;
Smart_Signed := True;
SetUpSRL;
AddOnTerminate('FreeDMTs');

DeclarePlayers;
LoginPlayer;

ToggleXPBar(True);
StartingExperience := GetXPBarTotal;
StartTime:=GetSystemTime;
MarkTime(Timeout);
end;

Procedure Antiban;
begin
Case Random(100) Of
1: HoverSkill('magic', False);
2: Boredhuman;
3: Wait(2500 + random(3868));
4: PickUpMouse;
end;
end;

begin
Setup;
repeat
EnchantBolts;
ProgressReport;
Antiban;
until (AllPlayersInactive);
end.

Ashaman88

2012-07-06 13:51:31

One thing I would suggest is instead of using a ton of if statements, just use a case.

Its used like this:

Case BoltType Of
1: Begin xprates:=3434; MMouse92434 End;
2: dslfjsklfjsld;
3: lskjdf
End;

Shortens up the code alot :) Congrats on your first script!

Silentcore

2012-07-06 14:38:46

Looks good, Might try this since im not having any luck with high lvl alch resource buying..hopefully this is good enough, if i try it, im going to come back here but post a 3 hour+ proggy..

SeanStar

2012-07-06 23:51:47

From: ashaman88
One thing I would suggest is instead of using a ton of if statements, just use a case.

Its used like this:

Case BoltType Of
1: Begin xprates:=3434; MMouse92434 End;
2: dslfjsklfjsld;
3: lskjdf
End;

Shortens up the code alot :) Congrats on your first script!


Thanks for the input! Completely passed my thought process, will implement this now.

kazzos

2012-07-07 00:32:13

thanks for the release, will test soon.

tested: works well, simple and effective

proggy 4k ruby bolts.
Time Running: 18 Minutes and 42 Seconds
Experience Earned: 23010
Experience/Hour: 73772
Bolts/H: 12504
Bolts Enchanted: 3900