Jump to content

rockscena

Active Members
  • Posts

    20
  • Joined

  • Last visited

rockscena's Achievements

Seeker

Seeker (1/7)

1

Reputation

  1. Hey Guyz, I installed Windows 8 Just now, i was using Ad-HOC network though i was not able reconnect to Ad-Hoc Network after the Restart, maybe Some Windows 8 issue. which means to recreate the network after a Restart. Anyways, I made this Script or Snippet so that automatically it will create the Network on startup. Only thing you need to do is Complile it and paste the Location in Startup. I know it has no special Coding. but its my first Example Script, and i felt like sharing. besides, New Ideas and improvised versions are always Welcome Here i am giving the code rather than the complied one. By the Way i am a Newbie just started Scripting 2-3 months back. So Appologies if the Scripting has done badly. #Comments-Start This Script is made to Automatically Start a AD-HOC Network to connect your wifi Devices(like mobile) from your Wifi Laptop(s) 1. You need to share the Internet Connection of Desktop or laptop by going into Properties Thats all. 2. Put This Compiled Script in Start-up Folder. There You Go. Default SSID = Home and Password = 12345678 Enjoy. Hope you Guyz like it. #Comments-End #RequireAdmin ; Run a command prompt as the other user. ;Local $AdminCMD = RunAs($sUserName, @ComputerName, $sPassword, 2, "cmd.exe", "", @SW_HIDE) $AdminCMD = Run("cmd.exe", @WindowsDir & "\system32", @SW_HIDE) Sleep(1000) If $AdminCMD = 0 Then MsgBox(0,"Error", "Something went Wrong while Creating Ad-HOC Network") EndIf ;Administrator: C:\Windows\SYSTEM32\cmd.exe ControlSend("Administrator: C:\Windows\SYSTEM32\cmd.exe","","","netsh wlan set hostednetwork mode=allow ssid=Home key=12345678") Sleep(500) ControlSend("Administrator: C:\Windows\SYSTEM32\cmd.exe","","","{ENTER}") Sleep(10000) ControlSend("Administrator: C:\Windows\SYSTEM32\cmd.exe","","","netsh wlan start hostednetwork") Sleep(1000) ControlSend("Administrator: C:\Windows\SYSTEM32\cmd.exe","","","{ENTER}") Sleep(1000) ControlSend("Administrator: C:\Windows\SYSTEM32\cmd.exe","","","Exit") Sleep(500) ControlSend("Administrator: C:\Windows\SYSTEM32\cmd.exe","","","{ENTER}") Exit Hope you Guyz enjoy (just because u want these small stuffs in your laptop to be auto setup)
  2. Wow this discussion also explored me .. Really , now exploring with these stuffs and other hWnd 's
  3. Yes it has been Solved chk out wat Rover has posted, he is using a Handle for operating multiple Files of diffrent location.
  4. Bro Thanks a Lot, It helped me a lot.
  5. Man while every time i make mistake i learned something, and yes i know what it is, but hey i am in a learning stage still, anyways, i found the solution i had to deep study in Arrays stuff , now i am more clear.... only thing i am not getting to Check or Uncheck Items Automatically, by their Windows handle i tried searching here and there but couldnt find possible stuff for learning, as u can see below ! #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GuiComboBox.au3> #include <WinAPI.au3> #include <IE.au3> #include <Date.au3> #include <array.au3> #include <GuiTreeView.au3> #include <GuiListBox.au3> #include <file.au3> #include <TreeViewConstants.au3> $dir1 = @WindowsDir $FileList1 = _FileListToArray($dir1,"*.exe",1) If @error = 1 Or @error = 4 Then Exit MsgBox(0, "", "Folders Not Found or No Files Found.") Global $hItem1[100],$INDEX1 #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Files Check ", 615, 438, 192, 114) $pattern1 = GUICtrlCreateCheckbox("Check/Uncheck", 72, 16, 137, 33) GUICtrlSetState(-1, $GUI_UNCHECKED) $TreeView1 = GUICtrlCreateTreeView(240, 40, 289, 209, $TVS_CHECKBOXES) GUICtrlSetState(-1, $GUI_DISABLE) _GUICtrlTreeView_BeginUpdate($TreeView1) For $INDEX1 = 1 To $FileList1[0] $POINT1 = StringInStr($FileList1[$INDEX1],".",0,-1) If $POINT1 <> 0 Then $hItem1[$INDEX1] = GUICtrlCreateTreeViewItem($FileList1[$INDEX1], $TreeView1) ;GUICtrlSetData(-1, $FILE[$INDEX]) EndIf Next _GUICtrlTreeView_EndUpdate($TreeView1) $run_script = GUICtrlCreateButton("Run Selected Files", 304, 288, 193, 49) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $pattern1 If BitAND(GUICtrlRead($pattern1), $GUI_CHECKED) Then GUICtrlSetState($TreeView1, $GUI_ENABLE) Else GUICtrlSetState($TreeView1, $GUI_DISABLE) EndIf Case $run_script For $INDEX1 = 1 to $FileList1[0] Local $script_selected1 If _GUICtrlTreeView_GetChecked($TreeView1, $hItem1[$INDEX1]) = True Then $script_selected1 = _GUICtrlTreeView_GetText($TreeView1, $hItem1[$INDEX1]) Sleep(1000) RunWait($dir1 & "/" & $script_selected1, $dir1) Sleep(1000) EndIf Next MsgBox(64,"Complete", "Your Automation Is Completed") EndSwitch WEnd Now as u can see here, i want to Uncheck all items in the Treeview if i Uncheck the "Check/Uncheck" of GUI ! But i am not getting it, Rover thanks for ur help i will apply your way of Logic for my Scripting ... Rover : "Knowledge has no reach, Explore as much as you can to get success, and sometimes its needed to make promises, so that you can actually achieve something with adrenaline." dont take me in a wrong sense :) u guyz are great Help
  6. The pattern of Ui will be like i have written in the code, but i want to write the filepath of the Selected checkboxes when i proceed furthur with my script.
  7. Hey Frends, i was able to do it till here, But i am stuck again., can any 1 please Help me out, As you can see in the below code , i made a gui which is able to show the list of files from Directory using file list to array. and adding checkboxes using treeview style. now i want a little help., If i select file/files it should get count of no. of files chosen. and the directory should copied in any empty memory so as to execute those directories path later in script. Below i am linking a post wrote by rover hu helped me out but in a diffrent way, m so much confused. as in that link he helped me out for combo Box ctrl pattern which copy the file location selected but, in the below code i want the file path should be copied for Selected Checkboxes. #include <file.au3> #include <GUIConstantsEx.au3> #include <TreeViewConstants.au3> #include <array.au3> #include <GuiTreeView.au3> #include <GuiListBox.au3> Main() Func Main() $Main_Window = GUICreate("Checkboxes Select With File List", 413, 298, 302, 218) $Listview1 = GUICtrlCreateTreeView(16, 16, 377, 265, $TVS_CHECKBOXES) GUISetState(@SW_SHOW) dim $file, $dir Local $aSrcFolder[1] = [0] $dir = @WindowsDir $FileList = _FileListToArray($dir,"*.exe",1) If @error = 1 Or @error = 4 Then Exit MsgBox(0, "", "Folders Not Found or No Files Found.") For $INDEX = 1 To $FileList[0] $POINT = StringInStr($FileList[$INDEX],".",0,-1) If $POINT <> 0 Then GUICtrlCreateTreeViewItem($FileList[$INDEX], $LISTVIEW1) ;GUICtrlSetData(-1, $FILE[$INDEX]) EndIf Next While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Listview1 EndSwitch WEnd EndFunc I know its a bit complicated but its eating me, i have some deadline in office i need to do it.. so i thought to ask your guyz Help. please its little urgent
  8. Hey Rover what if i need the above listview pattern with Checkboxes ? how should i declare the expression ?
  9. Ok I tried something Like this and Its Crashing previously same thing was Happening While 1 $nMsg = GUIGetMsg() ; GUI Closed ;-------------------- If $nMsg= $GUI_EVENT_CLOSE Then ExitLoop ; Try to receive (up to) 2048 bytes ;---------------------------------------------------------------- $dir_recv = TCPRecv($dir_Socket, 2291) ; If the receive failed with @error then the socket has disconnected ;---------------------------------------------------------------- If @error Then ExitLoop ; convert from UTF-8 to AutoIt native UTF-16 $dir_recv = BinaryToString($dir_recv, 4) ; Update the edit control with what we have received ;---------------------------------------------------------------- If $dir_recv <> "" Then _GUICtrlComboBox_BeginUpdate($VDID_2) _GUICtrlComboBox_AddDir($VDID_2, $dir_recv & "*.scp") _GUICtrlComboBox_EndUpdate($VDID_2) EndIf Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $VDID_2 Case $run_script GUICtrlSetState($end_script, BitOR($GUI_ENABLE, $GUI_SHOW)) GUICtrlSetState($run_script, $GUI_DISABLE) EndSwitch If $dir_Socket <> -1 Then TCPCloseSocket($dir_Socket) TCPShutdown() WEnd
  10. hey I already did that , Saw TCP Send and TCP Recv scripts, and thats working in two diffrent PCs. but i dont know how this mechanism can be put together. i am stuck :[ See the thing is i dun need to send any text file i just want to read the File List located on Server Computer from this clinet UI and when i hit Run Script it should load the settings on Server PC and initiate it !!
  11. I want to Do Something Like this #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GuiComboBox.au3> #include <WinAPI.au3> #include <IE.au3> #include <Date.au3> Global $dir_IPAddress, $dir_Port, $dir1 $dir_IPAddress = @IPAddress1 $dir_Port = 2291 TCPStartup() TCPConnect($dir_IPAddress, $dir_Port) ;Variable $dir1 should be Updated from the Script ! ; $dir = location on the Server Computer for Combo Box. #Region ### START Koda GUI section ### Form=c:documents and settingsadminmy documentsauto it custom scriptsvquad - onexa automationmain_window.kxf $Main_Window = GUICreate("Automation Wizard ", 724, 663, 276, 183) GUISetCursor (2) $radio_settings = GUICtrlCreateGroup("Settings", 32, 40, 649, 105) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $radio_agent = GUICtrlCreateRadio("Option 1", 48, 64, 217, 17) $radio_agentsip = GUICtrlCreateRadio("Option 2", 48, 88, 137, 17) $radio_communicator = GUICtrlCreateRadio("Option 3", 48, 112, 153, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $VDID_2 = GUICtrlCreateCombo("Choose...", 80, 304, 257, 150, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL,$WS_VSCROLL)) GUICtrlSetTip(-1, "Choose the Auto Script File for Device 1") $run_script = GUICtrlCreateButton("Run Script", 552, 600, 129, 41) $end_script = GUICtrlCreateButton("End Script", 424, 600, 129, 41) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetState(-1, $GUI_HIDE) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $VDID_2 _GUICtrlComboBox_BeginUpdate($VDID_2) _GUICtrlComboBox_AddDir($VDID_2, $dir1 & "*.scp") _GUICtrlComboBox_EndUpdate($VDID_2) Case $run_script GUICtrlSetState($end_script, BitOR($GUI_ENABLE, $GUI_SHOW)) GUICtrlSetState($run_script, $GUI_DISABLE) EndSwitch WEnd ;RUN Script ;So When I Hit Run Script it will be execute the settings on the Server PC by reading the option in Client PC. Now I need that This UI is the Client UI . Server is in listen Mode in another computer, i want to select any 1 option (option1/option2/option3) Combo Box should load the directory located in another computer, which could be done with TCP feature i suppose but i aint getting it tried binary to string and string to binary. so a little Help will be needed.. 1 more things i want when i hit Run Script button , the script should be loaded in Server Computer and execute the settings whihc i loaded in Client PC. Thanks and Please help me out i am stuck :[
  12. Actually if u put any example here , i can able to understand. though i am getting a new problem of TCP port i suppose bcs i saw a tutorial for basic TCP connect and listen , and data is not getting transmitted. i Dun know y. !
  13. This code should be for my Server Side, If GUICtrlRead($radio_agent) = 1 Then ;##### Run ######### Send ("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx") Sleep(1000) Send("{ENTER}") Sleep(1000) $x = 0 $y = 0 $result_h323 = _WaitForImageSearch("one_x_agenth323.bmp", 20, 1, $x, $y, 100) If $result_h323 = 1 Then MouseMove($x, $y, 100) Else MsgBox(0, "Error", "Check the Correct Statement") EndIf ;Activating Window WinActivate("xxxxxxxxxxxxxx") AutoItSetOption("MouseCoordMode",0) Sleep(1000) ;Placing a Call Mousemove (47,97.5,30) MouseClick ("left") Sleep(1000) Send("{ALTDOWN}") Send("{c}") Send("{ALTUP}") Send("50006") sleep(1000) Send("{Enter}") Client Side : Simple Gui Window with Run Script Radio button..... P.S : I am very new to Auto IT TCP module ... So i knw its hectic a little bit.. but pls help me out ! Thanks
  14. Hey Guyz, Its Diffrent this time, i was using my script to run the gui which control other functions only in same computer , but now i want to run my script to be used as TCP Server / Client algorithm. My Scenario is Server Script is in listen mode to track the Cleint Script Initialisation. When i send command from My gui in client computer Server Computer needs to perform the Script functions. One more thing Client Gui also have Combo Box whose value will be loaded from Server computer. Tell me How its gonna be done . Thanks an Example script will b e helpful , PS : i know very less about TCP Connect and all Thanks & Regards, G6
  15. In this script modify like this to gain control case $hbutton1 If GuiCtrlGet($hbutton1) = 1 Then /// Ur Script for enabling the button wether its a UDF's or Control Step by Step process /// ElseIf / Endif <as per ur needs> Hope this may help u out.. , well just wait 4 some more time , if anybody improvises ur idea.. bt as far as i am concerned this will wrk out
×
×
  • Create New...