PDA

View Full Version : In_Jeopardy's Normal Log Cutter (3rd ever script)



in_jeopardy
09-04-2006, 07:12 PM
Be nice, it's my third script that works :D

I would apreciate feedback and tips on how to improve it.


//------------------------------------------------------------------
// In_Jeopardy's
// Normal Log Cutter
//
// *Instructions*
// place character in an area that has lots of normal
// trees, use the crosshair to select the ruenscape
// client, pick the colour of the normal tree and place
// in line 41, press play and enjoy, (have your axe
// equipped or it wont work
//
//
// *Features*
// - will cut a full load of normal logs
// - will drop logs when inventory is full
// - checks for randoms
//
// *Credits*
// By In_Jeopardy
// With help from Sumilion =]
// With some guidance on log dropping from JLewis
//
//
//------------------------------------------------------------------


program BasicTreeCutter;
{.include SRL\SRL.scar}
{.include SRL\SRL\skill\WoodCutting.scar}
Var TempCount, CutMark, Mymark : integer;

procedure Setup;
begin;
SetupSRL;
ActivateClient;
MouseSpeed := 20;
end;

procedure colourpick1;
begin;
If FindColorSpiral(x, y, 2246712, 000, 000, 516, 337) Then;
begin;
Mouse(x, y, 3, 5, true);
TempCount := InvCount;
MarkTime(CutMark);
repeat
FindNormalRandoms;
Wait(200)
Until(InvCount = TempCount +1) Or (TimeFromMark(CutMark) >= 10000)
end;
end;

begin;
Setup;
repeat
marktime(mymark);
repeat
colourpick1;
until(InvFull) Or (TimeFromMark(MyMark) >= 60000) Then;
begin;
DropAllLogs;
end;
Until(false);
end.


I have updated the script a fair bit since the first post, so i thought I'd give a link to the current one:

Sumilion
09-04-2006, 07:51 PM
Nice, you published it :biggrin: , only you got me wrong on one part, you see, you have :
until(InvFull);
If(InvFull) Or (TimeFromMark(CutMark) >= 60000) Then;
while i meant it to be
until(InvFull) Or (TimeFromMark(MyMark) >= 60000);
If(InvFull) Then;

So in case you missed the point... the TimeFromMark was placed wrong and it wasnt CutMark but MyMark...

in_jeopardy
09-04-2006, 08:02 PM
Nice, you published it :biggrin: , only you got me wrong on one part, you see, you have :
until(InvFull);
If(InvFull) Or (TimeFromMark(CutMark) >= 60000) Then;
while i meant it to be
until(InvFull) Or (TimeFromMark(MyMark) >= 60000);
If(InvFull) Then;

So in case you missed the point... the TimeFromMark was placed wrong and it wasnt CutMark but MyMark...


Thanks, have made the changes, that'll teach me not to check it through...

Sumilion
09-04-2006, 08:53 PM
Hihi, ooohhh, your going to learn a lot more in these weeks ;)

in_jeopardy
09-05-2006, 02:04 AM
Added a login (i did that all by myself :D ), changed the findcolourspiral to include tolerance, and added a start button (saw a tut).

//---------------------------------------------------------
// In_Jeopardy's
// Normal Log Cutter
//
// *Instructions*
// place character in an area that has lots of normal
// trees, use the crosshair to select the ruenscape
// client, pick the colour of the normal tree and place
// in lines 34 and 35, press play and enjoy, (have your
// axe equipped or it wont work)
//
//
// *Features*
// - will log in
// - will cut a full load of normal logs
// - will drop logs when inventory is full
// - checks for randoms
//
// *Credits*
// By In_Jeopardy
// With help from Sumilion =]
// With some guidance on log dropping from JLewis
//
//
//---------------------------------------------------------


program BasicTreeCutter;
{.include SRL\SRL.scar}
{.include SRL\SRL\skill\WoodCutting.scar}
Var
TempCount, CutMark, Mymark : integer;
frmDesign : TForm;
Button1 : TButton;

const
user =''; //username goes in between quotes.
pass =''; //password goes in between quotes.

procedure Setup;
begin;
SetupSRL;
MouseSpeed := 20;
end;

procedure buttonclick(sender: TObject);
begin
Writeln('**Script Started**');
frmDesign.Caption:= frmDesign.Caption + '.';
frmDesign.ModalResult:= mrOk;
end;

procedure InitForm;
begin
frmDesign := CreateForm;
frmDesign.Left := 100;
frmDesign.Top := 100;
frmDesign.Width := 200;
frmDesign.Height := 180;
frmDesign.Caption := 'frmDesign';
frmDesign.Color := clBtnFace;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := False;
frmDesign.PixelsPerInch := 96;
Button1 := TButton.Create(frmDesign);
Button1.OnClick:= @buttonclick;
Button1.Parent := frmDesign;
Button1.Left := 60;
Button1.Top := 60;
Button1.Width := 75;
Button1.Height := 25;
Button1.Caption := 'Begin Log In';
Button1.TabOrder := 8;
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;

procedure colourpick0;
begin;
If FindColorSpiralTolerance(x, y, 2246712, 000, 000, 516, 337, 5) Then;
begin;
Mouse(x, y, 3, 5, true);
TempCount := InvCount;
MarkTime(CutMark);
repeat
FindNormalRandoms;
Wait(200)
Until(InvCount = TempCount +1) Or (TimeFromMark(CutMark) >= 10000)
end;
end;

procedure colourpick1;
begin;
If FindColorSpiralTolerance(x, y, 16777215, 397, 278, 528, 306, 5) Then;
begin;
Mouse(x, y, 3, 5, true);
end;
end;

procedure NameAndPass;
begin
SendKeys(user + chr(13) + pass)
end;

procedure colourpick2;
begin;
If FindColorSpiralTolerance(x, y, 16777215, 237, 308, 366, 334, 5) Then;
begin;
Mouse(x, y, 3, 5, true);
end;
end;

procedure colourpick3;
begin;
If FindColorSpiralTolerance(x, y, 16777215, 278, 298, 495, 375, 5) Then;
begin;
Mouse(x, y, 3, 5, true);
end;
end;

begin;
Setup;
SafeInitForm;
SafeShowFormModal;
ActivateClient;
colourpick1;
wait(2000)
NameAndPass;
wait(2000)
colourpick2;
wait(5000)
colourpick3;
wait(5000)
repeat
marktime(mymark);
repeat
colourpick0;
until(InvFull) Or (TimeFromMark(MyMark) >= 300000)
begin;
DropAllLogs;
end;
Until(false);
end.

What do you think?

Sumilion
09-05-2006, 04:26 PM
nice... only why all of the colour picks? Ow and DARN YOU! you have a form :mad: , i don't even know how to :tongue:

in_jeopardy
09-05-2006, 05:29 PM
nice... only why all of the colour picks? Ow and DARN YOU! you have a form :mad: , i don't even know how to :tongue:

the colour picks are for the login, the form is leeched (:() from a tutorial, its just a button so you can tell the script to start, o thought it was more interesting.

Sumilion
09-05-2006, 07:34 PM
Oké, i see, tho i would strongly suggest to use the functions made in SRL, i'll explain later when you are online, or maybe JLewis can explain it :rolleyes:

in_jeopardy
09-05-2006, 10:03 PM
Oké, i see, tho i would strongly suggest to use the functions made in SRL, i'll explain later when you are online, or maybe JLewis can explain it :rolleyes:

Ok, thanks, but I felt like making something that was all mine, so I made the login, I don't know why I never got into SCAR before, I used to use it a bit but... I never realised how fun actually making the scripts and having the satisfaction of watching them compile/work etc is.

:D :D Come online soon pleeeease.

Sumilion
09-06-2006, 01:32 PM
Hihi, i know, i even hate Runescape, but i like scar :biggrin: :biggrin: :biggrin:

in_jeopardy
09-06-2006, 10:56 PM
ok, have updated AGAIN, now it detects if the user is logged in, if not it loggs them in, also added highestangle to the main loop, after logging in the script angles the camera up all the way, making sure that the most trees possible are visable, i might have changed some other minor things, but thats about it. tell me what you think :D . In the next update I'm hoping to add the SRL login procedure to replace my own, antirandoms, an axe detection (equipped/not equipped etc)

//---------------------------------------------------------
// In_Jeopardy's
// Normal Log Cutter
//
// *Instructions*
// place character in an area that has lots of normal
// trees, use the crosshair to select the ruenscape
// client, pick the colour of the normal tree and place
// in lines 34 and 35, press play and enjoy, (have your
// axe equipped or it wont work)
//
//
// *Features*
// - will log in
// - will cut a full load of normal logs
// - will drop logs when inventory is full
// - checks for randoms
//
// *Credits*
// By In_Jeopardy
// With help from Sumilion =]
// With some guidance on log dropping from JLewis
//
//
//---------------------------------------------------------


program BasicTreeCutter;
{.include SRL\SRL.scar}
{.include SRL\SRL\skill\WoodCutting.scar}
Var
TempCount, CutMark, Mymark : integer;
frmDesign : TForm;
Button1 : TButton;

const
user =''; //username goes in between quotes.
pass =''; //password goes in between quotes.

procedure Setup;
begin;
SetupSRL;
MouseSpeed := 20;
end;

procedure buttonclick(sender: TObject);
begin
Writeln('**Script Started**');
frmDesign.Caption:= frmDesign.Caption + '.';
frmDesign.ModalResult:= mrOk;
end;

procedure InitForm;
begin
frmDesign := CreateForm;
frmDesign.Left := 100;
frmDesign.Top := 100;
frmDesign.Width := 200;
frmDesign.Height := 180;
frmDesign.Caption := 'frmDesign';
frmDesign.Color := clBtnFace;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := False;
frmDesign.PixelsPerInch := 96;
Button1 := TButton.Create(frmDesign);
Button1.OnClick:= @buttonclick;
Button1.Parent := frmDesign;
Button1.Left := 60;
Button1.Top := 60;
Button1.Width := 75;
Button1.Height := 25;
Button1.Caption := 'Begin Script';
Button1.TabOrder := 8;
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;

procedure colourpick0;
begin;
If FindColorSpiralTolerance(x, y, 2246712, 000, 000, 516, 337, 5) Then;
begin;
Mouse(x, y, 3, 5, true);
TempCount := InvCount;
MarkTime(CutMark);
repeat
FindNormalRandoms;
Wait(200)
Until(InvCount = TempCount +1) Or (TimeFromMark(CutMark) >= 10000)
end;
end;

procedure colourpick1;
begin;
If FindColorSpiralTolerance(x, y, 16777215, 397, 278, 528, 306, 5) Then;
begin;
Mouse(x, y, 3, 5, true);
end;
end;

procedure NameAndPass;
begin
TypeSend(user + chr(13) + pass)
end;

procedure colourpick2;
begin;
If FindColorSpiralTolerance(x, y, 16777215, 237, 308, 366, 334, 5) Then;
begin;
Mouse(x, y, 3, 5, true);
end;
end;

procedure colourpick3;
begin;
If FindColorSpiralTolerance(x, y, 16777215, 278, 298, 495, 375, 5) Then;
begin;
Mouse(x, y, 3, 5, true);
end;
end;

procedure LoginBegin;
begin;
colourpick1
wait(2000)
NameAndPass
wait(2000)
colourpick2
wait(10000)
colourpick3
wait(5000);
end;

begin;
Setup
SafeInitForm
SafeShowFormModal
ActivateClient
If loggedin = false Then
LoginBegin;
IF loggedin = true Then
ChatsOff
wait(2000)
highestangle;
repeat
marktime(mymark);
repeat
colourpick0;
until(InvFull) Or (TimeFromMark(cutMark) >= 150000)
begin;
DropAllLogs;
end;
Until(false);
end.

in_jeopardy
09-06-2006, 11:09 PM
ok, have updated AGAIN, now it detects if the user is logged in, if not it loggs them in, also added highestangle to the main loop, after logging in the script angles the camera up all the way, making sure that the most trees possible are visable, i might have changed some other minor things, but thats about it. tell me what you think :D . In the next update I'm hoping to add the SRL login procedure to replace my own, antirandoms, an axe detection (equipped/not equipped etc)

//---------------------------------------------------------
// In_Jeopardy's
// Normal Log Cutter
//
// *Instructions*
// place character in an area that has lots of normal
// trees, use the crosshair to select the ruenscape
// client, pick the colour of the normal tree and place
// in lines 34 and 35, press play and enjoy, (have your
// axe equipped or it wont work)
//
//
// *Features*
// - will log in
// - will cut a full load of normal logs
// - will drop logs when inventory is full
//
//
// *Credits*
// By In_Jeopardy
// With help from Sumilion =]
// With some guidance on log dropping from JLewis
//
//
//---------------------------------------------------------


program BasicTreeCutter;
{.include SRL\SRL.scar}
{.include SRL\SRL\skill\WoodCutting.scar}
Var
TempCount, CutMark, Mymark : integer;
frmDesign : TForm;
Button1 : TButton;

const
user =''; //username goes in between quotes.
pass =''; //password goes in between quotes.

procedure Setup;
begin;
SetupSRL;
MouseSpeed := 20;
end;

procedure buttonclick(sender: TObject);
begin
Writeln('**Script Started**');
frmDesign.Caption:= frmDesign.Caption + '.';
frmDesign.ModalResult:= mrOk;
end;

procedure InitForm;
begin
frmDesign := CreateForm;
frmDesign.Left := 100;
frmDesign.Top := 100;
frmDesign.Width := 200;
frmDesign.Height := 180;
frmDesign.Caption := 'frmDesign';
frmDesign.Color := clBtnFace;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := False;
frmDesign.PixelsPerInch := 96;
Button1 := TButton.Create(frmDesign);
Button1.OnClick:= @buttonclick;
Button1.Parent := frmDesign;
Button1.Left := 60;
Button1.Top := 60;
Button1.Width := 75;
Button1.Height := 25;
Button1.Caption := 'Begin Script';
Button1.TabOrder := 8;
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;

procedure colourpick0;
begin;
If FindColorSpiralTolerance(x, y, 2246712, 000, 000, 516, 337, 5) Then;
begin;
Mouse(x, y, 3, 5, true);
TempCount := InvCount;
MarkTime(CutMark);
repeat
FindNormalRandoms;
Wait(200)
Until(InvCount = TempCount +1) Or (TimeFromMark(CutMark) >= 10000)
end;
end;

procedure colourpick1;
begin;
If FindColorSpiralTolerance(x, y, 16777215, 397, 278, 528, 306, 5) Then;
begin;
Mouse(x, y, 3, 5, true);
end;
end;

procedure NameAndPass;
begin
TypeSend(user + chr(13) + pass)
end;

procedure colourpick2;
begin;
If FindColorSpiralTolerance(x, y, 16777215, 237, 308, 366, 334, 5) Then;
begin;
Mouse(x, y, 3, 5, true);
end;
end;

procedure colourpick3;
begin;
If FindColorSpiralTolerance(x, y, 16777215, 278, 298, 495, 375, 5) Then;
begin;
Mouse(x, y, 3, 5, true);
end;
end;

procedure LoginBegin;
begin;
colourpick1
wait(2000)
NameAndPass
wait(2000)
colourpick2
wait(10000)
colourpick3
wait(5000);
end;

begin;
Setup
SafeInitForm
SafeShowFormModal
ActivateClient
If loggedin = false Then
LoginBegin;
IF loggedin = true Then
ChatsOff
wait(2000)
highestangle;
repeat
marktime(mymark);
repeat
colourpick0;
until(InvFull) Or (TimeFromMark(cutMark) >= 150000)
begin;
DropAllLogs;
end;
Until(false);
end.

rsch33tah
09-30-2006, 11:37 AM
hehe i want to add something to it
if u start the scripts when ur already logged in..
it jus screams ur name and pass arround lol
(got me cleaned)
Also, it clicks on tons of bushes and stuff, and clicks allot jus next to the tree like 2 millimeter
Dont know if it helps by telling this :$ could be jus me lol

johnny101
10-22-2006, 05:27 PM
IT says

"Failed when compiling
Line 16: [Error] (16:1): Unknown identifier 'SetupSRL' in script"

E-mail me knight_stef@hotmail.com

What do i do?

in_jeopardy
10-29-2006, 04:18 AM
IT says

"Failed when compiling
Line 16: [Error] (16:1): Unknown identifier 'SetupSRL' in script"

E-mail me knight_stef@hotmail.com

What do i do?

WEll, the only thing I can think of is that you do not have SRL, which seems strangs seeing that this is the SRL forums...