put something like
if FindNormalRandoms or FindNonInventoryRandoms then
begin
LogOut;
TerminateScript;
end;
into your mainloop or wherever (i'd recommend making a procedure instead which you then call in your mainloop).
This will check wherever you place this for a 'normal' random or 'non-inventory' random and if they are found it will log out your player and then completely stop your script.
Try using the 'edit' button at the bottom of your posts, saves double-posting which is a no-no on the SRL forums.
EDIT: Steer well clear of movemouse(x, y); and clickmouse(x, y, 1); They are horribly likely to get you banned if this is for actual runescape.
for moving the mouse use MMouse(x,y,randx,randy);
for moving and clicking use Mouse(x,y,randx,randy,clicktype);
and for click where your mouse already is use ClickMouse2(clicktype);
These movements are MUCH more human-like and will avoid your impending ban by using the others.