
Originally Posted by
RsExploit
Hey guys this is my first post in here, but I have been looking around a lot.
I am working on learning to script, and I am using the minimap to find a color on it, and move my character, but instead of searching in the right areas I have listed my mouse cursor is just moved to the 0,0 coordinates on my computer. The error is in these lines
procedure FindStall;
var x, y: integer;
begin
FindColor(x, y, 2441027, 940, 135, 947, 141);
MoveMouse(x, y);
ClickMouse(x, y, 1)
end;
It moves like the x, y are set to 0,0 and then left clicks. Should take an experienced person 30s to answer =0
You should use an if...then...else statement.
If it finds the colour...then move the mouse and click....else we didn't find the colour
Simba Code:
procedure FindStall;
var x, y: integer;
begin // these are the minimap coordinates built into SRL already. MM colours change so use a tolerance, in this case 10.
if FindColorTolerance(x, y, 2441027, MMX1, MMY1, MMX2, MMY2, 10) then
begin //we need a begin and end because there is more than one statement after then
MMouse(x, y, 2, 2); //MMouse is less detectable and the 2 px of randomness in each direction
ClickMouse2(mouse_left); //ClickMouse2 is also less detectable
end else
WriteLn('We didnt find the colour on the MM');
end;
SjoeIsCool