Yrobot problem
Feb 23, 2011 at 5:41pm UTC
hi everyone
as u can see im new tp this forum and c++
i hae a litle problem with a yahoo autoresponse tool.
this was not created by me, the original codewas designed to save the messagelog as pictures(printscr) whic is not very clever ,and i want to modify this into a .txt file.
Original code (the mesages log work)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
c
# Creat de Rising ACK #
# Proiect open source #
# Enjoy it! #
#ce-------------------------------------------------------------------------#
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=nu's la pc 2.0.ico
#AutoIt3Wrapper_Res_Comment=2010
#AutoIt3Wrapper_Res_Description=Nu's la pc Yahoo Messenger program
#AutoIt3Wrapper_Res_Fileversion=2.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=by Rising ACK
#AutoIt3Wrapper_Res_SaveSource=y
#AutoIt3Wrapper_Res_Language=1033
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
#include <sound.au3>
#include <ScreenCapture.au3>
$hSound1 = _SoundOpen("C:\Program Files\Nu-s la PC\Hello.mp3")
_SoundPlay($hSound1)
_SoundClose($hSound1)
$text1 = Inputbox("Nu's la pc","Your message here"&@CR&"Apasa pe F4 pentru a opri robotul")
GUISetState(@SW_SHOW)
HotKeySet("{F4}", "Quit")
While 1
$msg = GUIGetMsg()
DirCreate(@DesktopDir & "\YahooMessengerData")
Select
Case WinActivate("[Class:CConvWndBase; Instance:1]");-->aici toti greseau
Send($text1)
Send("{TAB}")
Send("{ENTER}")
Sleep(2000)
_ScreenCapture_Capture(@DesktopDir & "\YahooMessengerData\"&@HOUR&"."&@MIN&"."&@SEC&".jpg","[Class:CConvWndBase; Instance:1]")
sleep(200)
WinClose("[Class:CConvWndBase; Instance:1]")
EndSelect
WEnd
Func Quit()
$hSound2 = _SoundOpen("C:\Program Files\Nu-s la PC\Bye.mp3")
_SoundPlay($hSound2)
MsgBox(64,"Nu's la pc","Created by Rising ACK"&@CR&"@2010")
_SoundClose($hSound2)
Exit
EndFunc
Modified code (wich doest saves the mesages as a .txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
#cs-------------------------------------------------------------------------#
# Creat de Rising ACK #
# Proiect open source #
# Enjoy it! #
#ce-------------------------------------------------------------------------#
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=nu's la pc 2.0.ico
#AutoIt3Wrapper_Res_Comment=2010
#AutoIt3Wrapper_Res_Description=Nu's la pc Yahoo Messenger program
#AutoIt3Wrapper_Res_Fileversion=2.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=by Rising ACK
#AutoIt3Wrapper_Res_SaveSource=y
#AutoIt3Wrapper_Res_Language=1033
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
#include <sound.au3>
AutoItSetOption("WinTitleMatchMode" ,2)
Global $TITLE = "- Instant Message"
$hSound1 = _SoundOpen("C:\Program Files\Nu-s la PC\Hello.mp3" )
_SoundPlay($hSound1)
_SoundClose($hSound1)
$text1 = Inputbox("Nu's la pc" ,"Your message here" &@CR&"Apasa pe F4 pentru a opri robotul" )
GUISetState(@SW_SHOW)
HotKeySet("{F4}" , "Quit" )
While 1
$msg = GUIGetMsg()
Select
Case WinActivate("[Class:CConvWndBase; Instance:1]" );-->aici toti greseau
Send($text1)
Send("{TAB}" )
Send("{ENTER}" )
Sleep(2000)
_FileWriteLog(@ScriptDir & "\messages.txt" ,GetMsg($INSTANCE) & @CRLF)
WinClose("[Class:CConvWndBase; Instance:1]" )
EndSelect
WEnd
Func GetMsg($INSTANCE)
$TEXT = _IEBodyReadText($INSTANCE)
$TEXT = StringStripWS(StringReplace($TEXT,"Show Recent Messages (F3)" ,"" ),4)
$TEXT = StringReplace($TEXT,@CR,@CRLF)
Return $TEXT
EndFunc
Func Quit()
$hSound2 = _SoundOpen("C:\Program Files\Nu-s la PC\Bye.mp3" )
_SoundPlay($hSound2)
MsgBox(64,"Nu's la pc" ,"Created by Rising ACK" &@CR&"@2010" )
_SoundClose($hSound2)
Exit
EndFunc
Feb 23, 2011 at 5:52pm UTC
Is this related to C++ in any way?
Topic archived. No new replies allowed.