SRL Archive - Archive

samuri51 - SRL Member Application


samuri51

2012-05-30 06:14:09

How Long have You Played Runescape?
8 Year(s)


Are you affilated in anyway with Jagex LTD?
No

Were you Referred to SRL?
No


What is your general programming knowledge?
A small amount of C programming from a college course, but not much.


Are you a member of any other communities?
Not scripting communities. This is my first.


Tell us about yourself…
From: samuri51
I am a computer science student at a university in Minnesota. We mostly learn theory in our classes and not a lot of raw useful programming… I've been wanting to get into an open source project for a while now to hopefully learn more about programming but didn't know where to start. Somehow through searching I found this awesome place c:. And since I'm a long time gamer spanning over many different games it made a lot of sense to try my hand at programming some Runescape. I hope to further my programming skills here and become more active in the community, so far I've learned so much… a few weeks ago there was no way I could fathom making a script but thanks to my buddies down at the help section I've managed to make a working script :D. Anyway if you want to know more feel free to ask. thanks.



Please show us one (or multiple) of your scripts.
program simplecoalpowerminer;
{$DEFINE SMART}
{$i srl/srl.simba}

// If using this in the miners guild a high angle looking North is recommended.

var
StartingXp, OriginalXp, CoalMined, TimeOut: Integer;


const
(********************Begin Setup*********************************)

SRLStats_Username = ''; // your SRL stats username
SRLStats_password = ''; // your srl stats password
Version = '1.0';
CustomMouseSpeed = 15;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; // Username?
Players[0].Pass := ''; // Password?
Players[0].Nick := ''; // 3 letters of your username (not the first letter)
Players[0].Active := True;
end;
(***************************End Setup******************************)

{Begin: Modified from MKHerbCleaner2.7 by GetDropped69}
procedure Antiban;
begin
case Random(1500) of
0..25:
begin
HoverSkill('Mining',false);
MouseBox(645,169,670,203,1);
end;
100..150:
begin
Sleep(1500+Random(1500));
end;
350..400:
begin
GameTab(tab_Friends);
Sleep(80+Random(225));
MouseBox(644,168,669,202,1);
end;
600..650:
begin
Mouse(260,160,5,6,false);
Sleep(200+Random(100));
MMouse(190,276,10,30);
Sleep(250+Random(100));
MMouse(495,45,50,50);
end;
800..850:
begin
ToggleMoneyPouch(true);
Sleep(200+Random(250));
Mouse(532,98,10,10,false);
WaitOptionMulti(['Examine money','money pouch'],200);
Sleep(500+Random(200));
ToggleMoneyPouch(false);
end;
900..950:
begin
SleepAndMoveMouse(2000+Random(2000));
end;
end;
end;
{End: Modified from MKHerbCleaner2.7 by GetDropped69}

function XPPerHour(Runtime,Gained:Extended):Extended;
begin
Result:=((Gained * 3600) / (Runtime / 1000));
end;

Function GainedXP:Extended;
begin
Result:= GetXPBarTotal - StartingXp;
end;

procedure ProgressReport;
var
TimeGone, CurrentXp, XpGain, CoalInInv: Integer;
begin
ClearDebug;
TimeGone := (GetTimeRunning/1000);
if(TimeGone = 0) then
exit;
CoalInInv := InvCount
CurrentXp := GetXPBar(1);
originalxp := GetXPBarTotal;
XpGain := (currentxp-originalxp);
begin
writeln('****************************************************************************');
writeln('****************************************************************************');
writeln('****************************************************************************');
writeln('****************************************************************************');
writeln('*Simple Coal Powerminer Version One*');
writeln('*We have mined: ' +IntToStr(CoalMined) + 'coal*');
writeln('*We have gained: ' + floattostr(GainedXp) + ' xp');
Writeln('Thats ' + FloatToStr(XpPerHour(GetTimeRunning,GainedXp))+ ' Xp Per Hour*');
writeln('*Total Running Time: ' + IntToStr(GetTimeRunning/60000) + ' Minutes*');
writeln('*****************************************************************************');
writeln('*****************************************************************************');
writeln('*****************************************************************************');
writeln('*****************************************************************************');
end;
end;

function AutoCoalColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL, R, G, B: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(1.20, 0.19);

if not (FindColorsTolerance(arP, 2237475, MSX1, MSY1, MSX2, MSY2, 7)) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
ColorToRGB(arC[i], R, G, B);

if (R >= 17) and (R <= 52) and (G >= 17) and (G <= 54) and (B >= 16) and (B <= 52) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;

Function MineCoal :Boolean;
var
a: Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
tmpCTS : Integer;
PlusOne: Integer;
counter: Integer;
begin
FindNormalRandoms;
PlusOne := InvCount+1;
if(not(LoggedIn))then Exit;
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(1.39, 0.10); //Hue and Sat here

FindColorsTolerance(TPA, AutoCoalColor, MSX1, MSY1, MSX2, MSY2, 7); //Color and tolerance here
SortTPAFrom(TPA, Point(MSCX, MSCY));
ATPA := TPAtoATPAEx(TPA, 25, 25);
SortATPAFromSize(ATPA, 500, true);

for a := 0 to High(ATPA) do
begin
MP := MiddleTPA(ATPA[a]);
MMouse(MP.X, MP.Y, 4, 4);
if WaitUptext('Mine Coal', 2000) then //Uptext of mining the rock
begin
FindNormalRandoms;
ClickMouse2(mouse_left);
Result := True;
Flag;
MarkTime(counter);
repeat
FindNormalRandoms;
AntiBan;
wait(1000);
if InvCount = plusone then
writeln('you add an ore of coal to your inventory');
until (invcount=PlusOne) or (TimeFromMark(counter) > 8000);
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;

procedure FailSafe;
var
Time, MaxTime: Integer;
begin
Time := 0;
maxTime := (RandomRange(10000, 20000));

MarkTime(Time)

repeat
if (TimeFromMark(Time) >= MaxTime) then
LogOut;
TerminateScript;
until(False);
end;

procedure Dropcoal;
Var
I : Integer;
B : TBox;
begin
FindNormalRandoms;
for i := 1 to 28 do
begin
If(ExistsItem(I))then
Begin
FindNormalRandoms;
B := InvBox(I);
If(CountColorTolerance(autocoalcolor, B.x1, B.y1, B.x2, B.y2, 20) > 50)then
Begin
MouseItem(I, mouse_Right);
WaitOption('rop', 100+Random(500));
FindNormalRandoms;
End;
End;
End;
End;

//credits: A big thanks to all the guys in the help section that helped
//me get this script into a working order.

begin
SetupSRL;
DeclarePlayers;
ActivateClient;
if not (LoggedIn) then
LogInPlayer;
if not(IsXPBarOpen) then
ToggleXPBar(True);
StartingXp := GetXPBarTotal;
MarkTime(TimeOut);
MouseSpeed := CustomMouseSpeed;
repeat
FindNormalRandoms;
MarkTime(TimeOut);
if (TimeFromMark(TimeOut) >30000) then
begin
FailSafe;
end;
MineCoal;
CoalMined := CoalMined + 1;
Dropcoal;
ProgressReport;
until(false);
end.

YoHoJo

2012-05-30 06:17:29

Very good start and all, love your enthusiasm and attitude, but this is still much too simple to earn the SRL Member rank buddy!
Keep on learning!

cause

2012-05-30 11:46:44

Yoho has summed up everyone's thoughts I think, good first try though!

P1nky

2012-05-30 15:04:06

Your on the right track, but like YoHoJo stated it's quite simple, I will have to say no on this one, try adding some walking ( DDTM/RRW/SPS/ ) along with some DTM's.

Gucci

2012-05-30 15:35:18

Pretty much been summed up by the other members but thias would be a good application script if you added walking to it (Also backup walkking would be very good for an application), and of course banking

Nava2

2012-06-02 12:23:51

I'm going to close this, it doesn't appear as though you will be getting in this time. I'm sorry!