This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

TCL request

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
e
eliteop
Voice
Posts: 2
Joined: Sun Feb 12, 2006 3:20 pm

TCL request

Post by eliteop »

Hi, can somebody help me?
I need a tcl that search every x minutes if a process is running and, if it is, tell it on a irc channel.
Something like: if i open notepad.exe i would like windrop to tell on irc "notepad.exe was just opened bla bla bla"
Thanks for your time
:D :D :D
d
deadite66
Halfop
Posts: 74
Joined: Mon May 30, 2005 2:49 am
Location: Great Yarmouth, UK

Post by deadite66 »

it could be done with a small vbscript as your using windrop.

Code: Select all

set wmi = getobject("winmgmts:")
wql = "select * from win32_process " _
    & " where name='notepad.exe'"
set results = wmi.execquery(wql)
WScript.Echo results.count 
if you had a tcl script to run
c:/windows/system32/cscript //Nologo c:/myscript.vbs
and catch the result.
0 = no notepad open
1+ = how many open
<- tcl newb
e
eliteop
Voice
Posts: 2
Joined: Sun Feb 12, 2006 3:20 pm

Post by eliteop »

and how to link it with the tcl for irc announcement?
Thanks
d
deadite66
Halfop
Posts: 74
Joined: Mon May 30, 2005 2:49 am
Location: Great Yarmouth, UK

Post by deadite66 »

try this, youl need to change the path to where the vbs script is and change the 2 #mychannel bits to your channel.

Code: Select all

set apprunningcheck 0

bind time - * go:appcheck

proc go:appcheck {m h d mo y} {
global apprunningcheck
set appres [exec c:/windows/system32/cscript //Nologo c:/test.vbs]

if {$appres != $apprunningcheck & $appres == "0"} {
puthelp "PRIVMSG #mychannel :app exited" ; set apprunningcheck 0
   } 
if {$appres != $apprunningcheck & $appres == "1"} {
puthelp "PRIVMSG #mychannel :app started" ; set apprunningcheck 1
   }
}
<- tcl newb
Post Reply