Post by psykad on Jan 10, 2006 16:22:18 GMT -5
Hey! This is my first script in LUA and I'm looking for a few tips and some help on completing it. It's script I'm testing out now while seeking for PT. It checks the last message in the chat to see if it was a received /tell (most likely a party invite). If it's true, it'll flash the screen red on/off until you reply or turn the script off. This allows me to sit further away from the screen and just glance over to see if someone has messaged me. What I'd like to do (if possible) is instead of having the screen alert show, have it play a wav or mp3. Could anyone lead me into the direction of tutorials on how to implement sound functions into the script or show me an example of it being used please? Also, I'm not too familiar with LUA so the script probably looks very rough to you guys, so take it easy on me.
*UPDATED 1/11/06*
*UPDATED 1/11/06*
ChatMessage = Graphics.primitive_CreateObject()
Graphics.primitive_SetVisibility(0,ChatMessage)
Graphics.primitive_SetColor(63,255,0,0,ChatMessage)
Graphics.primitive_SetPosition(0,0,ChatMessage)
Graphics.primitive_SetSize(1024,768,ChatMessage)
Graphics.primitive_SetVisibility(0,ChatMessage)
Status2=Graphics.text_CreateObject()
Graphics.text_SetVisibility(1,Status2)
Graphics.text_SetColor(255,0,0,0,Status2)
Graphics.text_SetPosition(901,753,Status2)
Graphics.text_SetFont("Arial Bold",10,Status2)
CurMessage=string.format("LFP ON")
Graphics.text_SetText(CurMessage, Status2)
Status=Graphics.text_CreateObject()
Graphics.text_SetVisibility(1,Status)
Graphics.text_SetColor(255,255,255,255,Status)
Graphics.text_SetPosition(900,752,Status)
Graphics.text_SetFont("Arial Bold",10,Status)
TotalTells = 0
LastMes = ""
NewestMes = ""
while true do
NewestChat=FFXI.chat_GetNewestLineNumber()
NewestMes=FFXI.chat_GetLine(NewestChat)
ChatType=FFXI.chat_GetLineType(NewestChat)
if NewestMes == LastMes then
--No new message
else
if ChatType == "0c" then
Graphics.primitive_SetVisibility(1,ChatMessage)
TotalTells = TotalTells + 1
elseif ChatType == "04" then
Graphics.primitive_SetVisibility(0,ChatMessage)
end
LastMes = NewestMes
end
CurMessage=string.format("Total Tells: %i", TotalTells)
Graphics.text_SetText(CurMessage, Status2)
Graphics.text_SetText(CurMessage, Status)
Windower.script_Sleep(100)
end