help with a quick script
"Littlefield, tyler" <[email protected]>
| Newsgroups | gmane.comp.windows.autoit.user |
|---|---|
| Message-ID | <006e01c733fc$1304b800$6401a8c0@development> |
Hello list,
This is just the beginning of a script I'm working on. I want it to connect to clients, and receive all data, as well as send data. I can't get it to send the data, and I can't tab around, also it doesn't receive much data, I know that it should be getting more
Here's the code, any help is really appriciated.
P.s. sorry for the indenting, I use a screen reader, so I don't need it, and I couldn't find the option in SiT.
<blockquote>
;FTalk
;Written by Tyler Littlefield
;Copyright 2007 Tyler Littlefield
;All rights reserved
;constants
const $version="1.0b"
$connected=0
#include <file.au3>
#include <string.au3>
#include <inet.au3>
#include <constants.au3>
#include <ie.au3>
#include <misc.au3>
#include <process.au3>
#include <math.au3>
#include <guiconstants.au3>
GuiCreate("FTalk", 250, 250, -1, -1)
GuiCtrlCreateLabel("Input", 10, 5, 240, 20)
$input=GuiCtrlCreateEdit("", 5, 40, 240, 40)
GuiCtrlSetState($input, $GUI_FOCUS)
GuiCtrlCreateLabel("history", 5, 90, 220, 20)
$history=GuiCtrlCreateEdit("", 5, 120, 220, 115, $ES_MULTILINE+$ES_READONLY)
GuiCtrlSetState($history, $GUI_ENABLE)
$status=GuiCtrlCreateLabel("", 5, 230, 240, 20)
$send=GuiCtrlCreateButton("send", 215, 90, 40, 25)
GUICtrlSetState($send, $GUI_DEFBUTTON)
GUICtrlSetResizing($input, $GUI_DOCKAUTO)
GuiCtrlSetResizing($history, $GUI_DOCKAUTO)
GuiCtrlSetResizing($send, $GUI_DOCKAUTO)
GuiCtrlSetResizing($status, $GUI_DOCKAUTO)
$historytext="This program was written and edited by Tyler Littlefield."&@crlf&"version: "&$version&"."&@crlf&"Copyright "&@year&", Tyler Littlefield."&@crlf&"All rights reserved."&@crlf&@crlf
GuiCtrlSetData($history, $historytext)
GuiSetState()
TCPStartup()
connect()
$text=""
while 1
$msg=GuiGetMsg()
if ($connected == 1) then
$text=TCPRecv($connection, 1000000)
if (stringlen($text) > 0) then
$historytext=$historytext&$text&@crlf
GuiCtrlSetData($history, $historytext)
EndIf
EndIf
select
case $msg=$GUI_EVENT_CLOSE
exit
case $msg=$send
if $connected == 1 then
if (stringlen(GuiCtrlRead($input)) > 0) then
MsgBox(0, "", GuiCtrlRead($input))
TCPSend($connection, GUICtrlRead($input))
EndIf
EndIf
endSelect
wend
func connect()
GuiCtrlSetData($status, "Connecting.")
global $connection=TCPConnect(TCPNameToIP("stockton.dyndns.org"), 7777)
global $connected=1
sleep(5)
$status=GuiCtrlSetData($status, "Connected-ready")
EndFunc
</blockquote>
Thanks,
Tyler Littlefield
Shaned.net customer support and server administrator.
Unlimited horizons head coder.
check out our website:
tysplace.homelinux.net
msn: [email protected]
aim: st8amnd2005
skype: st8amnd127
[Non-text portions of this message have been removed]