RE: Siren System - Work In Progress - Tommer - 2012-12-15 13:23
Yes. I plan to have indicator functionality so there is no need to launch extra software.
Thanks for helping. I will work to add Thrustmaster Functionality into the software.
I have a queery however. With the image you have shown me, what are buttons 11 and 12 referring to?
RE: Siren System - Work In Progress - Towcat - 2012-12-15 13:31
they are behind the wheel, both in the down right corner (i use them as indicator)
RE: Siren System - Work In Progress - Tommer - 2012-12-15 15:13
Learn something new every day. Noted
RE: Siren System - Work In Progress - Rasmus - 2012-12-15 15:32
YaY Tommers done soon
RE: Siren System - Work In Progress - Tommer - 2012-12-15 15:36
You wish. It's coming along nicely though.
RE: Siren System - Work In Progress - Rasmus - 2012-12-15 16:01
Yes i wish, What more u need to be done ?
RE: Siren System - Work In Progress - Tommer - 2012-12-15 16:46
Read my previous posts and you'll know.
RE: Siren System - Work In Progress - Rasmus - 2012-12-15 19:12
I did Tommer, But i dont really get it all this programming is not me
RE: Siren System - Work In Progress - Tommer - 2012-12-15 21:13
(2012-12-15 19:12)Rasmus Wrote: I did Tommer, But i dont really get it all this programming is not me
Got nothing to do with programming - need people to tell me the buttons of there various wheels
RE: Siren System - Work In Progress - Towcat - 2012-12-16 02:38
(2012-12-15 13:23)Tommer Wrote: Yes. I plan to have indicator functionality so there is no need to launch extra software.
in my current program i can set a value for the wheel angle when the indicator turns off automatically, like in a real car.
would be useful too
RE: Siren System - Work In Progress - Mr. NB - 2012-12-18 02:34
(2012-12-05 23:41)Josh Wrote: You could easily write a script (or Profiler Script) that Stops the horn, changes it, restarts the horn in one button click - This would prevent sound lag and of course wouldn't be any hassle whilst chasing.
Might sound stupid, but i have actually never thought of that, lol.
My bind currently looks like that - from Horn 5 to Horn 4 with Elmo's TCLights:
Code:
Press Page Up
Release Page Up
Press Shift
Press H
Press H
Press H
Press H
Release Shift
Press Page Up
Release Page Up
Same thing for from Horn 4 to Horn 5, but with one Shift + H.
I really do hope that this will prevent the sound lag.
RE: Siren System - Work In Progress - Pete - 2012-12-18 03:36
Tommer, what are you writing this program in and why did you decide to build it on top of this "Autohotkey" thing? Wouldn't it be nicer if you implemented your own method of sending keys rather than relying on a piece of 3rd party software?
A torrent of questions I know, but I'm Interested.
RE: Siren System - Work In Progress - Tommer - 2012-12-18 08:45
(2012-12-18 03:36)Lampshade Wrote: Tommer, what are you writing this program in and why did you decide to build it on top of this "Autohotkey" thing? Wouldn't it be nicer if you implemented your own method of sending keys rather than relying on a piece of 3rd party software?
A torrent of questions I know, but I'm Interested.
The program is written in Autohotkey's own scripting language and I chose to build it using this language because put simply this language is the best for the job, because it's very flexible, and easy to learn. Generally what i want to do it's specializing in.
Finding errors is fairly easy using it too because it tells you exactly what line the problem is on, to an experienced programmer that's probably not that important but for me the average noob this is a lifesaver 
I assume with the last thing you mean, eg writing the program natively, honestly, I wouldn't have known where to start with that, it would take me far too long just to create a simple application this one does the job efficiently and is fairly lightweight as far as I am concerned
RE: Siren System - Work In Progress - Pete - 2012-12-18 08:59
Ah I see, so AutoHotkey provides you with the ability to make your own GUI for customised key-sending scripts? If so, good find, might have to have a play around with it at some point.
Writing a program like TC lights is fairly simple once you've worked out how to get a program "out-of-focus" to interact with a program that's currently "in-focus", that's where you'd start if you were to do it from scratch. Sending 1 key from your program to a program like Notepad for instance can be done in not long at all once you've researched sending keys. Then you just need to extend it for use with LFS (Holding down the horn button for instance).
RE: Siren System - Work In Progress - Tommer - 2012-12-18 09:12
Yes, you can build basic GUI's with Autohotkey and go so far as to tell it to read/write files and registry entries which is useful for saving information written into the GUI. An example of how my GUI is built in which information can be saved to an .ini file;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;Loading Settings n all that nonsense;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
iniread, EnableP1Launch, AStrobe.ini, Settings, EnableP1Launch
iniread, EnableP2Launch, AStrobe.ini, Settings, EnableP2Launch
iniread, Program1Directory, AStrobe.ini, Settings, Program1Directory
iniread, Program2Directory, AStrobe.ini, Settings, Program2Directory
iniread, LIndicatorWILLALSO, AStrobe.ini, Settings, LIndicatorWILLALSO
iniread, RIndicatorWILLALSO, AStrobe.ini, Settings, RIndicatorWILLALSO
iniread, LHotkey, AStrobe.ini, Settings, LHotkey
iniread, RHotkey, AStrobe.ini, Settings, RHotkey
iniread, AutoOffDegrees, AStrobe.ini, Settings, AutoOffDegrees
iniread, UseIndicators, AStrobe.ini, Settings, UseIndicators
iniread, LFSClosesStrobe, AStrobe.ini, Settings, LFSClosesStrobe
iniread, StrobeToggleKey, Astrobe.ini, Settings, StrobeToggleKey
iniread, SirenToggleKey, AStrobe.ini, Settings, SirenToggleKey
iniread, Horn, AStrobe.ini, Settings, Horn
iniread, LInidicator, AStrobe.ini, Settings, LIndicator
iniread, RIndicator, AStrobe.ini, Settings, RIndicator
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;Load up the GUI n Stuff y0!;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Gui, Add, Text, x6 y254 w90 h20 , Advanced Strobe
Gui, Add, Text, x246 y254 w70 h20 , By Tommer
Gui, Add, Tab, x0 y1 w308 h253 , Status|Buttons|Behaviour
Gui, Tab, Behaviour
Gui, Add, CheckBox, vEnableP1Launch x16 y44 w130 h20 , Launch Program 1
Gui, Add, CheckBox, vEnableP2Launch x16 y64 w130 h20 , Launch Program 2
Gui, Add, Edit, vProgram1Directory x156 y44 w140 h20 , Enter Program Directory
Gui, Add, Edit, vProgram2Directory x156 y64 w140 h20 , Enter Program Directory
Gui, Add, CheckBox, vLIndicatorWILLALSO x16 y114 w140 h20 , L Indicator Also Presses
Gui, Add, CheckBox, vRIndicatorWILLALSO x16 y134 w140 h20 , R Indicator Also Presses
Gui, Add, GroupBox, x6 y94 w300 h70 , When Audible Siren is on (Chase Mode)
Gui, Add, Hotkey, vLHotKey x166 y114 w130 h20 ,
Gui, Add, Hotkey, vRHotkey x166 y134 w130 h20 ,
Gui, Add, GroupBox, x6 y24 w300 h70 , When this program is started also..
Gui, Add, GroupBox, x6 y164 w150 h80 , Indicators
Gui, Tab, Behaviour
Gui, Add, Edit, vAutoOffDegrees x16 y204 w130 h20 , Auto-Off Degrees
Gui, Add, CheckBox, vUseIndicators x16 y184 w130 h20 , Use Indicators
Gui, Add, GroupBox, x156 y164 w150 h50 , When LFS is Closed
Gui, Add, CheckBox, vLFSClosesStrobe x166 y184 w130 h20 , Close Strobe
Gui, Add, Button, gSave x156 y214 w150 h30 , Save and Apply Changes
Gui, Tab, Buttons
Gui, Add, GroupBox, x6 y34 w300 h90 , Strobe`, Siren`, Horn
Gui, Add, Edit, vStrobeToggleKey x146 y54 w150 h20 , Edit
Gui, Add, Edit, vSirenToggleKey x146 y74 w150 h20 , Edit(Do not use B)
Gui, Add, Edit, vHorn x146 y94 w150 h20 , Edit
Gui, Add, Text, x16 y54 w120 h20 , Toggle Strobe
Gui, Add, Text, x16 y74 w120 h20 , Toggle Siren
Gui, Add, Text, x16 y94 w120 h20 , Horn
Gui, Add, GroupBox, x6 y124 w300 h70 , Indicators
Gui, Add, Text, x16 y144 w120 h20 , L Indicator
Gui, Add, Text, x16 y164 w120 h20 , R Indicator
Gui, Add, Edit, vLInidicator x146 y144 w150 h20 , Edit
Gui, Add, Edit, VRIndicator x146 y164 w150 h20 , Edit
Gui, Add, Button, gSave x156 y214 w150 h30 , Save and Apply Changes
Gui, Show, x399 y307 h275 w311, New GUI Window
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;Show last set settings to prevent confusing people;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
GuiControl,, EnableP1Launch, %EnableP1Launch%
GuiControl,, EnableP2Launch, %EnableP2Launch%
GuiControl,, Program1Directory, %Program1Directory%
GuiControl,, Program2Directory, %Program2Directory%
GuiControl,, LIndicatorWILLALSO, %LIndicatorWILLALSO%
GuiControl,, RIndicatorWILLALSO, %RIndicatorWILLALSO%
GuiControl,, LHotkey, %LHotkey%
GuiControl,, RHotkey, %RHotkey%
GuiControl,, AutoOffDegrees, %AutoOffDegrees%
GuiControl,, UseIndicators, %UseIndicators%
GuiControl,, LFSClosesStrobe, %LFSClosesStrobe%
GuiControl,, StrobeToggleKey, %StrobeToggleKey%
GuiControl,, SirenToggleKey, %SirenToggleKey%
GuiControl,, Horn, %Horn%
GuiControl,, LInidicator, %LIndicator%
GuiControl,, RIndicator, %RIndicator%
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;Actually run the bloody script;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Siren=0
Strobe=0
talkstrobe=0
Hotkey, ~%SirenToggleKey%, SIRENTK
return
SIRENTK:
{
If Siren= 0
{
SoundBeep, 590 , 400
Siren= 1
WinWaitActive, Live for Speed
Send {b down}
}
else
{
Send {b up}
SoundBeep, 590 , 200
Sleep 100
SoundBeep, 590 , 200
Siren=0
}
return
}
Hotkey, ~%StrobeToggleKey%, STROBETK
STROBETK:
{
If Strobe= 1
{
Strobe=0
Sleep 600
Send {0}
}
else
Strobe=1
return
}
Hotkey, ~%Horn%, HORN
return
HORN:
If (Siren= 1 AND A_TimeSincePriorHotkey >900)
{
WinWaitActive, Live for Speed
Send {SHIFTDOWN}{H}{SHIFTUP}
Send {SHIFTDOWN}
Sleep, 50
Send {SHIFTUP}
Keywait, %Horn%
Send {SHIFTDOWN}{H}{SHIFTUP}
Send {SHIFTDOWN}{H}{SHIFTUP}
Send {SHIFTDOWN}{H}{SHIFTUP}
Send {SHIFTDOWN}{H}{SHIFTUP}
Send {SHIFTDOWN}
Sleep, 50
Send {SHIFTUP}
}
If (Siren= 1 AND A_PriorHotKey = "%Horn%" AND A_TimeSincePriorHotkey <800)
{
SoundBeep, 700 , 150
Send {SHIFTDOWN}{H}{SHIFTUP}
Send {SHIFTDOWN}{H}{SHIFTUP}
Send {SHIFTDOWN}{H}{SHIFTUP}
Send {SHIFTDOWN}{H}{SHIFTUP}
Send, {SHIFTDOWN}
Sleep, 50
Send, {SHIFTUP}
Keywait, %Horn%
Keywait, %Horn%, D
Send {SHIFTDOWN}{H}{SHIFTUP}
Send, {SHIFTDOWN}
SoundBeep, 700 , 150
Sleep, 10
Send, {SHIFTUP}
return
}
else
if Siren=0
{
WinWaitActive, Live for Speed
Send {ALTDOWN}{F1}{ALTUP}
Send {b down}
Keywait, %Horn%
Send {b up}
Send {ALTDOWN}{F1}{ALTUP}
}
return
~t::
If Strobe=1
{
Strobe=0
talkstrobe=1
WinWaitActive, Live for Speed
SendInput {delete, 5}
}
return
~enter::
if talkstrobe=1
{
strobe=1
talkstrobe=0
}
return
Return
GuiClose:
ExitApp
Save:
{
gui, submit, nohide
iniwrite, %EnableP1Launch%, AStrobe.ini, Settings, EnableP1Launch
iniwrite, %EnableP2Launch%, AStrobe.ini, Settings, EnableP2Launch
iniwrite, %Program1Directory%, AStrobe.ini, Settings, Program1Directory
iniwrite, %Program2Directory%, AStrobe.ini, Settings, Program2Directory
iniwrite, %LIndicatorWILLALSO%, AStrobe.ini, Settings, LIndicatorWILLALSO
iniwrite, %RIndicatorWILLALSO%, AStrobe.ini, Settings, RIndicatorWILLALSO
iniwrite, %LHotkey%, AStrobe.ini, Settings, LHotkey
iniwrite, %RHotkey%, AStrobe.ini, Settings, RHotkey
iniwrite, %AutoOffDegrees%, AStrobe.ini, Settings, AutoOffDegrees
iniwrite, %UseIndicators%, AStrobe.ini, Settings, UseIndicators
iniwrite, %LFSClosesStrobe%, AStrobe.ini, Settings, LFSClosesStrobe
iniwrite, %StrobeToggleKey%, Astrobe.ini, Settings, StrobeToggleKey
iniwrite, %SirenToggleKey%, AStrobe.ini, Settings, SirenToggleKey
iniwrite, %Horn%, AStrobe.ini, Settings, Horn
iniwrite, %LInidicator%, AStrobe.ini, Settings, LIndicator
iniwrite %RIndicator%, AStrobe.ini, Settings, RIndicator
sleep, 100
MsgBox, Gratz, you saved!
}
[Settings]
EnableP1Launch=0
EnableP2Launch=0
Program1Directory=c:\programs\lfs\lfs.exe
Program2Directory=somewhere\musicplayer.exe
LIndicatorWILLALSO=1
RIndicatorWILLALSO=0
LHotkey=F7
RHotkey=F8
AutoOffDegrees=200
UseIndicators=1
LFSClosesStrobe=1
StrobeToggleKey=f1
SirenToggleKey=f2
Horn=f3
LIndicator=
RIndicator=f5
Some pictures too 
![[Image: capture2db.jpg]](http://img708.imageshack.us/img708/6735/capture2db.jpg)
RE: Siren System - Work In Progress - Pete - 2012-12-18 09:51
To be fair, that is quite neat. Commenting with semicolons though, hideous!
RE: Siren System - Work In Progress - Tommer - 2012-12-18 10:14
(2012-12-18 09:51)Lampshade Wrote: To be fair, that is quite neat. Commenting with semicolons though, hideous!
To be fair you only have to use one semicolon
; Comment
But I just did did it like a mess because reasons
RE: Siren System - Work In Progress - Lewis - 2012-12-18 11:28
Looking good Tommer!
Can't wait to use it!!
RE: Siren System - Work In Progress - Pete - 2012-12-18 12:53
(2012-12-18 10:14)Tommer Wrote: (2012-12-18 09:51)Lampshade Wrote: To be fair, that is quite neat. Commenting with semicolons though, hideous!
To be fair you only have to use one semicolon
; Comment
But I just did did it like a mess because reasons 
lol, duh, I know but /'s are so much better
|