How can I get it to right click on a shop item, then press Buy-10? The co-ords don't work properly...
How can I get it to right click on a shop item, then press Buy-10? The co-ords don't work properly...



What do you mean the coords don't work properly? Just repick them. Unless you're talking about actually picking "buy 10". In that case, use the function ChooseOption.
Ok, I tried this:
SCAR Code:program Script;
{.include SRL/SRL.scar}
begin
activateclient;
wait(200)
ChooseOption(94, 131, 'uy 10');
End.
It does nothing. I want it to right click those co ords, then choose buy 10.
Try this:
SCAR Code:program Script;
{.include SRL/SRL.scar}
begin
activateclient;
Mouse(94, 131, 1, 1, False);
PopUp('Buy 10');
End.
It right clicks, then stops with this error:
SCAR Code:[Runtime Error] : Exception: Access violation at address 0064FEA2 in module 'scar.exe'. Read of address 00000000 in line 239 in script C:\Program Files\SCAR 2.03\includes\srl\srl\core\Text.scar



You need to put SetupSRL; as the first thing in your main loop.
SCAR Code:program Script;
{.include SRL/SRL.scar}
Procedure BuyItems;
begin
Mouse(94, 131, 1, 1, False);
PopUp('Buy 10');
end;
Procedure SetupScript;
begin
SetupSRL;
activateclient;
End.
It worked, I just tried creating the main loop, error:
SCAR Code:Failed when compiling
[Error] (17676:4): Semicolon (';') expected
SCAR Code:program new;
function functionname(functionparamaters);
begin
stuff;
end;
//main loop
begin
functionname;
end.
All ends should be end; with semi colon, except the main loop with a period/full stop/dot end.
You cant end the script like that, try this.
SCAR Code:{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
program test;
{.include SRL/SRL.scar}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
procedure BuyItems;
begin
Mouse(94, 131, 1, 1, False);
PopUp('Buy 10');
end;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
procedure SetupScript;
begin
SetupSRL;
activateclient;
end;
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
begin
SetupScript;
BuyItems;
end.
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
What are parameters?
Whats the difference between functions and procedures?
Parameters are the options in the ( ). Not all functions and procedures have them.
Functions return a value. For example FindColor returns true if it found the color.
Get Drigers tutorial.exe. See my FAQ part 1 link in sig.
There are currently 1 users browsing this thread. (0 members and 1 guests)