Jump to content

ITS Chat v0.7


themax90
 Share

Recommended Posts

This is the simplest peice of technology to run, I even gave them ALL of the instructions and they still couldn't figure it out......

lol... I know the feeling.

I goto great lengths to explain things to my clients, and sometimes they still just dont get it.

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

  • Replies 77
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

If you are on a LAN with your brother then you will need to forward the Port through your router and/or modem. It is possible with newer modems that the 'router' is built in.

JS

lol no actualy i figured it out very easily RIGHT after the last post i made.... lol it seems i accidently edited something in the .ini for the client witch didnt allow me to connect :o once i switched it to the origional one, i could connect easily

Edit: btw... i know this is just the beginning and you're putting in other stuff later, but here's just some ideas that you could put in if you wanted to...

Making a server screen too, that can ban/kick members (witch you already said you would do) but also be able to make members more powerful then others (like give a member admin powers, and the admins go to top of the list, or something like that)

Make the admin(s) a different color then normal people, so people would recognize authority

Make it so people can change the color of there font, (of course, not the color of there names, only admins would have colored names)

i'm not trying to push nothing on you, just giving you suggestions is all B)

Edited by TK_Incorperate
Link to comment
Share on other sites

That is pretty cool but colors should be waited for until all the functions and userability is out. The graphics comes after it actually works. I don't want to be all the graphics of AIM with non of the uses, I want to be all the uses of AIM with optional graphics B) good ideas though, they were already on my list.

Link to comment
Share on other sites

  • 2 weeks later...

Nice program Autoit Smith !

works nice.

Had to remove the "enter" hotkey and replaced it by making the "send" the default button :

GUIctrlsetState($Send,$GUI_DEFBUTTON)

(i could not use "enter" in other running applications)

on the server side, I added a little sleep(200) in the logon and logoff functions (between the SendMessage() and the UpdateUserlist())

this, because I often had "useruser has logged on" into the userlist instead of the messagelist.

(the SendMessage being soo fast that the client while-wend sees only one string coming in, being : "~userlist-useruser has logged on")

I also added some "background" colour flickering on the client side when a message comes in :

GUICtrlSetBkColor($History,0xA1EAA3)

_GUICtrlEditLineScroll ($History, 0, _GUICtrlEditGetLineCount ($History))

sleep(200)

GUICtrlSetBkColor($History,0xC6C6C6)

Thanks for this/these usefull script(s) !

D2charkeeper = No more 'expired characters' in D2.File Date Changer = Change the file date(s), attributes and the filename case of multiple files @ once.Updater_full = Copy/Update your autoitscripts, pictures, .mp3, .avi etc ... subdirs from your PC to your memory stick or to your external harddisk. Now with scheduling and logging.Questmapper
Link to comment
Share on other sites

im unable to connect to server! it only work here in my local network! and with my OpenVPN Client!

i got a server! running maybe you can try out!

the Ip Adress is www.aleajecta.com or 70.82.215.205 i think FQDN don't not work in ITS chat so use IP adress!

i will be on

bye bye!

Edited by Greenseed

GreenseedMCSE+I, CCNA, A+Canada, QuebecMake Love Around You.

Link to comment
Share on other sites

this is the code i've updated to make the key ENTER sending msg and not stoping working in other application!

is the only way to do it without capturing the key!

#include <GuiConstants.au3>
#include <GuiEdit.au3>
#include <Array.au3>
#include <String.au3>
Dim $ChatIni = "Chat.ini", $MaxChar = 512000, $MainSocket = -1
$LogonGUI = GUICreate("ITS Chat", 210, 325, (@DesktopWidth - 210) / 2, (@DesktopHeight - 325) / 2)
$FileMenu = GUICtrlCreateMenu("File")
$ServerSettings = GUICtrlCreateMenuItem("Server Settings", $FileMenu, 0)
$Exit = GUICtrlCreateMenuItem("Exit", $FileMenu, 1)
$ChatLogo = GUICtrlCreatePic("Logo.jpg", 10, 10, 190, 155)
$Usernames = GUICtrlCreateCombo("", 10, 200, 190, 21)
$Password = GUICtrlCreateInput("", 10, 250, 190, 20)
$UserLabel = GUICtrlCreateLabel("Username:", 72.5, 177.5, 60, 15, $SS_SUNKEN)
$PassLabel = GUICtrlCreateLabel("Password:", 72.5, 227.5, 60, 15, $SS_SUNKEN)
$Register = GUICtrlCreateButton("Register", 10, 280, 100, 20)
$Logon = GUICtrlCreateButton("Logon", 120, 280, 80, 20)
GUISetState()
LoadSettings($ChatIni)
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE Or $msg = $Exit
            ExitLoop
        Case $msg = $ServerSettings
            $ServerSetGUI = GUICreate("Server Settings", 130, 155, (@DesktopWidth - 130) / 2, (@DesktopHeight - 155) / 2)
            $IpSet = GUICtrlCreateInput("", 10, 40, 110, 20)
            $IpSetLabel = GUICtrlCreateLabel("Server Ip Address", 20, 10, 90, 20)
            $PortSet = GUICtrlCreateInput("", 10, 100, 110, 20)
            $PortSetLabel = GUICtrlCreateLabel("Server Port Number", 20, 70, 100, 20)
            $SetOpts = GUICtrlCreateButton("Set Options", 20, 130, 90, 20)
            GUISetState()
            While 1
                $msg = GUIGetMsg()
                Select
                    Case $msg = $GUI_EVENT_CLOSE
                        ExitLoop
                    Case $msg = $SetOpts
                        $IpIniSet = GUICtrlRead($IpSet)
                        $PortIniSet = GUICtrlRead($PortSet)
                        IniWrite($ChatIni, "Server Settings", "Server", $IpIniSet)
                        IniWrite($ChatIni, "Server Settings", "Port", $PortIniSet)
                        MsgBox(0, "Set", "Your server settings as been set to the following, IpAddress " & $IpIniSet & " Port " & $PortIniSet)
                        ExitLoop
                    Case Else
                    ;;;
                EndSelect
            WEnd
            GUIDelete($ServerSetGUI)
        Case $msg = $Register
        ; Register On Server
            $RegisterGUI = GUICreate("Register", 170, 140, (@DesktopWidth - 170) / 2, (@DesktopHeight - 140) / 2)
            $UL = GUICtrlCreateLabel("Username:", 60, 10, 63, 15)
            $UserInput = GUICtrlCreateInput("", 10, 30, 150, 20)
            $PL = GUICtrlCreateLabel("Password:", 60, 60, 50, 15)
            $PassInput = GUICtrlCreateInput("", 10, 80, 150, 20)
            $RegGo = GUICtrlCreateButton("Register", 50, 110, 70, 20)
            GUISetState()
            While 1
                $msg = GUIGetMsg()
                Select
                    Case $msg = $GUI_EVENT_CLOSE Or $msg = $Exit
                        ExitLoop
                    Case $msg = $RegGo
                        TCPStartup()
                        GUISetState(@SW_HIDE, $RegisterGUI)
                        $UserSend = GUICtrlRead($UserInput)
                        $PassSend = GUICtrlRead($PassInput)
                        $Server = IniRead($ChatIni, "Server Settings", "Server", -1)
                        $Port = IniRead($ChatIni, "Server Settings", "Port", -1)
                        $MainSocket = TCPConnect($Server, $Port)
                        $StatusGUI = GUICreate("Status", 270, 260, (@DesktopWidth - 270) / 2, (@DesktopHeight - 260) / 2)
                        $Status = GUICtrlCreateEdit("", 10, 10, 250, 200, $ES_READONLY + $WS_VSCROLL + $ES_AUTOVSCROLL)
                        $Close = GUICtrlCreateButton("Close", 80, 220, 110, 30)
                        GUISetState()
                        If $MainSocket = -1 Then
                            GUICtrlSetData($Status, "Unable to connect to server.....")
                        EndIf
                        $Text = "~register-" & $UserSend & "-" & $PassSend
                        SendMessage($Text)
                        While 1
                            $msg = GUIGetMsg()
                            Select
                                Case $msg = $GUI_EVENT_CLOSE Or $msg = $Close
                                    ExitLoop
                                Case Else
                                ;;;
                            EndSelect
                            $Recv = TCPRecv($MainSocket, $MaxChar)
                            If $Recv <> "" And $Recv <> "~bye" Then
                                GUICtrlSetData($Status, GUICtrlRead($Status) & $Recv)
                            ElseIf $Recv <> "" And $Recv = "~bye" Then
                                TCPCloseSocket($MainSocket)
                                TCPShutdown()
                            EndIf
                        WEnd
                        GUIDelete($StatusGUI)
                        ExitLoop
                    Case Else
                    ;;;
                EndSelect
            WEnd
            GUIDelete($RegisterGUI)
        Case $msg = $Logon
            GUISetState(@SW_HIDE, $LogonGUI)
        ; Logon On Server
            $ChatGUI = GUICreate("ITS Main Chat", 410, 290, (@DesktopWidth - 410) / 2, (@DesktopHeight - 270) / 2)
            $ChatFileMenu = GUICtrlCreateMenu("File")
            $ChatClose = GUICtrlCreateMenuItem("Close Connection", $ChatFileMenu, 0)
            $History = GUICtrlCreateEdit("Contacting Server.....", 10, 10, 290, 170, $WS_VSCROLL + $ES_READONLY)
            $Userlist = GUICtrlCreateList("", 310, 10, 90, 170)
            $Message = GUICtrlCreateEdit("", 10, 190, 290, 70, $ES_AUTOVSCROLL + $WS_VSCROLL)
            $Send = GUICtrlCreateButton("Send", 310, 230, 90, 30)
            $PersonalSend = GUICtrlCreateButton("Send To User", 310, 190, 90, 30)
            GUISetState()
            $UserLogon = GUICtrlRead($Usernames)
            $PassLogon = GUICtrlRead($Password)
            $Server = IniRead($ChatIni, "Server Settings", "Server", -1)
            $Port = IniRead($ChatIni, "Server Settings", "Port", -1)
            TCPStartup()
            $MainSocket = TCPConnect($Server, $Port)
            If $MainSocket = -1 Then
                GUICtrlSetData($History, "Unable to connect to server........")
            EndIf
            $Text = "~login-" & $UserLogon & "-" & $PassLogon
            SendMessage($Text)
            
            While 1
                $msg = GUIGetMsg()
                If _IsPressed('0d') and winactive("ITS Main Chat") Then $msg = $Send

                Select
                    Case $msg = $GUI_EVENT_CLOSE Or $msg = $ChatClose
                        ExitLoop
                    Case $msg = $Send
                    ; Send Message
                        $Text = GUICtrlRead($Message)
                        If $Text <> "" And $Text <> "/time" Then
                            GUICtrlSetData($Message, "")
                            SendMessage($Text)
                        ElseIf $Text = "/time" Then
                            SendMessage($Text)
                            GUICtrlSetData($Message, "")
                            GUICtrlSetData($History, GUICtrlRead($History) & @CRLF & "Your computer's time is " & Time())
                        EndIf
                    Case $msg = $PersonalSend
                        $PmUser = GUICtrlRead($Userlist)
                        $PmText = GUICtrlRead($Message)
                        If $PmText <> "" And $PmUser <> "" Then
                            GUICtrlSetData($Message, "")
                            SendMessage("~pm-" & $PmUser & "-" & $PmText)
                        ElseIf $PmUser = "" Then
                            MsgBox(0, "Error", "No user selected to PM.")
                        EndIf
                    Case Else
                    ;;;
                EndSelect
                $MainRecv = TCPRecv($MainSocket, $MaxChar)
                $UserListCheck = StringSplit($MainRecv, "-")
                Select
                    Case $MainRecv <> "" And $MainRecv <> "~bye" And $UserListCheck[1] <> "~userlist"
                        GUICtrlSetData($History, GUICtrlRead($History) & @CRLF & $MainRecv)
                        _GUICtrlEditLineScroll ($History, 0, _GUICtrlEditGetLineCount ($History))
                    Case $MainRecv = "~bye"
                    ; Connection was closed.
                    Case $UserListCheck[1] = "~userlist"
                    ; Userlist was sent.
                        GUICtrlSetData($Userlist, $UserListCheck[2])
                    Case Else
                    ; None
                EndSelect
            WEnd
            GUIDelete($ChatGUI)
            SendMessage("~bye")
            TCPCloseSocket($MainSocket)
            TCPShutdown()
            GUISetState(@SW_SHOW, $LogonGUI)
        Case Else
        ;;;
    EndSelect
WEnd
Exit
Func LoadSettings($Ini)
    $IniExists = FileExists($Ini)
    If $IniExists = 0 Then
    ; Ini Does Not Exist
        FileOpen($Ini, 2)
        FileClose($Ini)
        IniWrite($Ini, "Users", "0", "")
        IniWrite($Ini, "Users", "Amount", "0")
        IniWrite($Ini, "Server Settings", "Server", "")
        IniWrite($Ini, "Server Settings", "Port", "")
        MsgBox(0, "No Ini Detected", "ITS Chat did not detect an Ini file and one was generated for you." & @CRLF & "Please set all settings under the File menu before operating.")
    ElseIf $IniExists Then
    ; Ini Does Exist
    EndIf
    $AoU = IniRead($Ini, "Users", "Amount", -1)
    Dim $User[ ($AoU + 1) ]
    $Track = 0
    For $Track = 0 To $AoU Step 1
        $User[$Track] = IniRead($Ini, "Users", $Track, -1)
    Next
    _ArraySort($User)
    For $Track = 0 To $AoU Step 1
        GUICtrlSetData($Usernames, $User[$Track], $User[0])
    Next
EndFunc  ;==>LoadSettings
Func Enter()
    $msg = $Send
EndFunc  ;==>Enter
Func Error($ErrorNum = -1)
    Select
        Case $ErrorNum = 0
        ; Unknown Internal Error
            MsgBox(0, "Error", "Unknown Internal Error")
        Case $ErrorNum = 1
        ; Corrupt Ini
            MsgBox(0, "Error", "Corrupt Ini")
        Case Else
        ; Unknown Error
            MsgBox(0, "Error", "Unknown Error")
    EndSelect
    Exit
EndFunc  ;==>Error
Func SendMessage($Text)
    TCPSend($MainSocket, $Text)
EndFunc  ;==>SendMessage
Func Time()
    $light = " AM"
    $hour = @HOUR
    $minute = @MIN
    $sec = @SEC
    If $hour = 0 Then
        $hour = 12
    ElseIf $hour = 12 Then
        $light = " PM"
    ElseIf $hour > 12 Then
        $hour = (@HOUR) - 12
        $light = " PM"
    EndIf
    $time = $hour & ":" & $minute & ":" & $sec & $light
    Return $time
EndFunc  ;==>Time
[b]
Func _IsPressed($hexKey)
    Local $aR, $bRv
    $hexKey = '0x' & $hexKey
    $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey)
    If $aR[0] <> 0 Then
        $bRv = 1
    Else
        $bRv = 0
    EndIf
    Return $bRv
EndFunc; ==>Key Press
[/b]

Func OnAutoItExit()
    If $MainSocket <> - 1 Then
        SendMessage("~bye")
        TCPCloseSocket($MainSocket)
    EndIf
    TCPShutdown()
EndFunc  ;==>OnAutoItExit

Look For:

Func _IsPressed($hexKey)

Local $aR, $bRv

$hexKey = '0x' & $hexKey

$aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey)

If $aR[0] <> 0 Then

$bRv = 1

Else

$bRv = 0

EndIf

Return $bRv

EndFunc; ==>Key Press

And:

If _IsPressed('0d') and winactive("ITS Main Chat") Then $msg = $Send

and I've deleted all HOtKEySet()

Edited by Greenseed

GreenseedMCSE+I, CCNA, A+Canada, QuebecMake Love Around You.

Link to comment
Share on other sites

Nice to meet you on ITS Chat Greenseed !

I will try your solution tomorrow @work

D2charkeeper = No more 'expired characters' in D2.File Date Changer = Change the file date(s), attributes and the filename case of multiple files @ once.Updater_full = Copy/Update your autoitscripts, pictures, .mp3, .avi etc ... subdirs from your PC to your memory stick or to your external harddisk. Now with scheduling and logging.Questmapper
Link to comment
Share on other sites

Nice program Autoit Smith !

works nice.

Had to remove the "enter" hotkey and replaced it by making the "send" the default button :

GUIctrlsetState($Send,$GUI_DEFBUTTON)

(i could not use "enter" in other running applications)

on the server side, I added a little sleep(200) in the logon and logoff functions (between the SendMessage() and the UpdateUserlist())

this, because I often had "useruser has logged on" into the userlist instead of the messagelist.

(the SendMessage being soo fast that the client while-wend sees only one string coming in, being : "~userlist-useruser has logged on")

I also added some "background" colour flickering on the client side when a message comes in :

GUICtrlSetBkColor($History,0xA1EAA3)

_GUICtrlEditLineScroll ($History, 0, _GUICtrlEditGetLineCount ($History))

sleep(200)

GUICtrlSetBkColor($History,0xC6C6C6)

Thanks for this/these usefull script(s) !

The script is now in a much improved and advanced Beta 0.8, if you notice this thread is from weeks ago. Thank you for your reply however. Please refrain from talking about this here instead we have a forum at http://its.forumup.com/index.php?mforum=its

Please post there. Beta 0.8 to be out in about 4 days. Do not worry have working on it yet, everything you have been talking about is ALREADY fixed or changed.

Thank you for posting however

Here is a list of things that have already been fixed in the new version

Server :
        Added : User/Admin Settings
        Added : RegNumber Ini Logging
        Added : Message Logging
        Fixed : Message Send To Fast Glitch
        Added : /astatus (What Authority Is User?)
        Added : /cstatus (Is User Logged On?)
        Fixed : Rebuilt Variable Structure
        Fixed : Logout Structure - Notification
        Fixed : Login/Out Structure (Too Fast Messages)
        Added : Spec Log for IP and Socket Logging
        Fixed : Reg Logging Issue
        Added : Server Stream In Log
        Added : Server Stream Out Log
        
    Admin DB :
        Creation 11/17
        Added : GUI Layout
        Added : Userlists and Updating
        Added : User status functions
        
    Client : 
        Changed : HotKey to IsPressed (Add If Window OnTop?)
        Added : Blinking When Message Received (Change to Color?)
        Added : Save Conversation

Thanks,

AutoIt Smith

Edited by AutoIt Smith
Link to comment
Share on other sites

It always says 'unable to connect to server', whats up with that? probably my router right?

**edit**Got it to work, ip was incorrect....

i still have the router problem... but we are looking for a fix...

any ideas ?????

( port forwarding is not much of an option as i have 4 computers online)

8)

NEWHeader1.png

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...