shadeslayer
2013-04-24 16:35:08
How Long have You Played Runescape?
8 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Basic knowledge of C, C++, Java
Are you a member of any other communities?
yes, I am android kernel developer at xda
Tell us about yourself…
Please show us one (or multiple) of your scripts.
8 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Basic knowledge of C, C++, Java
Are you a member of any other communities?
yes, I am android kernel developer at xda
Tell us about yourself…
From: shadeslayer
I am bit of geek with online gaming thing.
Please show us one (or multiple) of your scripts.
Program MudGrinder;
{$DEFINE SMART8}
{$I SRL/SRL.SIMBA}
Var
BankSpot: Variant;
///////////////////////////////////////////////////////////////////////
// user setup //
///////////////////////////////////////////////////////////////////////
Const
{Break Settings}
TakeBreaks = False; // ***Do you want to take breaks?***
SwitchWorlds = False; // ***Switch worlds after a break?***
BreakIn = 600; // ***How long before we take a break? (minutes)***
BreakFor = 15; // ***How long will we break for? (minutes)***
Bir = 13; // ***Random minutes add/sub before break***
Bfr = 7; // ***Random minutes to add/subjtract from break duraction***
{Method Settings}
GrindMud = 'mud';
Procedure DeclarePlayers;
Begin
NumberOfPlayers(1);
CurrentPlayer := 0;
With Players[0] Do
Begin
Name := ''; // ***Username***
Pass := ''; // ***Password***
PIN := ''; // ***Pin**
Active := True;
Member := True;
WorldInfo := [77]; // ***Which world? Delete this line if you just want a random***
End;
BankSpot:= SRL_BANK_B; // ***Which bank?***
// ***Full list below***
//===== SRL Supported Banks ================================================
// Bank_FE (Falador East Bank)
// Bank_FW (Falador West Bank)
// Bank_VE (Varrock East Bank)
// Bank_VW (Varrock West Bank)
// Bank_GE (Varrock GE Bank)
// Bank_DR (Draynor Bank)
// Bank_AK (Al-Kharid Bank)
// Bank_EV (Edgeville Bank)
// Bank_CT (Catherby bank)
// Bank_CM (Camelot bank)
// Bank_NA (North Ardougne bank)
// Bank_SA (South Ardougne bank)
// Bank_YN (Yanille bank)
// Bank_NG (North gnome bank)
// Bank_SG (South gnome bank)
// Bank_WG (Warrior guild bank)
// Bank_FG (Fishing guild bank)
// SRL_BANK_SW (Soul Wars chest)
// SRL_BANK_CW (Castle Wars chest)
// SRL_BANK_B (Burthrope chest: outside warriors guild)
// SRL_BANK_GG (Gamer's Grotto: north of Falador)
End;
///////////////////////////////////////////////////////////////////////////////////////////
// End of user setup //
///////////////////////////////////////////////////////////////////////////////////////////
Var
ItemCount,XP,StartingExperience,Timeout: Integer;
W,X,Y,Z,RealBTime,CurrentBTime,BreakRounds,TotalBreaks: Integer;
ItemsPH,XPH: Extended;
Const
ScriptVersion = '0.1';
{*******************************************************************************
All of these mouse movements are credited to bENland100 and flight
*******************************************************************************}
//By Bandland100, modified to shift mouse speeds after every step
Procedure SuperWindMouse(xs, ys, xe, ye, gravity, wind, minWait, maxWait, maxStep, targetArea: extended);
Var
veloX,veloY,windX,windY,veloMag,dist,randomDist,lastDist,step: extended;
lastX,lastY,MSP,W: integer;
sqrt2,sqrt3,sqrt5: extended;
Begin
MSP := MouseSpeed;
sqrt2:= sqrt(2);
sqrt3:= sqrt(3);
sqrt5:= sqrt(5);
While hypot(xs - xe, ys - ye) > 1 Do
Begin
dist:= hypot(xs - xe, ys - ye);
wind:= minE(wind, dist);
If dist >= targetArea Then
Begin
windX:= windX / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
windY:= windY / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
End Else
Begin
windX:= windX / sqrt2;
windY:= windY / sqrt2;
If (maxStep < 3) Then
Begin
maxStep:= random(3) + 3.0;
End Else
Begin
maxStep:= maxStep / sqrt5;
End;
End;
veloX:= veloX + windX;
veloY:= veloY + windY;
veloX:= veloX + gravity * (xe - xs) / dist;
veloY:= veloY + gravity * (ye - ys) / dist;
if hypot(veloX, veloY) > maxStep then
Begin
randomDist:= maxStep / 2.0 + random(round(maxStep) div 2);
veloMag:= sqrt(veloX * veloX + veloY * veloY);
veloX:= (veloX / veloMag) * randomDist;
veloY:= (veloY / veloMag) * randomDist;
End;
lastX:= Round(xs);
lastY:= Round(ys);
xs:= xs + veloX;
ys:= ys + veloY;
Case Random(50) Of
1..25: W := (MSP + (Random((MSP/4))));
26..50: W := (MSP - (RandomRange((MSP/2), MSP-1)));
End;
If (W < 1) Then
W := 1;
If (lastX <> Round(xs)) Or (lastY <> Round(ys)) Then
MoveMouse(Round(xs), Round(ys));
step:= hypot(xs - lastX, ys - lastY);
//W := round((maxWait - minWait) * (step / maxStep) + minWait);
wait(W);
lastdist:= dist;
end;
If (Round(xe) <> Round(xs)) or (Round(ye) <> Round(ys)) Then
MoveMouse(Round(xe), Round(ye));
MouseSpeed := MSP;
End;
Procedure HumanMMouse(eX, eY, ranX, ranY: Integer);
Var
randSpeed: extended;
X,Y,X2,Y2,j,Dist,MP: integer;
Begin
j := MouseSpeed;
GetMousePos(X, Y);
Dist := Distance(X, Y, eX, eY);
MP := Round(Dist/150);
If MP < 0 Then
MP := 1;
randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
X2 := RandomRange(eX-(j*MP), eX+(j*MP));
Y2 := RandomRange(eY-(j*MP), eY+(j*MP));
SuperWindMouse(X, Y, X2, Y2, 11, 8, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);
GetMousePos(X, Y);
MMouse(eX, eY, ranX, ranY);
MouseSpeed := j;
End;
Procedure HumanMouseBox(X1, Y1, X2, Y2, ClickType: Integer);
Var
FX, FY: Integer;
Begin
GaussBox(FX,FY,X1,Y1,X2,Y2);
HumanMMouse(FX,FY,0,0);
Case ClickType Of
0: ClickMouse2(False);
1: ClickMouse2(True);
End;
End;
Function GrindMenu: Boolean;
Var
CTS: Integer;
Begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.02, 0.36);
If CountColorTolerance(8280838,398,361-50,480,369-50,25) > 500 Then
Result:=True;
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);
End;
Function DoneButton: Boolean;
Var
CTS: Integer;
Begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.02, 0.36);
If CountColorTolerance(8280838,223,217-50,299,233-50,20) > 100 Then
Result:=True;
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);
End;
Procedure ProgressReport;
Var
TTB: Integer;
Begin
ClearDebug;
TTB := (((W) + (Y) + BreakRounds)-GetTimeRunning);
ItemCount := ItemCount;
XP := (GetXPBarTotal - StartingExperience);
XPH := Round(XP * (3600.0 / (GetTimeRunning / 1000.0)));
ItemsPH := Round((ItemCount * (3600.0 / (GetTimeRunning / 1000.0))));
Writeln('======= ShadeSlayers MudGrinder '+ScriptVersion+' =======');
Writeln('Time Running: ' + TimeRunning);
Writeln('Items Made: ' + IntToStr(ItemCount));
Writeln('Experience Earned: ' + IntToStr(XP));
Writeln('Experience/Hour: ' + ToStr(XPH));
Writeln('Items/H: ' + ToStr(ItemsPH));
Writeln('================================');
If TakeBreaks Then
Writeln('Time until break: '+MsToTime(TTB, Time_Bare));
End;
Function BreakHandler(BreakIn, BreakFor, randBreakIn, randBreakFor: Integer): Boolean;
Var
H,M,S: Integer;
Begin
If Not LoggedIn Then
Exit;
If (HowManyPlayers = 1) Then
Begin
If (GetTimeRunning < ((W) + (Y) + BreakRounds)) Then
Exit Else
If (GetTimeRunning > ((W) + (Y) + BreakRounds)) Then
Begin
RealBTime := ((X+Z)/60000);
Writeln('Taking a break for about ' + IntToStr(RealBTime) + ' minutes.');
Logout;
MarkTime(CurrentBTime);
Repeat
Wait(21000);
ConvertTime((X+Z)-TimeFromMark(CurrentBTime),H,M,S);
Writeln('Breaktime left: '+IntToStr(H)+':'+IntToStr(M)+':'+IntToStr(S));
Until(TimeFromMark(CurrentBTime)>(X+Z));
Writeln('Logging in.');
If SwitchWorlds Then
If LoginPlayerToLob Then
ChangeWorld(RandomWorld(True, False)) Else
LoginPlayer;
Wait(4000);
Result := LoggedIn;
SetAngle(SRL_ANGLE_HIGH);
MarkTime(Timeout);
IncEx(BreakRounds, (W) + (X));
Inc(TotalBreaks);
Writeln('The next break will occur in about ' + IntToStr(BreakIn) + ' minutes.');
W := (BreakIn * 60000);
X := (BreakFor * 60000);
Y := RandomRange(-BIR * 60000, BIR * 60000);
Z := RandomRange(-BFR * 60000, BFR * 60000);
End;
End;
End;
Function WaitLoggedIn(Time:Integer): Boolean;
Var
T: Integer;
Begin
MarkTime(T);
Repeat
SRL_ResetNavBar;
If TimeFromMark(T)>Time Then
Begin
Result:=False;
Exit;
End;
Until (GetColor(472, 490) = 16777215);
Result:=True;
End;
Function Banking: Boolean;
Var
T: Integer;
Begin
If Not WaitLoggedIn(1000) Then
Exit;
MarkTime(T);
Repeat
Wait(Random(100));
If BankScreen Then
Break;
If IsUpTextMultiCustom(['Bank','Use',' chest','chest']) Then
Begin
ClickMouse2(True);
MarkTime(T);
Repeat
Wait(Random(100));
If Timefrommark(T)>6000 Then
Break;
Until BankScreen Or PinScreen;
If PinScreen Then
InPin(Players[CurrentPlayer].Pin);
If PinScreen Or BankScreen Then
Break;
End;
If OpenBank(BankSpot,True,True) Then
Break;
If (TimeFromMark(T)>10000) Or (Not WaitLoggedIn(1000)) Then
Exit;
Until (BankScreen Or Pinscreen);
If InvCount>1 Then
QuickDeposit(SRL_DEPOSIT_ALL);;
Case LowerCase(GrindMud) Of
'mud':
Begin
If (GetBankItemAmount(9,0) <= 28) Then
Begin
MarkTime(T);
Repeat
Wait(Random(100));
If Not WaitLoggedIn(1000) Then
Exit;
If TimeFromMark(T)>10000 Then
Begin
Writeln('Out of materials, top right slot. Shutting down');
Logout;
TerminateScript;
End;
Until (GetBankItemAmount(9,0) > 28)
End;
MarkTime(T);
Repeat
Wait(Random(100));
If Withdraw(9,0, 28) Then
Break;
If (TimeFromMark(T)>10000) Or (Not WaitLoggedIn(1000)) Then
Exit;
Until False;
End;
End;
CloseBank;
If LowerCase(GrindMud)='mud' Then
InvMouse(1,Mouse_Move) Else
HumanMouseBox(572,220,585,231,3);
MarkTime(T);
Result := True;
End;
Function MakeItems: Boolean;
Var
T: Integer;
Begin
If Not WaitLoggedIn(1000) Then
Exit;
Gametab(Tab_Inv);
Case LowerCase(GrindMud) Of
'mud':
Begin
InvMouse(1, Mouse_Left);
Wait(Random(100));
HumanMouseBox(300,300,437,320,2);
MarkTime(T);
Repeat
Wait(Random(100));
If (Not WaitLoggedIn(1000)) Or (TimeFromMark(T)>10000) Then
Exit;
Until GrindMenu;
ClickMouse2(True);
HumanMouseBox(232,170,284,180,2);
MarkTime(T);
Repeat
Wait(Random(100));
If (Not WaitLoggedIn(1000)) Or (TimeFromMark(T)>30000) Then
Exit;
Until DoneButton;
MarkTime(Timeout);
ClickMouse2(True);
MarkTime(T);
Repeat
Wait(Random(100));
If (Not WaitLoggedIn(1000)) Or (TimeFromMark(T)>30000) Then
Exit;
Until Not DoneButton;
Wait(Random(100));
ItemCount := ItemCount + 28;
End;
Else
Begin
Writeln('GrindMud type wrong, shutting down');
TerminateScript;
End;
End;
Result := True;
End;
Begin
ClearDebug;
Smart_FixSpeed := True;
SRL_SixHourFix := True;
SetupSRL;
DeclarePlayers;
LoginPlayer;
StartingExperience := GetXPBarTotal;
SetAngle(SRL_ANGLE_HIGH);
ToggleActionBar(False);
MarkTime(Timeout);
W := (BreakIn * 60000);
X := (BreakFor * 60000);
Y := RandomRange(-BIR * 60000, BIR * 60000);
Z := RandomRange(-BFR * 60000, BFR * 60000);
Repeat
If Not WaitLoggedIn(1000) Then
Begin
LoginPlayer;
SetAngle(SRL_ANGLE_HIGH);
MarkTime(Timeout);
End;
If Banking Then
Begin
FindNormalRandoms;
If MakeItems Then
Begin
ProgressReport;
FindNormalRandoms;
End;
End;
If TimeFromMark(Timeout)>300000 Then
Begin
Writeln('Nothing has happened for too long, shutting down!');
TerminateScript;
End;
If TakeBreaks Then
BreakHandler(BreakIn,BreakFor,Bir,Bfr);
Until AllPlayersInactive;
End.