jelknab
2013-04-29 15:44:57
How Long have You Played Runescape?
4 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
I used to script Expression 2, a script used for a mod in a game called Gmod. It is very similar to LUA.
So I think it's fair to say I know Lua quite a bit.
I recently started making scripts for OSR. It is quite easy to understand, so I do not have a lot of trouble writing my scripts.
Are you a member of any other communities?
I've been member of Vinsert.org for a very short period, but they had very little tutorials or help for beginning scripters.
Tell us about yourself…
Please show us one (or multiple) of your scripts.
The first script I've ever wrote was: "Seers_magicChopper", so please know it might contain a few flaws and it possably has some bad scripting in it, you can find it here:
http://villavu.com/forum/showthread.php?t=101312
Second was: "Master_thiever", in this script i started experiementing with walking methods. I used SPS with a custom map in the Magic_cutter script, but I like my DTM/Radialwalk method more in the master_thiever script. In this script I've possably learned most about for loops, I've spend a lot of time making a progress report with all the seeds it collected in it. This took me a lot of efford to do, but I was happy with the result.
http://villavu.com/forum/showthread.php?t=101676
My latest and unpublished script is: "Catherby_fisher", I've had this script running for over 27 hours, sadly it didn't support every random it encountered so the fish per hour wasn't too high, but it still ran very smooth. I am still working on the big_net fishing part, but it is pretty solid. (Please know when testing this you should start anywhere between the bank and the first fishing spot).
The script is the one below.
4 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
I used to script Expression 2, a script used for a mod in a game called Gmod. It is very similar to LUA.
So I think it's fair to say I know Lua quite a bit.
I recently started making scripts for OSR. It is quite easy to understand, so I do not have a lot of trouble writing my scripts.
Are you a member of any other communities?
I've been member of Vinsert.org for a very short period, but they had very little tutorials or help for beginning scripters.
Tell us about yourself…
From: jelknab
I am 16 years old, live on a rather small island in The Netherlands. I'm one of the social types. I love to be a helping hand. I started playing runescape after a while again because of the 07 servers and I'm quite enjoying my time now.
I'm currently in college, following a study route for: "personnel and labor provisions". In the weekends I work as breakfast assistant and as waiter in a hotel. And every now and then I get called for babysitting.
My hobbies include skiing and cycling as well as all kinds of computer games, I go skiing atleast once a year. Usually in Bulgaria.
Please show us one (or multiple) of your scripts.
The first script I've ever wrote was: "Seers_magicChopper", so please know it might contain a few flaws and it possably has some bad scripting in it, you can find it here:
http://villavu.com/forum/showthread.php?t=101312
Second was: "Master_thiever", in this script i started experiementing with walking methods. I used SPS with a custom map in the Magic_cutter script, but I like my DTM/Radialwalk method more in the master_thiever script. In this script I've possably learned most about for loops, I've spend a lot of time making a progress report with all the seeds it collected in it. This took me a lot of efford to do, but I was happy with the result.
http://villavu.com/forum/showthread.php?t=101676My latest and unpublished script is: "Catherby_fisher", I've had this script running for over 27 hours, sadly it didn't support every random it encountered so the fish per hour wasn't too high, but it still ran very smooth. I am still working on the big_net fishing part, but it is pretty solid. (Please know when testing this you should start anywhere between the bank and the first fishing spot).
The script is the one below.program Catherby_fisher;
{$DEFINE SMART}
{$I SRL-OSR/SRL.Simba}
{$i SRL-OSR\SRL\misc\SmartGraphics.simba}
var
BankDTM, Index, FishSpot, succes, LastInvCount, prevHP, LastChat : integer;
frmDesign: TForm;
Button1: TButton;
Labels: Array [0..6] Of TLabel;
Edits: Array [0..4] Of TEdit;
LabelName: Array Of String;
ComboBox1: TComboBox;
//Fishvars
Name, OptionName, SpotName, ToolName : string;
ReservedSlots, FishCount : integer;
Standing : boolean;
FishName : array of string;
FishDTM, cought : array of integer;
// FORM
Procedure ButtonClick(Sender: TObject);
Begin
frmDesign.ModalResult:= mrOk;
End;
procedure InitForm;
begin
frmDesign := CreateForm;
frmDesign.Left := 100;
frmDesign.Top := 100;
frmDesign.Width := 650;
frmDesign.Height := 200;
frmDesign.Caption := 'Catherby fisher set-up';
frmDesign.Color := ClWhite;
Button1 := TButton.Create(FrmDesign);
Button1.Parent := FrmDesign;
Button1.Left := 10;
Button1.Top := 160;
Button1.Height := 30;
Button1.Width := 150;
Button1.Caption := 'Start script';
Button1.OnClick := @ButtonClick;
LabelName := ['Username', 'Password', 'Nickname', 'PIN', 'Method', 'Part of your name without uppercase letters', 'By Jelknab'];
For Index := 0 To 6 Do
Begin
Labels[Index] := TLabel.Create(FrmDesign);
Labels[Index].Parent := FrmDesign;
Labels[Index].Left := 10;
Labels[Index].Top := 10 + (30 * Index);
If (index = 5) then
begin
Labels[Index].Left := 410;
Labels[Index].Top := 10 + (30 * 2);
end;
If (index = 6) then
begin
Labels[Index].Left := 575;
Labels[Index].Top := 10;
end;
Labels[Index].Caption := LabelName[Index];
End;
For Index := 0 To 3 Do
Begin
Edits[Index] := TEdit.Create(FrmDesign);
Edits[Index].Parent := FrmDesign;
Edits[Index].Top := 10 + (30 * Index);
Edits[Index].Left := 200;
Edits[Index].Width := 200;
Edits[Index].Height := 20;
End;
ComboBox1 := TComboBox.Create(FrmDesign);
ComboBox1.Parent := FrmDesign;
ComboBox1.Top := 130;
ComboBox1.Left := 200;
ComboBox1.Width := 200;
ComboBox1.Height := 20;
ComboBox1.Items.Add('Harpoon - Shark');
ComboBox1.Items.Add('Harpoon - Swordfish/Tuna');
ComboBox1.Items.Add('Cage');
ComboBox1.Items.Add('Bait');
ComboBox1.Items.Add('Big Net');
end;
procedure SafeInitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;
procedure ShowFormModal;
begin
frmDesign.ShowModal;
end;
procedure SafeShowFormModal;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;
// END OF FORM
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(1);
CurrentPlayer := 0;
Players[0].Name := Edits[0].text;
Players[0].Pass := Edits[1].text;
Players[0].Nick := Edits[2].text;
Players[0].Pin := Edits[3].text;
Players[0].Active:=True;
Players[0].LampSkill:= skill_fishing;
SetScreenName(Players[0].Nick);
end;
procedure DeclareSpot;
begin
case ComboBox1.TEXT of
'Cage': begin
Name := 'Catherby lobster fishing'
ReservedSlots := 1;
SpotName := 'Cag';
OptionName := 'age';
ToolName := 'obster';
SetArrayLength(FishName, 1);
SetArrayLength(Cought, 1);
SetArrayLength(FishDTM, 1);
FishName[0] := 'lobster';
FishDTM[0] := DTMFromString('mbQAAAHicY2VgYOABYiYgFgdiUSCWB2JpIJYEYgUgZgNiTgYQYMSCMQFOVQBDbgDM');
end;
'Harpoon - Shark': begin
Name := 'Catherby Shark fishing'
ReservedSlots := 1;
SpotName := 'et';
OptionName := 'arpo';
ToolName := 'arpoon';
SetArrayLength(FishName, 1);
SetArrayLength(Cought, 1);
SetArrayLength(FishDTM, 1);
FishName[0] := 'Shark';
FishDTM[0] := DTMFromString('mbQAAAHicY2VgYBACYnYg5gZiBSAWB2JhIFaGiqtA8cy+XiDJiIJZGTABIxYMBgC7CAKo');
end;
'Harpoon - Swordfish/Tuna': begin
Name := 'Catherby harpoon fishing'
ReservedSlots := 1;
SpotName := 'Cag';
OptionName := 'arpo';
ToolName := 'arpoon';
SetArrayLength(FishName, 2);
SetArrayLength(Cought, 2);
SetArrayLength(FishDTM, 2);
FishName[0] := 'Swordfish';
FishName[1] := 'Tuna';
FishDTM[0] := DTMFromString('mWAAAAHicY2FgYGAFYhEgVgZiWShmBmIBIBZjAAFGNIwKsMkCAC4UAKw=');
FishDTM[1] := DTMFromString('mggAAAHicY2NgYJAAYg4gFgNiZSBWAGJxIBYBYmkgZgdiYagaGSBev3gxkGTEwKwM2AGmSgiGAAAE9gMJ');
end;
'Big Net': begin
Name := 'Catherby bignet fishing'
ReservedSlots := 1;
SpotName := 'Net';
OptionName := 'et';
ToolName := 'ig';
SetArrayLength(FishName, 7);
SetArrayLength(Cought, 7);
SetArrayLength(FishDTM, 7);
FishName[0] := 'Bass';
FishName[1] := 'Cod';
FishName[2] := 'Mackerel';
FishName[3] := 'Oyster';
FishName[4] := 'Casket';
FishName[5] := 'seaweed';
FishName[6] := 'boot';
FishDTM[0] := DTMFromString('mWAAAAHicY2FgYBAEYkYglgZifiDmBWIxKJsJiOenRUFVwDAqYMQiCwBnqAHb');
FishDTM[1] := DTMFromString('mWAAAAHicY2FgYGAFYmEgFgFiOSCWBGI2IBYHYg4GEGBEw6gAmywAJ9wAlQ==');
FishDTM[2] := DTMFromString('mWAAAAHicY2FgYGAFYhkgVgRiPiCWgIoJALEkAwgwomFUgE0WACuYAKM=');
FishDTM[3] := DTMFromString('mbQAAAHicY2VgYJACYhYgFgBiUSCWB2IRIOYBYmYglobKiQgKAklGNIwJ0FXAVQEATUoA9Q==');
FishDTM[4] := DTMFromString('mbQAAAHicY2VgYJAAYhkgZgNiHiBWhIpxAjEfECtB5S+/AZGMaBgToKuAqwIAwnICvg==');
FishDTM[5] := DTMFromString('mbQAAAHicY2VgYBAGYgEgFgNiFiBWAmJRIGYHYmUglgZifgYQYMSCMQFOVQBHIgDY');
FishDTM[6] := DTMFromString('mbQAAAHicY2VgYBAFYnYglgJifiBWBGJhIJYDYhUg5gBiHgYQYMSCMQFOVQBKQQDf');
end;
'Bait': begin
Name := 'Catherby bait fishing'
ReservedSlots := 2;
SpotName := 'Net';
OptionName := 'ait';
ToolName := 'ishing';
Standing := true;
SetArrayLength(FishName, 2);
SetArrayLength(Cought, 2);
SetArrayLength(FishDTM, 2);
FishName[0] := 'Sardine';
FishName[1] := 'Herring';
FishDTM[0] := DTMFromString('mbQAAAHicY2VgYOAAYnYg5gZiIQYIAInxQNksQMwLxKtPrAGSjCiYlQETMGLBYAAAqDAChA==');
FishDTM[1] := DTMFromString('mWAAAAHicY2FgYGAFYmkgVgBiISAWBWJGIOYBYhEGBigPGaMCbLIAKEgAlQ==');
end;
end;
end;
procedure LoadDTM;
begin
BankDTM := DTMFromString('mWAAAAHicY2FgYAgCYi8gdgdiJyC2B2I7ILYCYlsg/vOHCYzfvmVg+PqVgYGfARUzomEQAAD9rQoW');
FishSpot := DTMFromString('mbQAAAHicY2VgYJBhgAABIFYGYm4gNgDiYCBWg8pZg+QCpRisnXzANAgfO+oOVo+MjYCYEQ2zQs1gAABsHwZQ');
end;
procedure FreeMyDTM;
var
I : integer;
begin
FreeDTM(BankDTM)
FreeDTM(FishSpot)
for I:=low(FishDTM) to high(FishDTM) do
begin
FreeDTM(FishDTM[I])
end
end;
procedure WaitCustom;
begin
case random(1000) of
1..500: Wait(RandomRange(150, 500));
501..700: Wait(RandomRange(225, 750));
701..950: Wait(RandomRange(350, 900));
951..1000: Wait(RandomRange(500, 1100));
end;
end;
procedure WalkSpot(Searchbox : Tbox; Tostart : boolean);
var
x, y :integer;
aFound : extended;
begin
if not tostart then
begin
if FindColorTolerance(x, y, 16745757, Searchbox.x1, Searchbox.y1, Searchbox.x2, Searchbox.y2,75) then
begin
decex(y, 5)
Mouse(x, y, 5, 5, true);
WriteLn('Moving to next spot...')
end;
end else
begin
repeat
if not loggedin then LoginPlayer;
if FindColorTolerance(x, y, 16745757, Searchbox.x1, Searchbox.y1, Searchbox.x2, Searchbox.y2,75) then
begin
Mouse(x, y, 5, 5, true);
WriteLn('Moving to first spot...')
end;
WaitCustom;
until FindDTMRotated(FishSpot, x, y, MMX1, MMY1, MMX2, MMY2, -Pi / 4, Pi / 4, Pi / 50, aFound)
end;
end;
procedure WalkTo(Place:string);
var
X, Y, FailSaveCount, DistanceToTarget, RadS, RadE, I, thecolor, L : integer;
ColorRoad : Tintegerarray;
aFound: extended;
Foundcolors: array of integer;
Arrived, Failed, SeeLocation : boolean;
P : Tpoint;
begin
repeat
if not loggedin then LoginPlayer;
MakeCompass('N');
SMART_ClearCanvas;
SeeLocation := false;
// Area detection \\
if (Place = 'Bank') then
begin
if FindDTMRotated(BankDTM, x, y, MMX1, MMY1, MMX2, MMY2, -Pi / 4, Pi / 4, Pi / 50, aFound) then
begin
incex(y, 10);
SeeLocation := true;
SMART_DrawBox(IntToBox(x - 20, y - 20, x + 10, y + 10));
SMART_DrawLine(false, IntToPoint(MMCX, MMCY), IntToPoint(x, y), 4);
end;
RadS := 240;
RadE := 320;
end;
if (Place = 'FishSpot') then
begin
if FindDTMRotated(FishSpot, x, y, MMX1, MMY1, MMX2, MMY2, -Pi / 4, Pi / 4, Pi / 50, aFound) then
begin
Incex(y, 15);
Decex(x, 15);
SeeLocation := true;
SMART_DrawBox(IntToBox(x - 20, y - 20, x + 10, y + 10));
SMART_DrawLine(false, IntToPoint(MMCX, MMCY), IntToPoint(x, y), 4);
end;
RadS := 90;
RadE := 115;
end;
DistanceToTarget := distance(MMCX, MMCY, x, y);
// Walking \\
if FindFlag(P) then inc(FailSaveCount);
if not FindFlag(P) or (FailSaveCount > 20) then
begin
FailSaveCount := 0;
If SeeLocation then
begin
mouse(x, y, 3, 3, true)
WriteLn('Found ' + Place + ' DTM')
writeLn('Using a direct click...')
end else
begin
WriteLn('Could not find ' + Place + ' DTM')
WriteLn('Using radialwalk...')
Colorroad := [7171189, 6381929, 6447465, 6119013, 6184293, 6579051, 6579307, 4605517, 4408395, 4144966];
SetArrayLength(Foundcolors, 0);
for I:=0 to high(Colorroad) do
begin
if FindColorSpiralTolerance(x, y, Colorroad[I], mmx1, mmy1, mmx2, mmy2, 6) then
begin
L := length(Foundcolors) + 1;
SetArrayLength(Foundcolors, L);
Foundcolors[L-1] := I;
end;
end;
for I:=low(Foundcolors) to high(Foundcolors) do
begin
writeLn(IntTostr(Foundcolors[I]))
thecolor := Foundcolors[random(length(Foundcolors))];
end;
writeLn('using color: ' + IntToStr(colorroad[thecolor]))
RadialWalkTolerance(colorroad[thecolor], RadS, RadE, 50, 1, 1, 45);
end;
end;
if (DistanceToTarget < 10) and SeeLocation then
begin
Arrived := true;
inc(succes)
WriteLn('Succesfully walked ' + IntToStr(Succes) + ' times!')
WriteLn('We have arrived at ' + Place)
end;
WaitCustom;
until Arrived or Failed;
end;
procedure BankItems;
var
x, y, BankColor : integer;
BankFound : boolean;
begin
repeat
BankColor := 9079436;
if FindObj(x, y, 'ooth', BankColor, 3) then
begin
Mouse(x, y, 3, 3, true);
BankFound := true;
wait(randomRange(2000, 3000))
end;
until BankFound;
if(PinScreen) then
InPin(Players[0].Pin);
if PinPending then
ConfirmPin();
if not bankscreen then bankitems;
Deposit(1+ReservedSlots, 28, true);
WaitCustom;
CloseBank;
if InvFull then
bankItems;
end;
procedure CheckRandoms;
var
x, y : integer;
begin
if (GetSkillInfo('hitpoints', true) < PrevHP) then
begin
writeLn('We lost HP')
RunAway('N', true, 1, randomRange(2000, 4000))
end;
if FindObj(x, y, 'ick', 945748, 25) then
begin
mouse(x, y, 0, 0, true);
if ClickContinue(false) then
begin
wait(2000);
CheckRandoms;
end;
end;
PrevHP := GetSkillInfo('hitpoints', true);
end;
function GetFishXP: integer;
var
MouseTB,b: TBox;
tpa: TPointArray;
begin
result := -1;
if(not TabExists(tab_Stats)) or (not gameTab(tab_Stats)) then exit;
MouseTB := SkillBoxCoords(705,285);
MMouse(MouseTB.X1,MouseTB.Y1, 20, 20);
wait(400 + random(200));
if (WaitFindColors(tpa, 10551295, MIX1, MIY1, MIX2, MIY2, 0, 3000)) then
begin
b := getTPABounds(tpa);
wait(450 + random(150));
result := strToIntDef(getNumbers(GetTextAtExWrap(b.x1+15, b.y1+2,b.x2-2,
b.y1+13, 0, 5, 1, 0, 0, 'smallChars07')), -1);
end;
end;
procedure ReportProgress;
var
box : Tbox;
I, x, y, TimeGone, Count : integer;
begin
Count := InvCount;
if not (LastInvCount = Count) and (Count > Reservedslots) then
begin
box := intToBox(InvBox(Count).X1,InvBox(Count).Y1,InvBox(Count).X2,InvBox(Count).Y2)
for I:=low(FishDTM) to high(FishDTM) do
begin
if FindDTM(FishDTM[I], x, y, Box.X1, Box.Y1, Box.X2, Box.Y2) then
begin
inc(Cought[I]);
inc(FishCount)
LastInvCount := InvCount;
end;
end;
end;
ClearDebug;
WriteLn(' __________________/'+Name+'\__________________')
writeLn('| Running for: ' + TimeRunning)
writeLn('| cought fish:')
for I:=low(Cought) to high(Cought) do
begin
writeLn('| * ' + IntToStr(Cought[I]) + ' ' + FishName[I])
end;
if (FishCount < 1) then exit;
TimeGone := (GetTimeRunning/1000);
Writeln('| Fish per hour: ' + IntToStr(3600 * FishCount / TimeGone));
end;
procedure antiban;
begin
Case random(250) Of
1: HoverSkill('fishing', False);
2: HoverSkill('cooking', False);
3: Boredhuman;
4: Wait(2500 + random(4500));
6: PickUpMouse;
8: CompassMovement(5, 30, true);
9: HoverOnlineFriend;
10: RandomMovement;
end;
end;
Procedure AutoRespond;
Begin
If InChat('bot') or InChat('bots') Then
begin
case random(8) of
1: Typesend('Ikr');
2: Typesend('meh');
3: Typesend('ye...');
4: Typesend('oh well');
5: Typesend(':l');
6: Typesend('Bots suck');
end
lastChat := 0;
end;
If InChat('lvls') or InChat('lvl') or InChat('levels') Then
If InChat('ish') Then
Begin
Typesend(IntToStr(GetSkillMaxLevel(skill_fishing)));
lastChat := 0;
End;
If InChat('bored') or InChat('tired') then
begin
case random(8) of
1: Typesend('Me too');
2: Typesend('meh :L');
3: Typesend('Fishing is quite boring');
4: Typesend(':l');
end
lastChat := 0;
end;
End;
procedure StartFishing;
var
PixelS, PixelT, x, y, I, CurSpot, FailedT, RandomTimer, lastChat : Integer;
begin
repeat
FindNormalRandoms;
PixelS := AveragePixelShift(IntToBox(MSCX-20, MSCY-20, MSCX+20, MSCY+50), 250, 500);
SMART_DrawBox(IntToBox(MSCX-20, MSCY-20, MSCX+20, MSCY+50))
for I:=1 to ReservedSlots do
begin
if not ExistsItem(I) then
begin
writeLn('Searching lost equipment...')
if FindObjCustom(x, y, [ToolName], [604242, 943236, 2701868], 15) then
begin
Mouse(x, y, 0, 0, false);
WaitCustom;
ChooseOption('ake');
wait(2500 + random(500))
end else
begin
writeLn('Could not locate lost equipment, logging out...')
writeLn('Make sure to have your equipment in the first slots.')
logout;
TerminateScript;
end;
end;
end;
if Standing then PixelT := 40 else PixelT := 60;
if (PixelS < PixelT) then
begin
if FindObjCustom(x, y, [SpotName], [14597535, 15123609, 14794914, 14858129, 13216647, 14597268, 15123625, 14398100, 14729121], 3) then
begin
Mouse(x, y, 5, 5, false);
WaitCustom;
if not ChooseOption(OptionName) then inc(FailedT);
wait(1250 + random(500))
if ClickContinue(false) then inc(FailedT);
end else inc(FailedT);
end;
if (FailedT > 2) then
begin
if (CurSpot > 4) then
begin
CurSpot := 0;
WalkSpot(IntToBox(MMX1, MMY1, MMCX, MMY2), true);
SMART_drawBox(IntToBox(MMX1, MMY1, MMCX, MMY2))
end else
begin
inc(CurSpot)
WalkSpot(IntToBox(MMCX+15, MMCY-15, MMX2-20, MMY2), false);
end;
WaitCustom;
FailedT := 0;
end;
if not loggedin then LoginPlayer;
ReportProgress;
if (RandomTimer > (10 + random(6))) then
begin
CheckRandoms;
antiban;
RandomTimer := 0;
end;
if (lastChat > 30) then AutoRespond;
inc(LastChat)
inc(RandomTimer)
ClickContinue(false)
WaitCustom;
until InvFull
WalkSpot(IntToBox(MMX1, MMY1, MMCX, MMY2), true);
end;
procedure StartMainLoop;
begin
repeat
if not InvFull then
begin
WalkTo('FishSpot');
StartFishing;
end;
if InvFull then
begin
WalkTo('Bank');
BankItems;
end;
until false;
end;
begin
AddOnTerminate('FreeMyDTM')
SafeInitForm;
SafeShowFormModal;
LoadDTM;
DeclareSpot;
SetUpsrl;
DeclarePlayers;
ActivateClient;
LoginPlayer;
SetAngle(0);
LastInvCount := InvCount;
PrevHP := GetSkillInfo('hitpoints', true);
StartMainLoop;
end.