SRL Archive - First Scripts

Bitmap From String Help..


Puffo

2007-10-31 12:07:54

Hello. Im trying to learn how to use BitmapFromString but i cant getting the mouse to click at the bitmap :S Ill like if somone can tell me how to do this and maby do it for me so i can see what i did wrong
This is my script(test):
(Im sorry for my bad english)
program New;

var
target: integer;

procedure LoadBitmap;
begin
target := BitmapFromString(32, 26, 'a9E58A78DACD93CD6A443108' +
'855FC97835EAD29FE4FD1FA9716E295D74A043A18C8B1311D12F8' +
'7040020EA08C87584398FCE81AD405DD1D939F95154FAEAE1FDA8' +
'77234CED4378B7D2EA4A70E7FE98893D7FC4A3F5E518F02E3172A' +
'7A6067BB8BF0F555D59590769FB7E03C7C6A7579A2347ACA0A0EF' +
'F5FF27D450D4212128387DE2441559523E8C8D437D79A5E795F88' +
'4F337FA727070075151DDF9645E5C723ED3542571710B03834057' +
'97E4C8C89A05B9172F5C98123BB65F26368FD31AE2E9E060B31FE' +
'99F7DFEE1A6F776036D44960360AE5BD7BDF7F6D3585D8D1619E9' +
'21C6436FB6AC82FC343FA3FA0055D');
end;

procedure FBitmap;
var
x, y :integer;
begin
if FindDTM(target, x, y, 553, 209, 725, 457) then
movemouse(x,y)
end;
begin
end.
Thanks

Rikje

2007-10-31 12:21:57

you dont decalre the bitmap?


program New;
{.include srl/srl.scar}
var
target: integer;

procedure LoadBitmap;
begin
target := BitmapFromString(32, 26, 'a9E58A78DACD93CD6A443108' +
'855FC97835EAD29FE4FD1FA9716E295D74A043A18C8B1311D12F8' +
'7040020EA08C87584398FCE81AD405DD1D939F95154FAEAE1FDA8' +
'77234CED4378B7D2EA4A70E7FE98893D7FC4A3F5E518F02E3172A' +
'7A6067BB8BF0F555D59590769FB7E03C7C6A7579A2347ACA0A0EF' +
'F5FF27D450D4212128387DE2441559523E8C8D437D79A5E795F88' +
'4F337FA727070075151DDF9645E5C723ED3542571710B03834057' +
'97E4C8C89A05B9172F5C98123BB65F26368FD31AE2E9E060B31FE' +
'99F7DFEE1A6F776036D44960360AE5BD7BDF7F6D3585D8D1619E9' +
'21C6436FB6AC82FC343FA3FA0055D');
end;

procedure FBitmap;
var
x, y :integer;
begin
if FindDTM(target, x, y, 553, 209, 725, 457) then
begin
Mouse(x, y, 1, 1, True); //true = left click, false = right click
WriteLn('Found bitmap');
end else
WriteLn('not found bitmap');
end;

begin
setupsrl;
Loadbitmap;
Fbitmap;
end.

Puffo

2007-10-31 12:22:40

Okay Thanks ill try that :)

Rikje

2007-10-31 12:23:53

ok, tell me if it worked ;)

Puffo

2007-10-31 12:25:07

Well….Now then im "playing"? The scripts its say:
Line 31: [Error] (56:1): Duplicate identifier '' in script C:\Programmer\SCAR 3.11\includes\SRL/SRL/Core/Globals.scar
…

Rikje

2007-10-31 12:36:01


program New;
{.include srl/srl.scar}
var
target, x, y: integer;

procedure Load;
begin
target := BitmapFromString(32, 26, 'a9E58A78DACD93CD6A443108' +
'855FC97835EAD29FE4FD1FA9716E295D74A043A18C8B1311D12F8' +
'7040020EA08C87584398FCE81AD405DD1D939F95154FAEAE1FDA8' +
'77234CED4378B7D2EA4A70E7FE98893D7FC4A3F5E518F02E3172A' +
'7A6067BB8BF0F555D59590769FB7E03C7C6A7579A2347ACA0A0EF' +
'F5FF27D450D4212128387DE2441559523E8C8D437D79A5E795F88' +
'4F337FA727070075151DDF9645E5C723ED3542571710B03834057' +
'97E4C8C89A05B9172F5C98123BB65F26368FD31AE2E9E060B31FE' +
'99F7DFEE1A6F776036D44960360AE5BD7BDF7F6D3585D8D1619E9' +
'21C6436FB6AC82FC343FA3FA0055D');
end;

procedure FBitmap;
begin
if FindBitmapToleranceIn(target, x, y, 553, 209, 725, 457, 20) then
begin
Mouse(x, y, 1, 1, True); //true = left click, false = right click
WriteLn('Found bitmap');
end else
WriteLn('not found bitmap');
end;

begin
setupsrl;
Load;
Fbitmap;
end.

it works for me.
btw,, you had finddtm. but you where using a bitmap.

Puffo

2007-10-31 12:55:05

I still have a probelm whit Globals.scar its keep saying:
Duplicate identifier '' in script C:\Programmer\SCAR 3.11\includes\SRL/SRL/Core/Globals.scar

Rikje

2007-10-31 13:02:13

make sure you have scar divi. and the lasted version of srl.

Puffo

2007-10-31 13:20:01

Okay Thanks..Ill try that :)

Puffo

2007-10-31 14:03:57

Okay..I have tryet to fing out how to update but i cant trun on "Subversion Repostiory" in option..I dont know why :S

Puffo

2007-10-31 14:08:20

Nvm. I fond out by my self

Puffo

2007-10-31 14:09:27

And its working grate thanks you all :)

Rikje

2007-10-31 14:13:19

iam glad that it works now ;) Good luck with you're script :)

(try not to double / triple post).