Markus
2011-05-30 05:04:20
Hey,
Here's a nice bolt enchanter. You might recognize some parts of it because someone dared to apply with it ;) Where's copybuster YoHoJo when you need him.
Instructions: put bolts plus runes in inventory (bolts in first slot) run. Multiplayer fully supported as usually.
Requires reflection but for low stack sizes (<10.000) bolts you could just use regular SRL, just take the two calls to r_GetStackSize (or however it is called) and a few r_FindRandoms out (which is easy, I wrapped it in one function).
This scripts borrows code heavily from Mage Me Fast, my old ruby ring alcher. I did write it from scratch in one morning.
Credits:
Plz post proggies! Stats are also fully supported so enter your details!
Markus
0.5.0:
Here's a nice bolt enchanter. You might recognize some parts of it because someone dared to apply with it ;) Where's copybuster YoHoJo when you need him.
Instructions: put bolts plus runes in inventory (bolts in first slot) run. Multiplayer fully supported as usually.
Requires reflection but for low stack sizes (<10.000) bolts you could just use regular SRL, just take the two calls to r_GetStackSize (or however it is called) and a few r_FindRandoms out (which is easy, I wrapped it in one function).
This scripts borrows code heavily from Mage Me Fast, my old ruby ring alcher. I did write it from scratch in one morning.
Credits:
- The Claw for his antiban, I ripped it out of MMF and made it work again
- Bobzilla69 for his player declaration. Ripped without permission but I could "rewrite" it if needed
- testje for applying with it for members! Good job man.
Plz post proggies! Stats are also fully supported so enter your details!
Markus
0.5.0:
////////////////////////////////////////////////////////////////////////////////
// B O L T M E B O L D L Y //
// By Markus //
// Version 0.5.0 //
////////////////////////////////////////////////////////////////////////////////
// //
// 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 :) //
////////////////////////////////////////////////////////////////////////////////
program BoldMeBoldly;
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. (hint, it's used for stats)
Debugmode = false; //True for debugmode (tons of crap in debugbox)
{.include srl/srl/misc/smart.scar}
{.include srl/srl.scar}
{.include srl/srl/skill/magic.scar}
{.include reflection/reflection.simba}
{.include srl/srl/misc/stats.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 := ''; //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? {opal, sapphire, jade, pearl, emmy, topaz, ruby, dimmy, dstone, onyx}
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;
function GetBoltXPFromID(boltID : integer) : integer;
var
arr : TIntegerArray;
begin
result := -1;
arr := [9, 17, 19, 29, 37, 33, 59, 67, 78, 97];
if (not(InRange(boltid, 0, 9))) then //exceptions are nasty to 'use'
exit;
result := arr[boltID];
end;
procedure ClickBoltEnchantThingy(boltID : integer);
var
x, y : integer;
spellbox : tbox;
timeouter : integer;
begin
if (not(loggedin)) then
exit;
R_FindRandoms;
FindNormalRandoms;
GameTab(tab_Magic);
if not SpellAvailable(spellbox, 'enchant crossbow bolt') then
begin
writeln('Spell not found! Player going inactive');
Writeln('But first checking for randoms..');
if R_FindRandoms or FindNormalRandoms then
begin
ClickBoltEnchantThingy(boltID);
Exit; //Recursion, look at this coolness ;)
end;
Players[CurrentPlayer].Rand := 'No spell';
logout;
exit;
end;
MouseBox(spellbox.x1, spellbox.y1, spellbox.x2, spellbox.y2, 1);
MarkTime(timeouter);
while not(getcolor(483, 39) = 1909802) do
begin
debug('waiting for dialog to appear');
wait(10);
FindNonInventoryRandoms;
if (TimeFromMark(timeouter) > 45000) then
begin
Writeln('Random checking..');
if R_FindRandoms or FindNormalRandoms then
begin
ClickBoltEnchantThingy(boltID);
Exit; //Recursion, look at this coolness ;)
end;
writeln('Took a year for dialog to pop up, weird..');
Players[CurrentPlayer].Rand := 'No dialog';
LogOut;
end;
end;
if OldStackSize < 10 then
begin
writeln('No bolts found! Maybe you are out of bolts =)');
writeln('Just for reference, stack size is: '+inttostr(GetItemStackSizeAt(1)));
logout;
exit;
end;
if (boltID >= 5) then
x := (boltID mod 5)*93 + 51 //bottom row
else
x := boltID*95 + 45; //Top row, Fagex slightly varies space although there are same amount of bolts top/bottom
y := (boltID div 5) * 131 + 100; //And this is pretty useless, but there is no a ? b | c in Pascal (Lape plz!!)
MouseBox(x{+32}, y{+25}, x+32, y+25, 2);//, {x{+29}{, y{+25}{,}// 2)});
wait(16+random(100)); //human reaction time, and interface might not appear directly
ChooseOption('10'); // ;-)
//MMouse(x,y,0,0);
end;
function DoClawAntiBan: Boolean; //Riped from MageMeFast, thanks KZ!
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;//+21 only thing I changed to update it
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; //Same as above, but this one leaves out the cool timers
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(boltID : integer); //Anyone up for a better name?
var
howmanyboltswedidduringthiswaitloop : integer; //Clear enough?
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..');
writeln('First we are going to check for randoms, because it seems they sometimes fail..');
if R_FindRandoms or FindNormalRandoms then
begin
writeln('We DID find a random!');
writeln('Breaking out of loop, antirandoms will log us out if we failed.');
Exit;
end;
LogOut;
Exit;
end;
if R_FindRandoms then break;
if FindNonInventoryRandoms then break; //The only inventory random left is reward box, which should be solved after it does a random??
{if (random(5) = 1) then} DoClawAntiBan; //It was a bit hyperactive because I messed up the initial wait things
wait(200+random(200));
end;
howmanyboltswedidduringthiswaitloop := OldStackSize-GetItemStackSizeAt(1);
IncEx(boltsdone, howmanyboltswedidduringthiswaitloop);
IncEx(Players[currentplayer].Integers[2], howmanyboltswedidduringthiswaitloop);
stats_IncVariable('Bolts Enchanted', howmanyboltswedidduringthiswaitloop);
IncEx(xpdone, (howmanyboltswedidduringthiswaitloop div 10)*GetBoltXPFromID(boltID)); //SHOULD WORK NOW!
IncEx(Players[currentplayer].Integers[3], (howmanyboltswedidduringthiswaitloop div 10)*GetBoltXPFromID(boltID));
OldStackSize := GetItemStackSizeAt(1); //It's better to set it here, more efficient than at start of function with regards to gametab switching
end;
procedure Report;
var
i : integer; //For player report
begin
SRLRandomsReport;
stats_Commit; //important =) It's not included in SRLRandomsReport like good ol' times
AddToReport('<=================================================================>');
AddToReport(' Enchant Ma Bolts version 0.5.0');
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))))+' xp/hour');
except end; //Should work now
//AddToReport(' Peformed '+inttostr(antibans)+' times an antiban action');
AddToReport('<=================================================================>');
AddToReport(' Name | Lv | XP | Bolts | Active | Random ');
AddToReport(' ---------------+----+---------+--------+--------+--------------- ');
for i := 0 to high(Players) do
AddToReport(' '+Padr(Players[i].Name, 14)+' | '+ //The name
Padz(IntToStr(Players[i].Level[SKILL_MAGIC]), 2) +' | '+ //Level, Padz padds 9 to 09
Padl(IntToStr(Players[i].Integers[3]), 7) + ' | ' + //The XP
Padl(IntToStr(Players[i].Integers[2]), 6) + ' | ' + //Bolts
Padl(BoolToStr(Players[i].Active), 6) + ' | ' + //True or False
Players[i].Rand);
AddToReport('<=================================================================>');
{ Look, imma designer, I first made this \/ then that ^
<=================================================================>
Name | Lv | XP | Bolts | Active | Random
---------------+----+---------+--------+--------+---------------
ImA Pirate yar | 09 | 2460049 | 100000 | False | Cap 'n Arnav
Zezima | 99 | 1337 | 35071 | True | Nolif3r
<=================================================================>
}
end;
var i : integer;
begin
Smart_Members := True;
Smart_Server := 52;
Smart_Signed := True;
Smart_SuperDetail := False;
setupsrl;
SetupReflection;
SetupSRLStats(102, YourSRLId, YourSRLPass);
DeclarePlayers;
LogInPlayer;
wait(5000+random(5000)); //it takes some time to build the interface.
for i := 0 to 5 do //Forgot to copy this one from MMF
MarkTime(AntibanMark[i]);
R_FindRandoms;
FindNormalRandoms;
repeat
logtime := GetSystemTime;
OldStackSize := GetItemStackSizeAt(1); //make this dynamic, baby
uberlogzor := (Logmins*60000)+(random(600) * 1000) + random(1000); //Randomly adds 10 mins,
writeln('Switching/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(GetBoltFromName(players[CurrentPlayer].Strings[0]));
if (not(loggedin)) then break;
until((not(loggedin)) or (GetSystemTime-logtime > uberlogzor));
Report;
NextPlayer(LoggedIn);
wait(5000+random(5000)); //idem dito
until false;
writeln('hello world');
writeln(GetItemStackSizeAt(1));
end.
.