Jump to content
ludger

Beginners help

Recommended Posts

And make it incompatible with every script that was written in 10 years that uses it...

SCAR 10 will come out with cross platform routine finding, resource hacking, with Titan or Zeus support maybe by then those scripts will be obsolete creating the opportunity to add the desktop boolean. Freddy will you be developing scar still 10 years from now ? If so I'll hold you to it. Maybe make a new interpreter option, and with that interpreter have the old functions but with new stuff added like the desktop boolean.</rant>

Link to comment
Share on other sites

I know, was joking earlier.

 

Freddy, why is implementing multithreading hard? Do you need a different interpreter?

 

The current script engine isn't thread-safe, it's not possible to synchronize access to it's call stack and other modules, which causes serious issues when using threads. It's not that I can't add them, it's simply not possible to use for more than a few seconds before SCAR crashes.

Link to comment
Share on other sites

uhm i got another question, why can't i combine holdmouse with movemouse, like this, all suggestions are appreciated!:

 

[sCAR] HoldMouse (1121+random(1)-random(1), 362+random(1)- random(1), true) ;

wait(20+random(21)) ;

MoveMouse (1121+random(1)-random(1), 620+random(1)- random(1), true) ;

wait(20+random(21)) ;

ReleaseMouse (1121+random(1)-random(1), 620+random(1)- random(1), true)

wait(20+random(21)) [/sCAR]

Link to comment
Share on other sites

uhm i got another question, why can't i combine holdmouse with movemouse, like this, all suggestions are appreciated!:

 

[sCAR] HoldMouse (1121+random(1)-random(1), 362+random(1)- random(1), true) ;

wait(20+random(21)) ;

MoveMouse (1121+random(1)-random(1), 620+random(1)- random(1), true) ;

wait(20+random(21)) ;

ReleaseMouse (1121+random(1)-random(1), 620+random(1)- random(1), true)

wait(20+random(21)) [/sCAR]

 

 

If you making this script for rs. I would highly suggest looking into Osi's Mouse.

Link to comment
Share on other sites

uhm i got another question, why can't i combine holdmouse with movemouse, like this, all suggestions are appreciated!:

 

[sCAR] HoldMouse (1121+random(1)-random(1), 362+random(1)- random(1), true) ;

wait(20+random(21)) ;

MoveMouse (1121+random(1)-random(1), 620+random(1)- random(1), true) ;

wait(20+random(21)) ;

ReleaseMouse (1121+random(1)-random(1), 620+random(1)- random(1), true)

wait(20+random(21)) [/sCAR]

First of all make sure each statement in SCAR being: A variable declaration, initialization, procedure/function call ends in a SEMI COLON ;

Except in the case of IF THEN statements, or other special cases.

 

Edit: ALSO, here's a working example of dragging, without using anything different:

Note this is the correct usage. You are supposed to move the mouse to (x, y) before you use HoldMouse or ReleaseMouse afaik, you might not need to, but its still good practice.

 

Will drag the mouse from 50, 50 to 500, 500

 

[sCAR]

MoveMouse(50, 50);

wait(500);

HoldMouse(50, 50, true);

wait(500);

MoveMouse(500, 500);

wait(500);

ReleaseMouse(500, 500, true);

[/sCAR]

Edited by LordJashin
Link to comment
Share on other sites

Tried scripting again just had 1 little issue, why is this not working.

It is not about the text but i can´t get to do 2 arguments with else like I did here.

[sCAR]

begin

LoadBitmap;

If FindBitmapTolerance(mojo, x, y, 25) then

WriteLn('Find') and

WriteLn('Find2')

Else

WriteLn ('Not finding') and

WriteLn ('Not finding2')

 

end.[/sCAR]

 

 

because this is actually working

 

[sCAR]

begin

LoadBitmap;

If FindBitmapTolerance(mojo, x, y, 25) then

WriteLn('Find')

Else

WriteLn ('Not finding')

 

end.[/sCAR]

Edited by ludger
Link to comment
Share on other sites

i think i know where u want to go ... to use some procedures or functions later so u can try this

begin
LoadBitmap;
If FindBitmapTolerance(mojo, x, y, 25) then
   begin
     WriteLn('Find');
     WriteLn('Find2');
   end else
   begin
    WriteLn ('Not finding') ;   
    WriteLn ('Not finding2');
   end;
end;

Edited by opiumhautopium1
Link to comment
Share on other sites

Theres always a way :)

 

[scar]type

TForm1 = record

Form1: TForm;

Memo1: TMemo;

Button1: TButton;

end;

 

var

Form1: TForm1;

 

procedure scroll(sender: tobject);

begin

Form1.Memo1.SelStart := Form1.Memo1.GetTextLen;

Form1.Memo1.SelLength := 0;

Form1.Memo1.ScrollBy(0, Form1.Memo1.Lines.Count);

Form1.Memo1.Refresh;

end;

 

procedure Form1_Init;

begin

with Form1 do

begin

Form1 := CreateForm;

Memo1 := TMemo.Create(Form1);

Button1 := TButton.Create(Form1);

with Form1 do

begin

Left := 376;

Top := 174;

Caption := 'Form1';

ClientHeight := 202;

ClientWidth := 304;

Color := clBtnFace;

Font.Charset := DEFAULT_CHARSET;

Font.Color := clWindowText;

Font.Height := -11;

Font.Name := 'Tahoma';

Font.Style := [];

OldCreateOrder := False;

PixelsPerInch := 96;

end;

with Memo1 do

begin

Parent := Form1;

Left := 8;

Top := 12;

Width := 284;

Height := 168;

Lines.Add('Thanks, now I have another Issue.');

Lines.Add('I was wondering if there is a possibility to scroll down ');

Lines.Add('using scar? ');

Lines.Add('using scar? ');

Lines.Add('using scar? ');

Lines.Add('using scar? ');

Lines.Add('using scar? ');

Lines.Add('using scar? ');

Lines.Add('using scar? ');

Lines.Add('using scar? ');

Lines.Add('using scar? ');

Lines.Add('using scar? ');

ScrollBars := ssVertical;

TabOrder := 0;

end;

with Button1 do

begin

Parent := Form1;

OnClick := @Scroll;

Left := 220;

Top := 180;

Width := 72;

Height := 20;

Caption := 'Button1';

TabOrder := 1;

end;

end;

end;

 

procedure Form1_SafeInit;

var

v: TVariantArray;

begin

SetLength(v, 0);

ThreadSafeCall('Form1_Init', v);

end;

 

function Form1_ShowModal: Boolean;

begin

Result := Form1.Form1.ShowModal = mrOk;

end;

 

function Form1_SafeShowModal: Boolean;

var

v: TVariantArray;

begin

SetLength(v, 0);

Result := ThreadSafeCall('Form1_ShowModal', v);

end;

 

begin

Form1_SafeInit;

Form1_SafeShowModal;

FreeForm(Form1.Form1);

end.[/scar]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...