Markus
2011-04-17 07:08:51
////////////////////////////////////////////////////////////////////////////////
// B O L T M E B O L D L Y //
// By Markus //
// Version 0.4.2 //
////////////////////////////////////////////////////////////////////////////////
// //
// This script will enchants bolts at any location. Have some bolts and runes//
// in your inventory, and it'll enchant forever! Or until you're bankrupt.. //
// //
// //
// Requirements: //
// * At least 9 magic //
// * Bolts in the first inventory spots, runes in the rest //
// //
// Please post proggys :) //
// - Markus //
////////////////////////////////////////////////////////////////////////////////
program BoltMeBoldly;
const
LogMins = 30; //How often do you want to log out and switch? Script will auto add 10 mins if everything is fine.
YourSRLId = ''; //Your SRL Id, leave blank if you don't know what it is
YourSRLPass = ''; //SRL pass, same as above.
Debugmode = false; //True for debugmode (tons of crap in debugbox)
StartingFrom = 3; //Don't touch if you don't know what to do
{.include srl/srl/misc/smart.scar}
{.include srl/srl.scar}
{.include srl/srl/skill/magic.scar}
{.include reflection/reflection.simba}
//Instructions:
// Enter details
// Place bolts in first inventory slot, the rest doesn't matter
// Have fun!
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do //ripped this from bobzilla without permission
begin
Name := ''; //Username
Pass := ''; //Password
Nick := 'arko'; //3-4 non uppercase, number, or space characters on your username
Pin := ''; //Bank Pin (Blank if none)er
Active := True; //Player Active?
Strings[0] := 'diamond'; //Which bolts you gonna enchant?
end;
end;
var
boltsdone, xpdone, OldStackSize, overalltimer, uberlogzor,logtime : integer;
AntibanTimer, AntiBanMark: Array [0..5] of Integer;
procedure debug(s : string);
begin
status(s);
if (Debugmode) then
writeln(s);
end;
function GetBoltFromName(name : string) : integer;
begin
case lowercase(trim(name)) of
'opal' : result := 0;
'sapphire', 'saphire' : result := 1; //Everyone spells this wrong
'jade' : result := 2;
'pearl' : result := 3;
'emerald', 'emmy' : result := 4;
'red topaz', 'topaz' : result := 5;
'ruby' : result := 6;
'diamond', 'dimmy' : result := 7;
'dragonstone', 'dstone' : result := 8;
'onyx' : result := 9;
end;
end;
procedure ClickBoltEnchantThingy(boltID : integer);
var
x, y : integer;
spellbox : tbox;
begin
if (not(loggedin)) then
exit;
GameTab(tab_Magic);
if not SpellAvailable(spellbox, 'enchant crossbow bolt') then
begin
writeln('Spell not found! Player going inactive');
logout;
exit;
end;
MouseBox(spellbox.x1, spellbox.y1, spellbox.x2, spellbox.y2, 1);
while not(getcolor(483, 39) = 1909802) do
begin
debug('waiting for dialog to appear');
wait(10);
FindNonInventoryRandoms;
end;
if OldStackSize < 10 then
begin
writeln('No bolts found! Maybe you are out of bolts =)');
logout;
exit;
end;
if (boltID >= 5) then
x := (boltID mod 5)*93 + 51 //bottom row
else
x := boltID*95 + 45;
y := (boltID div 5) * 131 + 100;
MouseBox(x{+32}, y{+25}, x+32, y+25, 2);//, {x{+29}{, y{+25}{,}// 2)});
wait(16+random(100)); //human reaction time
ChooseOption('10');
//MMouse(x,y,0,0);
end;
function DoClawAntiBan: Boolean; //Riped from MageMeFast
var
z, c, i, x, y: Integer;
begin
if TimeFromMark(OverallTimer) > 10 * 60000 then
begin
ClearReport;
MarkTime(OverallTimer);
for i := 0 to 5 do
begin
AntibanTimer[i] := Random((i + 1) * i) + 1 + Random(3);
AddToReport('AntibanTimer[' + IntToStr(i) + '] = ' + IntToStr(AntibanTimer[i]));
end;
end;
for i := 0 to 5 do
if TimeFromMark(AntiBanMark[i]) > (AntibanTimer[i] * (60000 + Random(30000))) then
begin
AddToReport('Performing antiban number ' + IntToStr(i));
case i of
0: begin MMouse(RandomRange(0, 760), RandomRange(0, 500), 0, 0); Wait(Random(1500) + Random(500)); end;
1: begin
MMouse(RandomRange(0, 760), RandomRange(0, 500), 0, 0);
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
Wait(Random(3000));
MMouse(RandomRange(0, 760), RandomRange(0, 500), 0, 0);
Wait(Random(2000));
end;
2: Wait(Random(15000));
3: begin
repeat
c := Random(13) + 21;
GameTab(c);
Wait(Random(2000));
inc(z);
until z >= 3;
// GameTab(4);
end;
4: BoredHuman;
5: HoverSkill('magic', False);
end;
MarkTime(AntiBanMark[i]);
Result := True;
end;
end;
procedure ForceClawAntiban;
var x, y, c, z : integer;
begin
z := 0;
case random(5) of
0: begin MMouse(RandomRange(0, 760), RandomRange(0, 500), 0, 0); Wait(Random(1500) + Random(500)); end;
1: begin
MMouse(RandomRange(0, 760), RandomRange(0, 500), 0, 0);
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
Wait(Random(3000));
MMouse(RandomRange(0, 760), RandomRange(0, 500), 0, 0);
Wait(Random(2000));
end;
2: Wait(Random(15000));
3: begin
repeat
c := Random(13) + 21;
GameTab(c);
Wait(Random(2000));
inc(z);
until z >= 3;
// GameTab(4);
end;
4: BoredHuman;
5: HoverSkill('magic', False);
end;
end;
procedure WaitWhileBeingLeet;
var
howmanyboltswedidduringthiswaitloop : integer;
TimeOut : integer;
begin
if (not(loggedin)) then
exit;
if random(2) = 1 then ForceClawAntiban;
wait(1000+random(2500));
TimeOut := GetSystemTime;
while (GetItemStackSizeAt(1) > Max(0, OldStackSize-100)) do
begin
if ((GetSystemTime-TimeOut) > 2*60000) then //2 minutes, it usually takes 20 seconds :p
begin
writeln('It''s taking a "bit" too long, logging out!');
LogOut;
Exit;
end;
if FindNonInventoryRandoms then break;
if R_FindRandoms then break;
if (random(5) = 1) then DoClawAntiBan;
wait(200+random(200));
end;
howmanyboltswedidduringthiswaitloop := OldStackSize-GetItemStackSizeAt(1);
IncEx(boltsdone, OldStackSize-GetItemStackSizeAt(1));
OldStackSize := GetItemStackSizeAt(1);
end;
procedure Report;
begin
SRLRandomsReport;
AddToReport('<==========================================================>')
AddToReport(' Bolt Me Boldly version 0.1');
AddToReport(' Bolting for ' + TimeRunning);
AddToReport(' Bolted '+inttostr(boltsdone div 10)+' times');
try
AddToReport(' At a rate of '+inttostr(round(boltsdone div (( GetTimeRunning div 3600000.0))))+' bolts/hour');
AddToReport(' Getting approx '+inttostr(round(xpdone div (( GetTimeRunning div 3600000.0)))*65)+' xp/hour');
except end; //Should work now
//AddToReport(' Peformed '+inttostr(antibans)+' times an antiban action');
AddToReport('<==========================================================>')
end;
var i : integer;
begin
Smart_Members := True;
Smart_Server := 52;
Smart_Signed := True;
Smart_SuperDetail := False;
setupsrl;
SetupReflection;
DeclarePlayers;
LogInPlayer;
for i := 0 to 5 do //Forgot to copy this one from MMF
MarkTime(AntibanMark[i]);
repeat
logtime := GetSystemTime;
OldStackSize := GetItemStackSizeAt(1); //make this dynamic, baby
uberlogzor := (Logmins*60000)+(random(600) * 1000) + random(1000); //Randomly adds 10 mins,
writeln('Logging out in '+inttostr(UberLogzor div 60000)+' minutes and '+inttostr(uberlogzor mod 60000 div 1000)+' seconds'); //<3 MMF
repeat
ClickBoltEnchantThingy(GetBoltFromName(players[CurrentPlayer].Strings[0]));
WaitWhileBeingLeet;
if (not(loggedin)) then break;
until((not(loggedin)) or (GetSystemTime-logtime > uberlogzor));
Report;
NextPlayer(LoggedIn);
until false;
writeln('hello world');
writeln(GetItemStackSizeAt(1));
end.
Pre-Alpha but it runs.10 points for the first one who knows what script this is based on (code-wise) ;)