SRL Archive - Help and Support

SCAR Form editor


P1nky

2011-11-11 13:59:24

Hallow…. I just made a form with the SCAR form editor , although I forgot how to get it to work…

I tried and got bunch of errors, or is it that i have forgotten something cause it has been quite a while since messing with forms X)

heres the error:
[Error] (17:1): Unknown identifier 'object' at line 16
Compiling failed.

this is the line:
object frmDesign: TfrmDesign  



Can someone please write the extra code I need, i can't find my old scripts that had forms </3
FORM:

begin
object frmDesign: TfrmDesign
Left = 250
Top = 114
BorderStyle = bsDialog
Caption = '- P1nky PowerChopper V2 -'
ClientHeight = 324
ClientWidth = 690
Color = clBlack
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = '@MingLiU_HKSCS-ExtB'
Font.Style = [fsBold]
OldCreateOrder = False
Visible = True
OnActivate = FormActivate
OnCloseQuery = FormCloseQuery
OnCreate = FormCreate
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 11
object Label1: TLabel
Left = 72
Top = 8
Width = 558
Height = 60
Caption = 'P1nky PowerChopper'
Font.Charset = ANSI_CHARSET
Font.Color = clFuchsia
Font.Height = -60
Font.Name = '@MingLiU_HKSCS-ExtB'
Font.Style = [fsBold]
ParentFont = False
end;
object Label2: TLabel
Left = 96
Top = 168
Width = 329
Height = 11
Caption = 'Smart Dropping - Accurate (will just drop logs)'
Color = clBlack
Font.Charset = ANSI_CHARSET
Font.Color = clFuchsia
Font.Height = -11
Font.Name = '@MingLiU_HKSCS-ExtB'
Font.Style = [fsBold]
ParentColor = False
ParentFont = False
end;
object Label3: TLabel
Left = 96
Top = 184
Width = 448
Height = 11
Caption = 'Fast Dropping - Make sure to have Axe either wield or first Invo'
Color = clBlack
Font.Charset = ANSI_CHARSET
Font.Color = clFuchsia
Font.Height = -11
Font.Name = '@MingLiU_HKSCS-ExtB'
Font.Style = [fsBold]
ParentColor = False
ParentFont = False
end;
object Label4: TLabel
Left = 16
Top = 224
Width = 90
Height = 27
Caption = 'Username'
Font.Charset = ANSI_CHARSET
Font.Color = clFuchsia
Font.Height = -19
Font.Name = 'Comic Sans MS'
Font.Style = [fsBold]
ParentFont = False
end;
object Label5: TLabel
Left = 216
Top = 224
Width = 82
Height = 27
Caption = 'Password'
Font.Charset = ANSI_CHARSET
Font.Color = clFuchsia
Font.Height = -19
Font.Name = 'Comic Sans MS'
Font.Style = [fsBold]
ParentFont = False
end;
object Label6: TLabel
Left = 8
Top = 280
Width = 329
Height = 11
Hint = 'Please enter your Username and Password'
Caption = 'Please Enter your RUNESCAPE Username && Password'
Font.Charset = ANSI_CHARSET
Font.Color = clFuchsia
Font.Height = -11
Font.Name = '@MingLiU_HKSCS-ExtB'
Font.Style = [fsBold]
ParentFont = False
ParentShowHint = False
ShowHint = True
end;
object WhatTree: TComboBox
Left = 440
Top = 128
Width = 168
Height = 23
Hint = 'What Tree To Chop?'
Color = clBlack
Ctl3D = True
Font.Charset = ANSI_CHARSET
Font.Color = clFuchsia
Font.Height = -15
Font.Name = 'DFKai-SB'
Font.Style = [fsBold]
ItemHeight = 15
ParentCtl3D = False
ParentFont = False
ParentShowHint = False
ShowHint = True
TabOrder = 8
Text = ' Choose Tree'
Items.Strings = (
'Regular Trees'
'Oaks'
'Willows')
end;
object ListBox1: TListBox
Left = 80
Top = 128
Width = 168
Height = 33
Color = clBlack
Font.Charset = ANSI_CHARSET
Font.Color = clFuchsia
Font.Height = -13
Font.Name = '@MingLiU_HKSCS-ExtB'
Font.Style = [fsBold]
ItemHeight = 13
Items.Strings = (
'Smart Dropping'
'Fast Dropping')
ParentFont = False
TabOrder = 9
end;
object P1nkyPowerChopper: TEdit
Left = 8
Top = 256
Width = 176
Height = 19
TabOrder = 10
Text = 'P1nkyPowerChopper'
end;
object Edit1: TEdit
Left = 216
Top = 256
Width = 128
Height = 19
TabOrder = 11
Text = 'Version_2'
end;
end;
Cheerz <3

Nava2

2011-11-11 14:45:38

If you made this for PaxCompiler, you can not use it in PS.

You also probably copied the .dfm, which instead, you should just use the output that comes up in the SCAR window.

P1nky

2011-11-11 14:59:08

:( ahhhh is there a tutorial or anything out there that will guide me to the right path?

Nava2

2011-11-11 15:06:30

Not sure, but you can build forms and put the dfm into Ron's parser.. its around here somewhere..

Shuttleu

2011-11-11 15:12:54

rons DFM form parser is included with scar

if you have the .dfm then just run it through rons dfm parser

however to get it working with simba you will need to include srl

~shut

Daniel

2011-11-11 19:08:51

From: Shuttleu
however to get it working with simba you will need to include srl

Why? :S

Does SRL have some methods which retain backwards compatibility related to forms? If so, where?

Shuttleu

2011-11-11 19:13:14

From: Daniel
Why? :S

Does SRL have some methods which retain backwards compatibility related to forms? If so, where?


yes it does, not sure where it is though
sorry

~shut

EDIT: C:\Simba\Includes\SRL\SRL\core\simba.simba

Daniel

2011-11-11 19:31:02

From: Shuttleu
yes it does, not sure where it is though
sorry

~shut

EDIT: C:\Simba\Includes\SRL\SRL\core\simba.simba


Thank you :)

P1nky

2011-11-12 01:19:48

From: Shuttleu
rons DFM form parser is included with scar

if you have the .dfm then just run it through rons dfm parser

however to get it working with simba you will need to include srl

~shut


When you said include SRL, did you mean this:
{$i srl\srl.scar}   


EDIT:

This is the code right here and I try compiling fixed all errors , but still says 'Compiling Failed'. :(

program New;
{$i srl\srl.scar}
var
// InitForm variables.
EndInitForm : Boolean;
PowerChopper : TForm;
Label1 : TLabel;
Label2 : TLabel;
Label3 : TLabel;
Label4 : TLabel;
Label5 : TLabel;
Label6 : TLabel;
WhatTree : TComboBox;
ListBox1 : TListBox;
P1nkyPowerChopper : TEdit;
Edit1 : TEdit;


procedure InitFormOnClose(Sender : TObject; var Action : TCloseAction);
begin
if (not(PowerChopper.ModalResult = 1)) then
EndInitForm := True;
end;

procedure InitForm;
begin
PowerChopper := CreateForm;
PowerChopper.OnClose := @InitFormOnClose;
PowerChopper.Position := poScreenCenter;
PowerChopper.FormStyle := fsStayOnTop;
PowerChopper.BorderStyle := bsDialog;
PowerChopper.Caption := '- P1nky PowerChopper V2 -';
PowerChopper.ClientHeight := 324;
PowerChopper.ClientWidth := 690;
PowerChopper.Color := clBlack;
PowerChopper.Font.Color := clWindowText;
PowerChopper.Font.Height := -11;
PowerChopper.Font.Name := '@MingLiU_HKSCS-ExtB';
PowerChopper.Font.Style := [fsBold];
PowerChopper.PixelsPerInch := 96;
Label1 := TLabel.Create(PowerChopper);
Label1.Parent := PowerChopper;
Label1.Left := 72;
Label1.Top := 8;
Label1.Width := 558;
Label1.Height := 60;
Label1.Caption := 'P1nky PowerChopper';
Label1.Font.Color := clFuchsia;
Label1.Font.Height := -60;
Label1.Font.Name := '@MingLiU_HKSCS-ExtB';
Label1.Font.Style := [fsBold];
Label2 := TLabel.Create(PowerChopper);
Label2.Parent := PowerChopper;
Label2.Left := 96;
Label2.Top := 168;
Label2.Width := 329;
Label2.Height := 11;
Label2.Caption := 'Smart Dropping - Accurate (will just drop logs)';
Label2.Color := clBlack;
Label2.Font.Color := clFuchsia;
Label2.Font.Height := -11;
Label2.Font.Name := '@MingLiU_HKSCS-ExtB';
Label2.Font.Style := [fsBold];
Label2.ParentColor := False;
Label3 := TLabel.Create(PowerChopper);
Label3.Parent := PowerChopper;
Label3.Left := 96;
Label3.Top := 184;
Label3.Width := 448;
Label3.Height := 11;
Label3.Caption := 'Fast Dropping - Make sure to have Axe either wield or first Invo';
Label3.Color := clBlack;
Label3.Font.Color := clFuchsia;
Label3.Font.Height := -11;
Label3.Font.Name := '@MingLiU_HKSCS-ExtB';
Label3.Font.Style := [fsBold];
Label3.ParentColor := False;
Label4 := TLabel.Create(PowerChopper);
Label4.Parent := PowerChopper;
Label4.Left := 16;
Label4.Top := 224;
Label4.Width := 90;
Label4.Height := 27;
Label4.Caption := 'Username';
Label4.Font.Color := clFuchsia;
Label4.Font.Height := -19;
Label4.Font.Name := 'Comic Sans MS';
Label4.Font.Style := [fsBold];
Label5 := TLabel.Create(PowerChopper);
Label5.Parent := PowerChopper;
Label5.Left := 216;
Label5.Top := 224;
Label5.Width := 82;
Label5.Height := 27;
Label5.Caption := 'Password';
Label5.Font.Color := clFuchsia;
Label5.Font.Height := -19;
Label5.Font.Name := 'Comic Sans MS';
Label5.Font.Style := [fsBold];
Label6 := TLabel.Create(PowerChopper);
Label6.Parent := PowerChopper;
Label6.Left := 8;
Label6.Top := 280;
Label6.Width := 329;
Label6.Height := 11;
Label6.Hint := 'Please enter your Username and Password';
Label6.Caption := 'Please Enter your RUNESCAPE Username && Password';
Label6.Font.Color := clFuchsia;
Label6.Font.Height := -11;
Label6.Font.Name := '@MingLiU_HKSCS-ExtB';
Label6.Font.Style := [fsBold];
Label6.ParentShowHint := False;
Label6.ShowHint := True;
WhatTree := TComboBox.Create(PowerChopper);
WhatTree.Parent := PowerChopper;
WhatTree.Left := 440;
WhatTree.Top := 128;
WhatTree.Width := 168;
WhatTree.Height := 23;
WhatTree.Hint := 'What Tree To Chop?';
WhatTree.Color := clBlack;
WhatTree.Ctl3D := True;
WhatTree.Font.Color := clFuchsia;
WhatTree.Font.Height := -15;
WhatTree.Font.Name := 'DFKai-SB';
WhatTree.Font.Style := [fsBold];
WhatTree.ItemHeight := 15;
WhatTree.ParentCtl3D := False;
WhatTree.ParentShowHint := False;
WhatTree.ShowHint := True;
WhatTree.TabOrder := 8;
WhatTree.Text := ' Choose Tree';
WhatTree.Items.Add('Regular Trees');
WhatTree.Items.Add('Oaks');
WhatTree.Items.Add('Willows');
ListBox1 := TListBox.Create(PowerChopper);
ListBox1.Parent := PowerChopper;
ListBox1.Left := 80;
ListBox1.Top := 128;
ListBox1.Width := 168;
ListBox1.Height := 33;
ListBox1.Color := clBlack;
ListBox1.Font.Color := clFuchsia;
ListBox1.Font.Height := -13;
ListBox1.Font.Name := '@MingLiU_HKSCS-ExtB';
ListBox1.Font.Style := [fsBold];
ListBox1.ItemHeight := 13;
ListBox1.Items.Add('Smart Dropping');
ListBox1.Items.Add('Fast Dropping');
ListBox1.TabOrder := 9;
P1nkyPowerChopper := TEdit.Create(PowerChopper);
P1nkyPowerChopper.Parent := PowerChopper;
P1nkyPowerChopper.Left := 8;
P1nkyPowerChopper.Top := 256;
P1nkyPowerChopper.Width := 176;
P1nkyPowerChopper.Height := 19;
P1nkyPowerChopper.TabOrder := 10;
P1nkyPowerChopper.Text := 'P1nkyPowerChopper';
Edit1 := TEdit.Create(PowerChopper);
Edit1.Parent := PowerChopper;
Edit1.Left := 216;
Edit1.Top := 256;
Edit1.Width := 128;
Edit1.Height := 19;
Edit1.TabOrder := 11;
Edit1.Text := 'Version_2';
end;

procedure SafeInitForm;
var
v : TVariantArray;
begin
SetArrayLength(v, 0);
ThreadSafeCall('InitForm', v);
end;

procedure ShowInitFormModal;
begin
PowerChopper.ShowModal;
end;

procedure SafeShowInitFormModal;
var
v : TVariantArray;
begin
SetArrayLength(v, 0);
ThreadSafeCall('ShowInitFormModal', v);
end;

procedure MainInitForm;
begin
SafeInitForm;
SafeShowInitFormModal;
FreeForm(PowerChopper);
end;

begin
ClearDebug;
//GetSelf.WindowState := wsMinimized;
MainInitForm;
//GetSelf.WindowState := wsNormal;
if (EndInitForm) then
TerminateScript;
end.

KingKong

2011-11-12 02:51:15

Just spent like 15mins? looking through you're code(god its horrible :p).

Comment out line 122 and 128 and you're good to go.

this is what its supposed to look like?

P1nky

2011-11-12 03:17:25

From: KingKong
Just spent like 15mins? looking through you're code(god its horrible :p).

Comment out line 122 and 128 and you're good to go.

this is what its supposed to look like?


Hahaha thanks! and wow it does look quite bad…. lol but appreciate it once again :)

I'll fix it up! ASAp

Shuttleu

2011-11-12 04:18:28

run this
program New;
var
STitles: array of string;
i: Integer;
begin
STitles := ['ChangeFormName', 'EndScript', 'CenterForm',
'WITHState', 'DisResize',
'DisMax', 'TryExcept',
'SuperVars', 'BreakDownVars'];
for i:=0 to High(STitles) do
SaveSetting('DFMFormParserByRon', STitles[i], 'True');
end.

then run the form parser again, it will make the code nicer and easier to read

~shut

P1nky

2011-11-13 01:41:30

How do i add a image again to a form :S

KingKong

2011-11-13 02:58:46

Read this:
http://villavu.com/forum/showthread.php?t=41418

P1nky

2011-11-13 12:53:23

From: KingKong
Read this:
http://villavu.com/forum/showthread.php?t=41418


Thanks! but les say:
Image1 := TImage.Create(FrmDesign);
Image1.Parent := FrmDesign;
Image1.Left := 20;
Image1.Top := 20;
Image1.Width := 600;
Image1.Height := 600;
b := loadbitmap('C:\Users\Sami Huss\Scripts\AMAN.jpeg');
getbitmapsize(b, w, h);
copycanvas(getbitmapcanvas(b), Image1.canvas, 0, 0, w, h, 0, 0, w, h);

i get a error for
[Error] (179:3): Unknown identifier 'copycanvas' at line 178

Daniel

2011-11-14 00:05:43

From: P1nky
Thanks! but les say:
Image1 := TImage.Create(FrmDesign);
Image1.Parent := FrmDesign;
Image1.Left := 20;
Image1.Top := 20;
Image1.Width := 600;
Image1.Height := 600;
b := loadbitmap('C:\Users\Sami Huss\Scripts\AMAN.jpeg');
getbitmapsize(b, w, h);
copycanvas(getbitmapcanvas(b), Image1.canvas, 0, 0, w, h, 0, 0, w, h);

i get a error for
[Error] (179:3): Unknown identifier 'copycanvas' at line 178

Replace:

b := loadbitmap('C:\Users\Sami Huss\Scripts\AMAN.jpeg');
getbitmapsize(b, w, h);
copycanvas(getbitmapcanvas(b), Image1.canvas, 0, 0, w, h, 0, 0, w, h);

with…

Image1.Picture.Bitmap.LoadFromFile('C:\Users\Sami Huss\Scripts\AMAN.jpeg');

Although I'd suggest to localise the script (i.e. put the picture in the scripts folder and do this:

Image1.Picture.Bitmap.LoadFromFile(ScriptPath + 'AMAN.jpeg');

P1nky

2011-11-14 01:41:13

Daniel although jpg isn't supported am i right, i remember there was only 1 or 2 formats that are workable with SCAR.

  Image1.Picture.Bitmap.LoadFromFile(ScriptPath + 'AMAN.jpg');
end;

procedure SafeInitForm;
var
v : TVariantArray;
begin
SetArrayLength(v, 0);
ThreadSafeCall('InitForm', v);
end;


because i get this error:
Error: Exception: Wrong image format at line 184

Line 184:
ThreadSafeCall('InitForm', v);

Kyle Undefined

2011-11-14 04:06:35

It appears that only bitmaps are supported, otherwise there would probably be an "Image1.Picture.Jpg.LoadFromFile()".

Nava2

2011-11-14 09:52:41

You can load using a TMufasaBitmap then convert that to a TBitmap.

P1nky

2011-11-14 16:35:09

I'll test the form in a bit, although can someone please help me here…


Case LowerCase(Players[CurrentPlayer].Strings[1]) Of
'Oaks' , 'oaks' , 'Oak' , 'oak' : Writeln('Chopping Oaks');
'Willows' , 'Willow' , 'willows' , 'willows' : Writeln('Chopping Willows');
'Tree' , 'tree' , 'Trees', 'trees' : Writeln('Chopping Regular Trees');

gettin this error
Error: Out Of Range at line 262


this being the line:
Case LowerCase(Players[CurrentPlayer].Strings[1]) Of


This is in my declareplayers
Players[0].Strings[1] := 'Oaks';

Nava2

2011-11-14 17:50:09

Have you ran DeclarePlayers?

KingKong

2011-11-14 17:57:38

From: Nava2
Have you ran DeclarePlayers?


Nope he hasn't :p

P1nky

2011-11-17 04:17:42

Ah thanks :)

J/W i remember in SCAR, I would use the 'Cast' Function but do we not have that function anymore for SIMBA?

Daniel

2011-11-17 04:56:44

From: P1nky
Ah thanks :)

J/W i remember in SCAR, I would use the 'Cast' Function but do we not have that function anymore for SIMBA?


Cast? As in a mage spell cast? Why would that be in SCAR?

P1nky

2011-11-17 12:53:43

From: Daniel
Cast? As in a mage spell cast? Why would that be in SCAR?


I mean the SRL Include SRL > Include > Skill > Magic.


but for some odd reason i try updating my Teleporter but 'cast' is unidentified :s

KingKong

2011-11-17 17:07:14

Its in there, i can see it in my in magic.scar file:


{*******************************************************************************
Function Cast(Spell: string; AutoCast: Boolean): Boolean;
By: N1ke!
Rev: 39
Date: 12 Sep 09
Description: Results true if the spell given is clicked.
if Autocast is true, it'll toggle the spell to autocast.
Will work however the spells are sorted, visable or not(Will enable
the spells sort if not enabled).
*******************************************************************************}


P1nky

2011-11-17 17:59:10

see:

[Error] (10:1): Unknown identifier 'cast' at line 9
Compiling failed.
:(
Line:
cast('falador teleport', true);

mormonman

2011-11-17 17:59:57

You have to include magic.scar

P1nky

2011-11-18 04:52:42

Lol got it :) Thanks <3.

btw for my SRL Stats , my script id is my 'ID'?
and if so is it the same for every script?

and this is how i send the variable to the Server , Correct?

stats_IncVariable('Willows Chopped',27);
?
or does the string have to be
Variable(Willow Logs Chopped)
???

KingKong

2011-11-18 05:35:57

From: P1nky
Lol got it :) Thanks <3.

btw for my SRL Stats , my script id is my 'ID'?
and if so is it the same for every script?

and this is how i send the variable to the Server , Correct?

stats_IncVariable('Willows Chopped',27);
?
or does the string have to be
???


Your script id is your 'Scripts ID', open up the page for your script and the last number of url is the script id, which is different for each script.
To commit to stats do something like this:

if (GetSystemTime - ReportTimer) >= 300000 then
begin
stats_IncVariable(Ar_Ore[2] , commits[0]);
stats_IncVariable('Smithing EXP (Gained)', commits[1]);
stats_IncVariable('Total EXP Gained', commits[1]);
if stats_Commit then
begin
commits[0]:= 0;
commits[1]:= 0;
end;
ReportTimer := GetSystemTime;
end;

Freddy1990

2011-11-18 07:26:02

From: Nava2
If you made this for PaxCompiler, you can not use it in PS.


Only SCAR Titan uses PaxCompiler, and it does not yet support forms.

@P1nky: Hmm, not sure what version of SCAR you used, but SCAR 3.25+ has a realtime form=>script feature in the form designer, if you're still using 3.22, get it at http://www.scar-divi.com/?page=download

P1nky

2011-11-18 13:25:59

From: KingKong
Your script id is your 'Scripts ID', open up the page for your script and the last number of url is the script id, which is different for each script.
To commit to stats do something like this:

if (GetSystemTime - ReportTimer) >= 300000 then
begin
stats_IncVariable(Ar_Ore[2] , commits[0]);
stats_IncVariable('Smithing EXP (Gained)', commits[1]);
stats_IncVariable('Total EXP Gained', commits[1]);
if stats_Commit then
begin
commits[0]:= 0;
commits[1]:= 0;
end;
ReportTimer := GetSystemTime;
end;


Thank You :)!
also what is commits[0] and [1]? are those the variables that i have setup on my script.





From: Freddy1990
Only SCAR Titan uses PaxCompiler, and it does not yet support forms.

@P1nky: Hmm, not sure what version of SCAR you used, but SCAR 3.25+ has a realtime form=>script feature in the form designer, if you're still using 3.22, get it at http://www.scar-divi.com/?page=download


I got it :) Thanks!

KingKong

2011-11-18 21:02:41

From: P1nky
Thank You :)!
also what is commits[0] and [1]? are those the variables that i have setup on my script.


Yep those are variables, but you don't have to use them, though i find it less confusing to just reset them to zero after comitting to the stats. This is the whole proc in case i confused you more:

procedure MainLoop;
var
loadsdone, ReportTimer: Integer;
commits: Array [0..1] of Integer;
begin
repeat
WithdrawOres;
SmeltOres;
DepositBars;
Inc(loadsdone);
IncEx(commits[0], 5); //bars
IncEx(commits[1], 125); //smithing xp
ClearDebug;
writeln('Time Running: ' + TimeRunning);
writeln('Loads done: ' + IntToStr(loadsdone) + '/' + IntToStr(LoadsToDo));
writeln('Smithing xp: ' + IntToStr(loadsdone * 125));
if (GetSystemTime - ReportTimer) >= 300000 then
begin
stats_IncVariable('Silver Ore (Melted)' , commits[0]);
stats_IncVariable('Smithing EXP (Gained)', commits[1]);
stats_IncVariable('Total EXP Gained', commits[1]);
if stats_Commit then
begin
commits[0]:= 0;
commits[1]:= 0;
end;
ReportTimer := GetSystemTime;
end;
until (loadsdone = LoadsToDo); //< loadstodo is global variable
end;

P1nky

2011-11-20 01:53:37

Ah i see, btw
Begin
If Not (LoggedIn) Or Not (Players[CurrentPlayer].Active) Then
NextPlayer(false);
If (invfull) Then
Begin
Case (DropType) Of
'Smart': SmartDrop;
'Fast': FastDrop;
End;
TreesChopped := TreesChopped + 27;
stats_IncVariable('Willow Logs Chopped',27);
report;
End;
End;

doesn't record my stats, for some reason it stopped at 81 willows chopped.

KingKong

2011-11-20 03:10:16

From: P1nky
Ah i see, btw
doesn't record my stats, for some reason it stopped at 81 willows chopped.


so it doesn't record past 81 logs? maybe something in your 'report' function is resetting the value? Because there is nothing wrong with what you're doing.

P1nky

2011-11-20 12:20:24

From: KingKong
so it doesn't record past 81 logs? maybe something in your 'report' function is resetting the value? Because there is nothing wrong with what you're doing.


No :(.

i can paste the script if you want to see?

Like the time it has been running for works but that is all.

KingKong

2011-11-20 16:52:38

From: P1nky
No :(.

i can paste the script if you want to see?

Like the time it has been running for works but that is all.


If its ok with you, then post it here, or else PM me. Also, how long does it take to cut the 81 logs? Because if it takes more than 5 mins then you would've committed the stats to the server and then the variable is reset.

P1nky

2011-11-20 20:27:13

From: KingKong
If its ok with you, then post it here, or else PM me. Also, how long does it take to cut the 81 logs? Because if it takes more than 5 mins then you would've committed the stats to the server and then the variable is reset.


Yeah why not mate!



program VersionA;
{$DEFINE SMART}
{$i srl\srl.scar}
{$i reflection\reflection.simba}
{$i SRL\SRL\Misc\Stats.simba}

{===================================================}
{ P1nky' PowerChopper Since 11/12/07 }
{===================================================}
{
Step 1: Have a Hatchet(axe) either on FIRST SLOT or WIELDED.
Step 2: Surrond your Character around the Trees that you have chosen.
Step 3: Start the script.
Step 4: Watch the script run for a good Minute.
Step 5: Enjoy The Script. Also, Please post PROGGIES keep the Thread Alive <3.

{===================================================}
//\\ Make Sure To Progress Reports on The Thread! //\\
{===================================================}
Const
PowerChop = True; // DO NOT CHANGE <3
DropType = 'fast'; // Either "Smart" or "Fast"(recommended)
Loads = 50;
{===================================================}
OakColor = 1655609; //DO NOT CHANGE UNLESS TROUBLE FINDING OAK
WillowColor = 2443076; //DO NOT CHANGE UNLESS TROUBLE FINDING WILLOWS
RegTreeColor = 1525329; //DO NOT CHANGE UNLESS TROUBLE FINDING TREES
{===================================================}
TakeBreaks = True;
DoYouLoveSRL = True; // <3 Dare you to type False :)
SRLStats_Username = ''; // Your SRL Stats Username (Optional) Register here: [url]http://stats.villavu.com/[/url]
SRLStats_Password = ''; // Your SRL Stats Password (Optional) Register here: [url]http://stats.villavu.com/[/url]
Ver = 2.0; // Don't touch.
{===================================================}
{######## ## ## ## ## ## ## ##
## ## #### ### ## ## ## ## ##
## ## ## #### ## ## ## ####
######## ## ## ## ## ##### ##
## ## ## #### ## ## ##
## ## ## ### ## ## ##
## ###### ## ## ## ## ##}
{===================================================}
Procedure DeclarePlayerz;
begin
HowManyPlayers := 2;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with players[0] do
begin
Name := ''; // Username.
Pass := ''; // Password.
Active := True; // Do Not Touch.
Pin := ''; // Don't Need.
Players[0].Strings[0] := 'Willows'; //'Willows' or 'Trees' or 'Oaks'


with players[1] do
Name := '';
Pass := '';
Active := True;
Pin := '';
Players[1].Strings[0] := 'Willows'; //'Willows' or 'Trees' or 'Oaks'
end;
end;
var
Loads1,Debugged,sleeper, Breaktime,Break, x , y ,TreesChopped, Dropper, level, axe, Chopped, NextBreak : integer;
Chop: TComboBox;
Version: String;
LastestVersion: Boolean;
{
===================================================
===================================================
===================================================
===================================================
===================================================
===================================================
}

Procedure Grats;
Begin
If Not (LoggedIn) Or Not (Players[CurrentPlayer].Active) Then
exit;
If (FindBlackChatMessage('Congratulations')) Or
(FindBlackChatMessage('you just advance')) Or
InChat('Congratulations') Or InChat('just advance') Or
InChat('congratulations,') Then
Begin
Writeln('Gained a levled!!!');
Begin
Case Random(18) Of
0: TypeSend('woot finnally LEVELED!!');
1: TypeSend('muwahah lvled');
2: TypeSend('leveled yay me!');
3: TypeSend('woot got wcing lvl :)');
4: TypeSend('omg.. i didnt even know i just leveld');
5: TypeSend('yay me');
6: TypeSend('w00t grats');
7: TypeSend('Dang!');
8: TypeSend('fireworks@!');
9: TypeSend('yay leveld!');
10: TypeSend('woot didnt notice since lagged lol');
11: Typesend('good i just leveld wc');
12: TypeSend('yay!');
13: TypeSend('Hleveled');
14: TypeSend('.lvld just now guys grats me jk');
15: TypeSend('lol');
16: TypeSend('lol...');
17: TypeSend('fireworkz');
End;
End;
writeln('you HAVE JUST LEVELED WOODCUTTING!');
// ReportVars[9] := ReportVars[9] + 1;
level := level + 1;
End;
End;





Procedure FindRandoms; //FINDS RANDOMS
Begin
If Not (LoggedIn) Or Not (Players[CurrentPlayer].Active) Then
NextPlayer(false);
Grats;
FindNormalRandoms;
wait(400)
//RunningFromFights;
FindLamp('Woodcutting');
End;

Procedure RandomButton;
Begin
If Not (LoggedIn) Or Not (Players[CurrentPlayer].Active) Then
NextPlayer(false);
//SRLStatsNeedSent;
Grats;
Case Random(3) Of
0:
Begin
KeyDown(VK_Left);
wait(Random(600) + 500);
KeyUp(VK_Left);
End;
1:
Begin
KeyDown(VK_Right);
wait(Random(600) + 500);
KeyUp(VK_Right);
End;
2:
Begin
KeyDown(VK_Up);
wait(Random(600) + 500);
KeyUp(VK_Up);
End;
End;
End;

Procedure randomcompass;
Begin
If Not (LoggedIn) Or Not (Players[CurrentPlayer].Active) Then
NextPlayer(false);
//SRLStatsNeedSent;
Grats;
Case Random(6) Of
0: makecompass('N');
1: makecompass('S');
2: makecompass('E');
3: makecompass('W');
4: setangle(true);
End;
End;



Procedure MyAntiBan;
Var
DBanMe: Integer;
Begin
If Not (LoggedIn) Or Not (Players[CurrentPlayer].Active) Then
NextPlayer(false);
Grats;
DBanMe := Random(12);
Case DBanMe Of
0: PickUpMouse;
1: GameTab(1 + Random(15));
2: DoEmote(1 + Random(75));
3: RandomRclick;
4: randomcompass;
5: RandomButton;
7: ChooseOption('cancel');
8: MMouse(Random(MSX2), Random(MSY2), 0, 0);
9:
Begin
HoverSkill('woodcutting', false);
sleepandmovemouse(200 + Random(100));
gametab(4);
ChooseOption('Cancel');
RandomButton;
MMouse(Random(MSY1), Random(MSX1), 0, 0);
End;
10:
Begin
GameTab(1 + Random(13));
wait(1000 + Random(600));
gametab(4);
RandomButton;
ChooseOption('Cancel');
setangle(true);
End;
11:
Begin
HoverSkill('random', false);
sleepandmovemouse(200 + Random(100));
gametab(4);
RandomButton;
ChooseOption('Cancel');
setangle(true);
End;
End;
End;




Procedure ActReport(Activity: string);
Begin
end;




Procedure Report;
Begin
//SRLStatsNeedSent;
Grats;
cleardebug;
SRLRandomsReport;
Writeln('||===========================||');
Writeln('|| P1nkys Draynor ||');
Writeln('||===========================||');
Writeln('|| ' + TheDate(Date_Formal) + ' ||');
Writeln('||===========================||');
Writeln(' Worked For ' + TimeRunning);
Writeln(' Chopped ' + IntToStr(TreesChopped));
Writeln(' Dropped(by loads) ' + IntToStr(Dropper));
Writeln(' Broken Axes ' + IntToStr(Axe));
Writeln(' Leveled ' + IntToStr(level));
Writeln(' Sleeped ' + IntToStr(Sleeper));
Writeln('||===========================||');
Writeln('||==== By P1nky ====||');
Writeln('||===========================||');
Writeln('||===========================||');
Writeln('||=====DESTROY THE TREES=====||');
Writeln('||===========================||');
begin
Stats_Commit;
ActReport('Break in Approx:');
Debugged:= Debugged + 1;
if Debugged > 5 then
begin
Writeln(IntToStr(Loads - Loads1) + ' Loads Left Until Sleep.');
Debugged := 0;
end;
end;
Case LowerCase(Players[CurrentPlayer].Strings[1]) Of
'Oaks' , 'oaks' , 'Oak' , 'oak' : Writeln('Chopping Oaks');
'Willows' , 'Willow' , 'willows' , 'willows' : Writeln('Chopping Willows');
'Tree' , 'tree' , 'Trees', 'trees' : Writeln('Chopping Regular Trees');
end;
//Writeln('Player:' + LowerCase(Players[CurrentPlayer].Name));
//SRLStatsNeedSent;
End;




procedure GoodNight;
var
l, s, Time: integer;
begin
l := RandomRange(5, 15);
s := l;
Status('Sleeping');
MarkTime(Time);
Sleeper := Sleeper + 1;
repeat
Disguise('Sleeping For ' + IntToStr(l) + ' minutes');
Writeln('Break Time: ' + IntToStr(l) + ' minutes left until Login.');
Wait(1000 * 60 * 1);
l := l - 1;
until (TimeFromMark(Time) > 1000 * 60 * s);
if not (LoggedIn) then
NextPlayer(true);
LoginPlayer;
end;


Function FindWillows:Boolean;
VAR
TreeColors: Array[0..3] Of integer;
TreeTPA: TPointArray;
RandomOption, Chill, a, I: Integer;
begin
If Not (LoggedIn) Or Not (Players[CurrentPlayer].Active) Then
NextPlayer(false);
//Send;
Makecompass('N');
Setangle(false);
repeat
{ 8428192
8955051
8560035}
{ TreeColors[0] := 1918005;
TreeColors[1] := 1918005;
TreeColors[2] := 1918005;
TreeColors[3] := 1918005;
a:=a+1;
For i := 0 To 3 Do
if FindObjTPA(x, y, TreeColors[i], MSX1, MSY1, MSX2, MSY2,50, ['hop','own','illo','willo']) then
Mouse(x,y,0,0,true);
For I := 0 To 0 Do }
if FindObj(x,y,'Willow',2443076,1) or FindObj(x,y,'Willow',1518121,1) or FindObj(x,y,'Willow',WillowColor,1)then
// If (FindColorSpiralTolerance(x, y, 4947304, MSX1, MSY1, MSX2, MSY2, 50)) or (FindColorSpiralTolerance(x, y, 4026977, MSX1, MSY1, MSX2, MSY2, 20)) then
Report;
FindRandoms;
MMouse(x,y,0,0);
//if uptext('hop down Willow') then
RandomOption := Random(3);
Case RandomOption Of
1: Mouse(x,y,0,0,true);
2:
begin
Mouse(x,y,0,0,False);
wait(700 + (232));
ChooseOption('hop down');
end;
end;
Chopped:= Chopped + 1;
wait(1675+random(654))
Fflag(0);
writeln('Success Finding Willow');
MyAntiBan;
RandomCompass;
// MovementAntiBan;
// while(TimeFromMark(Chill) <= 20000) do
begin
// MovementAntiBan;
FindRandoms;
RandomButton;
Grats;
{ if Chopped = 5 then
begin
if FindSymbol(x,y,'fish') then
begin
MMouse(x,y,0,0);
Mouse(x,y,0,0,true); }
if Chopped = 5 then
begin
Writeln('Cant find any Willows - checking every angle!');
RandomButton;
end;
end;

//end;
{ if not FindSymbol(x,y,'fish') then
begin
//BANK;
end;
//end; }
until(Invfull);
end;




Function FindOaks:Boolean;
VAR
TreeColors: Array[0..3] Of integer;
TreeTPA: TPointArray;
Chill, a, I: Integer;
begin
If Not (LoggedIn) Or Not (Players[CurrentPlayer].Active) Then
NextPlayer(false);
//Send;
Makecompass('N');
Setangle(True);
repeat
{ 8428192
8955051
8560035}
{ TreeColors[0] := 6659986;
TreeColors[1] := 6659986;
TreeColors[2] := 3697247;
TreeColors[3] := 3697247;
a:=a+1;
For i := 0 To 3 Do
if FindObjTPA(x, y, TreeColors[i], MSX1, MSY1, MSX2, MSY2,50, ['hop','own','ak','Oak']) then
For I := 0 To 0 Do }
if FindObj(x,y,'Oak',6659986,1) or FindObj(x,y,'Oak',3697247,1) or FindObj(x,y,'Oak',1655609,1) or FindObj(x,y,'Oak',1921092,1) or FindObj(x,y,'Tree',OakColor,1)then
// If (FindColorSpiralTolerance(x, y, 4947304, MSX1, MSY1, MSX2, MSY2, 50)) or (FindColorSpiralTolerance(x, y, 4026977, MSX1, MSY1, MSX2, MSY2, 20)) then
Report;
FindRandoms;
MMouse(x,y,0,0);
Mouse(x,y,0,0,true);
Chopped:= Chopped + 1;
wait(3477+random(1001))
Fflag(0);
writeln('Success Finding Oak');
MyAntiBan;
RandomCompass;
// MovementAntiBan;
// while(TimeFromMark(Chill) <= 20000) do
begin
// MovementAntiBan;
FindRandoms;
RandomButton;
Grats;
if Chopped = 5 then
begin
Writeln('Cant find any Willows - checking every angle!');
RandomButton;
end;
end;
if not FindSymbol(x,y,'fish') then
begin
//BANK;
end;
until(Invfull);
end;



procedure RegularTreeBan;
var
NoBan: Integer;
begin
// If Not (LoggedIn) Then Exit;
//SRLStatsNeedSent;
FindRandoms;
Grats;
Noban := Random(18);
case Move of
0: MMouse(x, y, (10 + random(350)), (10 + random(200)));
1: MMouse(x, y, (10 + random(400)), (10 + random(600)));
2: MMouse(x, y, (10 + random(550)), (10 + random(400)));
3: MMouse(x, y, (10 + random(500)), (10 + random(400)));
4: MMouse(Random(MSX2), Random(MSY2), 0, 0);
5: RandomRclick;
6: makecompass('N');
7: makecompass('S');
8: makecompass('E');
9: makecompass('W');
10: setangle(true)
end;
end;


Function FindTrees:Boolean;
VAR
TreeColors: Array[0..3] Of integer;
TreeTPA: TPointArray;
Chill, a, I: Integer;
begin
if(not(loggedin))then Exit;
//Send;
Makecompass('N');
Setangle(True);
repeat
{ 8428192
8955051
8560035}
{ TreeColors[0] := 6659986;
TreeColors[1] := 6659986;
TreeColors[2] := 3697247;
TreeColors[3] := 3697247;
a:=a+1;
For i := 0 To 3 Do
if FindObjTPA(x, y, TreeColors[i], MSX1, MSY1, MSX2, MSY2,50, ['hop','own','ak','Oak']) then
For I := 0 To 0 Do }
if FindObj(x,y,'Tree',1985346,1) or FindObj(x,y,'Tree',3163479,1) or FindObj(x,y,'Tree',RegTreeColor,1) then
// If (FindColorSpiralTolerance(x, y, 4947304, MSX1, MSY1, MSX2, MSY2, 50)) or (FindColorSpiralTolerance(x, y, 4026977, MSX1, MSY1, MSX2, MSY2, 20)) then
Report;
FindRandoms;
MMouse(x,y,0,0);
Mouse(x,y,0,0,false);
Chopped:= Chopped + 1;
ChooseOption('hop down');
if not ChooseOption('hop down') then
begin
RandomButton;
writeln('Cant Find Tree... les try different Angle');
break;
end;
wait(1500+random(1001))
Fflag(0);
writeln('Success Finding Regular Tree');
RegularTreeBan;
RandomCompass;
// MovementAntiBan;
// while(TimeFromMark(Chill) <= 20000) do
begin
// MovementAntiBan;
FindRandoms;
RandomButton;
Grats;
if Chopped = 5 then
begin
Writeln('Cant find any Willows - checking every angle!');
RandomButton;
end;
end;
if not FindSymbol(x,y,'fish') then
begin
//BANK;
end;
until(Invfull);
end;




Procedure PinkyBAN;
Var
DBanMe: Integer;
Begin
If Not (LoggedIn) Or Not (Players[CurrentPlayer].Active) Then
NextPlayer(false);
//SRLStatsNeedSent;
DBanMe := Random(12);
Case DBanMe Of
0: PickUpMouse;
1: GameTab(1 + Random(33));
2: DoEmote(1 + Random(75));
3: RandomRclick;
4: randomcompass;
5: RandomButton;
7: ChooseOption('cancel');
8: MMouse(Random(MSX2), Random(MSY2), 0, 0);
9:
Begin
HoverSkill('woodcutting', false);
sleepandmovemouse(200 + Random(100));
gametab(4);
ChooseOption('Cancel');
RandomButton;
MMouse(Random(MSY1), Random(MSX1), 0, 0);
End;
10:
Begin
GameTab(1 + Random(13));
wait(1000 + Random(600));
gametab(4);
RandomButton;
ChooseOption('Cancel');
setangle(true);
End;
11:
Begin
HoverSkill('random', false);
sleepandmovemouse(200 + Random(100));
gametab(4);
RandomButton;
ChooseOption('Cancel');
setangle(true);
End;
End;
End;

Procedure SmartDrop;
Var
logdtm: integer;
Begin
If Not (LoggedIn) Or Not (Players[CurrentPlayer].Active) Then
NextPlayer(false);
Writeln('using Dtm (smart way) slower though but more accurate');
logdtm := DTMFromString('78DA63CC63626078C880029A536D18FE03694' +
'620FE0F048C054035EF18D000231209A463816A9E135093015473' +
'87809A3222D45413B60B0046720E26');
gametab(4);
Repeat
If finddtm(logdtm, x, y, 550, 203, 731, 464) Then
Begin
Mouse(x, y, 3, 3, false);
Begin
wait(random(400) + 100);
chooseoption('Drop');
wait(1200 + random(1000));
Case LowerCase(Players[CurrentPlayer].Strings[1]) Of
'tree': ReportVars[4] := ReportVars[4] + 28;
'oak': ReportVars[5] := ReportVars[5] + 28;
'willow': ReportVars[6] := ReportVars[6] + 28;
'all': ReportVars[7] := ReportVars[7] + 28;
End;
End;
End;
Until (Not (finddtm(logdtm, x, y, 550, 203, 731, 464)));
freedtm(logdtm);
Begin
Dropper := Dropper + 1;
TreesChopped := TreesChopped + 27;
report;
FindRandoms;
Report;
//MyAntiBan;
End;
End;





Procedure FastDrop;
Var
i: Integer;
Begin
If Not (LoggedIn) Or Not (Players[CurrentPlayer].Active) Then
NextPlayer(false);
Writeln('Using Fast Dropping');
//SRLStatsNeedSent;
If Not (LoggedIn) Then Exit;
GameTab(4);
For i := 2 To 28 Do
Begin
If ExistsItem(i) Then
DropItem(i);
End;
Case LowerCase(Players[CurrentPlayer].Strings[1]) Of
'Tree' , 'tree' , 'Trees', 'trees' : stats_IncVariable('Normal Logs Chopped',27);
'Oaks' , 'oaks' , 'Oak' , 'oak' : stats_IncVariable('Oak Logs Chopped',27);
'Willows' , 'Willow' , 'willows' , 'willows' : stats_IncVariable('Willow Logs Chopped',27);
// 'all': ReportVars[7] := ReportVars[7] + 28;
End;
Begin
Dropper := Dropper + 1;
Loads1 := Loads1 + 1;
TreesChopped := TreesChopped + 27;
report;
FindRandoms;
Report;
if TakeBreaks then
if Loads1 > Loads then
begin
writeln('Going to Sleep');
Logout;
GoodNight;
Loads1 := 0;
end;
//MyAntiBan;
End;
End;



Procedure PinkyPowerChopper;
Begin
If Not (LoggedIn) Or Not (Players[CurrentPlayer].Active) Then
NextPlayer(false);
If (invfull) Then
Begin
Case (DropType) Of
'Smart': SmartDrop;
'Fast': FastDrop;
End;
TreesChopped := TreesChopped + 27;
stats_IncVariable('Willow Logs Chopped',27);
Stats_Commit;
report;
End;
End;


Procedure Check;
begin
WriteLn(GetPage('http://P1nky.webs.com/Version.txt'));
Version:= GetPage('http://P1nky.webs.com/Version.txt');
if Version <> '' then
// begin
// if (StrToFloat(Version) = VERSION_NUMBER) then
begin
ClearDebug;
WriteLn('');
WriteLn('Your version is not the latest. Get the latest version from:');
WriteLn('The Link To The Thread Of Your Script');
WriteLn('');
TerminateScript;
end else
Writeln('This Script is Up to Date!');
Wait(2000);
ClearDebug;
end;
Procedure Check1;
var
Version1 :string;
begin
WriteLn(GetPage('http://p1nky.webs.com/Version.txt'));
Version1:= GetPage('http://P1nky.webs.com/Version.txt');
if Version1 <> '' then
begin
if (StrToFloat(Version1) = Ver) then
begin
WriteLn('You have the lastest version of this script.');
LastestVersion := True;
end else
begin
WriteLn('There is a newer version of this script available. Get it here: http:villavu.com/forum/showthread.php?t=67367');
if MessageBox('There is a new version of this script available!'+chr(13)+'Would you like to open the download page in a new window?', 'Version alarm', 4) = 6 then
begin
OpenWebPage('http://villavu.com/forum/showthread.php?t=20826');
TerminateScript;
end;
end;
end else
begin
WriteLn('Couldn''t check the version number.');
LastestVersion := True;
end;
end;

begin
Check1;
if not DoYouLoveSRL then
begin

writeln('Sorry. Terminating Script. Love SRL or GTFO.');
wait(500);
writeln('Sorry. Terminating Script. Love SRL or GTFO.');
wait(500);
writeln('Sorry. Terminating Script. Love SRL or GTFO.');
wait(500);
writeln('Sorry. Terminating Script. Love SRL or GTFO.');
wait(500);
writeln('Sorry. Terminating Script. Love SRL or GTFO.');
wait(500);
writeln('Sorry. Terminating Script. Love SRL or GTFO.');
wait(500);
writeln('Sorry. Terminating Script. Love SRL or GTFO.');
TerminateScript;
end;
begin
Disguise('P1nky PowerChopper - Since 2007 - Version A');
ClearDebug;
ClearReport;
Smart_Server := 17;
Smart_Members := false;
Smart_Signed := true;
Smart_SuperDetail := false;
begin
if (SRLStats_Username = '') then
SetupSRLStats(230, 'Anonymous', 'anon1337')
else
SetupSRLStats(230, SRLStats_Username, SRLStats_Password);
SetupSRL;
declareplayerz;
Report;
LoginPlayer;
Dropper := 0;
TreesChopped := 0;
Report;
repeat
Case LowerCase(Players[CurrentPlayer].Strings[0]) Of
'Oaks' , 'oaks' , 'Oak' , 'oak' : FindOaks;
'Willows' , 'Willow' , 'willows' , 'willows' : FindWillows;
'Tree' , 'tree' , 'Trees', 'trees' : FindTrees;
end;
If (InvFull) Then
begin
//If PowerChop Then PinkyPowerChopper;
FastDrop;
end;
until(false);
//end;
end;
end;
end.
{ // stats_IncVariable('Total EXP Gained', Players[CurrentPlayer].Integers[21]);
_____ ______ ____ ______ _____ ____ ___ ___ ___ ___
/ ___/| T / T| T/ ___/ / T| \ | \ / _]| \
( \_ | |Y o || ( \_ Y o || \ | \ / [_ | \
\__ Tl_j l_j| |l_j l_j\__ T | || D Y| D YY _]| D Y
/ \ | | | | _ | | | / \ | | _ || || || [_ | |
\ | | | | | | | | \ | | | || || || T| |
\___j l__j l__j__j l__j \___j l__j__jl_____jl_____jl_____jl_____j


____ __ __ __ __ ___ ____ ____ ____ ______
| \ | T T | T T / \ | \ | \ l j| T
| o )| | | | l |Y Y| o )| o ) | T | |
| T| ~ | | _ || O || T| T | | l_j l_j
| O |l___, | | | || || O || O | | | | |
| || ! | | |l !| || | j l | |
l_____jl____/ l__j__j \___/ l_____jl_____j|____j l__j
}
//ASCII ART TEXt


Daniel

2011-11-21 00:34:03

Just saying, but I would ditch the use of InChat in your Grats procedure. What if people are saying "congratulations" to somebody else?

P1nky

2011-11-21 18:27:27

From: Daniel
Just saying, but I would ditch the use of InChat in your Grats procedure. What if people are saying "congratulations" to somebody else?


True.
Most that would happen is just a +1 on report, Although did you find any problems with the SRL stats?