SRL Archive - General Botting Help

Error: Access violation


Andrmolja

2015-04-17 08:45:48

I have installed Java 8 but I'm not sure that Java creates a problem in my code.

Here is a piece of code that I think that creates a problem.

program new;

var
i,s : integer;
b,t : string;
begin
i := 1;


WHILE i <=19999 DO
begin

ClickMouse ( 390, 329, mouse_left ); //
ClickMouse ( 390, 329, mouse_left ); // This code taken string
ClickMouse ( 390, 329, mouse_left ); // in CHAT on Firefox.
ClickMouse ( 390, 329, mouse_right ); // Sets the ClipBoard
wait (391); // with the option Copy
MoveMouse ( 458, 344); // (right_click,
ClickMouse ( 458,344, mouse_left ); // then left_click Copy)

s := Length(getClipBoard());
b := getClipBoard();

if s <= 3 then s := 4;


t := b[s-2];

i := i + 1;
end;

end.
loop works well (10 min - 1 hour) and then report error
Error: Access violation at line
t :=   b[s-2];

Most common ERROR is displayed when the s = 0.
That's why I put a line:
if s <= 3 then s := 4;


but error(Access violation) is still sometimes displayed.

rj

2015-04-17 11:51:06

The index b[s-2] does not exist, in other words the array is either empty or does not reach that high. You should add a length check before you do t := b[s-2]

if (length(b)) = 0) then
dosomething

Andrmolja

2015-04-17 16:35:20

Thank you. I tested code 2 hours and no error. Thank you very much RJ.