SetChat and the letter 'f'
Recently, FEAR came to me wondering why his SetChat procedures weren't working. So I edited SetChat a bit and made it faster. I also added constants, although SetChat wasn't the problem. The problem was that SCAR wasn't recognizing the ChooseOption letters 'ff', when side by side. In other words, it would never turn the chats 'Off'. Every other option worked fine.
Here is my edited SetChat if you want to take a look:
SCAR Code:
{ const Chat Constants;
Description: Constants representing the different chats in RS. }
const
chat_Game = 0;
chat_Public = 1;
chat_Private = 2;
chat_Clan = 3;
chat_Trade = 4;
chat_Assist = 5;
procedure SetChat(State: string; Chat: Integer);
var
x, y, mx, Color: Integer;
begin
case chat of
chat_Game: mx := 90;
chat_Public: mx := 145;
chat_Private: mx := 200;
chat_Clan: mx := 260;
chat_Trade: mx := 320;
chat_Assist: mx := 373;
else
begin
srl_Warn('SetChat', 'Chat(' + IntToStr(chat) + ') does not exist.', warn_AllVersions);
Exit;
end;
end;
State := LowerCase(State);
case State of
'on', 'all': Color := 65280;
'off': Color := 255;
'hide': Color := 16776960;
'friends', 'filter': Color := 65535;
else
srl_Warn('SetChat', State + ' does not exist.', warn_AllVersions);
end;
State := Capitalize(State);
if not FindColor(x, y, Color, mx - 10, 486, mx + 10, 503) then
begin
Mouse(mx, 496, 4, 4, False);
WaitOption(Copy(State, 2, Length(State)), 500);
end;
end;
I also tested with a Staff of Air, and it didn't work, but it worked with Amulet of Strength. So it looks like it only happens when a double 'f' comes up.