Jump to content
Sign in to follow this  

Read ChatBox In Real Time

Recommended Posts


Im trying to read a shoutbox in real time on a website. It will read each line and then if it sees a string within that line, it will respond. I used:

$sUrl = "http://site.com"
$oIE = _IECreate($sUrl)
$oHWND = _IEPropertyGet($oIE, "hwnd")
WinSetState($oHWND, "", @SW_MAXIMIZE)
$oForm = _IEFormGetCollection($oIE, 1)
$oShoutbox = _IEGetObjByName($oForm, 'shoutbox_form')
$sText = _IEBodyReadText($oShoutbox)
filewrite(@scriptdir & "\write.txt", $sText)
$shoutstring = fileread(@scriptdir & "\write.txt")


Func _Main()
    Local $aArray1 = _StringBetween($shoutstring, ">>>>>>", "<<<<<<")
    ;_ArrayDisplay($aArray1, 'Default Search')
    ;$aArray1[0] = StringReplace($aArray1[0], @CRLF & @CRLF, @CRLF)
    $aArray1[0] = StringStripWS($aArray1[0], 3)
filewrite(@scriptdir & "\filewrite.txt",$aArray1[0])
EndFunc   ;==>_Main

This gets the correct section for the shoutbox, but i dont know how to only write new lines to the text file. Since i need it to be able to respond when it reads a line, i need it to only read new lines, 1 by 1. Any idea how i go about this? Thanks for any help.

Share this post

Link to post
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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.