SRL Archive - SRL Archives

Flagchat.scar


Naike

2009-05-27 20:16:56

New chat to toggle means I got something to do ;)

  • Added support for the new tab
  • modified ChatsOff to skip Game chat
  • Might break a script, but afaik almost every update does.


{*******************************************************************************
procedure SetChat(state: String; chat: Integer);
By: Wizzup? modded by WT-Fakawi, Starblaster100 and N1ke!
Description: Sets Chat to desired state
*******************************************************************************}
procedure SetChat(state: string; chat: Integer);
var
x, y, mx, Color: Integer;
begin
case chat of
1: mx := 90;
2: mx := 145;
3: mx := 200;
4: mx := 260;
5: mx := 320;
6: 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, 506) then
begin
Mouse(mx, 496, 8, 8, False);
Wait(450 + Random(175));
ChooseOption(State);
end;
end;

{*******************************************************************************
procedure SetAllChats(Game, Pub, Priv, Clan, Trade, Assist: string);
By: ZephyrsFury modified by N1ke!
Description: Sets all the chats to a particular state in one simple procedure.
Leave the parameter as '' if you wish to leave the chat as it is:
Example: SetAllChats('on', 'friends', '', 'off', '');
*******************************************************************************}
procedure SetAllChats(Game, Pub, Priv, Clan, Trade, Assist: string);
var
States: TStringArray;
II: Integer;
begin
if (not(LoggedIn)) then Exit;
States := ['', Game, Pub, Priv, Clan, Trade, Assist];
for II := 1 to 6 do
begin
if (States[II] = '') then Continue;
SetChat(States[II], II);
end
end;

{*******************************************************************************
procedure ChatsOff;
By: Starblaster100 small edit by N1ke!
Description: Sets all Chats to off.
*******************************************************************************}

Procedure ChatsOff;
var
i: Integer;
Begin
For i := 2 to 6 do
SetChat('off', i);
end;

Richard

2009-05-27 20:22:50

I had literally just made this :p, except I just made it 0 instead of changing all the numbers, which would mean editing all the other functions if you did it your method.

Naike

2009-05-27 20:46:39

I thought, if i made it 0 then people would change it to 1 later on anyways…

Naum

2009-05-27 20:49:03

Gah, I had this done!!!

Good effort though, looks like fixes are bursting out you like god knows what.