 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Would you use this script? |
| Yes |
|
73% |
[ 17 ] |
| No |
|
8% |
[ 2 ] |
| Frequently |
|
13% |
[ 3 ] |
| Maybe once or Twice |
|
4% |
[ 1 ] |
|
| Total Votes : 23 |
|
| Author |
Message |
SpiderGames
Joined: 09 Jun 2008 Posts: 464 Location: Canada
|
Posted: Sat Aug 02, 2008 11:00 pm Post subject: |
|
|
compile dosn't work i need somethign to auto run because they blocked the USB port from studdent comand. _________________
Xfire: SpiderGames77 |
|
| Back to top |
|
 |
Petru D Guest
|
Posted: Tue Aug 05, 2008 8:02 am Post subject: |
|
|
| Is it possible to transfer files through this way? I tried by myself but did nothing... |
|
| Back to top |
|
 |
Slanter
Joined: 28 May 2008 Posts: 397 Location: Minnesota, USA
|
Posted: Tue Aug 05, 2008 9:46 am Post subject: |
|
|
@SpiderGames - I don't know much about how to autorun from a usb, but you can just hit Win + R, put this in the box that comes up
| Code: | | pathtoahk\AutoHotkey.exe "pathtoscript\Script.ahk" |
_________________ Unless otherwise stated, all code is untested
(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination. |
|
| Back to top |
|
 |
SpiderGames
Joined: 09 Jun 2008 Posts: 464 Location: Canada
|
Posted: Tue Aug 05, 2008 12:28 pm Post subject: |
|
|
Slanter hat worked thx _________________
Xfire: SpiderGames77 |
|
| Back to top |
|
 |
jmanx
Joined: 14 May 2008 Posts: 48
|
Posted: Thu Aug 07, 2008 12:47 am Post subject: |
|
|
yeah you can send files
a good easy way to do that without making an encrypter anything like that would be to save the file in mention as a .txt, then you can make a header in the file itself and send all of that, When the client receives it the header will explain what real file extension it is and save that text as that file. |
|
| Back to top |
|
 |
Jex
Joined: 01 Aug 2008 Posts: 61
|
Posted: Thu Aug 07, 2008 1:42 am Post subject: |
|
|
your explanation is vague, i'm not totally sure i understand what your saying.
Could you pass that by me again? _________________ Woot.
Please read forum etiquette |
|
| Back to top |
|
 |
jmanx
Joined: 14 May 2008 Posts: 48
|
Posted: Thu Aug 07, 2008 3:22 am Post subject: |
|
|
copy the file
change the extenstion to .txt
copy the text
send the text thru the client
reassemble the file using the original extenstion
this can all be done automaticly with AHK ^ |
|
| Back to top |
|
 |
Petru D Guest
|
Posted: Thu Aug 07, 2008 10:35 am Post subject: reply |
|
|
| jmanx wrote: | copy the file
change the extenstion to .txt
copy the text
send the text thru the client
reassemble the file using the original extenstion
this can all be done automaticly with AHK ^ |
Did you try this? Does this work? Because everything sent goes into the chat edit-box... |
|
| Back to top |
|
 |
jmanx
Joined: 14 May 2008 Posts: 48
|
Posted: Sun Aug 10, 2008 9:21 pm Post subject: |
|
|
| yeah it works, you have to go to line 578 and edit it in to run a different subroutine when it contains the header identifier. In the header identifier you can put the user name of the person you want it to go to, the actually file name, and where to save it to. |
|
| Back to top |
|
 |
Petru D Guest
|
Posted: Tue Aug 19, 2008 4:49 pm Post subject: |
|
|
thanks for your answer. I did not implement it but did lots of other changes: translated it in Romanian, added Buzz, traytip notfications, text encryption, statuses, etc. and my Romanian friends really enjoy chatting on my messenger. I'm going to give credits to anyone I inspired from but before that I'd like to ask you, jmanx about a strange bug with the client:
I open the server, open the client, type the ip of the server, then connect. It works. I close the client then open it again, type the ip of the server and it doesn't work anymore. Well, it seems to connect, but it can not receive any data from the server/other clients. What's wrong?
Here are my scripts. The server:
| Code: | #singleinstance force
;#notrayicon
ifnotexist, %a_appdata%\Winsock-Chat
{
Filecreatedir, %a_appdata%\Winsock-Chat
}
Network_Address = %A_Ipaddress1%
Network_Port = 1000
menu, tray, tip, Ascultare `nIP: %A_Ipaddress1%`nPort: %Network_Port%
menu, tray, icon, %a_windir%\explorer.exe
;menu, tray, nostandard
menu, tray, add, Restart
menu, tray, add, Afisare
menu, tray, add, Exit
INCEPE:
Gui, Font,, tahoma
if A_Ipaddress1 in 0.0.0.0,127.0.0.1
{
Gui, Add, Picture, Icon11, %A_WinDir%\system32\SHELL32.dll
Gui, Add, Text, x50 y10 w300 h30,Adresa de IP este %A_Ipaddress1%! Serverul nu se poate initializa fara o conexiune la internet.
Gui, Add, Text, x50 y40 w300 h20,Se testeaza conexiunea la internet in continuare...
Gui, Add, Progress, x10 w350 h25 -Smooth vWorking +0x8
Gui, Add, Button, x110 gIesi, Revocare si inchidere
Gui, Show, center, Eroare server
incrementare:=1
loop
{
sleep 100
Working+=incrementare
GuiControl,, Working,%Working%
if Working=100
incrementare:=0-incrementare
if Working=0
incrementare:=0-incrementare
if A_IpAddress1<>0.0.0.0
if A_IpAddress1<>127.0.0.1
{
gui,destroy
goto INCEPE
}
}
}
;colordef=C0C0C0
;gui, color, %colordef%
Gui, Add, Edit, x6 y5 w360 h190 readonly vchat, Adresa de IP: %A_Ipaddress1%
Gui, Add, Edit, x6 y204 w210 h20 vSendText,
Gui, Add, Button, x226 y204 w70 h20 gSendviaNet +default, Trimitere
Gui, Add, edit, x306 y204 w70 h20 vkicknick,
Gui, Add, Button, x386 y204 w80 h20 vkick gkick_player, Da afara
Gui, Add, Button, x376 y5 w110 h30 gculoare, Culoare fundal
;guicontrol,disable, kicknick
;guicontrol,disable, kick
Gui, Show, x135 y95 h250 w501, Server Petrix Mess
WinGet Gui_ID, ID, Server Petrix Mess
Gosub Connection_Init
return
buttonhide:
winhide, Server Petrix Mess
return
Afisare:
Show:
winshow, Server Petrix Mess
controlsend edit1, ^{end}, Server Petrix Mess
return
$numpadenter::
ifwinactive, Server Petrix Mess
{
goto, SendviaNet
}
else
send, {NUMPADENTER}
return
Enter::
ifwinactive, Server Petrix Mess
{
gosub, SendviaNet
}
else
send, {ENTER}
return
Connection_Init:
OnExit, ExitSub
socket := PrepareForIncomingConnection(Network_Address, Network_Port)
if socket = -1
ExitApp
Process, Exist
DetectHiddenWindows On
ScriptMainWindowId := WinExist("ahk_class AutoHotkey ahk_pid " . ErrorLevel)
DetectHiddenWindows Off
NotificationMsg = 0x5555
OnMessage(NotificationMsg, "ReceiveData")
FD_READ = 1
FD_CLOSE = 32
FD_CONNECT = 20
if DllCall("Ws2_32\WSAAsyncSelect", "UInt", socket, "UInt", ScriptMainWindowId, "UInt", NotificationMsg, "Int", FD_READ|FD_CONNECT)
{
MsgBox % "WSAAsyncSelect() a indicat eroarea WinSock " . DllCall("Ws2_32\WSAGetLastError")
ExitApp
}
i=1
Loop
{
VarSetCapacity(SocketAddress, SizeOfSocketAddress:=16)
conectioncheck%i% := DllCall("Ws2_32\accept", "UInt", socket, "UInt", &SocketAddress, "Int*", SizeOfSocketAddress)
if conectioncheck%i% != -1
{
i++
peername := DllCall("Ws2_32\inet_ntoa", "uint", NumGet(SocketAddress,4), "str")
. ":" NumGet(SocketAddress,2,"ushort")
fileappend, %peername% se conecteaza...`n, %a_appdata%\Winsock-Chat\server.txt
fileread, chat2, %a_appdata%\Winsock-Chat\server.txt
guicontrol,,chat, %chat2%
controlsend edit1, ^{end}, Server Petrix Mess
Sendtext= RX2CLIENTCON:
gosub, Send1
Sendtext=
}
sleep 500
}
return
SendviaNet:
Gui, Submit, NoHide
SendText =$ChatServer: %SendText%
guicontrol,,SendText,
go:
fileappend, %SendText%`n, %a_appdata%\Winsock-Chat\server.txt
fileread, chat2, %a_appdata%\Winsock-Chat\server.txt
guicontrol,,chat, %chat2%
controlsend edit1, ^{end}, Server Petrix Mess
gosub, send1
resend:
SendText= %ShowRecieved%
ShowRecieved=
send1:
Loop %i% {
SendData(conectioncheck%A_Index%,SendText)
}
SendText =
return
PrepareForIncomingConnection(IPAddress, Port)
{
VarSetCapacity(wsaData, 32)
result := DllCall("Ws2_32\WSAStartup", "UShort", 0x0002, "UInt", &wsaData) ; Request Winsock 2.0 (0x0002)
if ErrorLevel
{
MsgBox WSAStartup() n-a putut fi apelat datorita erorii %ErrorLevel%. Winsock 2.0 sau mai nou este necesar.
return -1
}
if result
{
MsgBox % "WSAStartup() a indicat eroarea WinSock " . DllCall("Ws2_32\WSAGetLastError")
return -1
}
AF_INET = 2
SOCK_STREAM = 1
IPPROTO_TCP = 6
socket := DllCall("Ws2_32\socket", "Int", AF_INET, "Int", SOCK_STREAM, "Int", IPPROTO_TCP)
if socket = -1
{
MsgBox % "socket() a indicat eroarea WinSock " . DllCall("Ws2_32\WSAGetLastError")
return -1
}
SizeOfSocketAddress = 16
VarSetCapacity(SocketAddress, SizeOfSocketAddress)
InsertInteger(2, SocketAddress, 0, AF_INET) ; sin_family
InsertInteger(DllCall("Ws2_32\htons", "UShort", Port), SocketAddress, 2, 2) ; sin_port
InsertInteger(DllCall("Ws2_32\inet_addr", "Str", IPAddress), SocketAddress, 4, 4) ; sin_addr.s_addr
if DllCall("Ws2_32\bind", "UInt", socket, "UInt", &SocketAddress, "Int", SizeOfSocketAddress)
{
MsgBox % "bind() indicated Winsock error " . DllCall("Ws2_32\WSAGetLastError") . "?"
return -1
}
if DllCall("Ws2_32\listen", "UInt", socket, "UInt", "SOMAXCONN")
{
MsgBox % "LISTEN() a indicat eroarea WinSock " . DllCall("Ws2_32\WSAGetLastError") . "?"
return -1
}
return socket
}
ReceiveData(wParam, lParam)
{
Critical
global ShowRecieved
socket := wParam
ReceivedDataSize = 4096
Loop
{
VarSetCapacity(ReceivedData, ReceivedDataSize, 0)
ReceivedDataLength := DllCall("Ws2_32\recv", "UInt", socket, "Str", ReceivedData, "Int", ReceivedDataSize, "Int", 0)
if ReceivedDataLength = -1
{
WinsockError := DllCall("Ws2_32\WSAGetLastError")
if WinsockError = 10035
return 1
if WinsockError <> 10054
MsgBox % "recv() a indicat eroarea WinSock " . WinsockError
ExitApp
}
Loop, parse, ReceivedData, `n, `r
{
ShowRecieved = %ShowRecieved%%A_LoopField%
ifnotinstring, Showrecieved, :
{
if ShowRecieved contains PTRXMSJ:
{
StringGetPos, pozitie, ShowRecieved, PTRXMSJ:
pozitie:=pozitie+9
StringTrimLeft,mesaj,ShowRecieved,pozitie
if mesaj contains S-a schimbat culoarea de fundal in:
{
StringGetPos, pozitie, ShowRecieved,S-a schimbat culoarea de fundal in:
pozitie:=pozitie+35
StringTrimLeft,ShowRecieved,ShowRecieved,pozitie
culoarea:=SubStr(ShowRecieved, 1,7)
gui,color,%culoarea%
guicontrol,,cutie_mesaje,%mesaj%
}
guicontrol,,cutie_mesaje,%mesaj%
ShowRecieved=
return
}
gosub, redirects
}
fileappend, %ShowRecieved%`n, %a_appdata%\Winsock-Chat\server.txt
fileread, chat2, %a_appdata%\Winsock-Chat\server.txt
guicontrol,,chat, %chat2%
controlsend edit1, ^{end}, Server Petrix Mess
gosub, resend
;ShowRecieved =
}
}
ifwinnotactive, Petrix Messenger
{
TrayTip,Mesaj nou,%ShowRecieved%,1,1
}
return 1
}
if ShowRecieved contains Sesiunea de control maus incheiata.
{
controlm=0
ShowRecieved=
}
SendData(wParam,SendData)
{
socket := wParam
;fileappend, %socket%`n, %a_appdata%\Winsock-Chat\testing.txt
SendDataSize := VarSetCapacity(SendData)
SendDataSize += 1
sendret := DllCall("Ws2_32\send", "UInt", socket, "Str", SendData, "Int", SendDatasize, "Int", 0)
;send( sockConnected,> welcome, strlen(welcome) + 1, NULL);
}
redirects:
ifinstring, Showrecieved, dat afara!
{
return
}
ShowRecieved2=%ShowRecieved%
Stringreplace, Showrecieved2, Showrecieved2, %A_Space%, `n,
filedelete, %a_appdata%\Winsock-Chat\usertemp.txt
fileappend, %ShowRecieved2%, %a_appdata%\Winsock-Chat\usertemp.txt
filereadline, name1, %a_appdata%\Winsock-Chat\usertemp.txt,1
filereadline, cord, %a_appdata%\Winsock-Chat\usertemp.txt,2
filedelete, %a_appdata%\Winsock-Chat\usertemp.txt
/*
if cord=conectat!
{
fileappend, %name1%`n, %a_appdata%\Winsock-Chat\userlist.txt
fileread, userlist, %a_appdata%\Winsock-Chat\userlist.txt
guicontrol,,chatlist, %userlist%
stringreplace,userlist,userlist,`n,*,All
sleep, 500
Sendtext=SR1CLIENTADDLIST%userlist%
gosub, send1
name1=
cord=
return
}
if cord=deconectat!
{
fileread, dellist, %a_appdata%\Winsock-Chat\userlist.txt
stringreplace, dellist2, dellist, %name1%`r`n
filedelete, %a_appdata%\Winsock-Chat\userlist.txt
fileappend, %dellist2%, %a_appdata%\Winsock-Chat\userlist.txt
fileread, userlist, %a_appdata%\Winsock-Chat\userlist.txt
guicontrol,,chatlist, %userlist%
stringreplace,userlist,userlist,`n,*,All
Sendtext=SR1CLIENTADDLIST%userlist%
gosub, send1
name1=
cord=
return
}
*/
InsertInteger(pInteger, ByRef pDest, pOffset = 0, pSize = 4)
{
Loop %pSize%
DllCall("RtlFillMemory", "UInt", &pDest + pOffset + A_Index-1, "UInt", 1, "UChar", pInteger >> 8*(A_Index-1) & 0xFF)
}
kick_player:
gui, submit, nohide
guicontrol,,kicknick,
ref=
Sendtext=RX2KICKPLAYER%kicknick%
gosub, send1
sleep, 500
/*
fileread, dellist, %a_appdata%\Winsock-Chat\userlist.txt
stringreplace, dellist2, dellist, %kicknick%`r`n
filedelete, %a_appdata%\Winsock-Chat\userlist.txt
fileappend, %dellist2%, %a_appdata%\Winsock-Chat\userlist.txt
fileread, userlist, %a_appdata%\Winsock-Chat\userlist.txt
guicontrol,,chatlist, %userlist%
stringreplace,userlist,userlist,`n,*,All
Sendtext=SR1CLIENTADDLIST%userlist%
gosub, send1
sendtext=
name1=
kicknick=
cord=
*/
return
restart:
filedelete, %a_appdata%\Winsock-Chat\server.txt
filedelete,%a_appdata%\Winsock-Chat\userlist.txt
DllCall("Ws2_32\WSACleanup")
reload
Exit:
exitapp
ExitSub:
gui, submit, nohide
if chatlist=
{
goto, end
}
Msgbox, 48, Server Petrix Mess, Serverul se inchide in 5 secunde dupa acest mesaj.
gui, destroy
Sendtext= Serverul se inchide in 5 secunde.
gosub, send1
sleep, 5000
end:
filedelete, %a_appdata%\Winsock-Chat\server.txt
filedelete,%a_appdata%\Winsock-Chat\userlist.txt
DllCall("Ws2_32\WSACleanup")
ExitApp
guiclose:
filedelete,%a_appdata%\Winsock-Chat\userlist.txt
filedelete, %a_appdata%\Winsock-Chat\server.txt
exitapp
Iesi:
exitapp
Culoare:
SendData(socket,"PTRXMSJ: Serverul intentioneaza sa schimbe culoarea de fundal.")
;Krappy Color Picker
;by Lego_coder / Miguel Agullo
;===============================================================
; Gui
gui,10: font,s14 w1000 cFF0000, Tahoma
gui,10: Add, Text, x20 y20, R
gui,10: font,s10 c000000 w400
gui,10: Add, Edit, x45 y20 w40 +right vRed_Value gChange_Red_Value,%Red_Value%
gui,10: Add, UpDown, Range0-255 Wrap w50, 0
gui,10: Add, Slider, x10 y50 w110 Range0-255 vRed_Slider gChange_Red_Slider ALtSubmit, %Red_Slider%
gui,10: font,s14 w1000 C00CC00
gui,10: Add, Text, x20 y90, V
gui,10: font,s10 c000000 w400
gui,10: Add, Edit, x45 y90 w40 +right vGreen_Value gChange_Green_Value, %Green_Value%
gui,10: Add, UpDown, Range0-255 Wrap w50, 0
gui,10: Add, Slider, x10 y120 w110 Range0-255 vGreen_Slider gChange_Green_Slider ALtSubmit, %Green_Slider%
gui,10: font,s14 w1000 C0000FF
gui,10: Add, Text, x20 y160, A
gui,10: font,s10 c000000 w400
gui,10: Add, Edit, x45 y160 w40 +right vBlue_Value gChange_Blue_Value, %Blue_Value%
gui,10: Add, UpDown, Range0-255 wrap w50, 0
gui,10: Add, Slider, x10 y190 w110 Range0-255 vBlue_Slider gChange_Blue_Slider ALtSubmit, %Blue_Slider%
gui,10: Add, ListView, x124 y20 h120 w120 ReadOnly 0x4000 +Background000000 VColor_Block
gui,10: font,s10 c000000 w400,
gui,10: Add, text, x124 y160 +right, Hex:
gui,10: Add, Edit, x161 y155 w81 +right VColor_Value
gui,10: Add, Button, x124 y196 w55 +center g10GuiClose, OK
gui,10: Add, Button, x190 y196 w65 +center gCopy_Hex_To_Clipboard, Copiere
Gosub Show_New_Color
gui,10: Show, x440 y329 h240 w260, Selector de culoare
Return
;===============================================================
;Gui Basics
10GuiClose:
SendText=PTRXMSJ: S-a schimbat culoarea de fundal in: %New_Color_Value%.
gosub,send1
gui,color,%New_Color_Value%
gui,10:destroy
return
;===============================================================
;Sliders
Change_Red_Slider:
GuiControlGet, Red_Slider
GuiControl,10: Text, Red_Value, %Red_Slider%
gosub Show_New_Color
Return
Change_Green_Slider:
GuiControlGet, Green_Slider
GuiControl,10: Text, Green_Value, %Green_Slider%
Gosub Show_New_Color
Return
Change_Blue_Slider:
GuiControlGet, Blue_Slider
GuiControl,10: Text, Blue_Value, %Blue_Slider%
Gosub Show_New_Color
Return
;===============================================================
;Value boxes
Change_Red_Value:
GuiControlGet, Red_Value
GuiControl,10: Text, Red_Slider, %Red_Value%
Gosub Show_New_Color
Return
Change_Green_Value:
GuiControlGet, Green_Value
GuiControl,10: Text, Green_Slider, %Green_Value%
Gosub Show_New_Color
Return
Change_Blue_Value:
GuiControlGet, Blue_Value
GuiControl,10: Text, Blue_Slider, %Blue_Value%
Gosub Show_New_Color
Return
;===============================================================
;Update new color
Show_New_Color:
Gui,10: submit, nohide
SetFormat, integer, hex
Red_Value += 0
Green_Value += 0
Blue_Value += 0
SetFormat, integer, d
Stringright,Red_Value,Red_Value,StrLen(Red_Value)-2
If (StrLen(Red_Value)=1)
Red_Value=0%Red_Value%
Stringright,Green_Value,Green_Value,StrLen(Green_Value)-2
If (StrLen(Green_Value)=1)
Green_Value=0%Green_Value%
Stringright,Blue_Value,Blue_Value,StrLen(Blue_Value)-2
If (StrLen(Blue_Value)=1)
Blue_Value=0%Blue_Value%
New_Color_Value=%Red_Value%%Green_Value%%Blue_Value%
/*
SendText=PTRXMSJ: S-a schimbat culoarea de fundal in: %New_Color_Value%.
gosub,send1
*/
GuiControl, Text, Color_Value, %New_Color_Value%
GuiControl, +Background%New_Color_Value%, Color_Block
Return
;===============================================================
;Copy hex color code to clipboard
Copy_Hex_To_Clipboard:
clipboard =
GuiControlGet, Color_Value
clipboard = %Color_Value%
Return
return
|
and the client:
[code:1:fbadc0125d]
menu, tray, icon, %A_Windir%\system32\user32.dll, 5
If A_IsCompiled
{
Menu,Tray,nostandard
gui,99:font,s16,tahoma
gui,99:add,text,,Se incarca...
gui,99:color,white
gui,99:-caption +toolwindow
gui,99:show
FileInstall,E:\Documents and Settings\Petru\Desktop\Petrix.png,%A_appdata%\PetrixMess\sigla.png,1
gui,99:destroy
gui,99:color,white
gui,99:add,picture,x0 y0,%A_appdata%\PetrixMess\sigla.png
gui,99:-caption +toolwindow
gui,99:show,,Petrix se initializeaza
winhide
winset,transcolor,FFFFFF 255,Petrix se initializeaza
winshow
sleep 2000
gui,99:hide
}
#singleinstance, off
Ifnotexist, %a_appdata%\PetrixMess
{
Filecreatedir, %a_appdata%\PetrixMess
}
menu, tray, add, Configurare
menu, tray, add, iesire
filedelete, %a_appdata%\PetrixMess\i2l.txt
filedelete, %a_appdata%\PetrixMess\usernamestemp.txt
on=0
checkornot=0
con=0
end=0
las=1
ClientName=NumeleTau
Network_Address = 0.0.0.0
Network_Port = 1000
Ifexist, %A_appdata%\PetrixMess\clientinfo.ini
{
iniread, Network_address, %A_appdata%\PetrixMess\clientinfo.ini, Info, ip
iniread, Network_port, %A_appdata%\PetrixMess\clientinfo.ini, Info, port
}
INCEPE:
Gui, Font,, tahoma
If A_Ipaddress1 in 0.0.0.0,127.0.0.1
{
Gui, Add, Picture, Icon11, %A_WinDir%\system32\SHELL32.dll
Gui, Add, Text, x50 y10 w300 h30,Adresa de IP este %A_Ipaddress1%! Pare ca nu exista o conexiune activa la internet
Gui, Add, Text, x50 y40 w300 h20,Se testeaza conexiunea la internet in continuare...
Gui, Add, Progress, x10 w350 h25 -Smooth vWorking +0x8
Gui, Add, Button, x110 gIesi, Revocare si inchidere
Gui, Show, center, Eroare server
incrementare:=1
Loop
{
sleep 100
Working+=incrementare
GuiControl,, Working,%Working%
If Working=100
incrementare:=0-incrementare
If Working=0
incrementare:=0-incrementare
If A_IpAddress1<>0.0.0.0
If A_IpAddress1<>127.0.0.1
{
gui,destroy
goto INCEPE
}
}
}
InputBox,Network_Address,Introduceti IP-ul serverului:,IP-ul serverului
If Network_Address=
exitapp
menu, tray, tip, Setat la `nIP: %Network_Address%`nPort: %Network_Port%
gui:
Menu, Conversatie, Add, &Schimbare status, Status
Menu, Conversatie, Add, &Buzz, Buzz
Menu, Conversietext, Add, Codul &Morse, morse
Menu, Conversietext, Add, Codul &Baudot, baudot
Menu, Conversietext, Add, Codul &hexadecimal, hexadecimal
Menu, Conversietext, Add, Codul &Albed (Cifrul Cezar), albed
Menu, Conversatie, Add, Codificare text, :Conversietext
Menu, BaraMeniu, Add, Messenger, :tray
Menu, BaraMeniu, Add, Conversatie, :conversatie
Menu, BaraMeniu, disable, Messenger
Menu, BaraMeniu, disable, Conversatie
Gui,Menu,BaraMeniu
stringmid, clientname, clientname, 0, 12
Gui, Add, Edit, x6 y5 w260 h140 readonly vchat,
Gui, Add, Edit, x6 y155 w340 h20 vSendText,
Gui, Add, Edit, x6 y185 w130 h20 limit12 vClientName, %ClientName%
Gui, Add, Button, x146 y185 w80 h20 vsendbutton gSendviaNet default , Trimitere
Gui, Add, Button, x236 y185 w70 h20 vbuzz gBuzz, Buzz!
Gui, Add, Button, x236 y185 w70 h20 vconnect gConnection_Init, Conectare
Gui, Add, Edit, x276 y5 w110 h140 readonly vcutie_mesaje,
Gui, Add, Button, x316 y185 w70 h20 vedit gdiscon , Deconectare
guicontrol, disable, edit
Gui, Add, StatusBar
SB_SetText("Neconectat",1)
SB_SetIcon("user32.dll",2,1)
inaltime:=232
guicontrol, disable, buzz
guicontrol, disable, sendbutton
Gui, Show, h%inaltime% w394, Petrix Messenger
Gui,1:+default +owndialogs
WinGet Gui_ID, ID, Petrix Messenger
Gui,9: Font,tahoma
Gui,9: Add, Edit, x6 y5 w220 h20 readonly vPagWeb,
Gui,9: Add, Button, x226 y5 w50 h20 vvizita gVizitare +BS_FLAT, Vizitare
Gui,9: Add, Button, x276 y5 w55 h20 vdownload gDownloadAdresa +BS_FLAT, Download
Gui,9: Add, Button, x331 y5 w61 h20 vvezi gAfisarePoza +BS_FLAT, Vizualizare
Gui,9: +toolwindow
guicontrol,,chat, Bun venit! Scrie-ti numele mai jos si apasa pe "Conectare"!
return
Configurare:
If on=1
{
Msgbox, 16+8192, Petrix Messenger, Nu se pot schimba setarile conectat.
return
}
Else
gui, 3:color, C0C0C0
Gui, 3:Add, Edit, x6 y5 w110 h20 vip, %Network_address%
Gui, 3:Add, Text, x119 y8 w60 h20 , Adresa IP
Gui, 3:Add, Edit, x6 y25 w110 h20 vport, %Network_port%
Gui, 3:Add, Text, x119 y28 w30 h20 , Port
Gui, 3:Add, Button, x26 y55 w110 h20 , Salvare
Gui, 3:Show, h80 w175, Configure
Return
3buttonsave:
gui, 3:submit, nohide
gui, 3:destroy
Network_Address=%ip%
Network_port=%port%
menu, tray, tip, Currently Set to`nIP: %Network_Address%`nPort: %Network_Port%
iniwrite, %Network_address%, %A_appdata%\PetrixMess\clientinfo.ini, Info, ip
iniwrite, %Network_port%, %A_appdata%\PetrixMess\clientinfo.ini, Info, port
return
3GuiClose:
gui, 3:destroy
return
check:
If on=0
{
Settimer,check,off
return
}
If on=1
{
guicontrol, enable, edit
Settimer,check,off
}
$numpadenter::
Ifwinactive, Petrix Messenger
{
goto, SendviaNet
}
Else
send, {NUMPADENTER}
return
$Enter::
Ifwinnotactive, Petrix Messenger
send, {ENTER}
Ifwinactive, Petrix Messenger
{
goto, SendviaNet
}
return
$UP::
Ifwinactive, Petrix Messenger,
{
If las=1
{
guicontrol,,sendtext, %lasttype%
ControlSend Edit2, ^{End}, Petrix Messenger
envadd, las, 1
return
}
If las=2
{
guicontrol,,sendtext, %lasttype2%
ControlSend Edit2, ^{End}, Petrix Messenger
envadd, las, 1
return
}
If las=3
{
guicontrol,,sendtext, %lasttype3%
ControlSend Edit2, ^{End}, Petrix Messenger
envadd, las, 1
return
}
If las=4
{
guicontrol,,sendtext, %lasttype4%
ControlSend Edit2, ^{End}, Petrix Messenger
envadd, las, 1
return
}
If las=5
{
guicontrol,,sendtext, %lasttype5%
ControlSend Edit2, ^{End}, Petrix Messenger
return
}
}
Else
send, {UP}
return
$DOWN::
Ifwinactive, Petrix Messenger,
{
If las=1
{
guicontrol,,sendtext,
return
}
If las=2
{
guicontrol,,sendtext, %lasttype%
ControlSend Edit2, ^{End}, Petrix Messenger
envsub, las, 1
return
}
If las=3
{
guicontrol,,sendtext, %lasttype2%
ControlSend Edit2, ^{End}, Petrix Messenger
envsub, las, 1
return
}
If las=4
{
guicontrol,,sendtext, %lasttype3%
ControlSend Edit2, ^{End}, Petrix Messenger
envsub, las, 1
return
}
If las=5
{
guicontrol,,sendtext, %lasttype4%
ControlSend Edit2, ^{End}, Petrix Messenger
envsub, las, 1
return
}
}
Else
send, {DOWN}
return
Connection_Init:
gui, submit, nohide
Ifinstring, Clientname, %A_Space%
{
Msgbox, 16+8192, Petrix Messenger, Nu folosi spatii in numele tau!
return
}
Ifinstring, Clientname, *
{
Msgbox, 16+8192, Petrix Messenger, Nu folosi asterisc in numele tau!
return
}
Ifinstring, Clientname, RX2
{
Msgbox, 16+8192, Petrix Messenger, Nu folosi RX2 in numele tau!
return
}
Ifinstring, Clientname, SR1
{
Msgbox, 16+8192, Petrix Messenger, Nu folosi SR1 in numele tau!
return
}
Ifinstring, Clientname, :
{
Msgbox, 16+8192, Petrix Messenger, Nu folosi doua puncte in numele tau!
return
}
Ifinstring, Clientname, $
{
Msgbox, 16+8192, Petrix Messenger, Caracterul $ e rezervat pentru server.`nNu-l poti folosi!
return
}
If Clientname=Console
{
Msgbox, 16+8192, Petrix Messenger,
(
Alege-ti un nume pentru chat. Poti folosi pana la 12 caractere.
Unele caractere (. , * : $ ) sunt interzise in nume.
)
return
}
If A_IsCompiled
{
gui,99:show
sleep 1000
gui,99:hide
}
Menu, BaraMeniu, enable, Messenger
Menu, BaraMeniu, enable, Conversatie
guicontrol,,chat,
guicontrol, disable, edit
guicontrol,hide, connect
guicontrol, hide, clientname
guicontrol, enable, buzz
guicontrol, enable, sendbutton
OnExit, ExitSub
SB_SetText("Conectare...",1)
SB_SetIcon("user32.dll",1)
socket := ConnectToAddress(Network_Address, Network_Port)
If socket = -1
ExitApp
Process, Exist
DetectHiddenWindows On
ScriptMainWindowId := WinExist("ahk_class AutoHotkey ahk_pid " . ErrorLevel)
DetectHiddenWindows Off
NotificationMsg = 0x5555
OnMessage(NotificationMsg, "ReceiveData")
menu, tray, tip, Currently connected to`nIP: %Network_Address%`nPort: %Network_Port%
FD_READ = 1
FD_CLOSE = 32
If DllCall("Ws2_32\WSAAsyncSelect", "UInt", socket, "UInt", ScriptMainWindowId, "UInt", NotificationMsg, "Int", FD_READ|FD_CLOSE)
{
SB_SetText("Eroare. Vedeti Explicarea erorilor pentru detalii.",1)
SB_SetIcon("user32.dll",4)
MsgBox % "WSAAsyncSelect() a indicat eroarea Winsock " . DllCall("Ws2_32\WSAGetLastError")
ExitApp
}
return
SendviaNet:
Gui, Submit, NoHide
lasttype5=%lasttype4%
lasttype4=%lasttype3%
lasttype3=%lasttype2%
lasttype2=%lasttype%
lasttype=%sendtext%
stringgetpos, count2, sendtext, /, L
If count2=0
{
If sendtext=/facilitati
{
If con=1
{
tooltip, Comanda valabila numai deconectat!
guicontrol,,sendtext,
Settimer, removetooltip, 4000
return
}
If con=0
{
guicontrol,,sendtext,
Guicontrol,,Chat,
(
PETRIX MESSENGER VERSIUNEA 1.9 beta - compilarea 122
Facilitati Petrix Messenger:
- compatibilitate utilizatori multipli
- interzicere acces (kick) de catre server
- culoarea a fundalului reglabila de catre server
- vizitare rapida adrese web primite
- descarcare adrese web primite
- previzualizare imagini/fotografii descarcate
- zona speciala pentru monitorizarea activitatilor utilizatorilor
- mesaje conectat/deconectat
- balon care afiseaza mesajele cand fereastra Petrix este inactiva
- Mod de comanda
- Ping
- IP2Location: Observare locatie adrese IP
- VisitWeb: Vizitare pagina web oarecare
- fereastra de configurare
- Enter = trimitere rapida
- Sus/Jos = navigare prin mesaje recente pentru retrimitere
)
return
}
}
If Sendtext=/cmd
{
If con=1
{
tooltip, Modul comanda disponibil numai in modul neconectat!
guicontrol,,sendtext,
Settimer, removetooltip, 4000
return
}
If con=0
guicontrol,,sendtext,
guicontrol,,chat, Mod comanda pornit!`n`n Comenzi disponibile:`nPing - /cmd ping (ip/hostname)`nIP2Location - /cmd i2l (ip)`nVisitWeb - /cmd vw (url)`n`n
return
}
Ifinstring, sendtext, /cmd ping
{
If con=1
{
tooltip, Comanda valabila numai in modul neconectat!
guicontrol,,sendtext,
Settimer, removetooltip, 4000
return
}
If con=0
{
ping=%sendtext%
guicontrol,,sendtext,
guicontrol,,chat, Se face ping...`nOperatia ar putea dura o vreme.
stringreplace, ping2, ping, /cmd,
stringreplace, ping3, ping2, ping,
stringreplace, ping4, ping3, %A_space%,
filedelete, %A_appdata%\PetrixMess\pinger.bat
filedelete, %A_appdata%\PetrixMess\Pinglog.txt
detecthiddenwindows, on
Loop,
{
Process, close, cmd.exe
Process, exist, cmd.exe
If errorlevel=0
break
}
fileappend,
(
cd\
ping -n 3 %ping4% >> "%A_appdata%\PetrixMess\Pinglog.txt"
), %A_appdata%\PetrixMess\pinger.bat
run, pinger.bat, %A_appdata%\PetrixMess\, hide useerrorlevel,
If errorlevel=ERROR
{
guicontrol,,chat, Nu s-a putut porni fisierul de executie pentru ping.
return
}
Loop,
{
Process, exist, cmd.exe,
If errorlevel=0
break
}
detecthiddenwindows, off
fileread, outping, %A_appdata%\PetrixMess\Pinglog.txt
guicontrol,, chat, %outping%
ControlSend Edit1, ^{End}, Petrix Messenger
filedelete, %A_appdata%\PetrixMess\pinger.bat
filedelete, %A_appdata%\PetrixMess\Pinglog.txt
return
}
}
Ifinstring, sendtext, /cmd i2l
{
If con=1
{
tooltip, Modul comanda valabil numai in modul neconectat.
guicontrol,,sendtext,
Settimer, removetooltip, 4000
return
}
If con=0
{
i2l=%sendtext%
guicontrol,,sendtext,
guicontrol,,chat,Functia IP2Location lucreaza...`nAsteptati pentru rezultate...
stringreplace, i2l2, i2l, /cmd,
stringreplace, i2l3, i2l2, i2l,
stringreplace, i2l4, i2l3, %A_space%,
filedelete, %a_appdata%\PetrixMess\1.txt
stringreplace, ip2, i2l4, -, ., All
ip=%ip2%
urldownloadtofile, http://www.dnsstuff.com/tools/whois.ch?ip=%ip%, %a_appdata%\PetrixMess\1.txt
fileread, 1, %a_appdata%\PetrixMess\1.txt
StringGetPos, 2, 1, Location:
stringmid, 3, 1, %2%,
stringreplace, 4, 3, ], `n, All
filedelete, %a_appdata%\PetrixMess\2.txt
fileappend, %4%, %a_appdata%\PetrixMess\2.txt
filereadline, 5, %a_appdata%\PetrixMess\2.txt, 2
bl=
stringreplace, 6, 5, Location:, %bl%, All
filedelete, %a_appdata%\PetrixMess\2.txt
filedelete, %a_appdata%\PetrixMess\1.txt
If 6=<html xmlns="http://www.w3.org/1999/xhtml">
{
guicontrol,,chat, IP nelocalizabil!
return
}
If ip=
{
ip=%A_Ipaddress1%
}
fileappend, %ip% found at%6%]`n, %a_appdata%\PetrixMess\i2l.txt
fileread, i2lout, %a_appdata%\PetrixMess\i2l.txt
guicontrol,,chat, %i2lout%
return
}
}
Ifinstring, sendtext, /cmd vw
{
If con=1
{
tooltip, Modul comanda valabil numai neconectat.
guicontrol,,sendtext,
Settimer, removetooltip, 4000
return
}
If con=0
{
vw=%sendtext%
guicontrol,,sendtext,
guicontrol,,chat,Vizitare adresa...
stringreplace, vw2, vw, /cmd,
stringreplace, vw3, vw2, vw,
stringreplace, vw4, vw3, %A_space%,
stringtrimleft, vw4, vw4, 1
run, %vw4%,, useerrorlevel
If ERRORlevel=ERROR
{
Guicontrol,,chat,Eroare la vizitarea adresei (%vw4%)`nAsta se intampla uneori datorita faptului ca Firefox e setat ca browser implicit`nIn acest caz ignorati eroarea iar adresa se va deschide normal.
return
}
Guicontrol,,chat,Adresa vizitata.
return
}
}
}
If Sendtext=
{
return
}
If Sendtext=%A_Space%
{
tooltip, Nu trimite linii goale!
guicontrol,,sendtext,
Settimer, removetooltip, 4000
return
}
If Sendtext=%A_Space%%A_Space%
{
tooltip, Nu trimite linii goale!
guicontrol,,sendtext,
Settimer, removetooltip, 4000
return
}
Ifinstring, Sendtext, %A_Space%%A_Space%%A_Space%
{
tooltip, Nu trimite linii goale!
guicontrol,,sendtext,
Settimer, removetooltip, 4000
return
}
Ifinstring, SendText, RX2CLIENTCON:
{
tooltip, Nu poti trimite "RX2CLIENTCON:"!
guicontrol,,sendtext,
Settimer, removetooltip, 4000
return
}
SendText =%ClientName%: %SendText%
guicontrol,,SendText,
send1:
SendData(socket,SendText)
SendText =
return
RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
return
ConnectToAddress(IPAddress, Port)
{
VarSetCapacity(wsaData, 32)
result := DllCall("Ws2_32\WSAStartup", "UShort", 0x0002, "UInt", &wsaData)
If ErrorLevel
{
SB_SetText("Eroare. Vedeti Explicarea erorilor pentru detalii.",1)
SB_SetIcon("user32.dll",4)
MsgBox WSAStartup() nu a putut fi apelat datorita erorii Winsock %ErrorLevel%. Winsock 2.0 sau mai recent necesar.
return -1
}
If result
{
SB_SetText("Eroare. Vedeti Explicarea erorilor pentru detalii.",1)
SB_SetIcon("user32.dll",4)
MsgBox % "WSAStartup() a indicat eroarea Winsock " . DllCall("Ws2_32\WSAGetLastError")
return -1
}
AF_INET = 2
SOCK_STREAM = 1
IPPROTO_TCP = 6
socket := DllCall("Ws2_32\socket", "Int", AF_INET, "Int", SOCK_STREAM, "Int", IPPROTO_TCP)
If socket = -1
{
SB_SetText("Eroare. Vedeti Explicarea erorilor pentru detalii.",1)
SB_SetIcon("user32.dll",4)
MsgBox % "socket() a indicat eroarea Winsock " . DllCall("Ws2_32\WSAGetLastError")
return -1
}
SizeOfSocketAddress = 16
VarSetCapacity(SocketAddress, SizeOfSocketAddress)
InsertInteger(2, SocketAddress, 0, AF_INET)
InsertInteger(DllCall("Ws2_32\htons", "UShort", Port), SocketAddress, 2, 2)
InsertInteger(DllCall("Ws2_32\inet_addr", "Str", IPAddress), SocketAddress, 4, 4)
If DllCall("Ws2_32\connect", "UInt", socket, "UInt", &SocketAddress, "Int", SizeOfSocketAddress)
{
SB_SetText("Eroare. Vedeti Explicarea erorilor pentru detalii.",1)
SB_SetIcon("user32.dll",4)
MsgBox % "connect() a indicat eroarea Winsock " . DllCall("Ws2_32\WSAGetLastError") . "?"
return -1
}
return socket
}
ReceiveData(wParam, lParam)
{
global AdresaWeb
global pos
global posibila_extensie
global control_maus
Critical
global ShowRecieved
socket := wParam
ReceivedDataSize = 4096
Loop
{
VarSetCapacity(ReceivedData, ReceivedDataSize, 0)
ReceivedDataLength := DllCall("Ws2_32\recv", "UInt", socket, "Str", ReceivedData, "Int", ReceivedDataSize, "Int", 0)
If ReceivedDataLength = 0
ExitApp
If ReceivedDataLength = -1
{
WinsockError := DllCall("Ws2_32\WSAGetLastError")
If WinsockError = 10035
{
return 1
}
If WinsockError <> 10054
SB_SetText("Eroare. Vedeti Explicarea erorilor pentru detalii.",1)
SB_SetIcon("user32.dll",4)
MsgBox % "recv() a indicat eroarea Winsock " . WinsockError
ExitApp
}
Loop, parse, ReceivedData, `n, `r
{
gui, submit, nohide
ShowRecieved = %ShowRecieved%%A_LoopField%
settimer, check, 2500
Ifnotinstring, Showrecieved, connected
{
Ifnotinstring, Showrecieved, :
{
gosub, adddellist
}
If ShowRecieved= RX2CLIENTCON:
{
gosub, connectpend
gosub, turnon
sleep, 250
con=1
return
}
If ShowRecieved contains Serverul initiaza procedura de control al mausului.
{
control_maus:=1
}
Ifinstring,showrecieved,BUZZPASS
{
soundplay %a_windir%\Media\Windows XP Battery Low.wav
gui,2:color,cecece
gui,2:font,s80,tahoma
gui,2:add,text,,BUZZ!
gui,2:show,center h233 w501,BUZZ!
gui,hide
sleep 2000
gui,2:destroy
gui,show
ShowRecieved=
return
}
If ShowRecieved contains PTRXMSJ:
{
StringGetPos, pozitie, ShowRecieved, PTRXMSJ:
pozitie:=pozitie+9
StringTrimLeft,mesaj,ShowRecieved,pozitie
If mesaj contains S-a schimbat culoarea de fundal in:
{
StringGetPos, pozitie, ShowRecieved,S-a schimbat culoarea de fundal in:
pozitie:=pozitie+35
StringTrimLeft,ShowRecieved,ShowRecieved,pozitie
culoarea:=SubStr(ShowRecieved, 1,7)
gui,color,%culoarea%
guicontrol,,cutie_mesaje,%mesaj%
}
guicontrol,,cutie_mesaje,%mesaj%
ShowRecieved=
return
}
Ifwinnotactive, Petrix Messenger
{
If not blocat
TrayTip,Mesaj nou,%ShowRecieved%,1,1
}
If ShowRecieved contains http://,https://,ftp://
{
StringGetPos, pos, ShowRecieved, http://
If ErrorLevel
StringGetPos, pos, ShowRecieved, https://
If ErrorLevel
StringGetPos, pos, ShowRecieved, ftp://
StringTrimLeft, AdresaWeb, ShowRecieved, %pos%
StringGetPos, pos, AdresaWeb ,%A_Space%
StringTrimRight, AdresaWeb, AdresaWeb, %pos%
StringRight, posibila_extensie, AdresaWeb, 4
gui,9:show,,Adresa web primita
guicontrol,9:,PagWeb,%AdresaWeb%
guicontrol,9:enable,vizita
guicontrol,9:enable,download
guicontrol,9:disable,vezi
If posibila_extensie contains bmp,jpg,gif,png,emf
guicontrol,9:enable,vezi
}
Ifinstring,showrecieved,BUZZPASS
{
soundplay %a_windir%\Media\Windows XP Battery Low.wav
gui,2:color,cecece
gui,2:font,s80,tahoma
gui,2:add,text,,BUZZ!
gui,2:show,center h233 w501,BUZZ!
gui,hide
sleep 2000
gui,2:destroy
gui,show
ShowRecieved=
return
}
}
SB_SetIcon("user32.dll",5)
SB_SetText("Ultimul mesaj la " A_Hour . ":" . A_Min . ":" . A_Sec,1)
fileappend, %ShowRecieved%`n, %a_appdata%\PetrixMess\client.txt
fileread, chat1, %a_appdata%\PetrixMess\client.txt
guicontrol,,chat, %chat1%
ShowRecieved =
ControlSend Edit1, ^{End}, Petrix Messenger
}
}
return 1
}
SendData(wParam,SendData)
{
socket := wParam
SendDataSize := VarSetCapacity(SendData)
SendDataSize += 1
sendret := DllCall("Ws2_32\send", "UInt", socket, "Str", SendData, "Int", SendDatasize, "Int", 0)
}
ConvertesteInMorse(byref text)
{
rezultat=%text%
StringReplace,rezultat,rezultat,%A_Space%,%A_Space%%A_Space%%A_Space%%A_Space%%A_Space%%A_Space%%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,!,, All
StringReplace,rezultat,rezultat,?,, All
StringReplace,rezultat,rezultat,=,, All
StringReplace,rezultat,rezultat,+,, All
StringReplace,rezultat,rezultat,-,, All
StringReplace,rezultat,rezultat,/,, All
StringReplace,rezultat,rezultat,$,...-..-%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,@,.--.-%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,A,.-%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,B,-...%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,C,-.-.%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,D,-..%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,E,.%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,F,..-.%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,G,--.%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,H,....%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,I,..%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,J,.---%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,K,-.-%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,L,.-..%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,M,--%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,N,-.%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,O,---%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,P,.--.%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,Q,--.-%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,R,.-.%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,S,...%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,T,-%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,U,..-%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,V,...-%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,W,.--%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,X,-..-%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,Y,-.--%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,Z,--..%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,1,.----%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,2,..---%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,3,...--%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,4,....-%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,5,.....%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,6,-....%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,7,--...%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,8,---..%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,9,----.%A_Space%%A_Space%, All
StringReplace,rezultat,rezultat,0,-----%A_Space%%A_Space%, All
return %rezultat%
}
ConvertesteDinMorse(byref text)
{
rezultat:=(A_SPACE "" text )
StringReplace,rezultat,rezultat,%A_Space%-%A_Space%,T, All
StringReplace,rezultat,rezultat,%A_Space%-..-%A_Space%,X, All
StringReplace,rezultat,rezultat,%A_Space%.-%A_Space%,A, All
StringReplace,rezultat,rezultat,%A_Space%-...%A_Space%,B, All
StringReplace,rezultat,rezultat,%A_Space%-.-.%A_Space%,C, All
StringReplace,rezultat,rezultat,%A_Space%-..%A_Space%,D, All
StringReplace,rezultat,rezultat,%A_Space%.%A_Space%,E, All
StringReplace,rezultat,rezultat,%A_Space%..-.%A_Space%,F, All
StringReplace,rezultat,rezultat,%A_Space%--.%A_Space%,G, All
StringReplace,rezultat,rezultat,%A_Space%....%A_Space%,H, All
StringReplace,rezultat,rezultat,%A_Space%..%A_Space%,I, All
StringReplace,rezultat,rezultat,%A_Space%.---%A_Space%,J, All
StringReplace,rezultat,rezultat,%A_Space%-.-%A_Space%,K, All
StringReplace,rezultat,rezultat,%A_Space%.-..%A_Space%,L, All
StringReplace,rezultat,rezultat,%A_Space%--%A_Space%,M, All
StringReplace,rezultat,rezultat,%A_Space%-.%A_Space%,N, All
StringReplace,rezultat,rezultat,%A_Space%---%A_Space%,O, All
StringReplace,rezultat,rezultat,%A_Space%.--.%A_Space%,P, All
StringReplace,rezultat,rezultat,%A_Space%--.-%A_Space%,Q, All
StringReplace,rezultat,rezultat,%A_Space%.-.%A_Space%,R, All
StringReplace,rezultat,rezultat,%A_Space%...%A_Space%,S, All
StringReplace,rezultat,rezultat,%A_Space%..-%A_Space%,U, All
StringReplace,rezultat,rezultat,%A_Space%...-%A_Space%,V, All
StringReplace,rezultat,rezultat,%A_Space%.--%A_Space%,W, All
StringReplace,rezultat,rezultat,%A_Space%-.--%A_Space%,Y, All
StringReplace,rezultat,rezultat,%A_Space%--..%A_Space%,Z, All
StringReplace,rezultat,rezultat,%A_Space%----%A_Space%,0, All
StringReplace,rezultat,rezultat,%A_Space%.----%A_Space%,1, All
StringReplace,rezultat,rezultat,%A_Space%..---%A_Space%,2, All
StringReplace,rezultat,rezultat,%A_Space%...--%A_Space%,3, All
StringReplace,rezultat,rezultat,%A_Space%....-%A_Space%,4, All
StringReplace,rezultat,rezultat,%A_Space%.....%A_Space%,5, All
StringReplace,rezultat,rezultat,%A_Space%-....%A_Space%,6, All
StringReplace,rezultat,rezultat,%A_Space%--...%A_Space%,7, All
StringReplace,rezultat,rezultat,%A_Space%---..%A_Space%,8, All
StringReplace,rezultat,rezultat,%A_Space%----.%A_Space%,9, All
StringReplace,rezultat,rezultat,%A_Space%%A_Space%%A_Space%%A_Space%%A_Space%%A_Space%%A_Space%,%A_Space%,ALL
StringReplace,rezultat,rezultat,%A_Space%.-.-.-%A_Space%,:, All
StringReplace,rezultat,rezultat,%A_Space%--..--%A_Space%,`,, All
StringReplace,rezultat,rezultat,%A_Space%..--..%A_Space%,?, All
StringReplace,rezultat,rezultat,%A_Space%.----.%A_Space%,', All
StringReplace,rezultat,rezultat,%A_Space%-.-.--%A_Space%,!, All
StringReplace,rezultat,rezultat,%A_Space%-..-.%A_Space%,/, All
StringReplace,rezultat,rezultat,%A_Space%-.--.%A_Space%,(, All
StringReplace,rezultat,rezultat,%A_Space%-.--.-%A_Space%,), All
StringReplace,rezultat,rezultat,%A_Space%.-...%A_Space%,ASTEAPTA, All
StringReplace,rezultat,rezultat,%A_Space%---...%A_Space%,:, All
StringReplace,rezultat,rezultat,%A_Space%-.-.-.%A_Space%,;, All
StringReplace,rezultat,rezultat,%A_Space%-...-%A_Space%,=, All
StringReplace,rezultat,rezultat,%A_Space%.-.-.%A_Space%,+, All
StringReplace,rezultat,rezultat,%A_Space%..--.-%A_Space%,_, All
StringReplace,rezultat,rezultat,%A_Space%.-..-.%A_Space%,", All
StringReplace,rezultat,rezultat,%A_Space%...-..-%A_Space%,$, All
StringReplace,rezultat,rezultat,%A_Space%.--.-.-%A_Space%,@, All
StringReplace,rezultat,rezultat,%A_Space%-....-%A_Space%,-, All
return %rezultat%
}
ConvertesteInBaudot(byref text)
{
rezultat=%text%
StringReplace,rezultat,rezultat,!,, All
StringReplace,rezultat,rezultat,?,, All
StringReplace,rezultat,rezultat,=,, All
StringReplace,rezultat,rezultat,+,, All
StringReplace,rezultat,rezultat,-,, All
StringReplace,rezultat,rezultat,/,, All
StringReplace,rezultat,rezultat,TE,99,All
StringReplace,rezultat,rezultat,A,03,All
StringReplace,rezultat,rezultat,B,19,All
StringReplace,rezultat,rezultat,C,0E,All
StringReplace,rezultat,rezultat,D,09,All
StringReplace,rezultat,rezultat,E,01,All
StringReplace,rezultat,rezultat,F,0D,All
StringReplace,rezultat,rezultat,G,1A,All
StringReplace,rezultat,rezultat,H,14,All
StringReplace,rezultat,rezultat,I,06,All
StringReplace,rezultat,rezultat,J,0B,All
StringReplace,rezultat,rezultat,K,0F,All
StringReplace,rezultat,rezultat,L,12,All
StringReplace,rezultat,rezultat,M,1C,All
StringReplace,rezultat,rezultat,N,0C,All
StringReplace,rezultat,rezultat,O,18,All
StringReplace,rezultat,rezultat,P,16,All
StringReplace,rezultat,rezultat,Q,17,All
StringReplace,rezultat,rezultat,R,0A,All
StringReplace,rezultat,rezultat,S,05,All
StringReplace,rezultat,rezultat,T,10,All
StringReplace,rezultat,rezultat,U,07,All
StringReplace,rezultat,rezultat,V,1E,All
StringReplace,rezultat,rezultat,W,13,All
StringReplace,rezultat,rezultat,X,1D,All
StringReplace,rezultat,rezultat,Y,15,All
StringReplace,rezultat,rezultat,Z,11,All
StringReplace,rezultat,rezultat,%A_Space%,04,All
StringReplace,rezultat,rezultat,$,
return %rezultat%
}
ConvertesteDinBaudot(byref text)
{
rezultat:=(A_SPACE "" text )
StringReplace,rezultat,rezultat,04,%A_Space%,All
StringReplace,rezultat,rezultat,0D,F,All
StringReplace,rezultat,rezultat,01,E,All
StringReplace,rezultat,rezultat,09,D,All
StringReplace,rezultat,rezultat,0E,C,All
StringReplace,rezultat,rezultat,19,B,All
StringReplace,rezultat,rezultat,03,A,All
StringReplace,rezultat,rezultat,99,TE,All
StringReplace,rezultat,rezultat,11,Z,All
StringReplace,rezultat,rezultat,15,Y,All
StringReplace,rezultat,rezultat,1D,X,All
StringReplace,rezultat,rezultat,13,W,All
StringReplace,rezultat,rezultat,1E,V,All
StringReplace,rezultat,rezultat,07,U,All
StringReplace,rezultat,rezultat,10,T,All
StringReplace,rezultat,rezultat,05,S,All
StringReplace,rezultat,rezultat,0A,R,All
StringReplace,rezultat,rezultat,17,Q,All
StringReplace,rezultat,rezultat,16,P,All
StringReplace,rezultat,rezultat,18,O,All
StringReplace,rezultat,rezultat,0C,N,All
StringReplace,rezultat,rezultat,1C,M,All
StringReplace,rezultat,rezultat,12,L,All
StringReplace,rezultat,rezultat,0F,K,All
StringReplace,rezultat,rezultat,0B,J,All
StringReplace,rezultat,rezultat,06,I,All
StringReplace,rezultat,rezultat,14,H,All
StringReplace,rezultat,rezultat,1A,G,All
return %rezultat%
}
ConvertesteInHex(x) ;originally: String2Hex(x) ; Convert a string to hex digits (modified to accommodate new line chars)
{
prevFmt = %A_FormatInteger%
SetFormat Integer, H ; this function requires hex format
Loop Parse, x
hex .= 0x100+Asc(A_LoopField)
StringReplace hex, hex, 0x1,,All
SetFormat Integer, %prevFmt% ; restore original integer formatting
Return hex
}
ConvertesteDinHex(x) ;originally: Hex2String(x) ; Convert a huge hex number to string (modified to suit String2Hex above)
{
Loop % StrLen(x)/2
{
Pos:=(A_Index-1)*2+1
StringMid hex, x, Pos, 2
string := string . Chr("0x" hex)
}
Return string
}
turnon:
on=1
return
adddellist:
ShowRecieved2=%ShowRecieved%
Ifinstring, Showrecieved2, RX2KICKPLAYER
{
stringreplace, Showrecieved2, Showrecieved2, RX2KICKPLAYER,-,All
If Showrecieved2=-%clientname%
{
gosub, Kickexit
}
Showrecieved=
exit
}
return
connectpend:
ShowRecieved=
If con=0
{
SB_SetIcon("user32.dll",5)
SB_SetText("Conectat!")
SendText=PTRXMSJ: %Clientname% conectat!
gosub, send1
con=1
return
}
Else
return
InsertInteger(pInteger, ByRef pDest, pOffset = 0, pSize = 4)
{
Loop %pSize%
DllCall("RtlFillMemory", "UInt", &pDest + pOffset + A_Index-1, "UInt", 1, "UChar", pInteger >> 8*(A_Index-1) & 0xFF)
}
ExitSub:
If nam=1
{
sleep, 500
}
open=PTRXMSJ: %Clientname% deconectat!
SendData(socket,open)
sleep, 250
gui, destroy
sleep, 250
DllCall("Ws2_32\WSACleanup")
filedelete,%a_appdata%\PetrixMess\userlistc.txt
filedelete, %a_appdata%\PetrixMess\client.txt
filedelete, %a_appdata%\PetrixMess\i2l.txt
filedelete, %a_appdata%\PetrixMess\usernamestemp.txt
If nam=1
{
Msgbox, 16++8192, Petrix Messenger, Nume deja in uz.
exitapp
}
ExitApp
discon:
chat=
open= PTRXMSJ: %Clientname% deconectat!
SendData(socket,open)
sleep, 250
sleep, 250
DllCall("Ws2_32\WSACleanup")
filedelete, %a_appdata%\PetrixMess\i2l.txt
filedelete, %a_appdata%\PetrixMess\usernamestemp.txt
on=0
checkornot=0
con=0
end=0
las=1
Ifexist, %A_appdata%\PetrixMess\clientinfo.ini
{
iniread, Network_address, %A_appdata%\PetrixMess\clientinfo.ini, Info, ip
iniread, Network_port, %A_appdata%\PetrixMess\clientinfo.ini, Info, port
}
exitapp
menu, tray, tip, Setat la`nIP: %Network_Address%`nPort: %Network_Port%
guicontrol, disable, edit
guicontrol,show, connect
guicontrol, show, clientname
guicontrol, move, sendbutton, x146 y185 w80 h20
configurex=1
filedelete,%a_appdata%\PetrixMess\userlistc.txt
filedelete, %a_appdata%\PetrixMess\client.txt
filedelete, %a_appdata%\PetrixMess\i2l.txt
filedelete, %a_appdata%\PetrixMess\usernamestemp.txt
return
Kickexit:
gui, destroy
open= %Clientname% a fost dat afara!
SendData(socket,open)
sleep, 500
DllCall("Ws2_32\WSACleanup")
Msgbox, 16++8192, Petrix Messenger, %Clientname%`, ai fost dat afara de catre server.
exitapp
Guiclose:
filedelete,%a_appdata%\PetrixMess\userlistc.txt
filedelete, %a_appdata%\PetrixMess\client.txt
filedelete, %a_appdata%\PetrixMess\i2l.txt
filedelete, %a_appdata%\PetrixMess\usernamestemp.txt
gosub, discon
iesire:
exit:
If con=0
{
exitapp
}
If con=1
{
goto, exitsub
}
Iesi:
exitapp
Vizitare:
gui,1:submit,nohide
SendText=PTRXMSJ: %Clientname% viziteaza adresa %AdresaWeb%.
gosub,send1
run %AdresaWeb%
return
DownloadAdresa:
gui,1:submit,nohide
SendText=PTRXMSJ: %Clientname% intentioneaza sa viziteze adresa web primita anterior.
gosub,send1
FileSelectFile, InFisier , S2,, Unde se va descarca fisierul, Toate fisierele (*.*)
If InFisier=
return
gui,4:+toolwindow
gui,4:font,,tahoma
gui,4:add,text, vStareDwnld ,Se descarca fisierul ...
gui,4:add,button,x+15 vVeziDwnld gDeschideFisier,Deschide
guicontrol,4:hide,vezidwnld
gui,4:show,center,Descarcare fisier
UrlDownloadToFile,%AdresaWeb%,%InFisier%
If not ErrorLevel
{
guicontrol,4:show,vezidwnld
guicontrol,4:,staredwnld,Descarcare completa.
}
Else
{
guicontrol,4:,staredwnld,Eroare neasteptata. (%ErrorLevel%)
}
return
AfisarePoza:
gui,1:submit,nohide
gui,4:destroy
gosub,DownloadAdresa
If InFisier=
return
gui,5:+toolwindow
gui,5:add,picture,,%InFisier%
gui,5:show,center,Examinare imagine: %InFisier%
return
DeschideFisier:
run %InFisier%
return
4guiclose:
gui,4:destroy
SendText = PTRXMSJ: %Clientname% a descarcat fisierul primit anterior.
gosub, send1
return
5guiclose:
gui,4:destroy
gui,5:destroy
SendText = PTRXMSJ: %Clientname% a vazut imaginea primita anterior.
gosub, send1
return
Buzz:
SemnalDeBuzz=BUZZPASS
SendData(socket,SemnalDeBuzz)
return
Status:
blocare_fereastra:=0
Gui, 6:destroy
Gui, 6:Font, S8 CDefault, tahoma
Gui, 6:Add, GroupBox, x16 y20 w380 h130 , Schimbare status
Gui, 6:Add, Text, x26 y40 w80 h20 , Formula:
Gui, 6:Add, DropDownList, x116 y40 w270 h170 vFormula gActualizareExamStatus, %Clientname% este |%Clientname% a plecat pentru ca |%Clientname% este OCUPAT(A)|%Clientname% este ocupat(a) dar vine repede (BRB)|
Gui, 6:Add, Text, x26 y70 w80 h20 , Continuare:
Gui, 6:Add, Edit, x116 y70 w270 h30 vContinuareStat gActualizareExamStatus,
Gui, 6:Add, Text, x26 y110 w80 h20 , Examinare:
Gui, 6:Add, Edit, x116 y110 w270 h30 vExaminareStatus +readonly,
Gui, 6:Add, GroupBox, x16 y160 w380 h130 , Blocare
Gui, 6:Add, CheckBox, x26 y180 w360 h20 gCheckBlocare, Blocare fereastra cu parola
Gui, 6:Add, Text, x26 y210 w80 h20 vparola1text, Parola:
Gui, 6:Add, Text, x26 y240 w80 h20 vparola2text, Repetare:
Gui, 6:Add, Edit, x106 y210 w280 h20 vparola1 +password,
Gui, 6:Add, Edit, x106 y240 w280 h20 vparola2 +password,
Gui, 6:Add, Button, x146 y290 w100 h30 gSchimbareStatus, Schimbare status
Gui, 6:Add, Button, x146 y320 w100 h30 g6GuiClose, Revocare
guicontrol,6:disable,parola1
guicontrol,6:disable,parola2
guicontrol,6:disable,parola1text
guicontrol,6:disable,parola2text
Gui, 6:Show, center h360 w419 +default, Schimba status
Return
CheckBlocare:
If blocare_fereastra
{
blocare_fereastra:=0
guicontrol,6:disable,parola1
guicontrol,6:disable,parola2
guicontrol,6:disable,parola1text
guicontrol,6:disable,parola2text
}
Else
{
blocare_fereastra:=1
guicontrol,6:enable,parola1
guicontrol,6:enable,parola2
guicontrol,6:enable,parola1text
guicontrol,6:enable,parola2text
}
return
ActualizareExamStatus:
gui,6:submit,nohide
status_nou=%Formula%%ContinuareStat%
guicontrol,6:,ExaminareStatus,%status_nou%
return
SchimbareStatus:
gui,6:submit,nohide
If parola1<>%parola2%
{
msgbox 16+8192,Problema cu parolele,Parolele introduse nu se potrivesc. `nReintroduceti parola si repetitia ei cu grija si incercati din nou.
return
}
Else
{
If parola1<>
{
If not blocat
{
blocat:=1
SendText=%status_nou%
gosub,send1
}
gui,6:hide
gui,1:hide
gui,7:font,,tahoma
gui,7:add,text,,Petrix Messenger a fost blocat de catre %clientname%.
gui,7:add,text,,Parola:
gui,7:add,edit,vParolaIntrodusa +password,
gui,7:add,button,gIntroducereParola +default,Introducere
gui,7:add,button,gdiscon,Deconectare
gui,7: -sysmenu +owndialogs -minimizebox
gui,7:show,,Messenger blocat
}
Else
{
gui,6:destroy
SendText=%status_nou%
gosub,send1
}
return
}
IntroducereParola:
gui,7:submit,nohide
If parolaintrodusa<>%parola1%
{
msgbox 16+8192,Parola incorecta,Parola introdusa este incorecta. Acces interzis.
return
}
Else
{
blocat:=0
gui,1:show
gui,7:destroy
}
6GuiClose:
gui,6:destroy
return
morse:
Gui, 10: Font, S8 CDefault, tahoma
Gui, 10:Add, Text, x19 y11 w437 h39 , Alfabetul (sau Codul) Morse este o metoda de transmitere a informatiei folosind secvente standardizate de semne sau pulsatii scurte si lungi - cunoscute in mod comun ca "puncte" si "linii" - pentru litere`, cifre si caracterele speciale specifice oricarui mesaj.
Gui, 10:Add, Text, x22 y57 w433 h35 , Codul Morse a fost creat original de catre Samuel Morse pe la mijlocul anilor 1830`, pentru a fi folosit la transmiterea informatiei cu ajutorul telegrafului electric.
Gui, 10:Add, GroupBox, x16 y97 w445 h130 , Traducere in Codul Morse
Gui, 10:Add, Text, x26 y119 w45 h15 , Textul:
Gui, 10:Add, Edit, x73 y119 w382 h39 vMorseText,
Gui, 10:Add, Text, x28 y161 w45 h28 , Textul tradus:
Gui, 10:Add, Edit, x73 y161 w382 h39 readonly vMorseTextTradus,
Gui, 10:Add, Button, x108 y201 w116 h24 gTraduInMorse, Traducere
Gui, 10:Add, Button, x253 y201 w116 h24 gTraduInMorseSiTrimite, Traducere si trimitere
Gui, 10:Add, GroupBox, x15 y229 w445 h130 , Traducere din Codul Morse
Gui, 10:Add, Button, x161 y334 w116 h24 gTraduDinMorse, Traducere
Gui, 10:Add, Text, x27 y251 w46 h40 , Textul in codul Morse:
Gui, 10:Add, Edit, x75 y250 w382 h39 vMorseTextDeTradus,
Gui, 10:Add, Text, x26 y293 w45 h28 , Textul initial:
Gui, 10:Add, Edit, x75 y293 w382 h39 readonly vMorseTextDeTradus |
|
| Back to top |
|
 |
SpiderGames
Joined: 09 Jun 2008 Posts: 464 Location: Canada
|
Posted: Tue Aug 19, 2008 6:19 pm Post subject: |
|
|
can you put that into a code box lol _________________
Xfire: SpiderGames77 |
|
| Back to top |
|
 |
WankaUSR
Joined: 14 Aug 2007 Posts: 33
|
Posted: Fri Aug 22, 2008 4:40 pm Post subject: |
|
|
Petru D the script you posted the client I mean does not work it says that the target label does not exist for the menu.
please edit it or repost the code and make it in English so other non Romanian users can use it and please give a link to sigla.png |
|
| Back to top |
|
 |
Petru D Guest
|
Posted: Thu Aug 28, 2008 7:02 pm Post subject: Reply |
|
|
Forget it, I resolved that but still can't send files through it. The clients get confused and send the files themselves. Could someone modify the original script and post it? Thanks.  |
|
| Back to top |
|
 |
WankaUSR
Joined: 14 Aug 2007 Posts: 33
|
Posted: Fri Aug 29, 2008 12:05 pm Post subject: |
|
|
Petru D I have an idea but only the concept .... make the client send the sever its ip and when you try to send a file between clients just open an socket connection between them and send it. I will make the script some time this days because I'm kind of busy and do me a favor and register so I can send you a PM when the script is ready or simply to exchange info about this.
EDIT
here is a code to send files (not tested) chunk by chunk. This was made in a hurry and needs work but it is a starting point. just put it somewhere in the client and add a button or a command for it it. The server should list the received data
| Code: | FileReadEx( ByRef V,F,B,O ) {
return varsetcapacity(v,b,0)-o+(h:=dllcall("_lopen",str,f,int,0))-h+dllcall("_llseek",uint
,h,uint,o,int,0)-dllcall("_lread",uint,h,str,v,int,b)+dllcall("_lclose",uint,h) ? -1 : &v
}
sendfile:
guicontrol,,SendText,
chunksize:=10000 ;The size of the sent data in bytes
FileSelectFile, file , Options, , Select the file to send, *.*
FileGetSize, size, %file%
chunk:=size/chunksize
chunks:=Round(chunk)
lastsize:=chunk-chunks
finalbytes:=lastsize*chunksize
offset=0
lastoffset:=chunks*chunksize
loop, %chunks%
{
FileReadEx( Bin, file, chunksize,offset )
SendText =BIN:%Bin%
gosub send1
offset:=%offset%+%chunksize%
Bins=%Bins%%Bin%
}
FileReadEx( Bin, file, finalbytes,lastoffset )
SendText =BIN& |
| | |