SRL Archive - Senior Scripts and Snippets

Standing Mager/Other


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.

{ 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.

mastaraymond

2010-01-31 11:06:41

Wats up with the shit prefix? :D

The Claw

2010-01-31 11:08:44

A carry over from MageMeFast, lol

RAM

2010-02-01 13:39:54

Hey, I gave the alching a try, findinventory randoms seemed to mess the script up a bit,so i commented it out and I moved findnormal randoms to the main loop, it says "f-up a spell" each time, but it did about 1k alchs no problem, including solving bee keeper random.

The Claw

2010-03-08 09:21:25

94 mage :D

The Claw

2010-06-23 00:26:33

Ties in with http://villavu.com/forum/showpost.php?p=719250&postcount=21

Fixshit = withdraw bones from bank
Clickshit = click one bone to bury
Mageshit = the logic putting those two together to bury, withdraw, bury, withdraw

Just showing how it would be put together to do other stuff, just put the extra methods for bone burying in the case as MagicType = 'bury'…its a messy script and made for mage things atm but the logic is there. So if you do that for 10 scripts youve got 1 big script which can do heaps of stuff with multiple characters - 10 mini scripts youve got a lot of hassle, less functionality, etc.

HyperSecret

2010-06-25 09:07:33

function ClickShit needs a 'Result := True;' for the 'alching' case. It has no wait if it isn't there because it always exits the MageShit function and never sets certain variables to true and never waits.

Has gotten me from 60 to 70 mage, thanks! Planning to go to 99 over the course of the summer.

HyperSecret

2010-06-25 15:46:28


Status: <====================================>
Status: The Claw's Standing Mager
Status: Running for 53 Minutes and 5 Seconds
Status: Casted 1082 times = 70330 xp gained
Status: At a rate of 1223 casts/hour
Status: Getting approx 79495 xp/hour
Status: Peformed 0 idle actions
Status: <====================================>


Status: <====================================>
Status: The Claw's Standing Mager
Status: Running for 1 Hours, 20 Minutes and 50 Seconds
Status: Casted 1651 times = 107315 xp gained
Status: At a rate of 1225 casts/hour
Status: Getting approx 79625 xp/hour
Status: Peformed 0 idle actions
Status: <====================================>

HyperSecret

2010-07-02 19:06:32

Can you post your latest version?

The one posted above has never worked for me alching. And for some reason I can't get it fixed.

I had it fixed to work but then I had to delete the vm I had it on and never put it on my thumb drive.

The Claw

2010-07-05 12:47:34

That is the latest version, havent touched it since I posted it lol. Did you put in the Result := True you posted about earlier? I dunno if it should be/shouldnt be there, it worked for me when I uploaded it..

HyperSecret

2010-07-05 12:49:15

Yea, idk what was wrong. I couldn't get it to work. I took the functions that you had and put them into a different script with a different arrangement and way of working (a couple if then statements change) and it started to work.

I really don't know what was going wrong, it was really wierd.