Jump to content

mlukac89

Active Members
  • Posts

    22
  • Joined

  • Last visited

Everything posted by mlukac89

  1. Thanks man, i made mistake in second loop with 25, so simple, thanks anyway
  2. Hi I want to make array to store checkboxes inside so i can use it later in code for easier access, and for less code. Issue is that loop is adding 1 more item in a row and there should be 5 rows and 5 columns, that's 25 in total. Also it doesn't giving me correct box number like 1 - 25, instead i have 0-6, 0-6, 0-6 On images you can see valid one and invalid one. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### $Form1 = GUICreate("Form1", 341, 443, -1, -1) $Group1 = GUICtrlCreateGroup("", 8, 40, 323, 361, -1, $WS_EX_TRANSPARENT) $Tab1 = GUICtrlCreateTab(16, 64, 308, 329) $TabSheet1 = GUICtrlCreateTabItem("Tab1") Global $boxArray[5][25] For $line = 0 To 4 For $i = 0 To 24 $boxArray[$line][$i] = GUICtrlCreateCheckbox('Box '&$i, 20+$i*59, 94+$line*58, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) Next Next #cs $box1 = GUICtrlCreateCheckbox("Box 1", 24, 94, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) $box2 = GUICtrlCreateCheckbox("Box 2", 83, 94, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) $box3 = GUICtrlCreateCheckbox("Box 3", 141, 94, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) $box4 = GUICtrlCreateCheckbox("Box 4", 199, 94, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) $box5 = GUICtrlCreateCheckbox("Box 5", 257, 94, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) $box6 = GUICtrlCreateCheckbox("Box 6", 24, 152, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) $box7 = GUICtrlCreateCheckbox("Box 7", 83, 152, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) $box8 = GUICtrlCreateCheckbox("Box 8", 141, 152, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) $box9 = GUICtrlCreateCheckbox("Box 9", 199, 152, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) $box10 = GUICtrlCreateCheckbox("Box 10", 257, 152, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) $box11 = GUICtrlCreateCheckbox("Box 11", 24, 210, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) $box12 = GUICtrlCreateCheckbox("Box 12", 83, 210, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) $box13 = GUICtrlCreateCheckbox("Box 13", 141, 210, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) $box14 = GUICtrlCreateCheckbox("Box 14", 199, 210, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) $box15 = GUICtrlCreateCheckbox("Box 15", 257, 210, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) $box16 = GUICtrlCreateCheckbox("Box 16", 24, 268, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) $box17 = GUICtrlCreateCheckbox("Box 17", 83, 268, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) $box18 = GUICtrlCreateCheckbox("Box 18", 141, 268, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) $box19 = GUICtrlCreateCheckbox("Box 19", 199, 268, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) $box20 = GUICtrlCreateCheckbox("Box 20", 257, 268, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) $box21 = GUICtrlCreateCheckbox("Box 21", 24, 326, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) $box22 = GUICtrlCreateCheckbox("Box 22", 83, 326, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) $box23 = GUICtrlCreateCheckbox("Box 23", 141, 326, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) $box24 = GUICtrlCreateCheckbox("Box 24", 199, 326, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) $box25 = GUICtrlCreateCheckbox("Box 25", 257, 326, 57, 57, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) #ce GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
  3. Melba23, First thx for your time but this get too complicated for me i see i must make something more efficient to rename all in 2-5 minutes because there is not so much items i need to rename I extracted all from 1 item, ok so now i think better way will be to make automatic replacer to replace only as it show on example below 1=Karkaen necklace with 1=@@@@ Karkaen necklace @@@@ this must not exceed 50 chars, i tried that before but then it replaces me all where is Karkaen necklace, even those 1=Excellent Karkaen Necklace that i don't need. And for section names, i think its not always the same because if coders add new item in INI then it changes section number and can't make some pattern to extract only for example 'uniqs' and put in array [5018], [9358], [10363], [20043], [20159] to it search only for it but its same because it search in whole file Is there a way to use it like this StringReplace() Karkaen necklace where is 1=Karkaen necklace on first place and dont replace where is 1=Inteligent Karkaen necklace ? ///////////// items i need to change names /////////////// name like @@@@@ Karkaen necklace @@@@@ ; max 50 chars lenght ////////////////////////////////////////////////////////// [5018] 0=AgpmItem 1=Karkaen Necklace [9358] 0=AgpmItem 1=Karkaen Necklace [10363] 0=AgpmItem 1=Karkaen Necklace [20043] 0=AgpmItem 1=Karkaen Necklace [20159] 0=AgpmItem 1=Karkaen Necklace //////////////// items that i dont need to search ///////////////// [7659] 0=AgpmItem 1=Karkaen Necklace Piece [11617] 0=AgpmItem 1=Brilliant Karkaen Necklace [11640] 0=AgpmItem 1=Intelligent Karkaen Necklace [11663] 0=AgpmItem 1=Glorious Karkaen Necklace [11686] 0=AgpmItem 1=Excellent Karkaen Necklace [11803] 0=AgpmItem 1=Karkaen Necklace Piece [12583] 0=AgpmItem 1=Karkaen Necklace Piece [20068] 0=AgpmItem 1=Brilliant Karkaen Necklace [20091] 0=AgpmItem 1=Intelligent Karkaen Necklace [20114] 0=AgpmItem 1=Glorious Karkaen Necklace [20137] 0=AgpmItem 1=Excellent Karkaen Necklace [20184] 0=AgpmItem 1=Brilliant Karkaen Necklace [20207] 0=AgpmItem 1=Intelligent Karkaen Necklace [20230] 0=AgpmItem 1=Glorious Karkaen Necklace [20253] 0=AgpmItem 1=Excellent Karkaen Necklace
  4. Ok i installed beta i tested it and its again too slow What was you think with this "I think you might be better off with a database." ?
  5. i see btw you have error on line 37 error: _FileReadToArray() called with wrong number of args. $aIniEntries = _FileReadToArray($sFilePath)
  6. Melba23, I make it to work, i changed _FileReadToArray to FileReadToArray now it show me all result as it need to but its too slow, any way to speed it up ? Example with your code #include <GUIConstantsEx.au3> #include <Array.au3> #Include <GuiListBox.au3> #include <File.au3> Global $hGUI, $hInput, $hList, $sPartialData, $filelist, $ini $ini = @ScriptDir&'\Opened ini.ini' $filelist = FileReadToArray($ini) Keywords() $hGUI = GUICreate("Example", 200, 400) $hInput = GUICtrlCreateInput("", 5, 5, 190, 20) $hList = GUICtrlCreateList("", 5, 30, 190, 325, BitOR(0x00100000, 0x00200000)) $hButton = GUICtrlCreateButton("Read", 60, 360, 80, 30) $hUP = GUICtrlCreateDummy() $hDOWN = GUICtrlCreateDummy() $hENTER = GUICtrlCreateDummy() GUISetState(@SW_SHOW, $hGUI) ; Set accelerators for Cursor up/down and Enter Dim $AccelKeys[3][2]=[["{UP}", $hUP], ["{DOWN}", $hDOWN], ["{ENTER}", $hENTER]] GUISetAccelerators($AccelKeys) $sCurr_Input = "" $iCurrIndex = -1 While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hList $sChosen = GUICtrlRead($hList) ; If $sChosen <> "" Then GUICtrlSetData($hInput, $sChosen) ; Case $hButton If $sPartialData <> "" Then $sFinal = GUICtrlRead($hInput) If _ArraySearch($filelist, $sFinal) > 0 Then MsgBox(0, "Chosen", $sFinal) EndIf EndIf Case $hUP If $sPartialData <> "" Then $iCurrIndex -= 1 If $iCurrIndex < 0 Then $iCurrIndex = 0 _GUICtrlListBox_SetCurSel($hList, $iCurrIndex) EndIf Case $hDOWN If $sPartialData <> "" Then $iTotal = _GUICtrlListBox_GetCount($hList) $iCurrIndex += 1 If $iCurrIndex > $iTotal - 1 Then $iCurrIndex = $iTotal - 1 _GUICtrlListBox_SetCurSel($hList, $iCurrIndex) EndIf Case $hENTER If $iCurrIndex <> -1 Then $sText = _GUICtrlListBox_GetText($hList, $iCurrIndex) GUICtrlSetData($hInput, $sText) $iCurrIndex = -1 _GUICtrlListBox_SetCurSel($hList, $iCurrIndex) EndIf EndSwitch ; If input has changed, refill list with matching items If GUICtrlRead($hInput) <> $sCurr_Input Then CheckInputText() $sCurr_Input = GUICtrlRead($hInput) EndIf WEnd Func CheckInputText() $sPartialData = "|" ; Start with delimiter so new data always replaces old Local $sInput = GUICtrlRead($hInput) If $sInput <> "" Then For $i = 0 To UBound($filelist) - 1 If StringInStr($filelist[$i], $sInput) <> 0 Then $sPartialData &= $filelist[$i] & "|" Next GUICtrlSetData($hList, $sPartialData) EndIf EndFunc ;==>CheckInputText Func Keywords() Local $sData For $i = 0 To UBound($filelist) - 1 $sData = $filelist[$i] & "|" Next GUICtrlSetData($hList, $sData) $iCurrIndex = -1 _GUICtrlListBox_SetCurSel($hList, $iCurrIndex) EndFunc ;==>Keywords
  7. Melba23, Thx for understanding. So anyone can help me or tell me how to search string in ini file ?
  8. Yes it is game related but dont affect gameplay in any way and its allowed to change it because that only for show items that drop on ground and only you can see it, and you cant change any part of game with it + its for private server you can check here http://forum.justac.net/index.php?topic=1672.0 here is already maded tool but its diferent than this i want to make.
  9. I implement your script in mine and i got this error "C:UsersxooooxDesktopNew AutoIt v3 Script (3).au3" (60) : ==> Subscript used on non-accessible variable.: $asKeyWords[$i] = $filelist $asKeyWords^ ERROR #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <File.au3> Global $FilePath, $CurrentInput, $asKeyWords, $filelist Keywords() $Form1 = GUICreate("Form1", 290, 295, 298, 253) $searchbox = GUICtrlCreateInput("", 8, 25, 273, 21) GUICtrlCreateLabel("Search for text", 8, 8, 73, 17) $List1 = GUICtrlCreateList("", 8, 82, 273, 175, BitOR(0x00100000, 0x00200000)) GUICtrlCreateLabel("Founded results", 8, 64, 79, 17) $openini = GUICtrlCreateButton("Open INI", 8, 264, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $openini $FilePath = FileOpenDialog('Select INI file', '', '(*.ini)') ; opens ini file $filelist = _FileReadToArray($FilePath, $asKeyWords) ; put ini file in array Case $List1 $Chosen = GUICtrlRead($List1) If $Chosen <> '' Then GUICtrlSetData($searchbox, $Chosen) EndSwitch ; If input has changed, refill list with matching items If GUICtrlRead($searchbox) <> $CurrentInput Then CheckInputText() $CurrentInput = GUICtrlRead($searchbox) EndIf WEnd Func CheckInputText() $sPartialData = '|' ; Start with delimiter so new data always replaces old Local $sInput = GUICtrlRead($searchbox) If $sInput <> '' Then For $i = 0 To 99 If StringInStr($asKeyWords[$i], $sInput) <> 0 Then $sPartialData &= $asKeyWords[$i] & '|' Next GUICtrlSetData($List1, $sPartialData) EndIf EndFunc ;==>CheckInputText Func Keywords() Local $sData For $i = 0 To UBound($filelist) $asKeyWords[$i] = $filelist ; line 60 $sData &= $asKeyWords[$i] & '|' Next GUICtrlSetData($List1, $sData) $iCurrIndex = -1 _GUICtrlListBox_SetCurSel($List1, $iCurrIndex) EndFunc ;==>Keywords and i tried to edit your script a bit and it give me only few results but not all, maybe because ini file is over 15 mb ? here is download link to ini file, try to open it and search for Karkaen it will give you many results for that. http://www.speedyshare.com/fBbuk/Opened-ini.ini #include <GUIConstantsEx.au3> #include <Array.au3> #Include <GuiListBox.au3> #include <File.au3> Global $hGUI, $hInput, $hList, $sPartialData, $asKeyWords, $filelist, $ini $ini = @ScriptDir&'\Opened ini.ini' ; opens ini file $filelist = _FileReadToArray($ini, $asKeyWords) ; puts ini file to array ; Create list full of random 5 character "words" Keywords() $hGUI = GUICreate("Example", 200, 400) $hInput = GUICtrlCreateInput("", 5, 5, 190, 20) $hList = GUICtrlCreateList("", 5, 30, 190, 325, BitOR(0x00100000, 0x00200000)) $hButton = GUICtrlCreateButton("Read", 60, 360, 80, 30) $hUP = GUICtrlCreateDummy() $hDOWN = GUICtrlCreateDummy() $hENTER = GUICtrlCreateDummy() GUISetState(@SW_SHOW, $hGUI) ; Set accelerators for Cursor up/down and Enter Dim $AccelKeys[3][2]=[["{UP}", $hUP], ["{DOWN}", $hDOWN], ["{ENTER}", $hENTER]] GUISetAccelerators($AccelKeys) $sCurr_Input = "" $iCurrIndex = -1 While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hList $sChosen = GUICtrlRead($hList) ; If $sChosen <> "" Then GUICtrlSetData($hInput, $sChosen) ; Case $hButton If $sPartialData <> "" Then $sFinal = GUICtrlRead($hInput) If _ArraySearch($asKeyWords, $sFinal) > 0 Then MsgBox(0, "Chosen", $sFinal) EndIf EndIf Case $hUP If $sPartialData <> "" Then $iCurrIndex -= 1 If $iCurrIndex < 0 Then $iCurrIndex = 0 _GUICtrlListBox_SetCurSel($hList, $iCurrIndex) EndIf Case $hDOWN If $sPartialData <> "" Then $iTotal = _GUICtrlListBox_GetCount($hList) $iCurrIndex += 1 If $iCurrIndex > $iTotal - 1 Then $iCurrIndex = $iTotal - 1 _GUICtrlListBox_SetCurSel($hList, $iCurrIndex) EndIf Case $hENTER If $iCurrIndex <> -1 Then $sText = _GUICtrlListBox_GetText($hList, $iCurrIndex) GUICtrlSetData($hInput, $sText) $iCurrIndex = -1 _GUICtrlListBox_SetCurSel($hList, $iCurrIndex) EndIf EndSwitch ; If input has changed, refill list with matching items If GUICtrlRead($hInput) <> $sCurr_Input Then CheckInputText() $sCurr_Input = GUICtrlRead($hInput) EndIf WEnd Func CheckInputText() $sPartialData = "|" ; Start with delimiter so new data always replaces old Local $sInput = GUICtrlRead($hInput) If $sInput <> "" Then For $i = 0 To 99 ; i tried to change this to more but i get same results If StringInStr($asKeyWords[$i], $sInput) <> 0 Then $sPartialData &= $asKeyWords[$i] & "|" Next GUICtrlSetData($hList, $sPartialData) EndIf EndFunc ;==>CheckInputText Func Keywords() Local $sData For $i = 0 To UBound($filelist) $asKeyWords[$i] = $filelist $sData &= $asKeyWords[$i] & "|" Next GUICtrlSetData($hList, $sData) $iCurrIndex = -1 _GUICtrlListBox_SetCurSel($hList, $iCurrIndex) EndFunc ;==>Keywords
  10. Hey I have few questions, i have gui like this, it have open file button so you open ini file for edit. Now how i can make it when i start to type in search filed, to show me only rows he founded in ini file and show it in listview ? I don't want to read whole ini file in listview if not required. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Search in ini file", 290, 295, 298, 253) $searchbox = GUICtrlCreateInput("", 8, 25, 273, 21) GUICtrlCreateLabel("Search for text", 8, 8, 73, 17) $List1 = GUICtrlCreateList("", 8, 82, 273, 175) GUICtrlCreateLabel("Founded results", 8, 64, 79, 17) $openini = GUICtrlCreateButton("Open INI", 8, 264, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $openini $FilePath = FileOpenDialog('Select INI file', '', '(*.ini)') ; opens ini file EndSwitch WEnd
  11. Glad to help you
  12. Ah i forgot i can read text and all from page but thx
  13. Ok, and how i check if im logged or not ?
  14. It can just script to be adapted to your needs and you need better GUI. It dont be complex to be effective something like this http://prntscr.com/2yp1ca
  15. Here i found this on this forum, try run 1 by 1 UDP #include<GUIConstantsEx.au3> $sock = "" #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("UDP", 328, 447, 193, 125) $IPin = GUICtrlCreateInput("", 50, 0, 121, 21) GUICtrlCreateLabel("IP/Host:", 0, 0, 50, 17) $History = GUICtrlCreateEdit("", 2, 82, 321, 361) $Go = GUICtrlCreateCheckbox("Start", 250, -2, 75, 25, 0) GUICtrlSetBkColor(-1, 0x009933) GUICtrlCreateLabel("Port", 178, 2, 23, 17) $Portin = GUICtrlCreateInput("", 204, 0, 45, 21) GUICtrlCreateLabel("History", 2, 62, 36, 17) $Gstatus = GUICtrlCreateLabel("", 74, 30, 196, 41) GUICtrlSetFont(-1, 26, 400, 0, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### START Koda GUI section ### Form= UDPStartup() While 1 $msgb = GUIGetMsg() Switch $msgb Case $GUI_EVENT_CLOSE UDPCloseSocket($sock) UDPShutdown() Exit Case BitAND(GUICtrlRead($go),$GUI_CHECKED) Case BitAND(GUICtrlRead($go),$GUI_UNCHECKED) $ip = GUICtrlRead($IPin, 1) $port = GUICtrlRead($Portin, 1) If $ip = "" Or $port = "" Then Else $ip = TCPNameToIP($ip) Sleep(1000) $start = TimerInit() $sock = UDPBind($ip, $port) If @error = 1 Then MsgBox(0, "Error", "Invalid IP entered!") GUICtrlSetState($go, $GUI_UNCHECKED) ElseIf @error = 2 Then MsgBox(0, "Error", "Invalid/closed Port entered!") GUICtrlSetState($go, $GUI_UNCHECKED) ElseIf $sock = -1 Then GUICtrlSetData($Gstatus, "OFFLINE!") GUICtrlSetFont($gstatus, 26) GUICtrlSetColor($gstatus, 0xFF0093) GUICtrlSetData($History, "[" & @HOUR & ":" & @MIN & ":" & @SEC & "] OFFLINE, "&$ip&":"&$port & @CRLF, GUICtrlRead($History)) Else $Stop = Round(TimerDiff($start), 2) GUICtrlSetData($Gstatus, "ONLINE!") GUICtrlSetFont($gstatus, 26) GUICtrlSetColor($gstatus, 0x009933) GUICtrlSetData($History, "[" & @HOUR & ":" & @MIN & ":" & @SEC & "] ONLINE, "&$ip&":"&$port&" ms:" & $Stop & @CRLF, GUICtrlRead($History)) UDPCloseSocket($sock) EndIf EndIf EndSwitch WEnd And TCP #include<GUIConstantsEx.au3> $sock = "" #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("TCP", 328, 447, 193, 125) $IPin = GUICtrlCreateInput("", 50, 0, 121, 21) GUICtrlCreateLabel("IP/Host:", 0, 0, 50, 17) $History = GUICtrlCreateEdit("", 2, 82, 321, 361) $Go = GUICtrlCreateCheckbox("Start", 250, -2, 75, 25, 0) GUICtrlSetBkColor(-1, 0x009933) GUICtrlCreateLabel("Port", 178, 2, 23, 17) $Portin = GUICtrlCreateInput("", 204, 0, 45, 21) GUICtrlCreateLabel("History", 2, 62, 36, 17) $Gstatus = GUICtrlCreateLabel("", 74, 30, 196, 41) GUICtrlSetFont(-1, 26, 400, 0, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### START Koda GUI section ### Form= TCPStartup() While 1 $msgb = GUIGetMsg() Switch $msgb Case $GUI_EVENT_CLOSE TCPCloseSocket($sock) TCPShutdown() Exit Case BitAND(GUICtrlRead($go),$GUI_CHECKED) Case BitAND(GUICtrlRead($go),$GUI_UNCHECKED) $ip = GUICtrlRead($IPin, 1) $port = GUICtrlRead($Portin, 1) If $ip = "" Or $port = "" Then Else $ip = TCPNameToIP($ip) Sleep(1000) $start = TimerInit() $sock = TCPConnect($ip, $port) If @error = 1 Then MsgBox(0, "Error", "Invalid IP entered!") GUICtrlSetState($go, $GUI_UNCHECKED) ElseIf @error = 2 Then MsgBox(0, "Error", "Invalid/closed Port entered!") GUICtrlSetState($go, $GUI_UNCHECKED) ElseIf $sock = -1 Then GUICtrlSetData($Gstatus, "OFFLINE!") GUICtrlSetFont($gstatus, 26) GUICtrlSetColor($gstatus, 0xFF0093) GUICtrlSetData($History, "[" & @HOUR & ":" & @MIN & ":" & @SEC & "] OFFLINE, "&$ip&":"&$port & @CRLF, GUICtrlRead($History)) Else $Stop = Round(TimerDiff($start), 2) GUICtrlSetData($Gstatus, "ONLINE!") GUICtrlSetFont($gstatus, 26) GUICtrlSetColor($gstatus, 0x009933) GUICtrlSetData($History, "[" & @HOUR & ":" & @MIN & ":" & @SEC & "] ONLINE, "&$ip&":"&$port&" ms:" & $Stop & @CRLF, GUICtrlRead($History)) TCPCloseSocket($sock) EndIf EndIf EndSwitch WEnd
  16. Global $run = False HotKeySet("^g", "_start") While 1 Sleep(100) WEnd Func _start() $run = Not $run While $run If $run Then Send("{x down}") Else Send("{x up}") EndIf WEnd EndFunc Is this helps ? just compile it
  17. U see in help file u cant make a port only adress or ip Parameters address/hostname Can be i.e. "www.autoitscript.com" or "87.106.244.38". timeout [optional] Is the time to wait for an answer in milliseconds (default is 4000). Try this or use TCP or UDP
  18. #include <IE.au3> Sleep(500) $url = "https://ericoll.internal.ericsson.com/sites/MUNA_RF_Engineering_Services/RF%20Engineering%20Design%20Services/Documents/Forms/AllItems.aspx?RootFolder=%2Fsites%2FMUNA%5FRF%5FEngineering%5FServices%2FRF%20Engineering%20Design%20Services%2FDocuments%2FATT%20RF%20Design%2FCentral%20Region" $oIE = _IECreate($url) Sleep(100) _IELoadWait($oIE) Sleep(100) $hIE = _IEPropertyGet($oIE, "hwnd") ; Get Handle of the IE window WinSetState($hIE, "" ,@SW_MAXIMIZE) Sleep(100)
  19. I tried this i use this as link too /login.php?login_attempt=1 and read data from it then check with ( If true Then ), it works if -fields are empty -if you enter invalid email -if you enter email and not password But if you got invalid password it redirect to some other link like this https://www.facebook.com/login/help.php?st=ipw&cuid=AYh1uXvT8CxRXEAOuz8uTgxBiSsuagKFJIzFqxxTJdEI3eF9bOtj2etEXznTD6jU3Ga5u5EGtIwDihw5O08pugAlAFjnbikX3B0W1sKo83U-Z9wQsksv33KGDM9dQ5v6Qw2eDTMTmHzRvCRMh8sqqlKWdncUCfbWydfHMZIHj2RStA and every time that is diferent because this CUID= is hash So still same question remains what if password is wrong and redirects you to other link like this above ? How can i know if im logged ? How i can get list of friends ? How to send message to friend ? How to show GUI window when friend send you message ? I found UDF for Facebook but dont works for me http://www.codebot.de/board77-autoit/board80-files-autoit/11793-facebook-udf/?s=7a10b47f77240505f70871817ef3d0fef752b269
  20. Hi, I want to make Facebook messenger, is it possible with AutoIt ? I made this piece of code, it works fine, while login browser is not showing like i want. I check after login if its logged when i open facebook page in IE manual and its logged so all is good. Now im interested if i can make this : How can i check if email and password is valid ? How can i know if im logged ? How i can get list of friends ? How to send message to friend ? How to show GUI window when friend send you message ? I don't want to show IE in any way #include <IE.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Global $url = 'https://facebook.com' $GUI = GUICreate("Form 1", 256, 210, 342, 170) GUISetFont(10, 400, 0, "Tahoma") $email = GUICtrlCreateInput("", 85, 24, 150, 24) $pass = GUICtrlCreateInput("", 85, 56, 150, 24, $ES_PASSWORD) GUICtrlCreateLabel("Email", 14, 27, 35, 20) GUICtrlCreateLabel("Password", 14, 59, 59, 20) $keeplogged = GUICtrlCreateCheckbox("Keep me logged in", 85, 96, 121, 17) $login = GUICtrlCreateButton("Log in", 27, 144, 201, 41, BitOR($BS_DEFPUSHBUTTON,$BS_FLAT)) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $login ; open browser ; url ; 1 = Try to attach to an existing window, 0 = (Default) do not try to attach ; 1 = (Default) Browser Window is visible, 0 = Browser Window is hidden ; 1 = (Default) Wait for page load to complete before returning, 0 = Return immediately, not waiting for page to load ; 1 = (Default) bring window into focus, 0 = Do not bring window into focus $IE = _IECreate($url, 1, 0, 1, 1) Sleep(2000) ; wait 2 seconds untill IE loads ; get properties of fields $Form = _IEFormGetCollection($IE, 0) $Username = _IEFormElementGetObjByName($Form, 'email') ; id of email field $Password = _IEFormElementGetObjByName($Form, 'pass') ; id of password field $Checkbox = _IEFormElementGetObjByName($Form, 'persist_box') ; id of checkbox field ; set values _IEFormElementSetValue($Username, GUICtrlRead($email)) _IEFormElementSetValue($Password, GUICtrlRead($pass)) ; Keep logged in if chceckbox is selected If GUICtrlRead($keeplogged) == $GUI_CHECKED Then _IEFormElementCheckBoxSelect($Form, $Checkbox, "", 1, "byIndex") ; submit form _IEFormSubmit($Form) EndSwitch WEnd
×
×
  • Create New...