Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Menu, Tray, NoStandard
- Menu, Standards, Standard
- Menu, Script, Add, Select Ringtone, SelectRingtone
- Menu, Script, Add, Select Message Tone, SelectMessageTone
- Menu, Tray, Add, Script Stuff, :Script
- Menu, Tray, Add, Standard Stuff, :Standards
- IncomingCallText = Incoming call on
- PickUpText = You have picked up the phone
- MessageText = You got a message on your phone
- RingStopText = The ringing has stopped
- SettingsFile = Settings.ini
- File = %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
- IniRead, Ringtone, %SettingsFile%, Tones, Ringtone, None
- IniRead, MessageTone, %SettingsFile%, Tones, MessageTone, None
- If Ringtone = None
- Gosub, SelectRingtone
- If MessageTone = None
- Gosub, SelectMessageTone
- IniRead, Ringtone, %SettingsFile%, Tones, Ringtone, None
- IniRead, MessageTone, %SettingsFile%, Tones, MessageTone, None
- SplashImage,,, Testing Ringtone..., Ringer
- SoundPlay, %Ringtone%
- Sleep, 10000
- SplashImage,,, Testing Message Tone..., Ringer
- SoundPlay, %MessageTone%
- Sleep, 10000
- SplashImage,,, Done!, Ringer
- SoundPlay, Silence.Silence
- Sleep, 1000
- SplashImage, Off
- Process, Wait, gta_sa.exe
- Goto, CheckChat
- Return
- SelectRingtone:
- FileSelectFile, Ringtone, 3,, Select a new Ringtone (Audio Files Only)
- IniWrite, %Ringtone%, %SettingsFile%, Tones, Ringtone
- MsgBox, 64, Ringtone Set!, New Ringtone Set!
- Return
- SelectMessageTone:
- FileSelectFile, MessageTone, 3,, Select a new Message Tone (Audio Files Only)
- IniWrite, %MessageTone%, %SettingsFile%, Tones, MessageTone
- MsgBox, 64, Message Tone Set!, New Message Tone Set!
- Return
- CheckChat:
- Loop,
- {
- FileReadLine, NoLine, %File%, %A_Index%
- If ErrorLevel
- Break
- Index:=A_Index-2
- }
- Loop,
- {
- FileReadLine, Line, %File%, %Index%
- If ErrorLevel
- {
- Index-=3
- If Index < 1
- {
- Index = 1
- }
- FileReadLine, Line, %File%, %Index%
- }
- Index+=2
- ; MsgBox, %Line%
- Ringing:=InStr(Line, IncomingCallText)
- PickedUp:=InStr(Line, PickUpText)
- RingingStopped:=InStr(Line, RingStopText)
- MessageReceived:=InStr(Line, MessageText)
- If Ringing and not RingingOn
- GoSub, Ringer
- If PickedUp or RingingStopped
- GoSub, StopRinging
- If MessageReceived
- GoSub, Messaged
- }
- Return
- Ringer:
- RingStart:=A_TickCount
- IniRead, Ringtone, %SettingsFile%, Tones, Ringtone, None
- RingingOn:=True
- SoundPlay, %Ringtone%
- Return
- StopRinging:
- SoundPlay, Silence.Silence
- RingingOn:=False
- Return
- Messaged:
- IniRead, MessageTone, %SettingsFile%, Tones, MessageTone, None
- RingingOn:=False
- SoundPlay, %MessageTone%
- FileAppend, This line has been placed here by AHK to prevent the script from reading the same line twice.`n`n, %File%
- Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement