FHannes Posted April 16, 2012 Share Posted April 16, 2012 If Freddy added a Desktop boolean to SaveScreenshot, that'd eliminate 10 lines of code right there! And make it incompatible with every script that was written in 10 years that uses it... Quote Link to comment Share on other sites More sharing options...
LordJashin Posted April 16, 2012 Share Posted April 16, 2012 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> Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted April 16, 2012 Share Posted April 16, 2012 If Freddy added a Desktop boolean to SaveScreenshot, that'd eliminate 10 lines of code right there! Those are all scar functions so it will take less than a few ms to do. Quote Link to comment Share on other sites More sharing options...
LordJashin Posted April 16, 2012 Share Posted April 16, 2012 Those are all scar functions so it will take less than a few ms to do. I know, was joking earlier. Freddy, why is implementing multithreading hard? Do you need a different interpreter? Quote Link to comment Share on other sites More sharing options...
FHannes Posted April 16, 2012 Share Posted April 16, 2012 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. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted April 16, 2012 Share Posted April 16, 2012 I know, was joking earlier. Freddy, why is implementing multithreading hard? Do you need a different interpreter? Try using Ttimers as threads if you need a function to run at a certain interval. Quote Link to comment Share on other sites More sharing options...
ludger Posted April 28, 2012 Author Share Posted April 28, 2012 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] Quote Link to comment Share on other sites More sharing options...
wyn10 Posted April 28, 2012 Share Posted April 28, 2012 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. Quote Link to comment Share on other sites More sharing options...
LordJashin Posted April 28, 2012 Share Posted April 28, 2012 (edited) 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 April 28, 2012 by LordJashin Quote Link to comment Share on other sites More sharing options...
ludger Posted April 28, 2012 Author Share Posted April 28, 2012 thanks both of you i see now that i didn't closed my arguments of the y coords with the ( and ) properly. Quote Link to comment Share on other sites More sharing options...
ludger Posted June 11, 2012 Author Share Posted June 11, 2012 (edited) 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 June 11, 2012 by ludger Quote Link to comment Share on other sites More sharing options...
opiumhautopium1 Posted June 11, 2012 Share Posted June 11, 2012 (edited) 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 June 11, 2012 by opiumhautopium1 Quote Link to comment Share on other sites More sharing options...
ludger Posted August 19, 2012 Author Share Posted August 19, 2012 Thanks, now I have another Issue. I was wondering if there is a possibility to scroll down using scar? Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted August 19, 2012 Share Posted August 19, 2012 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] Quote Link to comment Share on other sites More sharing options...