SRL Archive - First Scripts

Runespan Body Esshound Camper


TwilightSage

2012-05-01 21:27:20

EDIT: Alright, made some changes, but now I'm having a major problem. The script sometimes clicks on Nature Esshounds instead of Body Esshounds.

A pretty simple script, just looks for esshounds, makes sure they're body esshounds and siphons them. I'll try to add node support some time, but they seem glitchy at the moment so maybe later.

Setup: Have rune essence and be around a body esshound spawn point.

program RunespanCamper;
{$DEFINE SMART}
{$i SRL\SRL.simba}
{$i SRL/SRL/misc/paintsmart.simba}

const
Time = 3500; //Wait time inbetween checks for finding redoing siphon.
RunTime = 60; //Max run time in minutes.
var
XPStart: Integer;

Procedure DeclarePlayers;
var
i: Integer;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer :=0;
For i := 0 to HowManyPlayers-1 Do
Players[i].BoxRewards := ['mote', 'coal', 'XP'];

With Players[0] Do
Begin
Name := ''; //Username
Pass := ''; //Password
Active := True;
End;
End;

//EssHunting was created using Nemesis3X's finding NPCs tutorial
Function EssHunting(Color, Tolerance, NumOfPoints, Width, Height: Integer; Nick, Name: String): Boolean;
Var
TPAA: T2DPointArray;
TPA: TPointArray;
CTS, i, x, y: Integer;
Begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Color, MSX1, MSY1, MSX2, MSY2, Tolerance);
ColorToleranceSpeed(CTS);
TPAA := TPAToATPAEx(TPA, Width, Height);
SortATPASize(TPAA, True);
For i := 0 To High(TPAA) Do
If GetArraylength(TPAA[i]) > NumOfPoints Then
Begin
MiddleTPAEx(TPAA[i], x, y);
MMouse(x, y, 3, 3);
If (IsUpText(Nick)) Then
Begin
Result := True;
ClickMouse2(1);
Writeln('Found: ' + Name);
Break;
End;
End;
End;

Procedure Antiban;
Begin
Case Random(50) Of
0: RandomRClick;
1: HoverSkill('Runecrafting', False);
2: HoverSkill('Random', False);
3: PickUpMouse;
4: RandomMovement;
End;
End;

Procedure GainingXP;
var
XP: Integer;
Begin
Repeat
XP := GetXPBarTotal;
Wait(Time + Random(Time / 5));
Antiban;
FindNormalRandoms;
Antiban;
Until(xp = GetXPBarTotal);
End;

Procedure Proggy;
var
info1, info2, info3: String;
Begin
info1 := 'Run Time: ' + IntToStr(Round(GetTimeRunning / 60000.0)) + ' minutes';
info2 := 'Experience gained: ' + IntToStr(GetXPBarTotal - XPStart) + ' xp';
info3 := 'Average experience per hour: ' + IntToStr(Round((GetXPBarTotal - XPStart) / (GetTimeRunning / 3600000.0))) + ' xp/hr';
WriteLn(info1);
WriteLn(info2);
WriteLn(info3);
SMART_DrawTextEx(True, 10, 24, UpChars, info1, clWhite);
SMART_DrawTextEx(False, 10, 38, UpChars, info2, clWhite);
SMART_DrawTextEx(False, 10, 52, UpChars, info3, clWhite);
End;

Procedure Siphon;
Begin
If EssHunting(16632002, 10, 5, 5, 10, 'Body', 'Body esshound') Then GainingXP;
Proggy;
End;

Begin
SetupSRL;
DeclarePlayers;
If (not LoggedIn) Then
LoginPlayer;
Wait(Time * 2);
SetAngle(0);
XPStart := GetXPBarTotal;
Repeat
FindNormalRandoms;
Wait(RandomRange(Time / 5, Time));
Siphon;
Until((GetTimeRunning / 60000.0) > RunTime);
Logout;
End.

Created using YoHoJo's second video tutorial.

bas

2012-05-02 18:22:51

Try this:


Function EssHunting(Color, Tolerance, NumOfPoints, Width, Height: Integer; Nick, Name: String): Boolean;
Var
TPAA: T2DPointArray;
TPA: TPointArray;
CTS, i, x, y: Integer;
Begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Color, MSX1, MSY1, MSX2, MSY2, Tolerance);
ColorToleranceSpeed(CTS);
TPAA := TPAToATPAEx(TPA, Width, Height);
SortATPASize(TPAA, True);
For i := 0 To High(TPAA) Do
If GetArraylength(TPAA[i]) > NumOfPoints Then
Begin
MiddleTPAEx(TPAA[i], x, y);
MMouse(x, y, 3, 3);
If(WaitUpTextMulti(['ody','body'],800)) Then //ADDED THIS LINE
Begin
Result := True;
ClickMouse2(1);
Writeln('Found: ' + Name);
Break;
End;
End;
End;

xtrapsp

2012-05-02 18:37:52

From: kipjes bende
Try this:


Function EssHunting(Color, Tolerance, NumOfPoints, Width, Height: Integer; Nick, Name: String): Boolean;
Var
TPAA: T2DPointArray;
TPA: TPointArray;
CTS, i, x, y: Integer;
Begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Color, MSX1, MSY1, MSX2, MSY2, Tolerance);
ColorToleranceSpeed(CTS);
TPAA := TPAToATPAEx(TPA, Width, Height);
SortATPASize(TPAA, True);
For i := 0 To High(TPAA) Do
If GetArraylength(TPAA[i]) > NumOfPoints Then
Begin
MiddleTPAEx(TPAA[i], x, y);
MMouse(x, y, 3, 3);
If(WaitUpTextMulti(['ody','body'],800)) Then //ADDED THIS LINE
Begin
Result := True;
ClickMouse2(1);
Writeln('Found: ' + Name);
Break;
End;
End;
End;


make wait uptext time 200… 800 is excessive for uptext

nuphar

2012-05-03 10:46:04

This is such a bad script, just runs about for a bit then clicks on the nature hound, 5 minutes later it clicks on a body hound.

Kyle Undefined

2012-05-03 11:26:23

From: nuphar
This is such a bad script, just runs about for a bit then clicks on the nature hound, 5 minutes later it clicks on a body hound.


Hey, relax and take it easy. He's learning and I think it's a great start. There are plenty of other working RuneSpan scripts.

holysin

2012-05-03 12:16:42

nuphar why dont you make the script instead of complaing?

punkd

2012-05-03 14:40:22

From: nuphar
This is such a bad script, just runs about for a bit then clicks on the nature hound, 5 minutes later it clicks on a body hound.


Bellyflop off a bridge and tell me if it hurts k?

Joe

2012-05-03 16:42:54

From: nuphar
This is such a bad script, just runs about for a bit then clicks on the nature hound, 5 minutes later it clicks on a body hound.

lol you will probably get quoted quite a bit. But you should've known it would cause confusion with body and nature esshounds- you tell me the difference between them.

@Scripter- Great first script, using TPAs? Awesome.

From: punkd
Bellyflop off a bridge and tell me if it hurts k?

Kinda sore… :p

Getdropped

2012-05-03 22:25:39

From: nuphar
This is such a bad script, just runs about for a bit then clicks on the nature hound, 5 minutes later it clicks on a body hound.


I don't really get why people even post this…..

I feel this is a great start to writing scripts and i hope to see you making more! ;)

PS I just want you to know i still get yelled at for the most retarded things check out the pic i added….. People will just complain because they have nothing better to do even if its not even the script. I really hope this ……. scrub ;) doesn't ruin scripting for you people like this come with the teritory. :p Once again hope you continue with scripting ;)

TwilightSage

2012-05-04 16:18:22

From: nuphar
This is such a bad script, just runs about for a bit then clicks on the nature hound, 5 minutes later it clicks on a body hound.


This was the main problem with this script, though I think this new version shouldn't do that. It uses a better version of TPA object finding (imo), and it searches for better uptext.

Thanks for everyone's input so far. I haven't run this version for very long, mostly due to school finals taking up most of my time, but here's a new version.

program RunespanCamper;
{$DEFINE SMART}
{$i SRL\SRL.simba}

Const
Username = ''; //Username
Password = ''; //Password
Runtime = 1; //This is the run time in hours.
Time = 3250; //This is the wait time in millisecons between checks.
Var
XPStart: Integer;

Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer :=0;

With Players[0] Do
Begin
Name := Username;
Pass := Password;
BoxRewards := ['mote', 'coal', 'XP'];
Active := True;
End;
End;

Procedure Antiban;
Begin
Case Random(50) Of
0: RandomRClick;
1: HoverSkill('Runecrafting', False);
2: HoverSkill('Random', False);
3: PickUpMouse;
4: RandomMovement;
End;
End;

Procedure Proggy; //I'm using Info's instead of just putting stuff inside WriteLn because I may want to paint proggys onto the screen.
Var
Info1, Info2, Info3: String;
Begin
Info1 := 'Time Running: ' + IntToStr(GetTimeRunning / 3600000) + ' hours ' + IntToStr((GetTimeRunning mod 3600000) / 60000) + ' minutes';
Info2 := 'Experience: ' + IntToStr(GetXPBarTotal - XPStart);
Info3 := 'Experience per hour: ' + IntToStr(Round((GetXPBarTotal - XPStart) / (GetTimeRunning / 3600000.0)));
WriteLn('\\\--- Runespan Camper');
WriteLn(Info1);
WriteLn(Info2);
WriteLn(Info3);
WriteLn('///--- Created by Twilight Sage');
End;

//HueMod = H / L, SatMod = S / L, Uses Differ HSL values.
//Color is the middle HSL color, Tolerance = L
Function FindSiphon(UpText: TStringArray; Color, Tol: Integer; HueMod, SatMod: Extended): Boolean;
var
CTS, I, x, y, XP: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
Begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(HueMod, SatMod);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Color, MSX1, MSY1, MSX2, MSY2, Tol);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);

For I := 0 To High(ATPA) Do
Begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 2, 2);
If (WaitUpTextMulti(UpText, 200)) Then
Begin
Result := True;
ClickMouse2(1);
Break;
End;
End;
Repeat
XP := GetXPBarTotal;
Wait(Time + Random(Time / 50));
Antiban;
FindNormalRandoms;
Until(XP = GetXPBarTotal);
End;

Function Siphon(): Boolean;
Begin
Wait(Time);
Result := True
If FindSiphon(['body', 'ody', 'ody ess'], 16432051, 7, 0.044358223855874363, 1.676286676286672784) Then Exit //Body Esshounds
Else Result := False;
End;

Begin
SetupSRL;
DeclarePlayers;
If (not LoggedIn) Then
Begin
LoginPlayer;
Wait(6500);
End;
SetAngle(0);
XPStart := GetXPBarTotal;

Repeat
If (Siphon) Then Proggy;
Until ((GetTimeRunning / 3600000.0) > RunTime);
Logout;
End.

Joe

2012-05-04 19:53:28

I may be not seeing this… but in your TPA it just says color- and the color is not in the script anywhere. Or at least not in a global declaration where it should be. Maybe the script is just searching for the uptext?

TwilightSage

2012-05-05 06:00:20

From: JOEbot
I may be not seeing this… but in your TPA it just says color- and the color is not in the script anywhere. Or at least not in a global declaration where it should be. Maybe the script is just searching for the uptext?


It's being declared right here, in the function:
Function FindSiphon(UpText: TStringArray; Color, Tol: Integer; HueMod, SatMod: Extended): Boolean;

Why should it be declared globally? It's only ever used in this one function. If I get any sleep tonight, I'll try to fix any errors in the program, and add support for nodes (if I can get good colors), which is why color's variable.