SRL Archive - Archive

benjaa - SRL Member Application Form


benjaa

2008-12-08 01:37:47

<!– BEGIN TEMPLATE: formanswers –>
benjaa - SRL Member Application Form
benjaa

Where you Referred to SRL? If yes, by whom?
no


Programming Knowledge
GML

Other Communitys
gmc.yoyogames.com

How Long have You Played Runescape
About 6 years

Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.

I have been scripting for quite a while on GML (GameMaker Language), until I grew bored of it and discovered SCAR. This worked out perfectly, because hitting high school I had less time to play RS, but I still really enjoyed scripting.

I think that I would be a good addition to the Members 'group' because I have a decent amount of scripting knowledge, and always pass knowledge onto people who need it - whenever I can.

I'm willing to work very hard in members, and would really enjoy to see how people have solved the problems that I have faced whilst creating scripts. I will be an active participant as I continue to learn the scripting that makes me happy, and to of course help out with testing in scripting in the future.

Below I have included a script I have been working on which utilizes SRL includes and SRL stats commands to power mine almost every rock, everywhere. Any advice would be greatly appreciated to further my scripting knowledge.

benjaa

——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted

program Powerminer;
{.include SRL\SRL.scar}
{.include SRL\SRL\Skill\Mining.scar}

//by Benjaa

const
Version = '1.6';

//~~~~~~~~~~~~Values To Edit~~~~~~~~~~~~~~~~~~~~~//
ChangeTime = 9; // Sleep/Change after this many minutes (+ Random(2) minutes)
RunDir = 's';
TimeBetweenResponds = 2; //this is the minimal amount of wait between responds (in minutes)

SRLStatsID = '';
SRLStatsPass = '';
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//


procedure DeclarePlayers;
begin
HowManyPlayers := 1; //<------- This May Need Editing
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :=''; //character name
Players[0].Pass :=''; //character password
Players[0].Nick :=''; //3-4 letters of name
Players[0].Active := True;
Players[0].Strings[1] := 'new iron'; // ore type - See line 61.
Players[0].Integers[1] := 60; // # of loads

Players[1].Name :=''; //character name
Players[1].Pass :=''; //character password
Players[1].Nick :=''; //3-4 letters of name
Players[1].Active := True;
Players[1].Strings[1] := 'new iron'; // ore type - See line 61.
Players[1].Integers[1] := 60; // # of loads

Players[2].Name :=''; //character name
Players[2].Pass :=''; //character password
Players[2].Nick :=''; //3-4 letters of name
Players[2].Active := True;
Players[2].Strings[1] := 'new iron'; // ore type - See line 61.
Players[2].Integers[1] := 60; // # of loads

Players[3].Name :=''; //character name
Players[3].Pass :=''; //character password
Players[3].Nick :=''; //3-4 letters of name
Players[3].Active := True;
Players[3].Strings[1] := 'new iron'; // ore type - See line 61.
Players[3].Integers[1] := 60; // # of loads
end;

const
oldclay = old_clay;
oldcopper = old_copper;
oldtin = old_tin;
oldiron = old_iron;
oldcoal = old_coal;
oldmith = old_mithril;
oldaddy = old_adamant;

newclay = rimmington_Clay;
newcopper = rimmington_Copper;
newtin = rimmington_Tin;
newiron = rimmington_Iron;
newgold = rimmington_Gold;
newcoal = lumbridge_Coal;
newmith = lumbridge_Mithril;
newaddy = lumbridge_Adamant;
newsilver = varrock_Silver;

{---------------------DO NOT TOUCH BELOW THIS---------------------------}

var
RanAway, Start, Rests, Changes, Responds, LastRespond, Loads, Q : integer;

procedure ProgressReport; forward;
procedure RandomsCheck; forward;

function WhichOre : integer;
begin
case Lowercase(Players[CurrentPlayer].Strings[1]) of
'new clay' : Result := newclay;
'old clay' : Result := oldclay;
'new tin' : Result := newtin;
'old tin' : Result := oldtin;
'new copper' : Result := newcopper;
'old copper' : Result := oldcopper;
'new iron' : Result := newiron;
'old iron' : Result := oldiron;
'new coal' : Result := newcoal;
'old coal' : Result := oldcoal;
'new gold' : Result := newgold;
'new silver' : Result := newsilver;
'old mith', 'old mithril' : Result := oldmith;
'new mith', 'new mithril' : Result := newmith;
'old addy', 'old adamant' : Result := oldaddy;
'new addy', 'new adamant' : Result := newaddy;
else
begin
Writeln('Invalid Rock Name');
Logout;
TerminateScript;
end;
end;
end;

procedure MiningLevelResponder;
var
MiningQuestion, MiningAnswer : array of string;
i, MiningLevel : integer;
begin
MiningQuestion := ['ining', 'ine', 'evel', 'lvl', 'evl']
for i:=0 to i= GetArrayLength(MiningQuestion)do
if(InChat(MiningQuestion[i]))then
begin
MiningLevel := GetSkillLevel('mining');
MiningAnswer := [IntToStr(MiningLevel), 'mine is '+IntToStr(MiningLevel),
'my mining level is '+IntToStr(MiningLevel), 'not as high as i want',
'99', 'only '+IntToStr(MiningLevel)]
TypeSend(MiningAnswer[Random(GetArrayLength(MiningAnswer))]);
Responds := Responds + 1;
MarkTime(LastRespond);
end;
end;

procedure GreetingResponder;
var
Greeting, Reply, Person : array of string;
i : integer;
begin
Greeting := ['ey', 'ello', 'day', 'Yo', 'azzup', 'oing', 'Hi'];
for i := 0 to i= GetArrayLength(Greeting)do
if(InChat(Greeting[i]))then
begin
Person := ['mate', 'miner', 'son', 'dude', 'noob', ''];
Reply := ['hi', 'hello', 'gday', 'hey '+Person[Random(GetArrayLength(Person))], 'sup '+Person[Random(GetArrayLength(Person))], 'yo'];
TypeSend(Reply[Random(GetArrayLength(Reply))]);
Responds := Responds + 1;
MarkTime(LastRespond);
end;
end;

procedure AutoResponder;
begin
if(not LoggedIn)then Exit;
if(TimeFromMark(LastRespond) > (TimeBetweenResponds * 60000))and(not LastChatter(Players[CurrentPlayer].Nick))then
begin
MiningLevelResponder;
case Random(2)of
0:GreetingResponder;
end;
end;
end;

procedure MoveAway;
begin
Mouse(MMCX, MMCY, 5, 5, True);
end;

procedure CheckPick;
begin
if (not LoggedIn)then Exit;
if(not FindPick)then
begin
Players[CurrentPlayer].Active := False;
Logout;
end;
end;

procedure RandomsCheck;
var
rx, ry : integer;
begin
if(not LoggedIn)then Exit;
if(FindFight)then
begin
if(FindObjCustom(rx, ry, ['andwich','urpentine', 'enie'], [5647454, 8950471, 9245063], 9))then //damn rick and sandwich
begin
Mouse(rx, ry, 4, 4, True);
Wait(500);
ClickToContinue;
end else
begin
RunTo(RunDir, True);
RanAway := RanAway + 1;
end;
end;
FindNormalRandoms;
end;

procedure AntiBan;
begin
if(not LoggedIn)then Exit;
case (Random(10))of
0, 4: PickUpMouse;
1: BoredHuman;
2: HoverSkill('mining', false);
3: RandomMovement;
end;
end;

procedure MineOre;
var
x, y, f : integer;
begin
if(not LoggedIn)then Exit;
x := MSCX;
y := MSCY;
if FindObjRock(x, y, WhichOre)then
begin
if(not FindGas(x, y))then
begin
Disguise('Found a rock... Attempting to mine');
Case (Random(3)) of
0, 2: begin
Mouse(x, y, 2, 2, False);
Wait(Random(100));
ChooseOption('Mine');//otherwise it may Examine
end;
1: Mouse(x, y, 2, 2, True);
end;
Flag;
MarkTime(f);
Disguise('Mining rock...');
repeat
Wait(400 + Random(200));
RandomsCheck;
case (Random(3))of
0: AntiBan;
end;
until (FindGas(x, y))or(IsBlackText('anage', 8))or(IsBlackText('vailable', 8))or(TimeFromMark(f) > 8000);
if(FindGas(x, y))then
MoveAway
else
Wait(500 + Random(1000));
end else
MoveAway;
end else
RandomsCheck;
end;

procedure DropOres;
var
i : integer;
begin
if(not LoggedIn)then Exit;
if(InvFull)then
begin
if(Wielding = True)then
begin
for i := 1 to 28 do
begin
DropItem(i);
FindTalk;
end;
end else
begin
for i := 2 to 28 do
begin
DropItem(i);
FindTalk;
end;
end;
Loads := Loads + 1;
end;
end;

procedure TakeARest;
begin
if(not LoggedIn)then Exit;
if(FindPick)then
begin
if(HowManyPlayers < 2)then
begin
if(TimeFromMark(Start) > ((Q + 1) * (ChangeTime + Random(2)) * 60000))then
begin
RandomsCheck;
Logout;
Disguise('Taking a rest...Zzz');
Wait((1 + random(1)) * 60000);
ActivateClient;
LoginPlayer;
Rests := Rests + 1;
Q := Q + 1;
end;
end else
begin
if(TimeFromMark(Start) > ((Q + 1) * (ChangeTime + Random(2)) * 60000))then
begin
RandomsCheck;
Logout;
Disguise('Changing Player...');
ActivateClient;
NextPlayer(True);
LoginPlayer;
Changes := Changes + 1;
Q := Q + 1;
end;
end;
end;
end;

procedure ProgressReport;
var
i :integer;
begin
ClearDebug;
Writeln('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
Writeln(' PowerMiner by Benjaa ');
Writeln(' Version '+ Version);
if(HowManyPlayers > 1)then
Writeln('~~~ Multiplayer ('+IntToStr(HowManyPlayers)+')~~~')
else
Writeln('~~~ Single Player ~~~');
for i:=0 to HowManyPlayers -1 do
Writeln(' Player['+IntToStr(i)+'] Active: '+BoolToStr(Players[i].Active));
Writeln(' Time Running: '+TimeRunning);
Writeln(' Loads: '+IntToStr(Loads));
Writeln(' Ran Away: '+IntToStr(RanAway)+' time/s');
Writeln(' Took: '+IntToStr(Rests)+' rest/s');
Writeln(' Changed player: '+IntToStr(Changes)+' time/s');
Writeln(' Responded: '+IntToStr(Responds)+' time/s');
Writeln('Please give feedback');
Writeln('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
ReportVars[1] := Loads;
SrlRandomsReport;
end;

procedure MainLoop;
begin
repeat
if(not LoggedIn)then LoginPlayer;
repeat
AutoResponder;
DropOres;
CheckPick;
MineOre;
RandomsCheck;
ProgressReport;
TakeARest;
until (Loads >= (Players[CurrentPlayer].Integers[1])) or (not LoggedIn);
if(PlayersActive >= 1)then NextPlayer(Players[CurrentPlayer].Active);
until AllPlayersInactive;
end;

begin
SetupSRL;
ScriptID := '1110';
SRLID := SRLStatsID;
SRLPassword := SRLStatsPass;
SetupMining;
DeclarePlayers;
ActivateClient;
ClearDebug;
MarkTime(Start)
MainLoop;
end.

——————————————————
<!– END TEMPLATE: formanswers –>

EDIT: Sorry, here you go. A radial walker - Start in Varrock West Bank, near the NE slots.

program WalkFromWestToEast;
{.include SRL/SRL.scar}

function WalkToFountain : boolean;
var
x, y, i : integer;
begin
if(not LoggedIn)then Exit;
SymbolAccuracy := .45;
Result := False;
MakeCompass('n');
if(RadialWalk(FindVarrockRoadColor, 180, 160, 30, 0, 0))then
begin
Flag; //just in case
Wait(400 + Random(700));
for i:=0 to 4 do
begin
if(RadialRoadWalk(FindVarrockRoadColor, 105, 75, 30, 0, 0))then
begin
Flag;
Wait(400 + Random(700));
end;
if(FindSymbol(x, y, 'water'))then
begin
Mouse(x, y, 5, 5, true);
Flag;
Break;
end;
end;
end;
Result := FindSymbol(x, y, 'water');
SymbolAccuracy := 1;
end;

function KeepWalkingToBank : boolean;
var
x, y, i : integer;
begin
if(not LoggedIn)then exit;
SymbolAccuracy := .45;
Result := false;
if(RadialRoadWalk(FindVarrockRoadColor, 45, 95, 30, 0, 0))then
begin
Flag;
Wait(400 + Random(500));
for i:=0 to 6 do
begin
if(RadialRoadWalk(FindVarrockRoadColor, 105, 75, 30, 0, 0))then
begin
FFlag(4);
Wait(400 + Random(500));
end;
if(FindSymbol(x, y, 'bank'))then
begin
Mouse(x, y, 5, 5, True);
Flag;
Break;
end;
end;
end;
Result := FindSymbol(x, y, 'bank');
SymbolAccuracy := 1;
end;

begin
SetupSRL;
ActivateClient;
ClearDebug;
if(WalkToFountain)then KeepWalkingToBank else Writeln('Nuts... didnt make it');
end.

EDIT EDIT:
And here is a simple example of Dtms use; All points have a tolerance of 10, and center point has an area of 2. No need to has the center point tolerance 255, because its in the shopscreen.

This script starts in any shop with a brown keeper in sight, opens the bank and examines the bucket using DTM.


program Dtms;
{.include SRL/SRL.scar}

var
BucketDTM : integer;

function GetShopKeeperColors : Array of integer;
begin
Result := [3301002, 5597310, 1455933];
end;

function OpenShop : boolean;
var
x, y, t : integer;
begin
if(not LoggedIn)then exit;
if(not ShopScreen)then
begin
if(FindObjCustom(x, y, ['ssistant', 'eeper'], GetShopKeeperColors, 10))then
begin
Mouse(x, y, 5, 5, False);
Wait(200 + Random(300));
ChooseOption('rade');
MarkTime(t);
repeat
Wait(100 + Random(50));
until (ShopScreen) or (TimeFromMark(t) > 8000);
end;
end;
Result := ShopScreen;
end;

procedure DeclareDTMs;
begin
BucketDTM := DTMFromString('78DA633CCAC0C050CA00064C108A614AA52B0' +
'317906604E2FF40C0B80FC8A86340038C703560DE4922D41C0612' +
'35A82A5AAAAB50D5EC41B807A739BB81441E0135E780443E0135A' +
'7814426AA8A446F495435A7804419AA9A390D9E98FECA455593EA' +
'2785AAE60090C82160D7514CF7209B038A0B0087021E75');
end;

procedure ExamineTheBucket;
var
x, y : integer;
begin
DeclareDTMs;
if(not LoggedIn)then exit;
if(not ShopScreen)then exit;
ShopSwitchTab('main');
Wait(240 + Random(70));
if(FindDTM(BucketDTM, x, y, MSX1, MSY1, MSX2, MSY2))then
begin
MMouse(x, y, 6, 6);
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
Wait(200 + Random(100));
ChooseOption('xamine');
Writeln('Hmm... very interesting.');
Wait(400 + Random(600));
CloseBank;
Logout;
end;
end;

begin
SetupSRL;
ClearDebug;
ActivateClient;
if(OpenShop)then ExamineTheBucket;
FreeDTM(BucketDTM);
end.

TheChineseMan

2008-12-08 03:51:39

hey benjaa a couple of things i got a to tell u about the script you should add some walking into it… i mean like a powerminer isnt ganna get u into members also for the random check y did u check for sandwich and rick cantthe findnormalrandoms procedure take care of that anyways i wont vote in this 1 sorry but i would shape it up if i were u.
u need to show us u have more knowlage of scripting cus i didnt even see 1 DTM in there!!

benjaa

2008-12-08 05:23:46

Sorry, I edited to add those in.

And no, FindNormalRandoms kept missing them, so I gave them a little helping hand.

EvilChicken!

2008-12-08 06:02:46

A yes from me, I like your edits! xD

benjaa

2008-12-08 06:12:57

Thankyou EvilChicken
I value your support :)

TheChineseMan

2008-12-08 06:14:24

lol ok now i see u know what ur doin yes!

benjaa

2008-12-08 06:37:46

Woohoo! thanks thechineseman and other 2 new anonymous votes :)

boberman

2008-12-08 09:31:20

Sorry, but its a no from me. The goal was to post 1 script that was good enough to get in. you have three scripts and non of them are good enough to get in as a member.

A power miner is just too simple for me, put the three scripts together and make a miner/banker and Ill reconsider (don't give up as you really aren't too far)

benjaa

2008-12-08 10:15:16

Boberman, I remember reading somewhere a while ago what SRL Members should be able to do, and someone said that if your script doesnt include it, you should whip it up separately as proof.

EDIT:
From: Boreas

DO write a script that demonstrates you know standards, player switching, and anti-randoms. If you have a script but it's p2p and no switching, write a simple power chopper and submit both. Same goes for a script that doesn't get randoms Just make sure you show you know all these basics.


But if you don't think I'm ready, thats cool.

Scaper

2008-12-08 19:09:03

yes!!!

benjaa

2008-12-08 19:34:19

:) !!!

Thankyou so much Scaper

WT-Fakawi

2008-12-09 15:30:58

In.