
JavaScript_Freek
Active Members-
Posts
315 -
Joined
-
Last visited
Content Type
Forums
Downloads
Forum Articles
Events
Everything posted by JavaScript_Freek
-
This is what goes in my menu. #include <GUIConstants.au3> #include <Misc.au3> #include <File.au3> #include <TabConstants.au3> $name = InputBox("Log In", "Please enter your name:") GUICreate("Urbanyx",400,400) GUISetIcon("C:\Program\AutoIt3\beta\Icons\au3.ico", 0) TrayTip("Welcome to Urbanyx", "You are now logged into urbanyx.", 5, 1) ; MENU $filem = GUICtrlCreateMenu("File") GuiCtrlCreateMenuitem ("",$filem) $exititem2 = GUICtrlCreateMenuitem("Exit", $filem) $helpmenu = GUICtrlCreateMenu("About") $aboutitem2 = GUICtrlCreateMenuitem("About", $helpmenu) ; ABOUT $s_TempFile = _TempFile() Inetget("http://i36.tinypic.com/2wlzq6e.gif",$s_TempFile) GUICtrlCreatePic($s_TempFile, 0, 0, 400, 100) GUICtrlSetState(-1, $GUI_DISABLE) $label2 = GUICtrlCreateLabel($name, 290,28, 70, 14) GUICtrlSetBkColor( -1, $GUI_BKCOLOR_TRANSPARENT ) $tab = GUICtrlCreateTab(5, 105, 390, 100,$TCS_MULTILINE , $TCS_VERTICAL ) $tab0 = GUICtrlCreateTabItem("tab0") GUICtrlCreateLabel("lasdasd", 30, 130, 50, 20) $tab1 = GUICtrlCreateTabItem("tab----1") GUICtrlCreateLabel("label2", 30, 130, 50, 20) $tab2 = GUICtrlCreateTabItem("tab2") GUICtrlCreateLabel("label3", 30, 130, 50, 20) GUICtrlCreateTabItem("") ; end tabitem definition GuiSetState() While 1 $msg = GuiGetMsg() If $msg = $exititem2 Or $msg = -3 Or $msg = -1 Then ExitLoop If $msg = $aboutitem2 Then Msgbox(0,"About","Sample Menu coded by Dan http://sodadome.com") WEnd GUIDelete() Exit
-
I mean I want one box opens with text input then you click ok and it goes to my sample menu.
-
Ok well how would I make it so I have a GUIWindow pop up with text input box then an ok button which goes to the next window? Not INPUTBOX("title",blahlah) -no not that cause you can't style that with images. #include <GUIConstants.au3> #include <Misc.au3> #include <File.au3> #include <TabConstants.au3> $name = InputBox("Log In", "Please enter your name:") GUICreate("Urbanyx",400,400) GUISetIcon("C:\Program\AutoIt3\beta\Icons\au3.ico", 0) TrayTip("Welcome to Urbanyx", "You are now logged into urbanyx.", 5, 1) ; MENU $filem = GUICtrlCreateMenu("File") GuiCtrlCreateMenuitem ("",$filem) $exititem2 = GUICtrlCreateMenuitem("Exit", $filem) $helpmenu = GUICtrlCreateMenu("About") $aboutitem2 = GUICtrlCreateMenuitem("About", $helpmenu) ; ABOUT $s_TempFile = _TempFile() Inetget("http://i36.tinypic.com/2wlzq6e.gif",$s_TempFile) GUICtrlCreatePic($s_TempFile, 0, 0, 400, 100) GUICtrlSetState(-1, $GUI_DISABLE) $label2 = GUICtrlCreateLabel($name, 290,28, 70, 14) GUICtrlSetBkColor( -1, $GUI_BKCOLOR_TRANSPARENT ) $tab = GUICtrlCreateTab(5, 105, 390, 100,$TCS_MULTILINE , $TCS_VERTICAL ) $tab0 = GUICtrlCreateTabItem("tab0") GUICtrlCreateLabel("lasdasd", 30, 130, 50, 20) $tab1 = GUICtrlCreateTabItem("tab----1") GUICtrlCreateLabel("label2", 30, 130, 50, 20) $tab2 = GUICtrlCreateTabItem("tab2") GUICtrlCreateLabel("label3", 30, 130, 50, 20) GUICtrlCreateTabItem("") ; end tabitem definition GuiSetState() While 1 $msg = GuiGetMsg() If $msg = $exititem2 Or $msg = -3 Or $msg = -1 Then ExitLoop If $msg = $aboutitem2 Then Msgbox(0,"About","Sample Menu coded by Dan http://sodadome.com") WEnd GUIDelete() Exit
-
Pic overlapping Label?
JavaScript_Freek replied to JavaScript_Freek's topic in AutoIt GUI Help and Support
Whoa, didn't see Vault's post! Thanks you too! -
Pic overlapping Label?
JavaScript_Freek replied to JavaScript_Freek's topic in AutoIt GUI Help and Support
Thanks! Also, is there a way to make the background of the label white? -
Ok so I think the Picture is overlapping my label... #include <GUIConstants.au3> #include <Misc.au3> #include <File.au3> $name = InputBox("Log In", "Please enter your name:") GUICreate("Urbanyx",400,400) GUISetIcon("C:\Program Files\AutoIt3\beta\Icons\au3.ico", 0) TrayTip("Welcome to Urbanyx", "You are now logged into urbanyx.", 5, 1) ; MENU $filem = GUICtrlCreateMenu("File") GuiCtrlCreateMenuitem ("",$filem) $exititem2 = GUICtrlCreateMenuitem("Exit", $filem) $helpmenu = GUICtrlCreateMenu("About") $aboutitem2 = GUICtrlCreateMenuitem("About", $helpmenu) ; ABOUT $label2 = GUICtrlCreateLabel("Logged in as:" & $name, 290,29) $s_TempFile = _TempFile() Inetget("http://i36.tinypic.com/2wlzq6e.gif",$s_TempFile) GUICtrlCreatePic($s_TempFile, 0, 0, 400, 100) $tab = GUICtrlCreateTab(5, 105, 390, 100) $tab0 = GUICtrlCreateTabItem("tab0") GUICtrlCreateLabel("lasdasd", 30, 130, 50, 20) $tab1 = GUICtrlCreateTabItem("tab----1") GUICtrlCreateLabel("label2", 30, 130, 50, 20) $tab2 = GUICtrlCreateTabItem("tab2") GUICtrlCreateLabel("label3", 30, 130, 50, 20) GUICtrlCreateTabItem("") ; end tabitem definition GuiSetState() While 1 $msg = GuiGetMsg() If $msg = $exititem2 Or $msg = -3 Or $msg = -1 Then ExitLoop If $msg = $aboutitem2 Then Msgbox(0,"About","Sample Menu coded by Dan http://sodadome.com") WEnd GUIDelete() Exit See where the user icon is? Well next to it should say "Logged in as: $name" and its not. I am thinking its being overlapped!
-
I need GuiList.au3 to run some chat programs. I don't have it. Can anyone provide me with me with it? Thanks.
-
Line 59 is giving me error. It isn't declared
-
Ahh man really wanted to see how this would work. As for the functions changing... so THATS why my old SGUIM wouldn't work.
-
I got Error at line 84 for Server.au3 in Cobra Server Pack and on Cobra/Cobra.au3 I got error on Line 131.
-
Not Found The requested URL /repository/autoit/cobra/Cobrav0.3.6.zip was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
-
Cool! I'm logged in! God I really want disect this script so I can learn! May I? Btw why not just use Usernames? EDIT: Haha omg i put a word 'Dan' and im logged in as Dan! WoOT!
-
HTML Help file; how u create one
JavaScript_Freek replied to JavaScript_Freek's topic in AutoIt General Help and Support
Yes that's the HTML Help file. I want the .exe one you know. The Help Files for programs. -
30 Day Trial Period
JavaScript_Freek replied to JavaScript_Freek's topic in AutoIt General Help and Support
i'm just testing. btw how do you work this? -
Does anyone know a Autoit thing that makes my .au3 only last 30 days unless given a serial?
-
It freezes when i try to log in or register. Cool app tho.
-
Menu won't work. Someone please look.
JavaScript_Freek replied to JavaScript_Freek's topic in AutoIt General Help and Support
what are you suggesting? -
I broke it down from the example menu and added it to client.au3. No luck. client.au3 CODE; Urbanyx (Chat Application) ; Coded by: Black Aye ; HaloGrid.com/MystikFilms.com ; Written in AutoIt v3 #include <GUIConstants.au3> Opt("GUIOnEventMode", 1) Global Const $PORT = 31758 Global $list, $sock Global $userlist[17][2] ; [ index ][ username, ctrl id ] TCPStartUp() $gui = GUICreate("Login", 260, 100) GUICtrlCreateLabel("Server IP", 10, 10, 60, 20) GUICtrlCreateLabel("Username", 10, 40, 60, 20) $ipctrl = GUICtrlCreateEdit(@IPADDRESS1, 80, 10, 170, 20, $ES_READONLY) $userctrl = GUICtrlCreateInput("", 80, 40, 170, 20) $login = GUICtrlCreateButton("Login", 170, 70, 80, 20, $BS_DEFPUSHBUTTON) GUICtrlSetOnEvent($login, "_Login") GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") $filemenu = GuiCtrlCreateMenu ("File") $fileitem = GuiCtrlCreateMenuitem ("Open...",$filemenu) $recentfilesmenu = GuiCtrlCreateMenu ("Recent Files",$filemenu) $separator1 = GuiCtrlCreateMenuitem ("",$filemenu) $exititem = GuiCtrlCreateMenuitem ("Exit",$filemenu) $helpmenu = GuiCtrlCreateMenu ("?") $aboutitem = GuiCtrlCreateMenuitem ("About",$helpmenu) $okbutton = GuiCtrlCreateButton ("OK",50,130,70,20) $cancelbutton = GuiCtrlCreateButton ("Cancel",180,130,70,20) GUISetState() $loop = True While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $cancelbutton ExitLoop Case $msg = $fileitem $file = FileOpenDialog("Choose file...",@TempDir,"All (*.*)") If @error <> 1 Then GuiCtrlCreateMenuItem ($file,$recentfilesmenu) Case $msg = $exititem ExitLoop Case $msg = $okbutton MsgBox(0, "Click","You clicked OK!") Case $msg = $aboutitem Msgbox(0,"About","GUI Menu Test") EndSelect WEnd TrayTip("Login Successfull!", "Welcome to Urbanyx, "& $user &"!", 15, 1) $gui = GUICreate("Urbanyx - User ("& $user & ")", 460, 230) $list = GUICtrlCreateListView(" Users ", 350, 10, 100, 210) $edit = GUICtrlCreateEdit("Welcome to Urbanyx. "& $user & " Follow the rules!" & @CRLF & @CRLF , 10, 70, 330, 150, $ES_READONLY + $WS_VSCROLL + $ES_AUTOVSCROLL) $input = GUICtrlCreateInput("", 10, 10, 330, 20) $send = GUICtrlCreateButton("Send", 10, 40, 80, 20, $BS_DEFPUSHBUTTON) $pm = GUICtrlCreateButton("PM", 100, 40, 80, 20) GUICtrlSetOnEvent($send, "_Send") GUICtrlSetOnEvent($pm, "_PM") GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUICtrlSetState($input, $GUI_FOCUS) GUISetState() _ReduceMemory() While 1 Sleep(0) $recv = TCPRecv($sock, 2048) If @error Then mError("Connection lost.", 1) If not $recv Then ContinueLoop ; parse the command(s) $recv = StringSplit($recv, Chr(1)) For $i = 1 to $recv[0] $temp = StringSplit($recv[$i], Chr(2)) Switch $temp[1] Case "rejected" mError("Connection rejected.", 1) Case "kick" mError("Connection kicked.", 1) Case "accepted" If $USER = "admin" Then $kick = GUICtrlCreateButton("Kick", 190, 40, 80, 20) GUICtrlSetOnEvent($kick, "_Kick") EndIf Case "adduser" _AddUser($temp[2]) Case "deluser" _DelUser($temp[2]) Case "exit" mError("Server has closed.", 1) Case Else If $recv[$i] Then GUICtrlSetData($edit, $recv[$i] & @CRLF, 1) EndSwitch Next _ReduceMemory() WEnd Func _Login() $loop = False Global Const $IP = GUICtrlRead($ipctrl) Global Const $USER = GUICtrlRead($userctrl) GUIDelete($gui) If $USER = "admin" Then Local $pass = InputBox("Enter Password:", "Please enter the server password below.", "", "") If @error Then Exit $sock = TCPConnect($IP, $PORT) If $sock = -1 Then mError("Internet needs to be turned on.", 1) Else $sock = TCPConnect($IP, $PORT) If $sock = -1 Then mError("Internet needs to be turned on.", 1) TCPSend($sock, $USER) EndIf EndFunc Func _Send() If not GUICtrlRead($input) Then Return 0 TCPSend($sock, StringReplace(StringReplace(GUICtrlRead($input), Chr(1), ""), Chr(2), "")) GUICtrlSetData($input, "") Return 1 EndFunc Func _PM() If not GUICtrlRead($input) Then Return 0 Local $user = GUICtrlRead($list), $data = StringReplace(StringReplace(GUICtrlRead($input), Chr(1), ""), Chr(2), "") If not $user Then Return 0 $user = GUICtrlRead($user) TCPSend($sock, Chr(1) & "PM" & Chr(2) & $user & Chr(2) & $data) GUICtrlSetData($input, "") GUICtrlSetData($edit, "PM sent to: " & $user & "" & @CRLF & "" & $data & "" & @CRLF, 1) Return 1 EndFunc Func _Kick() Local $user = GUICtrlRead($list) If not $user Then Return 0 $user = GUICtrlRead($user) TCPSend($sock, Chr(1) & "kick" & Chr(2) & $user) GUICtrlSetData($edit, "<** Kick: " & $user & " **>" & @CRLF, 1) Return 1 EndFunc Func _AddUser( $user ) If $user = "admin" and not $userlist[16][0] Then $userlist[16][0] = $user $userlist[16][1] = GUICtrlCreateListViewItem($user, $list) Return 1 EndIf For $i = 0 to 15 If not $userlist[$i][0] Then $userlist[$i][0] = $user $userlist[$i][1] = GUICtrlCreateListViewItem($user, $list) Return 1 EndIf Next Return 0 EndFunc Func _DelUser( $user ) For $i = 0 to 16 If $userlist[$i][0] = $user Then $userlist[$i][0] = "" GUICtrlDelete($userlist[$i][1]) $userlist[$i][1] = 0 Return 1 EndIf Next Return 0 EndFunc Func _ReduceMemory() DllCall("psapi.dll", "int", "EmptyWorkingSet", "long", -1) EndFunc Func mError( $sText, $iFatal = 0, $sTitle = "Error", $iOpt = 0 ) Local $ret = MsgBox(48 + 4096 + 262144 + $iOpt, $sTitle, $sText) If $iFatal Then Exit Return $ret EndFunc Func _RC4( $sData, $sKey ) ; based on code by Valik Local $l[256], $i, $t, $x, $y, $s = "" Local $iLen = StringLen($sKey) For $c = 0 to 255 $l[$c] = $c Next For $c = 0 to 255 $i = Mod(Asc(StringMid($sKey, Mod($c, $iLen) + 1, 1)) + $l[$c] + $i, 256) $t = $l[$c] $l[$c] = $l[$i] $l[$i] = $t Next For $c = 1 to StringLen($sData) $x = Mod($x + 1, 256) $y = Mod($l[$x] + $y, 256) $t = $l[$x] $l[$x] = $l[$y] $l[$y] = $t $s &= Chr(BitXOR(Asc(StringMid($sData, $c, 1)), $l[Mod($l[$x] + $l[$y], 256)])) Next Return $s EndFunc Func _Time() ; based on code by jjohn and his time sync script ; 129.6.15.28 = time-a.nist.gov Local $conn = TCPConnect("129.6.15.28", 37), $recv = "" If $conn = -1 or @error Then Return SetError(1, 0, "...") While $recv = "" $recv = TCPRecv($conn, 512) If @error Then Return SetError(2, 0, "...") WEnd TCPCloseSocket($conn) Return StringTrimRight(Asc(StringMid($recv,1,1))*256^3+Asc(StringMid($recv,2,1))*256^2+Asc(StringMid($recv,3,1))*256+Asc(StringMid($recv,4,1)),1) EndFunc Func _Exit() Exit EndFunc Func OnAutoItExit() TCPSend($sock, Chr(1) & "bye") TCPShutdown() Exit EndFunc server.au3 CODEHotKeySet("{ESC}", "OnAutoItExit") Global Const $PASS = "dd" Global Const $IP = @IPADDRESS1 Global Const $PORT = 31758 Global $listen Global $list[17][2] ; [ index ][ socket, username ] TCPStartup() $listen = TCPListen($IP, $PORT, 17) If $listen = -1 Then mError("Unable to connect.", 1) TrayTip("Urbanyx", "Server is connected on:" & @CRLF & $IP & ":" & $PORT, 15, 1) _ReduceMemory() While 1 _CheckConn() Sleep(0) $sock = TCPAccept($listen) If $sock = -1 Then ContinueLoop _AddConn($sock) _ReduceMemory() WEnd Func _AddConn( $iSocket ) ; recieve the username from the client Local $recv = _SockRecv($iSocket), $temp If @error Then _DelConn($iSocket) Else ; if they are trying to login as admin then check the password If StringLeft($recv, 7) = Chr(1) & "admin" & Chr(2) Then $temp = StringSplit($recv, Chr(2)) If _RC4(BinaryString("0x" & $temp[2]), _Time()) == $PASS and not $list[16][0] Then $list[16][0] = $iSocket $list[16][1] = "admin" TCPSend($iSocket, Chr(1) & "accepted") _SendUsers($iSocket) _SendAll(Chr(1) & "adduser" & Chr(2) & "admin", "", $iSocket) Return 1 Else TCPSend($iSocket, Chr(1) & "rejected") EndIf Else ; find an empty space in the userlist For $i = 0 to 15 If not $list[$i][0] Then $list[$i][0] = $iSocket $list[$i][1] = $recv TCPSend($iSocket, Chr(1) & "accepted") _SendUsers($iSocket) _SendAll(Chr(1) & "adduser" & Chr(2) & $recv, "", $iSocket) Return 1 EndIf Next ; too many users, reject the connection TCPSend($iSocket, Chr(1) & "rejected") TCPCloseSocket($iSocket) EndIf EndIf Return 0 EndFunc Func _DelConn( $iSocket ) For $i = 0 to 16 If $list[$i][0] = $iSocket Then TCPCloseSocket($iSocket) $list[$i][0] = 0 $list[$i][1] = "" Return 1 EndIf Next Return 0 EndFunc Func _CheckConn() Local $recv = "" For $i = 0 to 16 If $list[$i][0] Then $recv = TCPRecv($list[$i][0], 2048) If @error Then ; disconnect client TCPCloseSocket($list[$i][0]) _SendAll(Chr(1) & "deluser" & Chr(2) & $list[$i][1]) $list[$i][0] = 0 $list[$i][1] = "" Else If $recv Then ; parse the command(s) $recv = StringSplit($recv, Chr(1)) For $j = 1 to $recv[0] $temp = StringSplit($recv[$j], Chr(2)) Switch $temp[1] Case "bye" TCPCloseSocket($list[$i][0]) _SendAll(Chr(1) & "deluser" & Chr(2) & $list[$i][1]) $list[$i][0] = 0 $list[$i][1] = "" Case "kick" _Kick($temp[2]) Case "PM" _PM($temp[2], $temp[3], $list[$i][1]) Case Else If $recv[$j] Then _SendAll($recv[$j], $list[$i][1]) EndSwitch Next EndIf EndIf EndIf Next EndFunc Func _SendAll( $str, $from = "", $except = 0 ) ; send a message to all users For $i = 0 to 16 If $list[$i][0] and $list[$i][0] <> $except Then If $from and StringLeft($str, 1) <> Chr(1) Then TCPSend($list[$i][0], $from & ": " & $str) Else TCPSend($list[$i][0], $str) EndIf EndIf Next EndFunc Func _Kick( $user ) ; kick a user and close their connection For $i = 0 to 15 If $list[$i][1] = $user Then TCPSend($list[$i][0], Chr(1) & "kick") TCPCloseSocket($list[$i][0]) $list[$i][0] = 0 _SendAll(Chr(1) & "deluser" & Chr(2) & $list[$i][1]) $list[$i][1] = "" Return 1 EndIf Next Return 0 EndFunc Func _PM( $user, $str, $from ) ; private message another user For $i = 0 to 16 If $list[$i][1] = $user Then TCPSend($list[$i][0], "~ " & $from & " > " & $str) Return 1 EndIf Next Return 0 EndFunc Func _SendUsers( $iSocket ) ; give the userlist to a connecting client For $i = 0 to 16 If $list[$i][0] Then TCPSend($iSocket, Chr(1) & "adduser" & Chr(2) & $list[$i][1]) Next EndFunc Func _SockRecv( $iSocket, $iBytes = 2048 ) Local $sData = "" While $sData = "" $sData = TCPRecv($iSocket, $iBytes) If @error Then Return SetError(1, 0, 0) Wend Return $sData EndFunc Func _ReduceMemory() DllCall("psapi.dll", "int", "EmptyWorkingSet", "long", -1) EndFunc Func mError( $sText, $iFatal = 0, $sTitle = "Error", $iOpt = 0 ) Local $ret = MsgBox(48 + 4096 + 262144 + $iOpt, $sTitle, $sText) If $iFatal Then Exit Return $ret EndFunc Func _RC4( $sData, $sKey ) ; based on code by Valik Local $l[256], $i, $t, $x, $y, $s = "" Local $iLen = StringLen($sKey) For $c = 0 to 255 $l[$c] = $c Next For $c = 0 to 255 $i = Mod(Asc(StringMid($sKey, Mod($c, $iLen) + 1, 1)) + $l[$c] + $i, 256) $t = $l[$c] $l[$c] = $l[$i] $l[$i] = $t Next For $c = 1 to StringLen($sData) $x = Mod($x + 1, 256) $y = Mod($l[$x] + $y, 256) $t = $l[$x] $l[$x] = $l[$y] $l[$y] = $t $s &= Chr(BitXOR(Asc(StringMid($sData, $c, 1)), $l[Mod($l[$x] + $l[$y], 256)])) Next Return $s EndFunc Func _Time() ; based on code by jjohn and his time sync script ; 129.6.15.28 = time-a.nist.gov Local $conn = TCPConnect("129.6.15.28", 37), $recv = "" If $conn = -1 or @error Then Return SetError(1, 0, "...") While $recv = "" $recv = TCPRecv($conn, 512) If @error Then Return SetError(2, 0, "...") WEnd TCPCloseSocket($conn) Return StringTrimRight(Asc(StringMid($recv,1,1))*256^3+Asc(StringMid($recv,2,1))*256^2+Asc(StringMid($recv,3,1))*256+Asc(StringMid($recv,4,1)),1) EndFunc Func OnAutoItExit() _SendAll(Chr(1) & "exit") TCPShutdown() Exit EndFunc You gotta double click server.au3 then double-click client.au3 to run the chatroom.
-
Yes It doesn't work... when I click on the .au3... nothi ng happens.
-
pleeeae! IM GUEST AND cant download AutoIt. So I can not run au3's. PLEASE MAKE A .EXE!!!!! PLEASE GOD~!!! PRETTY PLEASE
-
How do you create a HTML help file? like the one with the content on let and you click and on right comes up with the thing you clicked on? ty
-
.exe plz! im on a guest so i can download autoit or WinRar
-
when i join i get a input box. i type and press enter and NOTHING happens