
Originally Posted by
Haxz
Won't you get error on this line?
if FindChatBoxText('You can''t reach that.',8,ClBlack) then
The word "can't" just ended your string with the '
Nah it doesn't make an error cause I have two ' marks, but maybe it messes up the string.
Instead of 'FindChatBoxText('You can''t reach that.',8,ClBlack)' try this:
Simba Code:
FindBlackChatMessage('t reach th')
Thanks Flight, that worked straight away 
EDIT:
on another note, could anyone tell me what's wrong with the following?
I want the script to retry moving to the right area and click a TPA if it fails to find the TPA.
So far, it will attempt to move to the right area, but just clicks the area 3 times (max attempts) then logs out without trying to click the shortcut again.
Simba Code:
Procedure FindShortcut2;
var
PathTPA, WallTPA:TPointArray;
PathATPA:T2DPointArray;
PathBox:TBox;
attempts: integer;
i, r, counter:integer;
begin
if not(loggedin) then
exit;
Wait(RandomRange(2000, 200));
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.13, 0.43);
if FindColorsSpiralTolerance(MSX1, MSY1, PathTPA, 4413280, MSX1, MSY1, MSX2, MSY2, 20) then
begin
PathATPA := SplitTPAEx(PathTPA, 25, 25);
SortATPASize(PathATPA, True);
for i := 0 to high(PathATPA) do
begin
PathBox := GetTPABounds(PathATPA[i]);
SetColorSpeed2Modifiers(0.20, 3.85);
if FindColorsSpiralTolerance(MSX1, MSY1, WallTPA, 12118515, PathBox.X1, Pathbox.Y1, Pathbox.X2, Pathbox.Y2, 10) then
Break;
if i = high(PathATPA) then
begin
WriteLn('Failed to find wall color.');
repeat
Inc(attempts);
RunBack;
Obstaclearea2;
until (i= high(PathATPA) = false) or (attempts > 3); //Meant to move to the right area and re-search for the wall if it doesn't find the colors.
end;
if (attempts > 3) then
begin
StatsGuise('Failed to find shortcut after a few tries, logging out.');
Failsafe('Failed to find wall and path colors.');
Logout;[/COLOR]
end;
end;
SetColorToleranceSpeed(1);
SetColorSpeed2Modifiers(0.2, 0.2);
marktime(counter);
while (not isuptext('wall')) do
begin
r := random(length(WallTPA));
mmouse(WallTPA[r].x, WallTPA[r].y, 2, 2);
wait(randomrange(200, 500));
if timefrommark(counter) > 15000 then
begin
WriteLn('Failed to click the shortcut.'); //Meant to move to the right area and try and click the shortcut again if it fails.
repeat
Obstaclearea2;
Inc(attempts);
until (DidRedClick = true) or (attempts > 3);
end;
if (attempts > 3) then
begin
StatsGuise('Failed to find shortcut after a few tries, logging out.');
Failsafe('Failed to find shortcut after banking.');
Logout;
end;
end;
ClickMouse2(Mouse_left);
end;
Wait(RandomRange(3000, 5000));
end;