SRL Archive - News and General

Anyone Want To Test This?


skilld u

2008-03-18 23:16:09

Can some one just run this and make sure it works with no errors. auth user and pass is test

Program MyScript;


var
frmDesign : TForm;
GroupBox1 : TGroupBox;
Label1 : TLabel;
Label3 : TLabel;
Edit1 : TEdit;
AuthPassword : TEdit;
Rememberme : TCheckBox;
Login : TButton;
GroupBox2 : TGroupBox;
WhatsGoingOn : TMemo;
YourAuthPass : string;
YourAuthUser : string;
PlayerForm : TForm;
GroupBox3 : TGroupBox;
UserNameLabel : TLabel;
Label2 : TLabel;
Label5 : TLabel;
UserNameEdit : TEdit;
Passwordedit : TEdit;
ActiveComboBox : TComboBox;
GroupBox4 : TGroupBox;
Username2 : TLabel;
Password2 : TLabel;
Active2 : TLabel;
Edit9 : TEdit;
Passwordbox2 : TEdit;
True2 : TComboBox;
Usernamebox2 : TEdit;

function Authenticate: Boolean; Forward;

procedure StartClick(sender: TObject);
begin
YourAuthUser := (Edit1.Text);
YourAuthPass := (AuthPassword.Text);
if RememberMe.Checked then
begin
SaveSetting('MagicCutter', 'AuthUser', Edit1.Text);
SaveSetting('MagicCutter', 'AuthPass', AuthPassword.Text);
SaveSetting('MagicCutter', 'Remember', 'Yes');
end;
if Authenticate then
frmDesign.ModalResult:= mrOk;
if not Authenticate then
Exit;
FreeForm(frmDesign);
end;


procedure PlayerFormStuff;
begin
PlayerForm := CreateForm;
PlayerForm.Left := 250;
PlayerForm.Top := 114;
PlayerForm.Width := 465;
PlayerForm.Height := 241;
PlayerForm.Caption := 'Player Setup';
PlayerForm.Color := clBtnFace;
PlayerForm.Font.Color := clWindowText;
PlayerForm.Font.Height := -11;
PlayerForm.Font.Name := 'MS Sans Serif';
PlayerForm.Font.Style := [];
PlayerForm.Visible := False;
PlayerForm.PixelsPerInch := 96;
GroupBox3 := TGroupBox.Create(PlayerForm);
GroupBox3.Parent := PlayerForm;
GroupBox3.Left := 16;
GroupBox3.Top := 16;
GroupBox3.Width := 201;
GroupBox3.Height := 177;
GroupBox3.Caption := 'Player One';
GroupBox3.TabOrder := 0;
UserNameLabel := TLabel.Create(GroupBox1);
UserNameLabel.Parent := GroupBox1;
UserNameLabel.Left := 20;
UserNameLabel.Top := 48;
UserNameLabel.Width := 53;
UserNameLabel.Height := 13;
UserNameLabel.Caption := 'User Name';
UserNameLabel.Font.Color := clWindowText;
UserNameLabel.Font.Height := -11;
UserNameLabel.Font.Name := 'MS Sans Serif';
UserNameLabel.Font.Style := [];
UserNameLabel.ParentFont := False;
Label2 := TLabel.Create(GroupBox1);
Label2.Parent := GroupBox1;
Label2.Left := 20;
Label2.Top := 88;
Label2.Width := 46;
Label2.Height := 13;
Label2.Caption := 'Password';
Label5 := TLabel.Create(GroupBox1);
Label5.Parent := GroupBox1;
Label5.Left := 20;
Label5.Top := 128;
Label5.Width := 36;
Label5.Height := 13;
Label5.Caption := 'Active?';
UserNameEdit := TEdit.Create(GroupBox1);
UserNameEdit.Parent := GroupBox1;
UserNameEdit.Left := 88;
UserNameEdit.Top := 40;
UserNameEdit.Width := 97;
UserNameEdit.Height := 21;
UserNameEdit.TabOrder := 0;
Passwordedit := TEdit.Create(GroupBox1);
Passwordedit.Parent := GroupBox1;
Passwordedit.Left := 88;
Passwordedit.Top := 80;
Passwordedit.Width := 97;
Passwordedit.Height := 21;
Passwordedit.TabOrder := 1;
ActiveComboBox := TComboBox.Create(GroupBox1);
ActiveComboBox.Parent := GroupBox1;
ActiveComboBox.Left := 88;
ActiveComboBox.Top := 120;
ActiveComboBox.Width := 97;
ActiveComboBox.Height := 21;
ActiveComboBox.ItemHeight := 13;
ActiveComboBox.TabOrder := 2;
ActiveComboBox.Text := 'True';
GroupBox4 := TGroupBox.Create(PlayerForm);
GroupBox4.Parent := PlayerForm;
GroupBox4.Left := 240;
GroupBox4.Top := 16;
GroupBox4.Width := 201;
GroupBox4.Height := 177;
GroupBox4.Caption := 'Player Two';
GroupBox4.TabOrder := 1;
Username2 := TLabel.Create(GroupBox2);
Username2.Parent := GroupBox2;
Username2.Left := 16;
Username2.Top := 48;
Username2.Width := 53;
Username2.Height := 13;
Username2.Caption := 'User Name';
Password2 := TLabel.Create(GroupBox2);
Password2.Parent := GroupBox2;
Password2.Left := 16;
Password2.Top := 88;
Password2.Width := 46;
Password2.Height := 13;
Password2.Caption := 'Password';
Active2 := TLabel.Create(GroupBox2);
Active2.Parent := GroupBox2;
Active2.Left := 16;
Active2.Top := 128;
Active2.Width := 36;
Active2.Height := 13;
Active2.Caption := 'Active?';
Edit9 := TEdit.Create(GroupBox2);
Edit9.Parent := GroupBox2;
Edit9.Left := 96;
Edit9.Top := 32;
Edit9.Width := 1;
Edit9.Height := 21;
Edit9.TabOrder := 0;
Edit9.Text := 'Edit1';
Passwordbox2 := TEdit.Create(GroupBox2);
Passwordbox2.Parent := GroupBox2;
Passwordbox2.Left := 88;
Passwordbox2.Top := 80;
Passwordbox2.Width := 97;
Passwordbox2.Height := 21;
Passwordbox2.TabOrder := 1;
True2 := TComboBox.Create(GroupBox2);
True2.Parent := GroupBox2;
True2.Left := 88;
True2.Top := 120;
True2.Width := 81;
True2.Height := 21;
True2.ItemHeight := 13;
True2.TabOrder := 2;
True2.Text := 'True';
Usernamebox2 := TEdit.Create(GroupBox2);
Usernamebox2.Parent := GroupBox2;
Usernamebox2.Left := 88;
Usernamebox2.Top := 40;
Usernamebox2.Width := 97;
Usernamebox2.Height := 21;
Usernamebox2.TabOrder := 3;
end;

procedure ShowPlayerForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('PlayerFormStuff', v);
end;

procedure ShowPlayerformModal;
begin
PlayerForm.ShowModal;
end;

procedure SafeShowModalPlayerForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowPlayerformModal', v);
end;

procedure FormStuff;
begin
frmDesign := CreateForm;
frmDesign.Left := 259;
frmDesign.Top := 128;
frmDesign.Width := 449;
frmDesign.Height := 297;
frmDesign.Caption := 'Skilld Magic Tree Chopper';
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;
GroupBox1 := TGroupBox.Create(frmDesign);
GroupBox1.Parent := frmDesign;
GroupBox1.Left := 16;
GroupBox1.Top := 32;
GroupBox1.Width := 193;
GroupBox1.Height := 201;
GroupBox1.Caption := 'Authentification';
GroupBox1.TabOrder := 0;
Label1 := TLabel.Create(GroupBox1);
Label1.Parent := GroupBox1;
Label1.Left := 24;
Label1.Top := 48;
Label1.Width := 48;
Label1.Height := 13;
Label1.Caption := 'Username';
Label1.Font.Color := clWindowText;
Label1.Font.Height := -8;
Label1.Font.Name := 'MS Sans Serif';
Label1.Font.Style := [];
Label1.ParentFont := False;
Label3 := TLabel.Create(GroupBox1);
Label3.Parent := GroupBox1;
Label3.Left := 24;
Label3.Top := 80;
Label3.Width := 46;
Label3.Height := 13;
Label3.Caption := 'Password';
Edit1 := TEdit.Create(GroupBox1);
Edit1.Parent := GroupBox1;
Edit1.Left := 96;
Edit1.Top := 48;
Edit1.Width := 81;
Edit1.Height := 21;
Edit1.TabOrder := 0;
AuthPassword := TEdit.Create(GroupBox1);
AuthPassword.Parent := GroupBox1;
AuthPassword.Left := 96;
AuthPassword.Top := 80;
AuthPassword.Width := 81;
AuthPassword.Height := 21;
AuthPassword.TabOrder := 1;
AuthPassword.PasswordChar := '*';
Rememberme := TCheckBox.Create(GroupBox1);
Rememberme.Parent := GroupBox1;
Rememberme.Left := 24;
Rememberme.Top := 112;
Rememberme.Width := 97;
Rememberme.Height := 33;
Rememberme.Caption := 'Remember Me?';
Rememberme.TabOrder := 2;
Login := TButton.Create(GroupBox1);
Login.Parent := GroupBox1;
Login.Left := 56;
Login.Top := 152;
Login.Width := 81;
Login.Height := 25;
Login.Caption := 'Login';
Login.TabOrder := 3;
Login.OnClick := @StartClick;
GroupBox2 := TGroupBox.Create(frmDesign);
GroupBox2.Parent := frmDesign;
GroupBox2.Left := 224;
GroupBox2.Top := 32;
GroupBox2.Width := 193;
GroupBox2.Height := 201;
GroupBox2.Caption := 'What'#39's Going On';
GroupBox2.TabOrder := 1;
WhatsGoingOn := TMemo.Create(GroupBox2);
WhatsGoingOn.Parent := GroupBox2;
WhatsGoingOn.Left := 16;
WhatsGoingOn.Top := 24;
WhatsGoingOn.Width := 161;
WhatsGoingOn.Height := 161;
WhatsGoingOn.Lines.Add('Enter Your Auth Username and Password Please');
WhatsGoingOn.TabOrder := 0;
end;

procedure ShowForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('FormStuff', v);
end;

procedure ShowformModal;
begin
frmDesign.ShowModal;
end;

procedure SafeShowModal;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowformModal', v);
end;

function Authenticate: Boolean;
var
AuthUser : string;
AuthPass : string;
begin
AuthUser := 'test';
AuthPass := 'test';
if (AuthPass = YourAuthPass) and (AuthUser = YourAuthUser) then
begin
WhatsGoingOn.Clear;
WhatsGoingOn.Lines.Add('Thank You For Buying');
Result := True;
end else
begin
WhatsGoingOn.Clear;
WhatsGoingOn.Lines.Add('Your Username or Password were incorrect, Please Try Again.');
end;
end;

begin
ShowForm;
If LoadSetting('MagicCutter', 'Remember') = 'Yes' then
begin
Edit1.Text := LoadSetting('MagicCutter', 'AuthUser');
AuthPassword.Text := LoadSetting('MagicCutter', 'AuthPass');
end;
SafeShowModal;
ShowPlayerForm;
SafeShowModalPlayerForm;
end.

rockman

2008-03-18 23:48:42

I'm getting:




skilld u

2008-03-18 23:49:16

i got those errors too.

anyone know how to fix them?

rockman

2008-03-18 23:52:42

Sorry, I only know how to take screenshots and upload images lol

skilld u

2008-03-18 23:53:23

lol

Naum

2008-03-20 04:09:34

Read This:

Access violation usually always happens when somebody doesn't call for setupSRL; in there main loop of script (if your include is {.include SRL/SRL.scar}..) so heres what would be wrong:
Example:

program WhatEver;
{.include SRL/SRL.scar}
procedure Whatever2;
begin
//code here..
end;
begin //main loop.
Whatever2;
end.

See. now that would be wrong because you don't have SetupSRL; in your main loop. remember when using SetupSRL; you need it to be pretty much the first thing in your main loop, before any autoing. Heres a working example:

program WhatEver;
{.include SRL/SRL.scar}
procedure Whatever2;
begin
//code here..
end;
begin //main loop.
SetupSRL; //heres why it works now :D
Whatever2;
end.

The other most common way people get this error is calling for a bitmap when you didn't declare it. Lets say your script is something like this:

program Whatever;

var TheBitmap, x,y: Integer;

procedure LoadBitmaps;
begin

TheBitmap := BitmapFromString//And then the rest of your bitmap of course...

end;

procedure ClickTheBitmap;
begin
if(FindBitmap(TheBitmap,x,y))then
begin
wait(100+random(100));
Mouse(x,y,0,0,true);
end;
end;

begin
ClickTheBitmap;
end.

Now, that would cause an error! Do you know why? Because you didn't declare the LoadBitmaps procedure in the main loop as many people fail to do. So here is how it would look correctly:


program Whatever;

var TheBitmap, x,y: Integer;

procedure LoadBitmaps;
begin

TheBitmap := BitmapFromString//And then the rest of your bitmap of course...

end;

procedure ClickTheBitmap;
begin
if(FindBitmap(TheBitmap,x,y))then
begin
wait(100+random(100));
Mouse(x,y,0,0,true);
end;
end;

begin
LoadBitmaps; //This is what fixed the error!
ClickTheBitmap;
end.

Markus

2008-03-20 04:21:58

From: NaumanAkhlaQ
Read This:

Access violation usually always happens when somebody doesn't call for setupSRL; in there main loop of script (if your include is {.include SRL/SRL.scar}..) so heres what would be wrong:

See. now that would be wrong because you don't have SetupSRL; in your main loop. remember when using SetupSRL; you need it to be pretty much the first thing in your main loop, before any autoing. Heres a working example:

He doesn't use SRL.
From: NaumanAkhlaQ

The other most common way people get this error is calling for a bitmap when you didn't declare it. Lets say your script is something like this:
{removed script}
Now, that would cause an error! Do you know why? Because you didn't declare the LoadBitmaps procedure in the main loop as many people fail to do. So here is how it would look correctly:


There are no bitmaps.
And btw, it's always nice to post your source and to give credits to the original author.


Access violation is caused by this:

346 Edit1.Text := LoadSetting('MagicCutter', 'AuthUser');
347 AuthPassword.Text := LoadSetting('MagicCutter', 'AuthPass');
You aren't calling them in threadsafemode, so you'll get the error.

GoF

2008-03-20 11:17:19

From: NaumanAkhlaQ
Read This:

Access violation usually always happens when somebody doesn't call for setupSRL; in there main loop of script (if your include is {.include SRL/SRL.scar}..) so heres what would be wrong:
Example:

See. now that would be wrong because you don't have SetupSRL; in your main loop. remember when using SetupSRL; you need it to be pretty much the first thing in your main loop, before any autoing. Heres a working example:

The other most common way people get this error is calling for a bitmap when you didn't declare it. Lets say your script is something like this:

Now, that would cause an error! Do you know why? Because you didn't declare the LoadBitmaps procedure in the main loop as many people fail to do. So here is how it would look correctly:


What are you talking about? SRL is not user there, nor is there any bitmaps :p :garfield:

Naum

2008-03-20 12:40:48

No its JAD's i thought everyone knew about it.
It's stickied aswell??

R0b0t1

2008-03-20 15:45:45

Simply: Access violations occur when you attempt to access something that is non-existent, or you run out of memory.

Markus

2008-03-20 15:59:03

From: R0b0t1
Simply: Access violations occur when you attempt to access something that is non-existent, or you run out of memory.


Or when you access something you don't have access too ;)