Henry Posted November 3, 2006 Share Posted November 3, 2006 If you have a cell phone connected using a com port, this script could be useful to show incoming calls: #Include <Constants.au3> #NoTrayIcon Opt("TrayOnEventMode",1) Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown. TraySetClick(16) ; Only secondary mouse button will show the tray menu. Global $NetComm, $Com, $Iconpath $Com = $CmdLine[1] ; Comnunication Port passed by command line ;$Com = "16" ; Comunication Port if not passed by command line $Iconpath = "" ;$Iconpath = "e:\software\autoit\icons\" ; Use if icons are not into the same folder of CallerID.exe $settingsitem = TrayCreateMenu("Settings") $disableitem = TrayCreateItem("Disconnect phone on com"&$CmdLine[1], $settingsitem) TrayItemSetOnEvent(-1,"Disable") $enableitem = TrayCreateItem("Connect phone on com"&$CmdLine[1], $settingsitem) TrayItemSetOnEvent(-1,"Enable") TrayCreateItem("") $aboutitem = TrayCreateItem("About") TrayItemSetOnEvent(-1,"About") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TrayItemSetOnEvent(-1,"Exitscript") TraySetState() TraySetIcon($Iconpath&"phone_d.ico") $start = False While 1 If $start Then $a="" If $NetComm.InBufferCount > 0 Then $a=$a&$NetComm.InputData $a=StringTrimLeft($a,18) $b=StringInStr($a,chr(34)) If $b>1 Then $a=StringMid($a,1,$b-1) MsgBox(0, "CallerID "&"on COM"&$CmdLine[1], " Incoming call from # +"&$a&" ", 4) Else MsgBox(0, "CallerID "&"on COM"&$CmdLine[1], " Incoming call from Private Number ", 4) EndIf Sleep(250) EndIf EndIf Sleep(20) WEnd Exit ; Functions Func About() Msgbox(0, "About", " Display Caller ID for incoming calls - E. Schettini ", 3) EndFunc Func Disable() $start = False $NetComm.PortOpen = False Msgbox(0, "CallerID "&"on COM"&$CmdLine[1], " Disconnecting "&"phone on com"&$CmdLine[1], 3) TraySetIcon($Iconpath&"phone_d.ico") EndFunc Func Enable() $start = True $ft = True $NetComm = ObjCreate("NETCommOCX.NETComm") ;Create NETComm.ocx object ;Set object settings With $NetComm .CommPort = $Com ;Set port number .Settings = "9600,N,8,1" ;Set port settings .InputLen = 0 ;reads entire buffer .InputMode = 0 ;reads in text mode .HandShaking = 3 ;uses both RTS and Xon/Xoff handshaking .PortOpen = "True" ;opens specified COM port .Output = "AT+CLIP=1" & Chr(13) ;set CLIP=1. ;.Output = "ATV1Q0" & Chr$(13) ;Ensure that the modem responds with "OK". EndWith If $ft Then $ft = False Sleep(2500) $result = 0 While $result = 0 $result = StringInStr($NetComm.InputData, "OK") WEnd If $result <> 0 Then MsgBox(0, "CallerID on COM"&$CmdLine[1], " Connection to phone on com"&$CmdLine[1]&" established ", 2) TraySetIcon($Iconpath&"phone_e.ico") EndIf EndFunc Func Exitscript() If $start = False Then Exit Else $NetComm.PortOpen = False Msgbox(0, "CallerID on COM"&$CmdLine[1], " Disconnecting phone on com"&$CmdLine[1]&" ", 3) EndIf Exit EndFunc Link to comment Share on other sites More sharing options...
_Kurt Posted November 3, 2006 Share Posted November 3, 2006 Mind editing the post: put before your code and [*/code] after it (DO NOT PUT THE * IN) Thanks, Kurt Awaiting Diablo III.. Link to comment Share on other sites More sharing options...
Henry Posted November 3, 2006 Author Share Posted November 3, 2006 ok Kurt, sorry ... Here it is again: #Include <Constants.au3> #NoTrayIcon Opt("TrayOnEventMode",1) Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown. TraySetClick(16) ; Only secondary mouse button will show the tray menu. Global $NetComm, $Com, $Iconpath $Com = $CmdLine[1] ; Comnunication Port passed by command line ;$Com = "16" ; Comunication Port if not passed by command line $Iconpath = "" ;$Iconpath = "e:\software\autoit\icons\" ; Use if icons are not into the same folder of CallerID.exe $settingsitem = TrayCreateMenu("Settings") $disableitem = TrayCreateItem("Disconnect phone on com"&$CmdLine[1], $settingsitem) TrayItemSetOnEvent(-1,"Disable") $enableitem = TrayCreateItem("Connect phone on com"&$CmdLine[1], $settingsitem) TrayItemSetOnEvent(-1,"Enable") TrayCreateItem("") $aboutitem = TrayCreateItem("About") TrayItemSetOnEvent(-1,"About") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TrayItemSetOnEvent(-1,"Exitscript") TraySetState() TraySetIcon($Iconpath&"phone_d.ico") $start = False While 1 If $start Then $a="" If $NetComm.InBufferCount > 0 Then $a=$a&$NetComm.InputData $a=StringTrimLeft($a,18) $b=StringInStr($a,chr(34)) If $b>1 Then $a=StringMid($a,1,$b-1) MsgBox(0, "CallerID "&"on COM"&$CmdLine[1], " Incoming call from # +"&$a&" ", 4) Else MsgBox(0, "CallerID "&"on COM"&$CmdLine[1], " Incoming call from Private Number ", 4) EndIf Sleep(250) EndIf EndIf Sleep(20) WEnd Exit ; Functions Func About() Msgbox(0, "About", " Display Caller ID for incoming calls - E. Schettini ", 3) EndFunc Func Disable() $start = False $NetComm.PortOpen = False Msgbox(0, "CallerID "&"on COM"&$CmdLine[1], " Disconnecting "&"phone on com"&$CmdLine[1], 3) TraySetIcon($Iconpath&"phone_d.ico") EndFunc Func Enable() $start = True $ft = True $NetComm = ObjCreate("NETCommOCX.NETComm") ;Create NETComm.ocx object ;Set object settings With $NetComm .CommPort = $Com ;Set port number .Settings = "9600,N,8,1" ;Set port settings .InputLen = 0 ;reads entire buffer .InputMode = 0 ;reads in text mode .HandShaking = 3 ;uses both RTS and Xon/Xoff handshaking .PortOpen = "True" ;opens specified COM port .Output = "AT+CLIP=1" & Chr(13) ;set CLIP=1. ;.Output = "ATV1Q0" & Chr$(13) ;Ensure that the modem responds with "OK". EndWith If $ft Then $ft = False Sleep(2500) $result = 0 While $result = 0 $result = StringInStr($NetComm.InputData, "OK") WEnd If $result <> 0 Then MsgBox(0, "CallerID on COM"&$CmdLine[1], " Connection to phone on com"&$CmdLine[1]&" established ", 2) TraySetIcon($Iconpath&"phone_e.ico") EndIf EndFunc Func Exitscript() If $start = False Then Exit Else $NetComm.PortOpen = False Msgbox(0, "CallerID on COM"&$CmdLine[1], " Disconnecting phone on com"&$CmdLine[1]&" ", 3) EndIf Exit EndFunc [*/code] Link to comment Share on other sites More sharing options...
rambo3889 Posted November 3, 2006 Share Posted November 3, 2006 (edited) You shoudlt use * in the close code brackets Just do as in autoit remove the semi colon so that it isnt commented and it will work ;; Edited November 3, 2006 by rambo3889 My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! youÂ’re the best in town Fight! Link to comment Share on other sites More sharing options...
NELyon Posted November 3, 2006 Share Posted November 3, 2006 expandcollapse popup#Include <Constants.au3> #NoTrayIcon Opt("TrayOnEventMode",1) Opt("TrayMenuMode",1); Default tray menu items (Script Paused/Exit) will not be shown. TraySetClick(16); Only secondary mouse button will show the tray menu. Global $NetComm, $Com, $Iconpath $Com = $CmdLine[1]; Comnunication Port passed by command line ;$Com = "16"; Comunication Port if not passed by command line $Iconpath = "" ;$Iconpath = "e:\software\autoit\icons\"; Use if icons are not into the same folder of CallerID.exe $settingsitem = TrayCreateMenu("Settings") $disableitem = TrayCreateItem("Disconnect phone on com"&$CmdLine[1], $settingsitem) TrayItemSetOnEvent(-1,"Disable") $enableitem = TrayCreateItem("Connect phone on com"&$CmdLine[1], $settingsitem) TrayItemSetOnEvent(-1,"Enable") TrayCreateItem("") $aboutitem = TrayCreateItem("About") TrayItemSetOnEvent(-1,"About") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TrayItemSetOnEvent(-1,"Exitscript") TraySetState() TraySetIcon($Iconpath&"phone_d.ico") $start = False While 1 If $start Then $a="" If $NetComm.InBufferCount > 0 Then $a=$a&$NetComm.InputData $a=StringTrimLeft($a,18) $b=StringInStr($a,chr(34)) If $b>1 Then $a=StringMid($a,1,$b-1) MsgBox(0, "CallerID "&"on COM"&$CmdLine[1], " Incoming call from # +"&$a&" ", 4) Else MsgBox(0, "CallerID "&"on COM"&$CmdLine[1], " Incoming call from Private Number ", 4) EndIf Sleep(250) EndIf EndIf Sleep(20) WEnd Exit ; Functions Func About() Msgbox(0, "About", " Display Caller ID for incoming calls - E. Schettini ", 3) EndFunc Func Disable() $start = False $NetComm.PortOpen = False Msgbox(0, "CallerID "&"on COM"&$CmdLine[1], " Disconnecting "&"phone on com"&$CmdLine[1], 3) TraySetIcon($Iconpath&"phone_d.ico") EndFunc Func Enable() $start = True $ft = True $NetComm = ObjCreate("NETCommOCX.NETComm");Create NETComm.ocx object ;Set object settings With $NetComm .CommPort = $Com;Set port number .Settings = "9600,N,8,1";Set port settings .InputLen = 0;reads entire buffer .InputMode = 0;reads in text mode .HandShaking = 3;uses both RTS and Xon/Xoff handshaking .PortOpen = "True";opens specified COM port .Output = "AT+CLIP=1" & Chr(13);set CLIP=1. ;.Output = "ATV1Q0" & Chr$(13);Ensure that the modem responds with "OK". EndWith If $ft Then $ft = False Sleep(2500) $result = 0 While $result = 0 $result = StringInStr($NetComm.InputData, "OK") WEnd If $result <> 0 Then MsgBox(0, "CallerID on COM"&$CmdLine[1], " Connection to phone on com"&$CmdLine[1]&" established ", 2) TraySetIcon($Iconpath&"phone_e.ico") EndIf EndFunc Func Exitscript() If $start = False Then Exit Else $NetComm.PortOpen = False Msgbox(0, "CallerID on COM"&$CmdLine[1], " Disconnecting phone on com"&$CmdLine[1]&" ", 3) EndIf Exit EndFunc There is his code in the [ code] tags Link to comment Share on other sites More sharing options...
ame1011 Posted November 3, 2006 Share Posted November 3, 2006 expandcollapse popup#Include <Constants.au3> #NoTrayIcon Opt("TrayOnEventMode",1) Opt("TrayMenuMode",1); Default tray menu items (Script Paused/Exit) will not be shown. TraySetClick(16); Only secondary mouse button will show the tray menu. Global $NetComm, $Com, $Iconpath $Com = $CmdLine[1]; Comnunication Port passed by command line ;$Com = "16"; Comunication Port if not passed by command line $Iconpath = "" ;$Iconpath = "e:\software\autoit\icons\"; Use if icons are not into the same folder of CallerID.exe $settingsitem = TrayCreateMenu("Settings") $disableitem = TrayCreateItem("Disconnect phone on com"&$CmdLine[1], $settingsitem) TrayItemSetOnEvent(-1,"Disable") $enableitem = TrayCreateItem("Connect phone on com"&$CmdLine[1], $settingsitem) TrayItemSetOnEvent(-1,"Enable") TrayCreateItem("") $aboutitem = TrayCreateItem("About") TrayItemSetOnEvent(-1,"About") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TrayItemSetOnEvent(-1,"Exitscript") TraySetState() TraySetIcon($Iconpath&"phone_d.ico") $start = False While 1 If $start Then $a="" If $NetComm.InBufferCount > 0 Then $a=$a&$NetComm.InputData $a=StringTrimLeft($a,18) $b=StringInStr($a,chr(34)) If $b>1 Then $a=StringMid($a,1,$b-1) MsgBox(0, "CallerID "&"on COM"&$CmdLine[1], " Incoming call from # +"&$a&" ", 4) Else MsgBox(0, "CallerID "&"on COM"&$CmdLine[1], " Incoming call from Private Number ", 4) EndIf Sleep(250) EndIf EndIf Sleep(20) WEnd Exit ; Functions Func About() Msgbox(0, "About", " Display Caller ID for incoming calls - E. Schettini ", 3) EndFunc Func Disable() $start = False $NetComm.PortOpen = False Msgbox(0, "CallerID "&"on COM"&$CmdLine[1], " Disconnecting "&"phone on com"&$CmdLine[1], 3) TraySetIcon($Iconpath&"phone_d.ico") EndFunc Func Enable() $start = True $ft = True $NetComm = ObjCreate("NETCommOCX.NETComm");Create NETComm.ocx object ;Set object settings With $NetComm .CommPort = $Com;Set port number .Settings = "9600,N,8,1";Set port settings .InputLen = 0;reads entire buffer .InputMode = 0;reads in text mode .HandShaking = 3;uses both RTS and Xon/Xoff handshaking .PortOpen = "True";opens specified COM port .Output = "AT+CLIP=1" & Chr(13);set CLIP=1. ;.Output = "ATV1Q0" & Chr$(13);Ensure that the modem responds with "OK". EndWith If $ft Then $ft = False Sleep(2500) $result = 0 While $result = 0 $result = StringInStr($NetComm.InputData, "OK") WEnd If $result <> 0 Then MsgBox(0, "CallerID on COM"&$CmdLine[1], " Connection to phone on com"&$CmdLine[1]&" established ", 2) TraySetIcon($Iconpath&"phone_e.ico") EndIf EndFunc Func Exitscript() If $start = False Then Exit Else $NetComm.PortOpen = False Msgbox(0, "CallerID on COM"&$CmdLine[1], " Disconnecting phone on com"&$CmdLine[1]&" ", 3) EndIf Exit EndFunc [font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font] Link to comment Share on other sites More sharing options...
Confuzzled Posted November 7, 2006 Share Posted November 7, 2006 Could this be used on a fixed line with a spare dialup modem/modem card that is lying around? Link to comment Share on other sites More sharing options...
McGod Posted November 7, 2006 Share Posted November 7, 2006 doubt it, Im guessing this is a plugged-in cellphone. You would need a modem and some some software to do that although there is some nice programs out there(Roots around for old modem ) [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now