function main()
{
if ${Game.Name.Equal[Everquest II]}
{
call EQ2
}
if ${Game.Name.Equal[World of Warcraft]}
{
call WoW
}
}
function EQ2()
{
extension -require isxeq2
declare PlayTellSnd global 0
squelch bind endchatrelay F12 "endscript chatrelay"
AddTrigger TellRecieved "\\aPC @*@ @*@:@sender@\\/a tells you@*@@*@"
AddTrigger TellRecieved "\\aPC @*@ @*@:@sender@\\/a says,@*@@*@"
AddTrigger TellRecieved "\\aPC @*@ @*@:@sender@\\/a say,@*@@*@"
do
{
if ${PlayTellSnd}>0
{
call PlaySound "IncomingChat.wav"
PlayTellSnd:Set[0]
}
call ProcessTriggers
}
while 1
}
function TellRecieved(string Line, string sender)
{
call LightWindow
if ${Line.Find[annoyinggoldseller]} || ${Line.Find[cometomysite]}
{
return
}
if ${sender.Equal[ignoreplayer1]} || ${sender.Equal[ignoreplayer2]}
{
return
}
EQ2Echo Tell Recieved from ${sender}
call PlaySound "IncomingChat.wav"
wait 1
relay all PlayTellSnd:Set[1]
wait 5
relay all echo Tell directed at ${Me}: ${Line}
wait 5
relay all EQ2Echo Tell directed at ${Me}: "${Line}" -chattype gsay
}
function PlaySound(string Filename)
{
;Play Sound
System:APICall[${System.GetProcAddress["WinMM.dll","PlaySound"].Hex},Filename.String,0,Math.Dec[22001\]]
}
function ProcessTriggers()
{
if "${QueuedCommands}"
{
do
{
ExecuteQueued
}
while "${QueuedCommands}"
}
}
function LightWindow()
{
Display.Window:Flash
}
function LightWindowDeprecated()
{
; Make the window that received the tell light up.
declare handle int script 0
declare window string script "is1 (Ctrl+Alt+1)"`
System:APICall[${System.GetProcAddress["user32.dll","FindWindowA"].Hex},0,window]
handle:Set[${APIReturn}]
System:APICall[${System.GetProcAddress["user32.dll","FlashWindow"].Hex},${handle},0]
deletevariable handle
deletevariable window
}
function WoW()
{
extension -require isxWoW
declare PlayTellSnd global 0
squelch bind endstartstop F12 "endscript chatrelay"
; Trigger for say - from WoW wiki
AddTrigger TellReceivedWoW "[Event:@eventid@:CHAT_MSG_SAY] (\"@message@\",\"@speaker@\",\"@language@\",\"@something@\",\"@something@\",\"@something@\",@something@,@something@,\"@something@\",@something@)"
; Trigger for whispers from WoW wiki
AddTrigger TellReceivedWoW "[Event:@eventid@:CHAT_MSG_WHISPER](\"@message@\",\"@speaker@\",\"@language@\",\"@something@\",\"@something@\",\"@something@\",@something@,@something@,\"@something@\",@something@)"
do
{
if ${PlayTellSnd}>0
{
call LightWindow
call PlaySound "IncomingChat.wav"
PlayTellSnd:Set[0]
}
call ProcessTriggers
}
while 1
}
function TellRecievedWoW(string Line, string sender)
{
WoWEcho Tell Recieved from ${sender}
call PlaySound "IncomingChat.wav"
wait 1
uplink relay all PlayTellSnd:Set[1]
wait 5
Uplink Relay all WoWEcho Tell received for ${Me}: ${Line}
}