SRL Archive - OSR Outdated / Broken Scripts

[First Script] Oak Chopper + Long Bow Fletcher


Hamish

2013-03-14 16:57:08

Hey guys, first ever script here. Works quite well from what iv'e tested.

Current Features:
Chops Oak tree's
Fletches oak logs into oak longbows
drops all bows

In Progress
Walks to shop and sells bows
option to cut other things

I know this script isn't going to be amazing but i'd really appreciate if I got feedback on my code and how I can improve and where and what problems you had.

Thanks.

program oakFletcher;

{$I SRL/SRL.Simba}
{$I P07Include.Simba}
{$I 07symbol.simba}

var
X,Y, knifeDTM,logDTM,longBowDTM: Integer;


procedure P07_DeclarePlayer;
begin
P07_PlayerName := '';
P07_PlayerPass := '';
end;

Procedure DTMshere;
begin
knifeDTM := DTMFromString('mQwAAAHicY2ZgYKhlYWDoBuJWIE5iZGDwBOJQIC7MzGTISU1lyEtPZ+AEqoNhRiQMBAAPugZz');
logDTM := DTMFromString('mrAAAAHic42BgYDjExMCwB4iPAfEpIN4JxFuYIOL7gZiLkYFBEIgZgZgXiJmhND+UXZ9gyTC50ImhMdkKTPfkODIsbIoG0y2pNgyEACMBDAMAPmkQRw==');
longBowDTM := DTMFromString('mbQAAAHicY2VgYMhlYmAoA+JEIM4G4kIgZmFkYBAC4t9A+f9AzAlkH18kzjC5QpChPo2XYec0EaAoUBALYMSCwQAAlZIJQw==');
end;

Procedure shopWalk;
begin

P07_MakeCameraAngleHigh;
P07_MakeCompassNorth;
If FindSymbol(x, y, Symbol07_shop) then
begin
writeln('Walking to general store');
MMouse(x, y, 3, 3);
ClickMouse2(Mouse_Left);
end;
p07_FFlag;
wait (1000+Random(500));
end;


Procedure FindShopKeeper;
var
tmpCTS, l, r:Integer;
ObjectTPA:TPointArray;
begin
MouseSpeed:=15;
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.05, 0.14);
if FindColorsTolerance(ObjectTPA, 2178910, 8, 25, 518, 359, 4) then
begin
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
L := High(ObjectTPA);
mmouse((ObjectTPA[r].x), (ObjectTPA[r].y), 2, 2);
wait(randomrange(100, 150));
clickmouse2(mouse_right);
Writeln('Found the Shop keeper');
wait(randomrange(500, 600));
P07_ChooseOptionMulti(['rade', 'tra']);
wait(randomrange(2000, 2500));
end else
Writeln('couldnt find the Shop keeper');
end;

Procedure sellBows;
begin
if(FindDTM(longBowDTM, x, y, P07_MIX1, P07_MIY1, P07_MIX2, P07_MIY2)) then
mmouse(x, y, 2, 2);
clickmouse2(mouse_right);
Repeat
P07_ChooseOptionMulti(['ell 10', '10']);
until
not (findDTM(longbowDTM, x, y, 565, 7, 717, 157))
end;


procedure treeWalk;

begin
P07_MakeCameraAngleHigh;
P07_MakeCompassNorth;
mmouse(620, 90, 4, 4);
wait(350+random(125));
clickmouse2(mouse_left);
wait(350+random(125));
end;

Procedure ChopOak;
Begin

P07_MakeCameraAngleHigh;

repeat
if p07_findobjCustom(x,y, ['Oak'], [933173, 1863263, 2505017], 5) then
writeln('Found Oak');
Wait(500 + Random(153));
mmouse(x, y, 5, 5); //Moves Mouse to tree
clickmouse2(mouse_left);
Writeln('Clicked Oak');
P07_MakeCompassDegree(RandomRange(25,260));
Wait (RandomRange(7000,8000))
until(P07_InvFull)
end;

Procedure FletchBows;

Begin

wait(random(900));
if(findDTM(knifeDTM, x, y, P07_MIX1, P07_MIY1, P07_MIX2, P07_MIY2)) then
Begin
MMouse(x, y, 8, 4); // Found and clicked on knife
clickmouse2(mouse_left);
wait(random(400));
if(FindDTM(logDTM, x, y, P07_MIX1, P07_MIY1, P07_MIX2, P07_MIY2)) then
wait(250+random(125));
Begin
MMouse(x, y, 2, 2);
wait(250+random(125));
clickmouse2(mouse_left);
wait(250+random(125));
mmouse( 255, 394, 7, 7);
wait(100+random(8));
clickmouse2(mouse_right);
wait(240+random(35));
P07_ChooseOptionMulti(['e X', 'X']);
Wait(RandomRange(600,999));
SendKeys(IntToStr(RandomRange(30, 99)), 95, 35);
Wait(RandomRange(270, 370));
P07_UseKey(13);
wait(18000+random(12700));

end;

end;

end;

Procedure FreetheDTM;
begin
FreeDTM(knifeDTM);
FreeDTM(logDTM);
FreeDTM(longBowDTM);
end;
Procedure login;
begin
If (Not P07_LoggedIn) Then
begin
P07_LogInPlayer;
P07_MakeCameraAngleHigh;
end;
end;



begin
DTMshere;
P07_DeclarePlayer;
SetupP07Include;
ActivateClient;
Addonterminate('FreetheDTM');
login;
Wait(100);


repeat
chopoak;
FletchBows;
wait(18000+random(12700));
ShopWalk;
FindShopKeeper;
wait(1000+random(100));
treeWalk;

until(not P07_Loggedin);

end.

Thanks to RJJ95 for his 'guide to scripting on runescape private servers'

Place the 07Symbol attatchment into your Simba>Includes folder.

Netzone

2013-03-14 17:09:40

I haven't got the time to test the script out right now, but make it a habit of using the parser every now and then to make your script look nicer. :)

Hamish

2013-03-14 17:47:29

I'll have a look, thanks.

Attempted to add walking, bow selling and returning back to tree's. Seems to be semi working

Brid Mayhem

2013-03-16 04:02:01

Lol isn't this the other script that was made for short bows just renamed methods?

Gopper

2013-03-16 12:57:54

whats the p07symbol? i don't have that file part of my simba

Hamish

2013-03-16 13:07:15

From: Brid Mayhem
Lol isn't this the other script that was made for short bows just renamed methods?


Not at all, i'd prefer if you didn't come in and give me shit in my thread, cheers!

From: Gopper
whats the p07symbol? i don't have that file part of my simba


Oh, forgot to put info about that. It goes in your Simba>Includes folder, added it onto the main post.

Brid Mayhem

2013-03-16 14:19:40

From: Hamish
Not at all, i'd prefer if you didn't come in and give me shit in my thread, cheers!



Oh, forgot to put info about that. It goes in your Simba>Includes folder, added it onto the main post.


Not 'coming and giving you shit' was a valid question, considering it looks alike. http://villavu.com/forum/showthread.php?t=97065

fluffycluffy

2013-04-06 00:09:20

You Have The Latest Version of P07Include
Error: Exception: Out of memory at line 226
The following DTMs were not freed: [0, 1, 2, 3, 4, 5, 6]

Mark327

2013-06-05 05:58:37

Exception in Script: Unable to find file '07symbol.simba' used from ''

i redownload it and put it in includes again and still get same message

Riylo69

2013-06-14 13:47:49

cool

sal man

2013-06-19 23:42:40

Thanks for this script! will definately use to level up fletch lol

leeds4eva

2013-11-11 18:34:20

hmmm looks like code from another script, sorry if im wrong, but if u used then please credit thescripter

n0m

2013-11-11 20:40:04

From: sal man
Thanks for this script! will definately use to level up fletch lol


Same here!

Ashaman88

2013-11-27 00:21:20

P07include outdated. Please use official one - shoot me a PM when/if this is updated.