PDA

View Full Version : [First Script] Oak Chopper + Long Bow Fletcher



Hamish
03-14-2013, 08:57 PM
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('mQwAAAHicY2ZgYKhlYWDoBuJWIE5iZGDwBO JQIC7MzGTISU1lyEtPZ+AEqoNhRiQMBAAPugZz');
logDTM := DTMFromString('mrAAAAHic42BgYDjExMCwB4iPAfEpIN4JxF uYIOL7gZiLkYFBEIgZgZgXiJmhND+UXZ9gyTC50ImhMdkKTPfk ODIsbIoG0y2pNgyEACMBDAMAPmkQRw==');
longBowDTM := DTMFromString('mbQAAAHicY2VgYMhlYmAoA+JEIM4G4kIgZm FkYBAC4t9A+f9AzAlkH18kzjC5QpChPo2XYec0EaAoUBALYMSC wQAAlZIJQw==');
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' (http://villavu.com/forum/showthread.php?t=94909)

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

Netzone
03-14-2013, 09:09 PM
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
03-14-2013, 09:47 PM
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
03-16-2013, 08:02 AM
Lol isn't this the other script that was made for short bows just renamed methods?

Gopper
03-16-2013, 04:57 PM
whats the p07symbol? i don't have that file part of my simba

Hamish
03-16-2013, 05:07 PM
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!


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
03-16-2013, 06:19 PM
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
04-06-2013, 04:09 AM
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
06-05-2013, 09:58 AM
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
06-14-2013, 05:47 PM
cool

sal man
06-20-2013, 03:42 AM
Thanks for this script! will definately use to level up fletch lol

leeds4eva
11-11-2013, 11:34 PM
hmmm looks like code from another script, sorry if im wrong, but if u used then please credit thescripter

n0m
11-12-2013, 01:40 AM
Thanks for this script! will definately use to level up fletch lol

Same here!

Ashaman88
11-27-2013, 05:21 AM
P07include outdated. Please use official one - shoot me a PM when/if this is updated.