SRL Archive - Help

Error: Exception: "Tele_var" is an invalid integer at line 11


rj

2013-01-01 16:37:32

Getting this error, I am testing out if my DTM's are accurate enough in my include, Is there anyway I can input the DTM name and it click the DTM. I tried to do it like this but I am not sure if it is possible:

program Test;
{$i srl/srl.simba}
{$include SoulSplit/SoulInclude.simba}

var
DTMClick: string;

procedure ClickDTM;
var
x, y: integer;
begin
if FindDTM((StrToInt(DTMClick)), x, y, SS_IX, SS_IY, SS_IX2, SS_IY2) then
begin
mmouse(x, y, 1, 1);
wait(randomrange(150, 250));
ClickMouse2(mouse_left);
end
else
Writeln('DTM not found!');
end;

procedure AskDTM;
begin
if (InputQuery('DTM To click?', 'DTM:', DTMClick)) then
ClickDTM;
end;

begin
MouseSpeed := 15;
SetupSoulInclude;
AskDTM;
end.

xdarkshadowx

2013-01-01 19:00:10

Are you just trying to see if it's there? and to click it if it is?

riwu

2013-01-01 19:03:55

DTMClick is a string. How are you suppose to convert it to integer? Declaring it as integer again will cause duplicate identifier error.

Only real numbers can be converted with StrToInt().

rj

2013-01-01 19:44:59

if i do it any other way then it will think its looking for 'DTMClick'

xdarkshadowx

2013-01-01 20:06:13

I'd use a straightforward approach, but that's just me..

function clickaDTM(): boolean;
var
aDTM : integer;
begin
aDTM := DTMFromString('awet3154272');
findDTM(aDTM,x,y, tbox, 12);

mouse(x,y,1,1,true);

end;

rj

2013-01-01 20:19:52

i just wont add user input for this -.-

Justin

2013-01-01 20:26:02

Why not use a 'case' of the user input and set 'DTMClick' to the DTM that you want clicked?