Jump to content

Recommended Posts

Posted (edited)

Hi,

For the program X-fire(like msn but only for games).

it would be great if i can make a little program that when you are away that it send automessage when someone types to you.

i want the program look if there is an window of X-fire.

When you open a window and chat to someone the windows has the name:

(playername)-Chat-Venster

Now what my problem is.

i want that the program looks if there is a chat window bit the program is the playername

if i want to make the program for other people it must nog look at the playername but to the text Chat-Venster

How to do that the program only looks at the text Chat-Venster?

Second:

i must only type that when someone say's something

when someone types to me i get a windows whit his text

i want that the program types automessage i am not here something like that.

how to make that the program only type it 1 time to one windows thats opend?

Could you please help me whit those things

Edited by Erik.

I little problem, hard to find and fix

Posted (edited)

Opt("WinTitleMatchMode", 2)

;wait for a new window to pop up
While 1
   ;if a new chat window popped up sedn the away message
    If WinExists( "Chat-Venster ) Then
        $title = WinGetTitle( "Chat-Venster" )
        $text = WinGetText( $title )
        ControlSend( $title, $text, CONTROL ID, AWAY MESSAGE )
        ControlClick( $title, $text, CONTROL_ID )
        WinClose( $title )
    EndIf

    Sleep( 1000 )
WEnd

This code whould work with some modifications. You need to change AWAY MESSAGE to whatever string you want sent as your away message. The CONTROL ID in the ControlSend() line needs to be the control id of the text box that you would normally type ur away message in. The CONTROL ID in the ControlClick() like is the contol id of the Send button that you would normally click after typing a message to someone.

The contorl id's are foudn using Start -> Programs -> AutoIt -> Window Info Tool

Edited by Don N

_____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper

Posted (edited)

Yo,

Thanks for it

it does not work full but i try to make it.

sometimes it sends text but some times not

The problem is that ( "Chat-Venster") is not the whole title furrow

the chat-venster there some the player name but i do not want to need al the player names so other people can use it

Edited by Erik.

I little problem, hard to find and fix

Posted

Opt("WinTitleMatchMode", 2), this should make it detect every window that pops up because it makes WinExists( "Chat-Venster ) return 1 when "Chat-Venster" is a substring or is the whole title.

_____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper

Posted (edited)

Hi,

i understand

what is the problem it does not work?

EDIT:

Okej

it only works if i open a window:P

i was wrong

the windows does not come up but you see it flashing at your taskbar

Edited by Erik.

I little problem, hard to find and fix

Posted (edited)

Hi,

what i made is this:

it only does not type the enter button:(

Opt("WinTitleMatchMode", 2)

;wait for a new window to pop up
While 1
 ;if a new chat window popped up sedn the away message
    If WinExists( "Chat-Venster" ) Then
        $title = WinGetTitle( "- Chat-Venster")
        $text = WinGetText( $title )
        WinSetOnTop($title, $text,0)
        Sleep(1000)
        Send(" (Automessage) Ik ben er niet!")
        sleep(1000)
        Send("{ENTER}")
        sleep(1000)
        WinClose($title, $text)
    EndIf
    sleep(1000)
WEnd

EDIT:

Opt("WinTitleMatchMode", 2)

;wait for a new window to pop up
While 1
  ;if a new chat window popped up sedn the away message
    If WinExists( "Chat-Venster" ) Then
        $title = WinGetTitle( "- Chat-Venster")
        $text = WinGetText( $title )
        WinSetOnTop($title, $text,1)
        Sleep(1000)
        ControlSend($title,$text,1013," (Automessage) Ik ben er niet!")
        sleep(1000)
        ControlSend($title,$text,1013,"{ENTER}")
        sleep(1000)
        WinClose($title, $text)
    EndIf
    sleep(1000)
WEnd

only the enter does not work.

could you help me?

Edited by Erik.

I little problem, hard to find and fix

Posted

Is there a button that can also be clicked to send the message, if there is try using controlclick() and clicking on that button. That would eb the best way to do it, Send"{ENTER}") may jsut be putting a carriage return in the chat box. Find the control id of the send button the same way u found the control id of the chat box.

_____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper

Posted

Hello,

Thanks

The problem is that the button does not have a control id.

Ore something like that.

another problem is that it only works when i open a window and not when someone types to me.

i do not know how to make that.

I little problem, hard to find and fix

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
  • Recently Browsing   0 members

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