Old script no longer works?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
PepeLapiu
Posts: 324
Joined: 19 Jun 2020, 14:06

Old script no longer works?

Post by PepeLapiu » 28 Jan 2023, 13:42

Hey guys. I've had this side script working very well for me for the last 6 months or so. It has worked so well that I have no needed to edit it or open it for any reason so far for 6 months or so. But all of a sudden, it stoppped working without me changing anything.
Here is the script:

Code: Select all

Sleep 200
IniRead,speakit,C:\Users\GO\Desktop\Main Script\PNGs\waiting.ini,settings,speakit
IniRead,ringer,C:\Users\GO\Desktop\Main Script\PNGs\waiting.ini,settings,ringer
If(ringer="beep600")
	{
	SoundBeep,600,500
	Sleep,500
	}
If(ringer="beep5")
	{
	SoundPlay,beep-05.wav
	Sleep,500
	}
If(ringer="annoying")
	{
	SoundPlay,Siren_Noise-KevanGC-1337458893.wav
	Sleep, 2000
	SoundPlay, fake.wav
	}
ComObjCreate("SAPI.SpVoice").Speak(speakit)
IniDelete,C:\Users\GO\Desktop\Main Script\PNGs\waiting.ini,settings,speakit
IniDelete,C:\Users\GO\Desktop\Main Script\PNGs\waiting.ini,settings,ringer
ExitApp
And here is the error I get:
Image
Any idea what is going on? How do I fix this?

PepeLapiu
Posts: 324
Joined: 19 Jun 2020, 14:06

Re: Old script no longer works?

Post by PepeLapiu » 28 Jan 2023, 14:31

Well, it appears the problem is solved.
I have a function called SPEAK() on an other script. I renamed it SPEEK() and it appears to somehow have fixed the problem.

gmoises
Posts: 74
Joined: 18 Nov 2017, 16:43

Re: Old script no longer works?

Post by gmoises » 28 Jan 2023, 21:53

I think the code is correct.
Make sure the variable 'speakit' contains the appropriate text you want spoken.

Code: Select all

Sleep 200
IniRead,speakit,C:\Users\GO\Desktop\Main Script\PNGs\waiting.ini,settings,speakit
IniRead,ringer,C:\Users\GO\Desktop\Main Script\PNGs\waiting.ini,settings,ringer
If(ringer="beep600")
	{
	SoundBeep,600,500
	Sleep,500
	}
If(ringer="beep5")
	{
	SoundPlay,beep-05.wav
	Sleep,500
	}
If(ringer="annoying")
	{
	SoundPlay,Siren_Noise-KevanGC-1337458893.wav
	Sleep, 2000
	SoundPlay, fake.wav
	}
;------------------
MsgBox % speakit
;------------------
ComObjCreate("SAPI.SpVoice").Speak(speakit)
IniDelete,C:\Users\GO\Desktop\Main Script\PNGs\waiting.ini,settings,speakit
IniDelete,C:\Users\GO\Desktop\Main Script\PNGs\waiting.ini,settings,ringer
ExitApp

Post Reply

Return to “Ask for Help (v1)”