Jump to content

Need extreme help with a script for aim.


para
 Share

Recommended Posts

Hello, I am new to autoit yet have used it before, but off templates for simple things. Mostly in games...

A friend of mine needs a script, I tried and failed. I don't think it would be to hard if the person doing it knows what they are doing.

Here is what I need it to do...

Every time someone uses aol instant messanger to message his account, or multiple accounts, it waits 4 seconds(enough for the away message to kick in), then closes the message box, leaving the away message up and the new message gone.

Aim freezes on him at 140 aims. He runs a buisness and he gets alot! His away message is a link. He needs this to work pretty bad, it fills up real fast.

Heres the run down.

Program that will loop, closing aol instant messanger windows(the kind you use to chat) yet leaving the away message alone.

The problem I ran into is the name of the aim window on the taskbar changes every time due to screen name, but is there a way to use a partial taskbar name?

I would grately appriciate it if someone could write this for me, or at least shoot good pointers at me.

Thanks alot.

Link to comment
Share on other sites

I would say use trillian or some other program that replaces MSN, AIM, and the others all in one program. Trillian seems to work far better and not disconnect. It also offers a few more features.

You could most likely use the classname or partial name of the title.

Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

Use window spy to get the name, or classname, ok, say the classname shows up like this:

classname=MozillaWindowClass

Opt("WinTitleMatchMode", 4)    ;advanced
while 1
if winexists("classname=MozillaWindowClass","") then cleanup()
sleep(10)
wend

func cleanup()
 msgbox(1,"Tada","Actually I would have closed it at this point")
endfunc

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

ahh that right there i THINK is exactly what I needed... i will see when i get home in 2 hours.

by the way, can i make it so that when it detects the window, it waits like 2-4 seconds so his away message can respond?

Link to comment
Share on other sites

Opt("WinTitleMatchMode", 4)   ;advanced
while 1
if winexists("classname=MozillaWindowClass","") then cleanup()
sleep(10)
wend

func cleanup()
sleep(2000); for 2 seconds, before doing whatever you are going to do.
msgbox(1,"Tada","Actually I would have closed it at this point")
endfunc

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

Try this... I use aim so this is coming from mine...

Opt("WinTitleMatchMode", 2)
Dim $pause = 5;pause in seconds
Dim $pTitle = ": screenname - Instant Message";Partial Title
$pause = $pause * 1000

While 1
   If WinExists($pTitle) Then 
      WinActivate($pTitle)
      $title = WinGetTitle($pTitle)
      CleanUp($title)
   Sleep(100)
   EndIf
WEnd

Func CleanUp(ByRef $title)
   Sleep($pause)
   WinKill($title)
End Func

I havent tested this as of yet. I will do it when I get back from lunch. If you can test before then please do so.

Edit: Fixed code... (forgot the EndIf)

JS

Edited by JSThePatriot

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

js, yours gives me an error saying that wend will not work with the rest of the code...(weld it said i think?)

skriptkiddie... it seems to work, but what do i change to make it actually close without giving a popup?

thanks a million guys

Link to comment
Share on other sites

Opt("WinTitleMatchMode", 4)  ;advanced
while 1
if winexists("classname=MozillaWindowClass","") then cleanup()
sleep(10)
wend

func cleanup()
sleep(2000); for 2 seconds, before doing whatever you are going to do.
Winkill("classname=MozillaWindowClass") 
endfunc

Make sure to use your classname of the window and not MozillaWindowClass.

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

js, yours gives me an error saying that wend will not work with the rest of the code...(weld it said i think?)

skriptkiddie... it seems to work, but what do i change to make it actually close without giving a popup?

thanks a million guys

<{POST_SNAPBACK}>

Sorry I edited my above code to include the closing if statement I forgot in my rush to get out to lunch :)

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...