 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Fry
Joined: 01 Nov 2007 Posts: 610
|
Posted: Tue Jan 08, 2008 3:05 am Post subject: SimpleChat (LAN and WAN) No FTPS Used! |
|
|
SimpleChat is a simple chatting script which allows you to chat over a network (LAN) or not over a network mean anybody in the world(WAN)
this script depends on the batch files it creates
You can send messages by Entering the LAN or Wan IP or Name of pc in the IP Address Box (Picture Below)
An Example of a WAN IP Address is 24.177.17.74
An Example of a LAN IP Address is 192.168.1.101
An Example of a PC name is Laptop01 (This is another way of LAN)
Type your message in the Message box and press Send it will send your message and a msgbox on the desired Computer will popup with your text
DISCLAIMERS
To receive messages you must have this script open
WAN sendings might not work with people who have Routers
This program is in v0.1 aplha stage and will be improved in the future
In the program it tells you your LAN and WAN Ip
POST YOUR IP
Post your ip in this topic maybe we could have a ip directory of everybody here
Script : SimpleChat.ahk
| Code: |
#SingleInstance Ignore
SplashTextOn, , , Starting, Starting.... Please Wait
FileAppend,netsh firewall set opmode enable, Firewaller.bat
runwait, Firewaller.bat,,Hide
FileDelete,Firewaller.bat
OnExit,Exiter
#NoEnv
FileAppend, net send netsh firewall set opmode disable, Firewall.bat
runwait, Firewall.bat,,Hide
FileDelete,Firewall.bat
SetBatchLines -1
Checker =
(
@echo OFF
SC query messenger | find "STATE" > Simple.Chat
echo %errorlevel%
type Simple.Chat | find "1"
echo %errorlevel%
if errorlevel 1 goto m
goto start
:start
echo START
sc config messenger start= demand
net start messenger
goto m
m:
exit
)
FileAppend, %Checker%, SimpleChat.bat
runwait, SimpleChat.bat,,Hide
SplashTextOff
FileDelete, SimpleChat.bat
FileDelete, Simple.Chat
UrlDownloadToFile, http://www.whatismyip.org/, %A_Temp%\ip.txt
FileRead, ip, %A_Temp%\ip.txt
FileDelete, %A_Temp%\ip.txt
Gui, Add, Button, x216 y160 w70 h30 gSendMessage, Send
Gui, Add, Edit, x6 y120 w200 h70 vText, Text to send
Gui, Add, Edit, x216 y120 w140 h20 vIP, Friends Lan/Wan Ip
Gui, Add, Text, x16 y10 w100 h30 , Your LAN Ip Is`n%A_IPAddress1%
Gui, Add, Edit, x376 y10 w230 h180 , People To Chat To:
Gui, Add, Text, x16 y60 w100 h30 , Your WAN Ip Is`n%ip%
Gui, Add, Button, x286 y160 w70 h30 +Disabled, Open Friends SideBar
; Generated using SmartGUI Creator 4.0
Gui, Show, x131 y90 h208 w375, Simple Chat
return
SendMessage:
Gui,Submit,NoHide
FileAppend, net send %IP% %Text%, Sender.bat
runwait, Sender.bat
return
Exiter:
SplashTextOn, , , Unloading, Exiting.... Please Wait
FileAppend,netsh firewall set opmode enable, Firewaller.bat
runwait, Firewaller.bat,,Hide
FileDelete,Firewaller.bat
sleep 100
FileAppend, net stop messenger`nsc config messenger start= disabled, Messenger.bat
runwait, Messenger.bat,,Hide
FileDelete,Messenger.bat
SplashTextOff
ExitApp
|
_________________ check out my site
www.eliteknifesquad.com |
|
| Back to top |
|
 |
Rhys
Joined: 17 Apr 2007 Posts: 722 Location: Florida
|
Posted: Tue Jan 08, 2008 3:50 am Post subject: |
|
|
Cool script but net send is disabled where I work (and many corporate locations I think) and my WAN IP at home is my router Maybe net send supports ports so they can be forwarded? _________________ [Join IRC!]
 |
|
| Back to top |
|
 |
DerRaphael
Joined: 23 Nov 2007 Posts: 456 Location: Heidelberg, Germany
|
Posted: Tue Jan 08, 2008 8:35 pm Post subject: |
|
|
collecting ips is not always a clever idea, especially not in a public place like this forum - i doubt that people 'd give you their static ip's so these can be published and accessed by whoever wants to, when they know what they're doing.
depending on where you live and how you access the internet, many ISP (internet service provider) use dynamic ips. so collecting these is pointless, because these change everytime you dial in or connect to the net.
to make up a chat which works over WAN some centralized instance will be needed. take a look at how peer-to-peer networks (bittorent for example) are organized to get the idea.
my 2 cents
derRaphael _________________
|
|
| Back to top |
|
 |
Fry
Joined: 01 Nov 2007 Posts: 610
|
Posted: Tue Jan 08, 2008 10:10 pm Post subject: |
|
|
Ok ips is not really that good
but this script enables net sned when you start it
When you end the script it disables net send _________________ check out my site
www.eliteknifesquad.com |
|
| Back to top |
|
 |
tank
Joined: 21 Dec 2007 Posts: 679
|
Posted: Tue Jan 08, 2008 10:13 pm Post subject: |
|
|
providing that the use rhas admin rights to enable a service
in most corp and workplace environs this is not possible | Quote: | DerRaphael:
collecting ips is not always a clever idea |
and i second the idea that freely providing ip's is bad karma _________________ Read this
Com
Automate IE7 with Tabs |
|
| Back to top |
|
 |
Fry
Joined: 01 Nov 2007 Posts: 610
|
Posted: Tue Jan 08, 2008 10:15 pm Post subject: |
|
|
jeez i expected a good job needs a little work
but i hate the people who just ridicule peoples scripts _________________ check out my site
www.eliteknifesquad.com |
|
| Back to top |
|
 |
DerRaphael
Joined: 23 Nov 2007 Posts: 456 Location: Heidelberg, Germany
|
Posted: Tue Jan 08, 2008 11:27 pm Post subject: |
|
|
fry, everybody startet as a n00b the other day. even me - i'd say im still a n00b, just got some more expirience but u know ... than more i learn then better i understand how little i know.
when you plan to make the ultimate chat with ahk - i might assist you in answering your questions and even help you with the code. i also can give you ideas of how to 'make' things.
for example ... an ahk chat should be a scripted chat only no external dependencies
2nd it'd be good to have the script working everywhere ... even behind firewalls and NATs .... much the way skype works ... e.g. 'hijacking' some popular protocols like http on port 80 or ftp on port 21 and sneaking that way thru the firewall.
3rd i server might be needed to connect all people without presenting their external ips to the public - also some sort of security would usefull - eg crypted data streams - so no one can use the read datastreams (tcpdump - ethereal etc). i'd prefer a service where user have to sign up otherwise the chat works only with restrictions ... like nomore than xxx chars and 2 answers/minute or smething like that
filetransfer 'd come in handy - especially when not directly connecting between users and this as a toggle feature so use might establish direct connections - knowing that this 'll expose their IPs
different 'channels' - private channels - moderator feats - 1 on 1 ---
the feature list is nearly endless - each has its own advantages but also disadvanatages.
i think the important thing is to have it small and robust, so it can be used in every situation.
let me know if you need help
greets
derRaphael _________________
|
|
| Back to top |
|
 |
tank
Joined: 21 Dec 2007 Posts: 679
|
Posted: Wed Jan 09, 2008 12:27 am Post subject: |
|
|
@fry
i sincerely hope you do not mistake my comments as ridicule
those who have posted responses are merely trying to point out some conceptual issues that are faced with these types of applications in the real world thinking perhaps you may have overlooked them
in one shape or another we are all noobs when we look at other peoples ideas in the fact that its a new idea that no matter the level of experience do not see the same picture as the person presenting it.
the idea of the forum is to discuss the value of these idea's and viability of working code when it works.
Yours does seem to work however many who posted have tried in earnest to present some conceptual issues that in the eyes of some you "seem to have overlooked"
we are not poking fun only helping you see the whole picture _________________ Read this
Com
Automate IE7 with Tabs |
|
| Back to top |
|
 |
hello Guest
|
Posted: Wed Jan 09, 2008 5:11 am Post subject: i know this sounds |
|
|
i know this sounds strange but i have a LAN network chat system, is there anyway i can implement this into the full featured chat?
it can
1) send user list to a ftp, then download user lists with status every second (to make it work)
2) allow private messages
30 allow users to connect to one ip address (that of the server for the chat) and chat
| Code: | ; <COMPILER: v1.0.47.5>
#singleinstance off
chat = chat.dat
#IfWinActive, Lan Chat v1.0.4 - emoyasha dev co
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
mcounter = 0
hcounter = 0
Menu,Tray,NoStandard
Menu,Tray,DeleteAll
Menu,Tray,Add,Chat
Menu,Tray,Add,ChangeUsername
Menu,Tray,Add,ChangeMessage
Menu,Tray,Add,Hotkeys
Menu,Tray,Add,About
Menu,Tray,Add,Exit
Menu,Tray,Default,Chat
Menu,Tray,add,admin
Menu,Tray,add,logviewer
Ifnotexist, %a_windir%\system32\lcsettings.dll
{
Msgbox, , Lan Talk v1.0.4, Written By: EmoYasha`n`nIdea By: Tim Chen
InputBox, name, Lan Chat v1.0.4, What do you want your chat name to be?
if ErrorLevel
{
MsgBox, You cancelled.
ExitApp
}
IniWrite, %name%, %a_windir%\system32\lcsettings.dll, Personal, name
Loop
{
Random, yourcomp, 100, 999
Loop, read, users.ini
{
if a_loopreadline contains %yourcomp%
{
used = 1
break
}
}
if used <> 1
break
}
IniWrite, %yourcomp%, %a_windir%\system32\lcsettings.dll, Computer, id
IniWrite, %name%, users.ini, %yourcomp%, name
IniWrite, 0, %a_windir%\system32\lcsettings.dll, Personal, Message
}
Else
{
IniRead, name, %a_windir%\system32\lcsettings.dll, Personal, name
IniRead, yourcomp, %a_windir%\system32\lcsettings.dll, Computer, id
Iniread, bl, %a_windir%\system32\lcsettings.dll, Computer, bl
if bl = 1
{
IniRead, ul, users.ini, %yourcomp%, bl
if ul = 2
{
IniDelete, %a_windir%\system32\lcsettings.dll, Computer, bl
IniDelete, users.ini, %yourcomp%, bl
}
else
{
Msgbox,, Blocked, What do you think your doing!!! You've been blocked!,2
ExitApp
}
}
IniWrite, %name%, users.ini, %yourcomp%, name
}
IniWrite, *, users.ini, %yourcomp%, online
Settimer, updatechat, 100
Settimer, Checkbl, 1000
Settimer, CheckMessages, 10
Settimer, UpdateUserList, 1000
Settimer, Updatebroadcast, 100
Settimer, Updatecleaner, 100
Gui, 2:Add, Button, x6 y70 w130 h20 , Update Done
Gui, 2:Add, Button, x6 y10 w130 h20 , Turn Cleaner ON
Gui, 2:Add, Button, x6 y30 w130 h20 , broadcast
Gui, 2:Add, Button, x6 y50 w130 h20 , Update Program
Gui, 2:Add, Edit, x16 y120 w50 h20 vcomid, ID
Gui, 2:Add, Button, x76 y120 w50 h20 , Block
Gui, 2:Add, Button, x26 y150 w90 h20 , Un Block
Gui, 2:Add, GroupBox, x6 y100 w130 h80 , User Control
Gui, 3:Add, Edit, x16 y350 w360 h20 vMessage, Type your message here...
Gui, 3:Add, Button, x400 y340 w60 h20 gbuttonsend , Send PM
Gui, 3:Add, Edit, x16 y0 w360 h340 vMessageWindow +ReadOnly, Your messages will come in here...
Gui, 3:Add, Edit, x16 y390 w80 h20 vtocomp, CompID
Gui, Add, Edit, x16 y350 w560 h20 vMessage, Type your message here...
Gui, Add, Edit, x606 y340 w80 h20 vtocomp, CompID
Gui, Add, Button, x700 y340 w60 h20 gbuttonsend , Send PM
Gui, Add, Button, x690 y370 w90 h20 gbuttonaction ,send as Action
Gui, Add, GroupBox, x6 y0 w580 h400 +, Chat
Gui, Add, ListView, x16 y20 w560 h330 , Chat
Gui, Add, Text, x316 y370 w200 h20 +, Press Enter to send the message
Gui, Add, button, x490 y370 default genter1 + , send
Gui, Add, GroupBox, x596 y300 w180 h70 , Send Private Message
Gui, Add, Text, x616 y320 w140 h20 , Send a message to one user
Gui, Add, Button, x536 y410 w50 h50 , Open`nSidebar
Gui, Add, GroupBox, x6 y400 w520 h70 , Private Messages
Gui, Add, Edit, x16 y420 w500 h40 vMessageWindow +ReadOnly, Your messages will come in here...
Gui, Add, GroupBox, x596 y0 w180 h300 , User List
Gui, Add, Edit, x606 y20 w160 h270 vUserWindow +ReadOnly, Users in Chat
gui, add, button, x606 y450, pm window
Gui, Show, x50 y50 h483 w595, Lan Chat v1.0.4 - emoyasha dev co
Return
Chat:
WinActivate, Lan Chat v1.0.4
return
ChangeUsername:
stop = 0
InputBox, newname, Lan Chat v1.0.4, What do you want you chat name to be?
FileRead, tempusers, users.ini
if tempusers contains %newname%
{
Msgbox, Sorry but this username has already been taken.
return
}
oldname = %name%
name = %newname%
IniWrite, %name%, %a_windir%\system32\lcsettings.dll, Personal, name
IniWrite, %name%, users.ini, %yourcomp%, name
FileAppend, "%oldname%" changed his name to "%name%" %a_yday%`n, userhistory.dat
return
ChangeMessage:
InputBox, buttonmess, Lan Chat v1.0.4, What do you want to change the predefined message to?
if ErrorLevel
return
IniWrite, %buttonmess%, %a_windir%\system32\lcsettings.dll, Personal, Message
goto buttonl
return
^h::
Hotkeys:
Msgbox, , Lan Chat Hotkeys, Control+h - Hotkeys Help`nControl+m - Open Messages`nControl+e - Hides the Window`nControl+Alt+a - Action`nControl+Shift+a - Admin Menu`nControl+Alt+s - Send private message`nControl+p - Send your predefined message`n`nAlt+x - Exits
return
About:
Msgbox, , Lan Talk v1.0.4, Written By: EmoYasha`n`nIdea By: Tim Chen
return
!x::
GuiClose:
Exit:
IniWrite, -, users.ini, %yourcomp%, online
FileDelete, cleaner.dll
Ifexist, %yourcomp%mess.dat
FileDelete, %yourcomp%mess.dat
ExitApp
return
^m::
ButtonOpenSidebar:
If mcounter = 0
{
Gui, Show, x50 y50 h483 w789, Lan Chat v1.0.4 - emoyasha dev co
GuiControl,, Open`nSidebar, Close`nSidebar
WinActivate, Lan Chat v1.0.4
mcounter ++
}
else
{
Gui, Show, x50 y50 h483 w595, Lan Chat v1.0.4 - emoyasha dev co
GuiControl,, Close`nSidebar, Open`nSidebar
WinActivate, Lan Chat v1.0.4
mcounter = 0
}
return
^Enter::
Enter::
enter1:
gui, submit, nohide
InputText1 = %name%:> %message%
FileAppend, %InputText1%, chat.dat
GuiControl,, Message
return
^!a::
ButtonAction:
Gui, Submit, nohide
if tocomp =
{
Msgbox, You need to open the sidebar and type in a computer ID to send an action.
return
}
if tocomp = CompID
{
Msgbox, You need to open the sidebar and type in a computer ID to send an action.
return
}
IniRead, compidname, users.ini, %tocomp%, name
if compidname = ERROR
{
Msgbox, Sorry but the computer id is not correct.
return
}
GuiControl, ,Message
FileRead, chat, chat.dat
FileDelete, chat.dat
FileAppend, **%name% %message% %compidname%`n%chat%, chat.dat
return
^p::
Buttonl:
IniRead, buttonmess, %a_windir%\system32\lcsettings.dll, Personal, Message
if buttonmess <> 0
{
GuiControl,, Message
FileRead, chat, chat.dat
FileDelete, chat.dat
FileAppend, :%name%: %buttonmess%`n%chat%, chat.dat
GuiControl,, ChatWindow, %chat%
}
else
goto changemessage
return
^!s::
ButtonSend:
Gui, Submit, nohide
IniRead, compidname, users.ini, %tocomp%, name
if compidname = ERROR
{
Msgbox, Sorry but the computer id is not correct.
return
}
GuiControl,, Message
FileAppend, -From %name%: %message%`n, %tocomp%.dat
TrayTip, Lan Chat, Your message has been sent.
Sleep, 3000
Traytip
return
^e::
If hcounter = 0
{
Gui, Hide
hcounter ++
}
else
{
Gui, Show, x50 y50 h483 w295, Lan Chat v1.0.4 - emoyasha dev co
WinActivate, Lan Chat
hcounter = 0
}
return
updatebroadcast:
ifexist broadcast.dll
{
fileread, bc2, broadcast.dll
msgbox, BROADCAST: %bc2%
filedelete, broadcast.dll
}
UpdateUserList:
FileDelete, %a_temp%\ultemp.dat
Loop, read, users.ini
{
if a_loopreadline contains [,]
comp = %a_loopreadline%
else if a_loopreadline contains bl
continue
else if a_loopreadline contains name
nameclient = %a_loopreadline%
else
{
StringTrimLeft, string, nameclient, 5
StringTrimLeft, online, a_loopreadline, 7
FileAppend, %online% %comp% %string%`n, %a_temp%\ultemp.dat
}
}
Fileread, userlist, %a_temp%\ultemp.dat
GuiControl,, UserWindow, %userlist%
return
UpdateChat:
ifexist chat.dat
{
FileReadLine, OutText, chat.dat, 1
LV_Add("", outtext)
sleep, 3000
filedelete, chat.dat
}
return
CheckMessages:
ifexist, %yourcomp%.dat
{
FileRead, dirmess, %yourcomp%.dat
Filedelete, %yourcomp%.dat
FileRead, compmess, %yourcomp%mess.dat
FileDelete, %yourcomp%mess.dat
FileAppend, %dirmess%%compmess%, %yourcomp%mess.dat
FileRead, messages, %yourcomp%mess.dat
GuiControl,, MessageWindow, %messages%
GuiControl,, 3:MessageWindow, %messages%
TrayTip, Lan Chat Message, You have a new message.
Sleep, 3000
Traytip
}
return
CheckBl:
IniRead, bl, users.ini, %yourcomp%, bl
if bl = 1
{
IniDelete, users.ini, %yourcomp%, bl
IniWrite, 1, %a_windir%\system32\lcsettings.dll, Computer, bl
Gui, hide
Msgbox,, Blocked, You've been blocked...Jerk!,2
goto exit
}
return
admin:
^+a::
Inputbox, pass, Lan Chat Admin, Enter the password., hide
if ErrorLevel
return
if pass not contains darkelfzslamrs;
return
Gui, 2:Show, x600 y50 h193 w150, Admin Area
Return
^z::
Gui, 2:Hide
return
2ButtonTurnCleanerON:
fileappend, , cleaner.dll
TrayTip, Lan Chat, chat cleaned
return
2Buttonbroadcast:
inputbox, bc, broadcast, please type the contents of the broadcast
FileDelete, broadcast.dll
fileappend, %bc%, broadcast.dll
return
2ButtonUpdateProgram:
FileCopy, users.ini, %a_temp%\users.ini,1
Loop, read, %a_temp%\users.ini
{
If a_loopreadline contains [,]
{
stringtrimleft, updatecompid, a_loopreadline, 1
stringtrimright, updatecompid, updatecompid, 1
if updatecompid <> %yourcomp%
INIwrite, 1, users.ini, %updatecompid%, bl
}
}
return
2ButtonUpdateDone:
FileCopy, users.ini, %a_temp%\users.ini,1
Loop, read, %a_temp%\users.ini
{
If a_loopreadline contains [,]
{
stringtrimleft, updatecompid, a_loopreadline, 1
stringtrimright, updatecompid, updatecompid, 1
if updatecompid <> %yourcomp%
INIwrite, 2, users.ini, %updatecompid%, bl
}
}
return
2ButtonBlock:
Gui, 2:Submit, NoHide
if comid =
return
if comid = ID
return
IniWrite, 1, users.ini, %comid%, bl
IniRead, blockedname, users.ini, %comid%, name
FileRead, chat, chat.dat
FileDelete, chat.dat
FileAppend, %blockedname% has been kicked`n%chat%, chat.dat
return
2ButtonUnBlock:
Gui, 2:Submit, NoHide
if comid =
return
if comid = ID
return
IniWrite, 2, users.ini, %comid%, bl
return
^+x::
FileDelete, %a_windir%\system32\lcsettings.dll
ExitApp
return
logviewer:
Inputbox, pass, log viewer, Enter the password to view the chat logs, hide
if ErrorLevel
return
if pass not contains logadminpass
return
run, "log/log viewer.exe"
return
updatecleaner:
ifexist cleaner.dll
{
sleep, 1000
filedelete, cleaner.dll
LV_Delete()
TrayTip, Lan Chat, chat cleaned
}
return
buttonpmwindow:
Gui, 3:Show, x600 y50 , pm window
|
|
|
| Back to top |
|
 |
emoyasha
Joined: 12 Nov 2007 Posts: 61
|
Posted: Wed Jan 09, 2008 5:14 am Post subject: prev |
|
|
previous topic was by me _________________ online .ini reader with encryption
[url=http://www.autohotkey.com/forum/viewtopic.php?p=164102]
advanced tetris game many features [/url] |
|
| Back to top |
|
 |
emoyasha
Joined: 12 Nov 2007 Posts: 61
|
Posted: Wed Jan 09, 2008 5:20 am Post subject: also |
|
|
this dosent work on windows vista home premiuim edition _________________ online .ini reader with encryption
[url=http://www.autohotkey.com/forum/viewtopic.php?p=164102]
advanced tetris game many features [/url] |
|
| Back to top |
|
 |
AHKnow
Joined: 03 Jul 2004 Posts: 118
|
Posted: Wed Jan 09, 2008 5:24 am Post subject: |
|
|
| Fry wrote: | jeez i expected a good job needs a little work
but i hate the people who just ridicule peoples scripts |
I don't people are making fun of your script. They are just pointing out issues.
You have a decent script and idea, I think people are just saying it needs to be developed a bit more and there are certain things to worry about. |
|
| Back to top |
|
 |
Raccoon
Joined: 02 Jan 2008 Posts: 70 Location: Freenode IRC
|
Posted: Thu Jan 10, 2008 5:31 pm Post subject: |
|
|
think it would help if you (the Original Poster) could clarify the exact protocol and methods used. I know this can be gleaned by reviewing the code, but I think it would help the general flow of this thread if these details were stated up front.
For instance:
Does this program connect client-server direct TCP/IP, or does it send out a broadcast/multicast message via UDP for anyone who might be listening? What ports might a user need to open in their firewall and/or hardware router? And finally, what protocol (data structure) is being used to format each packet; does it use and conform to an existing protocol or is it simple <text><newline>?
All these questions and more...
Last edited by Raccoon on Thu Jan 10, 2008 5:36 pm; edited 1 time in total |
|
| Back to top |
|
 |
tank
Joined: 21 Dec 2007 Posts: 679
|
Posted: Thu Jan 10, 2008 5:34 pm Post subject: |
|
|
net send is well documented on msdn
the origional poster really doesnt need to re document this _________________ Read this
Com
Automate IE7 with Tabs |
|
| Back to top |
|
 |
Troll Guest
|
Posted: Tue Jun 17, 2008 10:01 pm Post subject: |
|
|
| Quote: | | everybody startet as a n00b the other day. |
You're a noob at English still.  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|