
Jaysen
Members-
Posts
19 -
Joined
-
Last visited
Jaysen's Achievements

Seeker (1/7)
0
Reputation
-
Issue with TCP and Switch Statement
Jaysen replied to Jaysen's topic in AutoIt General Help and Support
Got my problem fixed. Whenever I passed the $recv variable to a switch or select statement, nothing happened. I eliminated the need for a switch by just changing the values sent from the server to a 4 (Force Logoff), 5 (Force Shut Down), and 6 (Force Restart) and then passed the $recv variable straight to the AutoIT Shutdown command. Now everything works fine. The script sends a reply to my phone letting it know it received the command and then takes the appropriate action (Logoff, Shut Down, or Restart). If $recv <> "" Then TCPSend($ConnectedSocket, "###OK###") Shutdown($recv) If $ConnectedSocket <> -1 Then TCPCloseSocket($ConnectedSocket) EndIf Someone can close this thread. -
Issue with TCP and Switch Statement
Jaysen replied to Jaysen's topic in AutoIt General Help and Support
I appreciate you trying to help, but just please stop. You can't understand what my problem is and keep giving me these off the wall answers that have nothing to do with what I'm trying to accomplish. -
Issue with TCP and Switch Statement
Jaysen replied to Jaysen's topic in AutoIt General Help and Support
You are still not listening. There is code to send a message back to the sender, it's in the switch and select statements. And you don't have to have a specific IP address, you just use the connected socket. I have no issue sending a reply when the script doesn't have to make a decision. When I try and use a switch or select statement to determine what command was sent and what to do with that command, nothing is sent back and the script doesn't execute any statements within that condition. Anything between one case and the next does not work. None of the cases are executed. I made three seperate tests one using switch, another using select, and last using if statements, none of them work. I don't know how much more simple I can make it. I know for a fact that there is nothing wrong with the program on my phone, nothing wrong with the send, and nothing wrong with the receive, the ONLY issue is with the decisions. -
Issue with TCP and Switch Statement
Jaysen replied to Jaysen's topic in AutoIt General Help and Support
The issue is not whether or not the AutoIT script receives the command, because I know it does, it works from the program I made for my phone. I know the receive on my phone works because I tested a simple send/receive without a switch statement and it works fine. The issue is that no decision is made in those conditional statements and nothing is sent back to my phone. -
Issue with TCP and Switch Statement
Jaysen replied to Jaysen's topic in AutoIt General Help and Support
I don't think you quite understand what I'm having a issue with... I have a program I wrote for my Windows Mobile phone that sends a command to the AutoIT Script and assigns that command to the $recv variable. The script needs to pass that variable to a switch or select statement and take a different action depending on what command was sent. The AutoIT script receives the command sent from my phone. I put a messagebox there to show that the AutoIT script receives the command, which it does. What's supposed to happen is the AutoIT script is supposed reply with the appropriate message and showing a messagebox to confirm that it was sent. But instead, the script just closes without errors, doesn't send a reply back and doesn't show any more message boxes. -
Issue with TCP and Switch Statement
Jaysen replied to Jaysen's topic in AutoIt General Help and Support
Thanks for the quick reply. That code is slightly modified version of the example in the Online Documentation for TCPAccept. All I really did was take out the GUI and send a reply back. It runs through the entire program, but anything after any of the decisions in the different test cases isn't executed. -
I have a VB.Net program I wrote for my Windows Mobile phone that will send a Logoff, Reboot, or Shutdown command to a AutoIT script running on multiple computers at the Charter School I work for. The AutoIT script (below) receives the command and depending on which command it is, do a different shutdown method. Whenever the $recv variable is used on a Switch, Select, or If statements, none of the conditions are executed, but the program closes without any errors and I don't receive the TCP message sent back on my mobile device. The very bottom TCPSend that is commented out does get sent back to my mobile device if I uncomment it. Is there something I'm missing, or does anyone else have any suggestions? Local $szIPADDRESS = @IPAddress1 Local $nPORT = 63000 Local $MainSocket, $ConnectedSocket Local $recv TCPStartup() $MainSocket = TCPListen($szIPADDRESS, $nPORT) If $MainSocket = -1 Then Exit $ConnectedSocket = -1 Do $ConnectedSocket = TCPAccept($MainSocket) Until $ConnectedSocket <> -1 $recv = TCPRecv($ConnectedSocket, 2048) If $recv <> "" Then MsgBox(0, "", "Received > " & $recv) ;#cs - Test 1 Switch $recv Case "###LOGOFF###" TCPSend($ConnectedSocket, "Log Off Intiated") MsgBox(0, "", "Log Off Intiated") Case "###REBOOT###" TCPSend($ConnectedSocket, "Reboot Intiated") MsgBox(0, "", "Reboot Intiated") Case "###SHUTDOWN###" TCPSend($ConnectedSocket, "Shut Down Intiated") MsgBox(0, "", "Shut Down Intiated") EndSwitch ;#ce #cs - Test 2 Select Case $recv = "###LOGOFF###" TCPSend($ConnectedSocket, "Log Off Intiated") MsgBox(0, "", "Log Off Intiated") Case $recv = "###REBOOT###" TCPSend($ConnectedSocket, "Reboot Intiated") MsgBox(0, "", "Reboot Intiated") Case $recv = "###SHUTDOWN###" TCPSend($ConnectedSocket, "Shut Down Intiated") MsgBox(0, "", "Shut Down Intiated") EndSelect #ce #cs - Test 3 If $recv = "###LOGOFF###" Then TCPSend($ConnectedSocket, "Log Off Intiated") MsgBox(0, "", "Log Off Intiated") EndIf If $recv = "###REBOOT###" Then TCPSend($ConnectedSocket, "Reboot Intiated") MsgBox(0, "", "Reboot Intiated") EndIf If $recv = "###SHUTDOWN###" Then TCPSend($ConnectedSocket, "Shut Down Intiated") MsgBox(0, "", "Shut Down Intiated") EndIf #ce If $ConnectedSocket <> -1 Then TCPCloseSocket($ConnectedSocket) EndIf TCPShutdown()
-
Heya, Thanks for all the replies, I really appreciate it. I ended up using ptrex's suggestion of VNCX, it turned out to be exactly what I was looking for. @weaponx - I know all about NetOp for Schools and all the other "RAT" suites, but I am trying to do this at little to no cost for the school. I also like the ability to design my own features, instead of waiting on the Dev team to release an update. I am working on a Software Engineering degree, so I don't have any problem designing software to fit what I need when one already exists. Thnx Jaysen
-
Heya Peeps, I have a different job title depending on what day of the week it is. One of those titles is System Administrator for a Charter School. I am attempting to develop a program for the teacher of the computer lab so she can monitor all of the 21 student machines at once and take control when she needs to. I know you can embed programs into an AutoIT GUI, I was just wondering if this was possible with TightVNC Viewer or if anyone knows of anyway to get AutoIT to work with VNC. I know it can be done by using a few DLLs and listening to some TCP ports, but I thought this would be an easier approach. Thanks
-
Heya Peeps, I did a search, but I don't know if I'm blind or if it really wasn't there, forgive me if a similar thread exists. I'm a Computer Tech and the majority of the work I do is removing infections. Over the past year and a half, I have been working on a program to do the following: - Detect what programs are installed - Download setup executables for the ones not installed - Detect and uninstall old versions - Automatically install the downloaded executables - Update all programs - Scans with all programs with our normal list of programs (Ad-Aware, a-squared, CCleaner, etc...). Some of the programs are written in .NET (Ad-Aware, a-squared, Spyware Terminator) and AutoIT can't detect the buttons in order to use ControlClick(). I was wondering if there was any other way besides using DllCalls and Mouse positions relative to the size of the window to work with .NET programs. I can't possibly be the only one experiencing this can I? I've already got all the downloads, detect previous versions, scans, and updates coded and working fine in seperate functions. The program is working fine the way it is, I was just looking to see if there was a better way to work with the .NET programs and try and reduce some of the lines of code. I know there are programs out there, such as Hitman and GeekSquad's L.A.S.E.R., that basically do the same thing... But I'm doing this to work with the programs we use in our shop. That way I can just run my script and tell the customer that their computer is fixed and it'll be an hour and a half, or they need a reload, instead of constantly having to monitor the computer and see if the scan finished in order to start the next one. Thnx Jaysen
-
Heya, No, it's not. But I have found some code that I have edited to do what I needed. Appreciate the effort though. Thnx Jaysen
-
Heya, Sorry to raise a old post, but that will invert the checkbox on each run. Is there anyway to determine which ones are checked and which ones are unchecked? I'm working on a program for our shop trying to automate the installation, updates, and scanning of various anti-malware tools we use. IEPrivacy Keeper is the one I need this for. Thanks in Advance! Jaysen
-
Heya, Thanks alot for the replies! Thanks to the link herewasplato gave, I found what I needed. I didn't exactly want it to write it to a txt file, but I can work with it to do what I need. Consider this thread closed. Thnx Jaysen
-
Heya, Thanks for the suggestion, it's been awhile since anyone has replied. I was starting to think that this was dead. This is a small part of a larger program I'm working on and the sooner it's done, the better. There's got to be a easy way to do this... I'm sure there's some other programs out there that deal with the same situation. I appreciate the suggestion, I'll look into it. Thnx Jaysen
-
Heya, Thanks. I do alot of coding with other languages such as VB, C++, Java to name a few, but I never really got into nested loops. This is one of the easiest languages I've found to pickup on, and I figured I'd be able to do it without too much of a problem, but I'm still stuck... I really appreciate it! I'm still working on it too, let me know if you come across anything ok? Thanks, Jaysen