Jump to content

Triblade

Active Members
  • Posts

    392
  • Joined

  • Last visited

Everything posted by Triblade

  1. Yes, it's possible. But don't expect 'us' to script it for you. This is a general help forum, post a sample script you made and comments where you are stranded. Then we could try to fix your non-working code. And please don't post an exact copy of the code from the link. Edit: Ow, and please read this: Example for reproduction
  2. Yes, even years after release it's still updated Version 3.5.2 is released (see first post) to accommodate a bugfix and while doing that tested the script in the latest version of AutoIt and found it working.
  3. Np, array's FTW
  4. I hope you have the button ID's in an array? If not, put them in there. If the buttons could be auto-created that would be very easy. Dim $array[100] For $i = 0 To 99 $array[$i] = GUICtrlCreateButton("Text", 10, $i * 20, 50, 20) Next Then check with: For $i = 0 To 99 If GUICtrlRead($array[$i]) = "Text you want to check on" Then 'do stuff' EndIf Next
  5. Looks great! Only the black circles looks kinda blurry. And I'd replace: "#include <GUIConstants.au3>" With: " #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> "
  6. Well, good luck then. I hope my code could contribute.
  7. Well, people can't help out that way.
  8. No, I didn't know that you didn't updated that code Edit: ok, nvm this line. I see you edited Time to update code
  9. Looks great. Cancel button does not work. You could simply add "If $m=$Install_Cancel_Button Then _Exit ()" To exit is cancelled. Also, the date is serperated by semicoloms ( . Maybe dashes (-) are better Add the following code anywhere: Edit: Place: $Name_S = choose_name()oÝ÷ Ø¢·­å¡Wµ{ax[§q!ÀD@«ZºÚ"µÍËKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKB[ÈÚÛÜÙWÛ[YJ HÎÈÚÛÜÙHH[YKY][ÈÈ ÌÍÓ[YWÔËY][YH^ÝËÚÛÜÙH[Ý[È[Ý[ÛÈ[Ý[ÛXYHHXYKLL LH [[K^^^JBRY[Q^ÝÊ ÌÍÔÔ×ÝÙ×ÒSJHH[[UÜ]TÙXÝ[Û ÌÍÔÔ×ÝÙ×ÒSK ][ÝÑÓÐS ][ÝË ][ÝÌS]È[YI][ÝÊBSØØ[ ÌÍÛÛÓ[YWÔË ÌÍÙÝXK ÌÍÝÙÈH[TXYÙXÝ[Û ÌÍÔÔ×ÝÙ×ÒSK ][ÝÑÓÐS ][ÝÊBBRYÐ^J ÌÍÝÙÊHH[BR[UÜ]J ÌÍÔÔ×ÝÙ×ÒSK ][ÝÑÓÐS ][ÝË ÌÍÓ[YWÔÊBBT] ÌÍÓ[YWÔÂQ[QQÂBIÌÍÙÝXHH[ÙBBQÜ ÌÍÚHHÈ ÌÍÝÙÖÌVÌBBBRY ÌÍÝÙÖÉÌÍÚWVÌWHH ÌÍÓ[YWÔÈ[BBBIÌÍÙÝXHHYBBBBQ^]ÛÜBBQ[YBS^BRY ÌÍÙÝXHHYH[BBIÌÍÛÛÓ[YWÔÈH ÌÍÓ[YWÔÂBBIÌÍÓ[YWÔÈH[]Þ ][ÝÐÚ[ÙHÙ[YI][ÝË ][ÝÕÙ[YHÈZÙ[XÙH[H]È[YK][ÝË ÌÍÓ[YWÔÈ [È ][Ý×É][ÝÈ [È[ÛJK ÌÍÝÙÖÌVÌJÌLJJBBBRYÜ[ ÌÍÓ[YWÔÈH ÌÍÛÛÓ[YWÔÂBQ[YU[[ ÌÍÙÝXHH[ÙBR[UÜ]J ÌÍÔÔ×ÝÙ×ÒSK ][ÝÑÓÐS ][ÝËÙXÚÛ[X K ÌÍÓ[YWÔÊBT] ÌÍÓ[YWÔÂ[[Â[È[[ÝWÛ[YJ HÎÈÈ[[ÝH[YK[ÜÝZÙ[HÙY]ÙÜ[H^]È[Ý[ÛXYHHXYKLL LH [[K^^^JBSØØ[ ÌÍÚHH ÌÍÜÙXÝ[ÛÛ[YË ÌÍÙÝ[IÌÍÜÙXÝ[ÛÛ[YÈH[TXYÙXÝ[Û ÌÍÔÔ×ÝÙ×ÒSK ][ÝÑÓÐS ][ÝÊBQÂBIÌÍÙÝ[HÐ^TÙXÚ ÌÍÜÙXÝ[ÛÛ[YË ÌÍÓ[YWÔËKJBBIÌÍÚH ÏHBU[[ ÌÍÙÝ[ ÉÝÈLHÜÜRY ÌÍÙÝ[ ÉÝÈLH[BR[Q[]J ÌÍÔÔ×ÝÙ×ÒSK ][ÝÑÓÐS ][ÝË ÌÍÜÙXÝ[ÛÛ[YÖÉÌÍÙÝ[VÌJBBT] ÌÍÙÝ[Q[YT]LB[[Â[ÈÙXÚÛ[X HÎÈÛÚÜÈÜÛY^Ý[È[HÙ^H[XÈ[ÜÙÈ ÌÎNÙ[HÛÈ[Ý[ÛXYHHXYKLL LH [[K^^^JBSØØ[ ÌÍÚHHLK ÌÍÜÙXÝ[ÛÛ[YË ÌÍÙÝ[IÌÍÜÙXÝ[ÛÛ[YÈH[TXYÙXÝ[Û ÌÍÔÔ×ÝÙ×ÒSK ][ÝÑÓÐS ][ÝÊBQÂBIÌÍÚH ÏHBBIÌÍÙÝ[HÐ^TÙXÚ ÌÍÜÙXÝ[ÛÛ[YË ÌÍÚJBU[[ ÌÍÙÝ[HLBT] ÌÍÚB[[ÂËKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK I added "Global $SS_users_INI = @ScriptDir & "\SHARED_users.ini"" at top. This would be more conform your code. Also I did nothing with the install. So maybe you want to create that file at install.
  10. Why the client does not receive anything from the server: It has no good connection with it. In the client: Search & Replace all: $connectsock with: $connectsocket Edit: typo
  11. Edit: Yeah looked nice. Even a title change.. Looks like it's gonna work soon I made some improvements (in my humble opinion) #include <GUIConstants.au3> #include <GuiListView.au3> #include <EditConstants.au3> Global $recieve = "", $received, $listensocket = -1, $track = 0, $connected = 0, $connectionsocket = 0, $data, $empty, $max GUICreate("DarkChat Server", 430, 500) GUICtrlCreateLabel("IP Address:", 15, 15, 55, 20) GUICtrlCreateLabel("Port:", 245, 15, 30, 20) GUICtrlCreateLabel("Maximum allowed connections:", 15, 45, 150, 20) $ip = GUICtrlCreateEdit("127.0.0.1", 72.5, 10, 160, 20, $ES_NOHIDESEL) $port = GUICtrlCreateEdit("8472", 270, 10, 145, 20, $ES_NUMBER) $maxConnections = GUICtrlCreateEdit("2", 165, 40, 50, 20, $ES_NUMBER) $textbox = GUICtrlCreateEdit("Welcome to DarkChat Server Edition." & @CRLF & @CRLF, 15, 70, 400, 150, BitOr($ES_READONLY, $ES_AUTOVSCROLL, $ES_NOHIDESEL)) $setMax = GUICtrlCreateButton("Set maximum", 220, 40, 90, 20) $startButton = GUICtrlCreateButton("Start Server", 15, 230, 65) $stopButton = GUICtrlCreateButton("Stop Server", 80, 230, 65) $kickButton = GUICtrlCreateButton("Kick User", 145, 230, 55) $adminButton = GUICtrlCreateButton("Give Control", 200, 230, 65) $deadminButton = GUICtrlCreateButton("Remove Control", 265, 230, 85) $msgButton = GUICtrlCreateButton("Message", 350, 230, 67.5) $userlist = GUICtrlCreateListView("#|User's screen name|User's IP address|User's socket ID", 15, 265, 400, 222.5, $ES_READONLY) $currentMax = GUICtrlCreateLabel("", 325, 45, 150, 20) GUICtrlSetState($stopButton, $GUI_DISABLE) GUICtrlSetState($kickButton, $GUI_DISABLE) GUICtrlSetState($adminButton, $GUI_DISABLE) GUICtrlSetState($deadminButton, $GUI_DISABLE) GUICtrlSetState($msgButton, $GUI_DISABLE) GUISetState(@SW_SHOW) Global $max = Int(GUICtrlRead($maxConnections)), $acceptedsocket[$max], $item[$max], $socketsLeft = $max ;; replaced setmaxglobal() GUICtrlSetData($currentMax, "Currently set: " & $max) ;; dito For $track = 0 To $max -1 Step 1 $acceptedsocket[$track] = -1 Next While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Close() Case $msg = $startButton TCPStartUp() $listensocket = TCPListen(GUICtrlRead($ip), GUICtrlRead($port), 1) $connected = 1 GUICtrlSetData($textbox, "Server started." & @CRLF, 1) GUICtrlSetState($stopButton, $GUI_ENABLE) GUICtrlSetState($kickButton, $GUI_ENABLE) GUICtrlSetState($adminButton, $GUI_ENABLE) GUICtrlSetState($deadminButton, $GUI_ENABLE) GUICtrlSetState($msgButton, $GUI_ENABLE) GUICtrlSetState($startButton, $GUI_DISABLE) GUICtrlSetState($setMax, $GUI_DISABLE) mainHandle() Case $msg = $stopButton MsgBox(16, "Error Disconnecting", "The server isn't connected.") Case $msg = $setMax setMaxGlobal() EndSelect WEnd Func Close() If $connected = 1 Then stopServer() EndIf Exit EndFunc Func stopServer() If $connected = 0 Then MsgBox(16, "Error", "The server is already being stopped.") Return False EndIf $connected = 0 For $track = 0 To $max - 1 Step 1 If $acceptedsocket[$track] <> -1 Then TCPCloseSocket($acceptedsocket[$track]) EndIf Next TCPShutdown() GUICtrlSetData($textbox, "Server stopped." & @CRLF, 1) GUICtrlSetState($stopButton, $GUI_DISABLE) GUICtrlSetState($startButton, $GUI_ENABLE) GUICtrlSetState($setMax, $GUI_DISABLE) GUICtrlSetState($kickButton, $GUI_DISABLE) GUICtrlSetState($adminButton, $GUI_DISABLE) GUICtrlSetState($deadminButton, $GUI_DISABLE) GUICtrlSetState($msgButton, $GUI_DISABLE) For $i = 0 To $max Step 1 _GUICtrlListView_DeleteItem($userlist, $i) Next EndFunc Func mainHandle() $empty = socketSearch() ;; added so this line won't loop when it's not needed, but it has to run once before going into the loop. While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Close() Case $msg = $startButton MsgBox(16, "Error Connecting", "The server is already connected.") Case $msg = $stopButton stopServer() ExitLoop Case $msg = $kickButton $name = InputBox("Kick", "Enter someone's username here to kick them from the server.", "Username") sendToConnectedSockets("Receive:disconn" & $name) Case $msg = $adminButton $name = InputBox("Administrator Managment", "Enter someone's username here to give them administrative control over the server.", "Username") sendToConnectedSockets("Receive:admin" & $name) Case $msg = $deadminButton $name = InputBox("Administrator Managment", "Enter someone's username here to remove their administrative control over the server.", "Username") sendToConnectedSockets("Receive:deadmin" & $name) Case $msg = $msgButton $word = InputBox("Send Message", "Send a pop-up message to everyone on the server.", "Message") sendToConnectedSockets("Receive:message" & $word) EndSelect ;; removed $empty = socketSearch() because this line does not have to run every loop. I added up one and down one, read their comments If $socketsLeft > 0 then If $acceptedsocket[$empty] = -1 then $oldconnectionsocket = $connectionsocket $connectionsocket = TCPAccept($listensocket) If $connectionsocket = -1 Then $connectionsocket = $oldconnectionsocket ElseIf $connectionsocket <> -1 Then ;; made elseif instead of twice an if $acceptedsocket[$empty] = $connectionsocket ;; this line moved from the select cause because I wanted the socket to be changes as soon as possible $socketsLeft = $socketsLeft - 1 ;; I moved this line from the select cause because I wanted the variable to be down one because if the client does not react, the loop does not know there is a connection in progress. GUICtrlSetData($textbox, $socketsLeft & " sockets left.." & @CRLF, 1) ;; added for debugging $empty = socketSearch() ;; added so only when a socket is gone, a new free one is sought EndIf EndIf EndIf $track = 0 For $track = 0 To $max - 1 Step 1 If $acceptedsocket[$track] <> -1 Then $data = TCPRecv($acceptedsocket[$track], 1024) If $data <> "" Then checkCommand($data) EndIf Next WEnd EndFunc Func checkCommand($messages) Select Case StringLeft($messages, 8) = "Receive:" catchCommand(StringTrimLeft($messages, 8)) Case Else If $messages <> "" Then GUICtrlSetData($textbox, $messages & @CRLF, 1) sendToConnectedSockets($messages) EndIf EndSelect EndFunc Func socketSearch() Local $track = 0 For $track = 0 To $max - 1 Step 1 If $acceptedsocket[$track] = -1 Then Return $track ;; added if, else it allways returns... Next EndFunc Func catchCommand($received) Local $found, $item ;; added $item just because I can :) Select Case StringLeft($received, 4) = "conn" ;; removed two lines and put then at line 138 & 139. Read those comments. $found = _ArraySearch($acceptedsocket, $connectionsocket) ;; needed for the array number which we need at disconnect to set arrayitem to -1 GUICtrlSetData($textbox, StringTrimLeft($received, 4) & " has connected." & @CRLF, 1) GUICtrlCreateListViewItem($found & "|" & StringTrimLeft($received, 4) & "|" & $connectionsocket, $userlist) ; added the first column in front instead of the $empty variable that is easely flawed when code changes sendToConnectedSockets(StringTrimLeft($received, 4) & " has connected." & @CRLF) Case StringLeft($received, 7) = "disconn" $socketsLeft = $socketsLeft + 1 GUICtrlSetData($textbox, StringTrimLeft($received, 7) & " has disconnected." & @CRLF, 1) sendToConnectedSockets(StringTrimLeft($received, 7) & " has disconnected." & @CRLF) $socketTemporary = StringTrimLeft($received, 7) $found = _GUICtrlListView_FindInText($userlist, StringTrimLeft($received, 7)) $item = _GUICtrlListView_GetItemTextArray($userlist, $found) TCPCloseSocket($item[4]) ;; 3 = 4 cause one column is added $acceptedsocket[$item[1]] = -1 ; first column _GUICtrlListView_DeleteItem($userlist, $found) $empty = socketSearch() ; we have free sockets! yay! EndSelect EndFunc Func setMaxGlobal() $max = Int(GUICtrlRead($maxConnections)) Redim $acceptedsocket[$max], $item[$max] ;; ReDimm is needed to adjust array size for future expansion $socketsLeft = $max GUICtrlSetData($currentMax, "Currently set: " & $max) EndFunc Func sendToConnectedSockets($message) For $track = 0 To $max - 1 Step 1 If $acceptedsocket[$track] <> -1 Then TCPSend($acceptedsocket[$track], $message) EndIf Next EndFuncoÝ÷ ØÆ²m쨻§¶Ú-)äiº.µ§]xæz¸§¶©®+jkh²0Ýý±«­¢»ºÚ"µÍØÜÈKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKB]]Ò]Ú[ÛËË ]JB]]Ü^S[YBØÜ[Ý[ÛU[]H]]Ò]ØÜØÙHKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKBÈØÜÝHY[ÝÛÙH[ÝÈ
  12. Thanks. I do know there are examples, but don't like to copy examples as I tend to copy them instead of learning. (not allways, but sometimes) If someone points out a mistake I've made, I can't copy anything and I learn Anyway, one error is that "Return $track" is supposed to be: "If $acceptedsocket[$track] = -1 Then Return $track"
  13. Odd, I cannot connect with more then one client atm...
  14. I don't have much time this day, but this ain't gonna work: StringLeft($received, 7) == "admin" Edit: well, it may work, but you dont want to gamble I will look at it soon. Thanks, Tri.
  15. Yeah, im curious for the code now Heh, ur right And you probably build it to the last AutoIt version instead of the 2007 version right? So, the old #include <GUIConstants.au3> is replaced by: #include <GUIConstantsEx.au3> ; <-- Replaces GUIConstants.au3. #include <WindowsConstants.au3> ; <-- this one is usefull for a lot of GUI stuff.
  16. Well, I'm allways interrested in why this doesn't work. I kinda gave up since I don't have much time. This is something that probably would be my networking standard from now on: http://www.autoitscript.com/forum/index.php?showtopic=74325
  17. What I allways do in this kinda situation is putting useless msgbox's after 'important' points in the code. Try putting in a msgbox before and after winwait and winactivate. Then put a number in every msgbox to see what the last action was. This way you should be able to 'see' where the code is. The other way is to not use msgbox's but ConsoleWrite - and look into the console in SciTe.
  18. Looks great!!, and I can surely use this in a 'simulation' I'm cooking up. Only, if I tick the allow diagonal moves box, it does do diagonal, but not with walls besides them. See attachement above for what I mean. I have drawn two lines over the squares. The left one does not count and the right one does. Bug or feature?
  19. Depends on the download speed. If the download takes 10 minutes to complete... You get the picture.
  20. I don't get it what you want. What is 'what-u-hear'? And what input should be changed?
  21. If I understand well: You want to auto fill .au3 files with functions you call 'snippets'. Well, .au3 files are plain text, so you could allways edit/filewrite one from within AutoIt, and run "AutoIt3.exe" with the .au3 file as a parameter. To stop such script, just processkill autoit.exe break within, I personally do that the monkey way, just If-fileexists('file')-Then a certain filename within c:\ on every important part in the code and give it an output in a file with a line nr or something. Global vars, only possible within one script as far as I know, but I don't know much about that. And why not communicate through a file or ini? Or else, http://www.autoitscript.com/forum/index.ph...s+communication or something This bit above also works for telling another script what to do. Or the other way around, the 'client' script looks into a file for a known function name, just a thought.
  22. You know the WinWaitClose waits for the download window to be gone right?
  23. Ok, Now I think I understand your problem. However I still think this is kinda a citrix-server side issue. As the apps really work in a hidden desktop AutoIt can't touch the application itself. So the hidden desktop may have focus, the application still does not have to. The only AutoIt solutions I can think of are alt-tabbing until it's focused or pixelsearch a certain line of pixels and then AutoItted-mouseclick that spot. There are probably much better AutoIt solutions out there, but I ain't so good yet
  24. Very odd that the ica file starts two applications, and above all, starts the syngo without having to login. :s I would publish the application anew and see what happes manually. Looks like there is something wrong with the ica file or the published applications. I can't happen that without logging in an application starts.
  25. Try: ShellExecute() (at least, look how to use it in the help file )
×
×
  • Create New...