The Claw
2010-01-31 11:04:45
Hello. This script is for the skills you can train standing in one spot - such as magic, herblore, fletching, crafting, cooking at rogue den, and prayer (f2p). Basically anything which requires short, simple loops repeated many times to train. The design is modular so that it's very easy to add new capabilities to it - all the logic is there, for most things you probably wont even need any new functions, just a few additions.
At the moment the script has support for Alching items in invent slot 16 (requires 1 nature rune, 1 fire staff, gets 65 xp per, ~70k xp an hour), and for Stunning the magic dummies at lumby (1 soul, 1 mud staff, 90 xp per, ~110k xp/hour, 80 mage required), but its not flawless - theres a few tweaks that still need to be made so it cant be run unattended yet. I've had a few runs of 1-2 hours, but wouldnt risk it.
If you make any additions, post and I'll add into the main script - would be cool to get a whole collection of things coded up and included. Its a 1 player script, so if enough things get added, you could set it up standing at a bank for example to alch for an hour, fletch a bit, cut some gems, and so on. Also has some Antiban/Idle actions that are performed every so often, dunno if it does anything in terms of stopping bans but it looks more human when youre watching it. Will release to SRL Members or everyone (havent decided) when I get 99 mage, 83 atm.
At the moment the script has support for Alching items in invent slot 16 (requires 1 nature rune, 1 fire staff, gets 65 xp per, ~70k xp an hour), and for Stunning the magic dummies at lumby (1 soul, 1 mud staff, 90 xp per, ~110k xp/hour, 80 mage required), but its not flawless - theres a few tweaks that still need to be made so it cant be run unattended yet. I've had a few runs of 1-2 hours, but wouldnt risk it.
If you make any additions, post and I'll add into the main script - would be cool to get a whole collection of things coded up and included. Its a 1 player script, so if enough things get added, you could set it up standing at a bank for example to alch for an hour, fletch a bit, cut some gems, and so on. Also has some Antiban/Idle actions that are performed every so often, dunno if it does anything in terms of stopping bans but it looks more human when youre watching it. Will release to SRL Members or everyone (havent decided) when I get 99 mage, 83 atm.
{ The Claw's Standing Mager/Other - 1/2/2010 }
program New;
const
MagicType = 'stun'; //Stun: Hide all but combat, sort by level (spell options)
//Alching: Show all, sort by level, items in inv slot 16
{.include srl/srl/misc/smart.scar}
{.include srl/srl.scar}
var
alchs, logtime, Idles, overalltimer, i, globalx, globaly, number : integer;
IdleTimer, IdleMark: Array [0..5] of Integer;
DoingShitAlready, DoNotWait, HaventCasted: Boolean;
procedure DeclareShit;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
Players[0].name := '';
Players[0].pass := '';
Players[0].nick := '';
Players[0].active := true;
end;
function ATPAShit(a : t2dpointarray) : tpointarray; //By Markus
var
i, h : integer;
begin
setlength(result, length(a));
h := high(a);
for i := 0 to h do
result[i] := MiddleTPA(a[i]);
end;
function IdleShit: Boolean;
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
IdleTimer[i] := Random((i + 1) * i) + 1 + Random(3);
AddToReport('IdleTimer[' + IntToStr(i) + '] = ' + IntToStr(IdleTimer[i]));
end;
end;
for i := 0 to 5 do
if TimeFromMark(IdleMark[i]) > (IdleTimer[i] * (60000 + Random(30000))) then
begin
AddToReport('Performing idle number ' + IntToStr(i));
Inc(Idles);
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: RandomAngle(1);
4: BoredHuman;
5: HoverSkill('magic', False);
end;
MarkTime(IdleMark[i]);
Result := True;
end;
end;
function CheckShit(const CheckType: String): Boolean;
var //substitute for uptext. not as concise, but good enough
UptextColor: Integer;
UptextColors: TPointArray;
begin
Result := False;
case Lowercase(CheckType) of
'selecting':
begin
case Lowercase(MagicType) of
'alching':
begin
if (globalx < 695) or (globalx > 705) or
(globaly < 340) or (globaly > 345) then Exit;
if (GetColor(695, 354) <> 5627371) then Exit;
UptextColor := 1370135; //green
end;
'stun':
begin
if (globalx < 615) or (globalx > 628) or
(globaly < 320) or (globaly > 334) then Exit;
if GetColor(619, 327) <> 16579836 then Exit;
UptextColor := 1370135; //green
end;
end;
end;
'casting':
begin
if (globalx < 278) or (globalx > 326) or
(globaly < 78) or (globaly > 246) then Exit; //right side of the screen
UptextColor := 1370135; //green add yellow
end;
end;
FindColorsTolerance(UptextColors, UptextColor, 5, 5, 200, 20, 30);
if not GetArrayLength(UptextColors) > 20 then Exit;
Result := True;
end;
function FixShit: Boolean;
begin
Result := False;
if not Gametab(tab_Magic) then Exit;
case Lowercase(MagicType) of
'alching':
begin
if (GetColor(695, 354) <> 5627371) then Exit;
MMouse(695, 340, 10, 5); //Alch icon
end;
'stun':
begin
if (GetColor(619, 327) <> 16579836) then Exit;
MMouse(615, 320, 13, 14); //Stun icon
end;
end;
Result := True;
end;
function FindShit(var T: TPointArray): Boolean;
var
GroupedPoints: T2DPointArray;
a: TPoint;
begin
case LowerCase(MagicType) of
'stun':
begin
a.x := 291;
a.y := 161;
FindColorsTolerance(T, 8940891, MSX1, MSY1, MSX2, MSY2, 30);
GroupedPoints := SplitTPAEx(T, 10, 10);
T := ATPAShit(GroupedPoints);
SortTPAFrom(T, a); //points found, sorted from center
Result := GetArrayLength(T) > 0;
Writeln(BoolToStr(Result));
end;
end;
end;
function ClickShit: boolean;
var
x, y, z: Integer;
FoundPoints: TPointArray;
begin
case LowerCase(MagicType) of
'alching':
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True); //now goes to inv
Wait(250 + Random(250));
Mouse(x, y, 0, 0, True);
end;
'stun':
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True); //selected spell, so find and click dummy
if not FindShit(FoundPoints) then begin Writeln('aaaa'); Exit; end;
if number = 1000 then
begin
for i := 0 to High(FoundPoints) do
begin
MMouse(FoundPoints[i].x, FoundPoints[i].y, 5, 5);
GetMousePos(globalx, globaly);
if CheckShit('casting') then Break;
end;
number := i;
end else
begin
MMouse(FoundPoints[number].x, FoundPoints[number].y, 20, 20);
GetMousePos(globalx, globaly);
end;
Mouse(globalx, globaly, 0, 0, True); //click the dummy
//DoNotWait := True;
Result := True;
end;
end;
end;
function MageShit: boolean;
var
PreWait, z: integer;
begin
Result := False;
if (not(loggedin)) then exit;
if (not(TabExists(tab_Inv) and TabExists(tab_Magic))) then
begin
writeln('No gametab =(');
FindNormalRandoms;
end;
FindNonInventoryRandoms;
GetMousePos(globalx, globaly);
case Lowercase(MagicType) of
'alching':
begin
if DoingShitAlready then //Wait after item click to go to magic tab
begin
MarkTime(z);
repeat
wait(250 + random(200));
if TimeFromMark(z) > 1000 then Break;
until GetCurrentTab = tab_Magic;
end;
end;
end;
if IdleShit then
begin
DoNotWait := True;
GameTab(tab_Magic);
end;
if not CheckShit('selecting') then
if not FixShit then Exit //spells selected by now
else
if not ClickShit then Exit;
if DoNotWait then PreWait := Random(500) else
case LowerCase(MagicType) of
'alching': PreWait := 1000 + random(500);
'stun': PreWait := 1200 + Random(350);
end;
DoNotWait := False;
MarkTime(z);
repeat
wait(100 + random(100));
until TimeFromMark(z) > PreWait;
DoingShitAlready := True;
Result := True;
end;
procedure ReportShit;
var
xp: Integer;
begin
//SRLRandomsReport;
case MagicType of
'alching': xp := 65;
'stun': xp := 90;
end;
ClearReport;
AddToReport('<====================================>')
AddToReport(' The Claw''s Standing Mager');
AddToReport(' Running for ' + TimeRunning);
AddToReport(' Casted '+inttostr(alchs)+' times = ' + IntToStr(xp*alchs) + ' xp gained');
try
AddToReport(' At a rate of '+inttostr(round(alchs div (( GetTimeRunning div 3600000.0))))+' casts/hour');
AddToReport(' Getting approx '+inttostr(round(alchs div (( GetTimeRunning div 3600000.0)))*XP)+' xp/hour');
except end; //Should work now
AddToReport(' Peformed '+inttostr(Idles)+' idle actions');
AddToReport('<====================================>')
end;
procedure DoSomeShit;
var
j: integer;
begin
J := 0;
if not MageShit then
begin
writeln('fucked up a spell');
Inc(j);
end else
begin
J := 0;
number := 1000;
end;
Inc(alchs);
if (J > 5) then
begin
writeln('5 spells in a row fucked? cant be coincidence');
TakeScreen('Casting failed');
//Logout;
Exit;
end;
ReportShit;
end;
begin
Smart_Members:= True;
Smart_Server := 111;
Smart_Signed := true;
SetupSRL;
UseAutoResponder := True;
ScriptID := '1173';
DoingShitAlready := False;
HaventCasted := True;
DeclareShit;
logtime := GetSystemTime;
number := 1000;
writeln('Loggin in');
// LoginPlayer;
writeln('done');
wait(3000 + random(5000));
SetAngle(true);
SetRun(true);
MakeCompass('n');
for i := 0 to 5 do
MarkTime(IdleMark[i]);
repeat
logtime := GetSystemTime;
if not(GameTab(tab_Magic)) then
begin
writeln('gt break');
break;
end;
repeat
DoSomeShit;
until not LoggedIn;
until(false);
end.