Brandon
04-12-2011, 05:57 AM
So I have the two codes below.. One Fixes chat so that it doesn't constantly show garbage.. like "you have picked herb from patch", etc..
Problem is that when someone says something, and the text is still in the chat box, the alert will keep going off until the text disappears.. any IDEAS on how to make it only alert about 1-3 times per chatbox text?? Rather than alerting every single time the script loops? And how do I make it find text in the middle of a string?
Example: Someone talks.. it alerts you like 3 times (the script looped once).. then it stops alerting until another NEW text is found..
Example2: LOL name... other words here.. It detects name in somewhere in the string and alerts.
At the start of the script.
SetChat('Filter', 0); //sets game filter.
SetChat('Off', 2); // sets private off.
During Runtime. (Plays sound when someone talks or says whatever..)
function SomeoneTalked: Boolean;
begin
if (ChatBoxTextExists(5, 'name1') or ChatBoxTextExists(5, 'namepart') or ChatBoxTextExists(5, 'to trade with you')
or ChatBoxTextExists(5, 'part') or ChatBoxTextExists(5, 'requesting your assistance')
or ChatBoxTextExists(5, 'assist request has been refused')) then
begin
PlaySound(IncludePath+'Reflection/Custom/Sounds/MorseCode.wav');
end;
end;
Problem is that when someone says something, and the text is still in the chat box, the alert will keep going off until the text disappears.. any IDEAS on how to make it only alert about 1-3 times per chatbox text?? Rather than alerting every single time the script loops? And how do I make it find text in the middle of a string?
Example: Someone talks.. it alerts you like 3 times (the script looped once).. then it stops alerting until another NEW text is found..
Example2: LOL name... other words here.. It detects name in somewhere in the string and alerts.
At the start of the script.
SetChat('Filter', 0); //sets game filter.
SetChat('Off', 2); // sets private off.
During Runtime. (Plays sound when someone talks or says whatever..)
function SomeoneTalked: Boolean;
begin
if (ChatBoxTextExists(5, 'name1') or ChatBoxTextExists(5, 'namepart') or ChatBoxTextExists(5, 'to trade with you')
or ChatBoxTextExists(5, 'part') or ChatBoxTextExists(5, 'requesting your assistance')
or ChatBoxTextExists(5, 'assist request has been refused')) then
begin
PlaySound(IncludePath+'Reflection/Custom/Sounds/MorseCode.wav');
end;
end;