Jump to content

Kyme

Active Members
  • Posts

    198
  • Joined

  • Last visited

Everything posted by Kyme

  1. Hello all I have a really strange problem with what i'm dealing with, and i don't understand if i'm doing something wrong or it's a bug given code is: #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <MsgBoxConstants.au3> #include <Array.au3> local $nodata[2][4]=[["No Data1", "N/A1", "N/A2", "N/A3"],["No Data2", "N/A1", "N/A2", "N/A3"]] Global $index[3]=["0","1","3"] Global $index2=0 Example() Func Example() Local $idListview GUICreate("ListView Get Item Text", 400, 300) $idListview = GUICtrlCreateListView("", 2, 2, 394, 268) GUISetState(@SW_SHOW) _GUICtrlListView_AddColumn($idListview, "Item", 100) _GUICtrlListView_AddColumn($idListview, "Item", 100) _GUICtrlListView_AddColumn($idListview, "Item", 100) _GUICtrlListView_AddColumn($idListview, "Item", 100) _GUICtrlListView_AddArray ($idListview, $nodata ) MsgBox($MB_SYSTEMMODAL, $index2, _GUICtrlListView_GetItemText($idListview, $index2,0)&@CRLF&_GUICtrlListView_GetItemText($idListview, $index2,1)); it works normally MsgBox($MB_SYSTEMMODAL, $index[0], _GUICtrlListView_GetItemText($idListview, $index[0],0)&@CRLF&_GUICtrlListView_GetItemText($idListview, $index[0],1)); no data? but $iIndex param it's same Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc calling _GUICtrlListView_GetItemText with an array index return nothing, why and how can i fix this situation? A short moment later... i've tried to cast the param to string, but silly me didn't tought it through till the end, it needs a number, casting it to number fixed it MsgBox($MB_SYSTEMMODAL, $index2, _GUICtrlListView_GetItemText($idListview, $index2,0)&@CRLF&_GUICtrlListView_GetItemText($idListview, $index2,1)) MsgBox($MB_SYSTEMMODAL, $index[0], _GUICtrlListView_GetItemText($idListview, Number($index[0]),0)&@CRLF&_GUICtrlListView_GetItemText($idListview, Number($index[0]),1)); Thank you
  2. Thank you for fast response i saw the script prior posting and as i understood it's a gui thing, i need a string format i have a function that require a string to print it on lcd, can be used marquee to create a same size string as original one but rotating?maybe i've missed something, i could make a function to subtract the max-1 both sides and concatenate them and trim it to @30 chars, but it sounds painful and i guess it's harder then it sounds. My small project it's to make a lcd app to print song name that's playing on spotify. Till now i've managed to do the displaying but i want the text to be on 1 line only, and if the title it's longer then to scroll the text. Edit: this is what i'm come up to, is there any other more elegant solution, it looks sooo trivial... $title="Adelitas Way - What It Takes"&" " ;31 $max=10 while 1 $title=title($title) ConsoleWrite(StringTrimRight($title,Int(StringLen($title))-$max)&@CRLF) Sleep(100) WEnd Func title($otitle) local $o_title=$otitle local $size=StringLen($o_title) local $char=StringTrimRight($o_title,$size-1) local $title_subed=StringTrimLeft($o_title,1) $first=StringTrimLeft($o_title,1) ;ConsoleWrite($title_subed&$char&@CRLF) Return $title_subed&$char EndFunc
  3. Hello Guys I want to make a scroll text and send it to a lcd, I've managed the connection and be able to display it but i faced the "too much chars to be displayed" problem, so i need to create a function to scroll the text, the problem is that i have no idea how can i get the first char and put it last if the string it's too big and if not then let it as it is Can anybody give me an idea where can i start? Thank you
  4. Hello there, As i tried to use last 2 days imagesearch and failed to do it due an unknown error i found out that i have a problem with resolution si i've tried this thing MsgBox(0,"",@DesktopWidth&@crlf&@DesktopHeight) i was amazed when it returned 1270x720 now the problem with imagesearch in this place it's obvious right? now i ask a dumb question, how the hell is this possible, in display props i have 1920x1080 even when i set 1680x1050 it returns 1344x840 now i know probably there is nothing wrong with the autoit(i guess) and it's all about some strange stuff based on video driver, otherwise i have no damn idea what is i have an windows 10 pro 64bit laptop with fresh install can anybody tell me what's going on or an idea how to fix this thing... thank you even the autoit info tool on mouse shows max the returned resolution Edit: i've found that if i compile the script and i set compatibility to disable display scaling on high dpi settings will do the trick, anyone have an idea how to set this thing on script run?is there an option for disabling display scaling? Edit2: if somebody will have this problem, i've set the autoit editor with disabled display scaling and it worked. Regards, Emanuel
  5. thank you. i guess the problem it's from the dll, it seems that sometimes it founds the match sometimes not, i've tried on start button, few icons in an open folder with no success, even with tolerance 200(sometimes it returns 1 but the x y are false), but when i tried on my computer icon it worked, and i've tried multiple format for image bmp 256/24bit jpg,png, gif(with high tolerance due the detail decrease) for all tests the strange part is that every time when imagesearch it's called the taskbar flashes, i guess after all it is from dll or i am too dumb... here's the script i've used, maybe someone will have a clue that the heck it's going on with it. Edit: what kind of format for image did you used?i've tried them all what paint support and almost nothing. the taskbar flashes in your VM too? i mean a short flash?with 24bit bmp and tolerance 200 it works but x y are a little off, they go on next icon on the right. also, do you use the lastest version of autoit? Edit2: mistery solved, on my server with same OS works as oiled so i guess something it's messed up with my system thank you a lot sir, now i can peacefully sleep knowing the problem in the end i've used bmp 24 and worked, on my machine fail to do so regards, emanuel #AutoIt3Wrapper_UseX64=n #include <ImageSearch.au3> Global $y = 0, $x = 0 While 1 test() WEnd Func test() $Icon = @ScriptDir & "\1.bmp" $result = _ImageSearch($Icon, 0, $x, $y, 200, 0) If $result > 0 Then MsgBox(0, "found", $result) MouseMove($x,$y) Else MsgBox(0, "not found", $result) EndIf EndFunc
  6. can you please also post ImageSearch.au3, it's missing in zip thank you
  7. Hello all Can anybody please post a zip with working imagesearch example and dll for windows 10 pro 64bit? i've tried almost all versions i've got and nothing, i end up with doing nothing for few minutes and after that it return 0 or returning 0. as i said, i have win 10 pro 64bit, i've tried 32 and 64 bit versions and nothing, as almost all versions have some errors and as i read they can be fixed with ctrl+t but honestly i've spent more then 5h searching a working version and nothing... i've set sciTE to run as admin, with #AutoIt3Wrapper_UseX64=n, all the combos i've tried nothing... can somebody post a zip with needed files and a simple example for win 10 64bit please, i will provide a png for test(a section of screenshot i've made) hopefully somebody would be kind to help me figure it out what i do wrong it's not first time i use this udf but this time i don't know what's going on...i hope that there is an version for win10 because i ended in a opinion that it don't work under win10 regards, emanuel
  8. Hello forum, I have a small question, i searched but i didn't found something precise so i will ask you guys, Autoit it's able to make apps for dos?, i mean under dos, without windows. The thing that it interest me if i'm able to create a exe to print a message in dos, like "echo" in bat but to be exe and be able to run under dos Thank you. Regards, Emanuel
  9. grate job man, i actualy use this library on my remote php website to be able controling winamp from bed you are awesome can i suggest something?if you have time add to _Winamp_GetCurrentTrackInfo the whole time of the current track, would be nice to see it there thank you for your hard work sir regards
  10. nvm, i just found an socket server udf with an php client, works amazing...that's really fast...i think i found what i need thank you anyway regards
  11. hello there, it's not quite right forum to ask, but it use autoit that's why i ask here, most of it i will find it quicker answare here then on php/html forums well, lets start, i want to use and tcp ip conection based on server-client to control my winamp(like volum up, down, play, pause, stop, next e.t.c) that's easy to do it with an simple php script and and tool to check an field infinitely and search commands, but that make quite big delay between client-server so i ask myself what alternative i have, well, tcp ip it seems to be good one, but i'm not sure of something can i make an web server and use autoit client and control client through webpage?if yes, can somebody give me please some point where to start?no matter if it's autoit or php or both i just need to know if it's possible in this way, or you can tell me some better way to don't have so big delay between server-client?all i have until now it's @3h of work, and and done project(autoit&php) what use mysql to store comands and it's look like inet an page with single post of mysql(command) if that file contain only "done"-> do nothing if contain other thing like winamp_play it will call function winamp_play() here's my script until now, the delay it's because of sql update using IE after done the command commands are done by php script what update the command field with functions from autoit client what will be called after check any better solution for this it is possible? Edit: i forgot to say that i will be using mostly my domain not local connection, it's more easier(i already saw the mysql udf, i just can't config mysql server to accept external connection, don't know why, it refuse to work, so this one kinda fall) #include <IE.au3> #include <Winamp_Library.au3> ;~ MsgBox(0, "Form Element Value", $getcommand) reload() func reload() while 1 Local $command = InetRead("http://localhost/remote/_update.php?view",1) If BinaryToString($command) = "done" Then Else Call(BinaryToString($command)) $oIE = _IECreate("http://localhost/remote/_update.php?update=done",0,0,1,0) _IEQuit($oIE) EndIf sleep(1000) WEnd EndFunc Func winamp_play() _Winamp_play() TrayTip("Remote control","Winamp play/pause",5000) EndFunc Func winamp_stop() _Winamp_Stop() TrayTip("Remote control","Winamp stop",5000) EndFunc Func winamp_next() _Winamp_Next() TrayTip("Remote control","Winamp next",5000) EndFunc Func winamp_prev() _Winamp_Previous() TrayTip("Remote control","Winamp prev",5000) EndFunc Func winamp_volup() $getvol=_Winamp_GetVolume() _Winamp_SetVolume($getvol+26) TrayTip("Remote control","Winamp Volume Up",5000) EndFunc Func winamp_volmin() _Winamp_SetVolume(0) TrayTip("Remote control","Winamp Volume Min",5000) EndFunc Func winamp_vol50() _Winamp_SetVolume(128) TrayTip("Remote control","Winamp Volume 50%",5000) EndFunc Func winamp_volmax() _Winamp_SetVolume(255) TrayTip("Remote control","Winamp Volume Max",5000) EndFunc Func winamp_voldown() $getvol=_Winamp_GetVolume() _Winamp_SetVolume($getvol-26) TrayTip("Remote control","Winamp Volume Down",5000) EndFunc Func teamview() Run("C:Program Files (x86)TeamViewerVersion7TeamViewer.exe") TrayTip("Remote control","TeamViewer Started",5000) EndFunc Func teamviewkill() ProcessClose("TeamViewer.exe") TrayTip("Remote control","TeamViewer Killed",5000) EndFunc Func winampstart() _Winamp_Start() TrayTip("Remote control","Winamp Started",5000) EndFunc
  12. i have an small issue, it's there an function to add only the files from path?not the whole folder? something like c:backup*.* instead c:backup if i make an _zip_additem(@scriptdir&"backup.zip",C:backup) the structure of zip will start with folder backup, can it be done to starts with content of that folder? sorry for asking but really i don't see it
  13. here's the the script, _arraydisplay works like hell, but the problem it's with listview, i don't know why #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <String.au3> #include <inet.au3> #include <IE.au3> $gui = GUICreate("ListBiew items", 400, 320, -1, -1, -1) $listview = GUICtrlCreateListView("ID|Data", 10, 10, 380, 280);,$LVS_SORTDESCENDING) GUICtrlSetState(-1, $GUI_DROPACCEPTED) ; to allow drag and dropping GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 188) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 188) GUISetState() $button = GUICtrlCreateButton ("install",165,290,70,20) $file = _INetGetSource('http://www.autoitscript.com/autoit3/files/beta/update.dat') $ssection = IniReadSectionNamesText($file,True) _ArrayDisplay($ssection) $SectionData = "" For $i = 1 To $ssection[0] GUICtrlCreateListViewItem($ssection[$i], $listview) Next GUICtrlSendMsg($ListView, 0, 0, 100) Do $msg = GUIGetMsg() if $msg = $button Then $test= _StringBetween(GUICtrlRead(GUICtrlRead($listview)), '', '|') Global $idselector=$test[0] write() EndIf Until $msg = $GUI_EVENT_CLOSE Func IniReadSectionNamesText($Text,$Binary = False) if ($Binary) Then $Text = BinaryToString($Text) $TLen = StringLen($Text) Local $RTArray[1][2] , $UBound = 0 For $A = 1 To $TLen $CharA = StringMid($Text,$A,2) if (StringIsCRLF($CharA) Or $A = 1) Then $A = StringExceedsCRLF($Text,$A) For $B = $A To $TLen $CharB = StringMid($Text,$B,1) if (Not CharIsSpace($CharB)) Then For $C = $B To $TLen $CharC = StringMid($Text,$C,1) if (StringCompare($CharC,"[") = 0) Then For $D = $C + 1 To $TLen $CharD = StringMid($Text,$D,1) if (Not CharIsSpace($CharD)) Then For $E = $D To $TLen $CharE = StringMid($Text,$E,1) if (Not CharIsSpace($CharE)) Then For $F = $E To $TLen $CharF = StringMid($Text,$F,1) if (StringCompare($CharF,"]") = 0) Then if ($F = $TLen) Then $UBound += 1 ReDim $RTArray[$UBound] $RTArray[$UBound - 1] = StringMid($Text,$D,$F - $D) Return $RTArray EndIf For $G = $F + 1 To $TLen $CharG = StringMid($Text,$G,1) $CharH = StringMid($Text,$G,2) if (Not CharIsSpace($CharG)) Then if (StringIsCRLF($CharH)) Then $UBound += 1 ReDim $RTArray[$UBound] $RTArray[$UBound - 1] = StringMid($Text,$D,$F - $D) ExitLoop 6 Else if ($G = $TLen) Then $UBound += 1 ReDim $RTArray[$UBound] $RTArray[$UBound - 1] = StringMid($Text,$D,$F - $D) Return $RTArray EndIf ExitLoop 6 EndIf EndIf if ($G = $TLen) Then $UBound += 1 ReDim $RTArray[$UBound] $RTArray[$UBound - 1] = StringMid($Text,$D,$F - $D) Return SetError(0,0,$RTArray) EndIf Next Else EndIf if ($F = $TLen) Then if ($UBound > 0) Then Return SetError(0,0,$RTArray) Else Return SetError(1,0,$RTArray) EndIf EndIf Next EndIf if ($E = $TLen) Then if ($UBound > 0) Then Return SetError(0,0,$RTArray) Else Return SetError(1,0,$RTArray) EndIf EndIf Next EndIf if ($D = $TLen) Then if ($UBound > 0) Then Return SetError(0,0,$RTArray) Else Return SetError(1,0,$RTArray) EndIf EndIf Next Else ExitLoop 2 EndIf if ($C = $TLen) Then if ($UBound > 0) Then Return SetError(0,0,$RTArray) Else Return SetError(1,0,$RTArray) EndIf EndIf Next EndIf if ($B = $TLen) Then if ($UBound > 0) Then Return SetError(0,0,$RTArray) Else Return SetError(1,0,$RTArray) EndIf EndIf Next EndIf if ($A = $TLen) Then if ($UBound > 0) Then Return SetError(0,0,$RTArray) Else Return SetError(1,0,$RTArray) EndIf EndIf Next if ($UBound > 0) Then Return SetError(0,0,$RTArray) Else Return SetError(1,0,$RTArray) EndIf EndFunc Func StringIsCRLF($String) if StringCompare($String,@CRLF) = 0 Then Return 1 Return 0 EndFunc Func StringExceedsCRLF($Text,$Pos) $A = $Pos $TLen = StringLen($Text) While $A <> $TLen $CharA = StringMid($Text,$A,1) if StringCompare($CharA,@CR) <> 0 And _ StringCompare($CharA,@LF) <> 0 Then ExitLoop $A += 1 WEnd Return $A EndFunc Func CharIsSpace($CharA) if StringCompare($CharA," ") = 0 Then Return 1 Return 0 EndFunc nvm i found the problem, it was from selector reader, i found an sweet udf and it works like hell #include <Inet.au3> #include <Array.au3> #include "IniString.au3" #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ListViewConstants.au3> #include <String.au3> #include <IE.au3> $gui = GUICreate("ListBiew items", 400, 320, -1, -1, -1) $listview = GUICtrlCreateListView("ID|Data", 10, 10, 380, 280) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 188) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 188) GUISetState() $button = GUICtrlCreateButton ("install",165,290,70,20) $sSource_Mem_Ini = _InetGetSource("http://www.autoitscript.com/autoit3/files/beta/update.dat") $aReadSectionNames = _IniString_ReadSectionNames($sSource_Mem_Ini) For $i = 1 To $aReadSectionNames[0] GUICtrlCreateListViewItem($aReadSectionNames[$i], $listview) Next Do $msg = GUIGetMsg() if $msg = $button Then $test= _StringBetween(GUICtrlRead(GUICtrlRead($listview)), '', '|') MsgBox(0,"",$test[0]) EndIf Until $msg = $GUI_EVENT_CLOSE thank you guinness for the your effort, i think i got the FOR thing thank's to you, i gonna save that damn segment to know next time, i wish you an good night and all good on the world Regards, Emanuel
  14. $gui = GUICreate("ListBiew items", 400, 320, -1, -1, -1) $listview = GUICtrlCreateListView("ID|Date", 10, 10, 380, 280) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 188) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 188) GUISetState() $button = GUICtrlCreateButton ("install",165,290,70,20) $file = _INetGetSource('http://aaaaaa/data.txt') $ssection = IniReadSectionNamesText($file,True) For $i = 1 To $ssection[0] GUICtrlCreateListViewItem($ssection[$i], $listview) Next GUICtrlSendMsg($ListView, 0, 0, 100) Do $msg = GUIGetMsg() if $msg = $button Then $test= _StringBetween(GUICtrlRead(GUICtrlRead($listview)), '', '|') write() EndIf Until $msg = $GUI_EVENT_CLOSE i used listview because i need the $button to make the write of keys below that section, could you please help be with it, honest i don't know the for thing, and i think i will never understand it, always don't work...
  15. sorry taking you precious time, i'm dumb...i really don't get the FOR thing i don't see where is the wrong, but it is wrong somewhere, 0 rezults in listview For $i = 1 To $ssection[0] GUICtrlCreateListViewItem($ssection[$i], $listview) Next
  16. i got it, i can use similar to this but how to make it to don't get error incorect nr for subscripts, i mean to automate it $i=$i+1 until it's the last? the "10" to be N where N it's the last array $file = _INetGetSource('http://asdasd/data.txt') $ssection = IniReadSectionNamesText($file,True) $SectionData = "" For $i = 1 To 10 GUICtrlCreateListViewItem($ssection[$i], $listview) Next
  17. one more question, could you help me to do an FOR segment for it, i really don't know the FOR thing and all the time it's an obstacle for me here is my script $var = _INetGetSource('http://home.kymy32.co.cc/data.txt') $RTArray = IniReadSectionNamesText($var,True) _ArrayDisplay($RTArray, "Section Names") i would like to make it with msgbox to be able to set it to listview and i really don't have any clue how to use FOR -> $RTArray[0] $RTArray[1] $RTArray[2] etc nevermind...how i see it is an perfect example in help @for FOR $element IN $aArray $string = $string & $element &"|" NEXT
  18. ups...ma' bad...i'm dumbthank yo very much for the tip, you saved me Regards, Emanuel
  19. i found it, but nothing helpful, what i need is to tell me the section names, in the ini will be alot of section names, unknown, and what i need to do it's to catch them all and put them in listview
  20. hello guys i have an little problem, i have an ini read from internet function, but i don't know how to make other to read section names could you guys please help me with this please? ini example [user1] ID=id1 Pass=password1 [user2] ID=id2 Pass=password2 [user3] ID=id3 Pass=password3 and here is the ini key reader Func _InetIniRead($s_url, $v_section, $v_key, $v_default = -1) If $v_default = -1 Or $v_default = Default Then $v_default = "" Local $s_text = _INetGetSource($s_url) If $s_text = "" Then Return SetError(1, 0, $v_default) $s_text = @CRLF & $s_text & @CRLF $v_section = StringStripWS($v_section, 7) Local $a_data = StringRegExp($s_text, "(?s)(?i)\n\s*\[\s*" & $v_section & "\s*\]\s*\r\n(.*?)(?m:\[|\z)", 3) If IsArray($a_data) = 0 Then Return SetError(2, 0, $v_default) Local $a_read = StringRegExp(@LF & $a_data[0], "(?s)(?i)\n\s*" & $v_key & "\s*=(.*?)\r", 1) If IsArray($a_read) = 0 Then Return SetError(3, 0, $v_default) Return $a_read[0] EndFunc could you please help me with an function for section read? thank you
  21. hello, can be made an script when i use multiple rows with quotes, to make it in one row it's ugly and pretty hard how to make multiple rows with same quote? for ex "dataone"& "datatwo"& "data3" thank you i found it "row1"&_ "row2"&_ "row3"
  22. i think this is it, you save my day, honestlythank you very very much, i search the help but only for data and i didn't find any helping thing thank you again mate have an good day
  23. hello everyone i have an small problem, can somebody please give me some idea how to do current date+ x days(7,10,15,20days etc) i don't need all done script, i need an idea how to do it, i want to have gui like this $data = GUICtrlCreateCombo("", 40, 32, 137, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "7days|10days|15days|20days|30days|60days|90days|120days|180days|365days", "7days") and when i msgbox an button to show me the curent date+$data any ideas how to do it without changing current date of windows? thank you, i waiting your feedback's good day
  24. thank you for the topic, it's exactly what i need it, works like hell, i love it! thank you again regards, emanuel
  25. hi everyone, i have an simple question, it's there possible to make an tool to search on screen using an image, i mean, an small image cuted from screen and to find the position of that cut in screen, for example, on screen it's an image of multiple houses, i cut one house, same pixels, and use it like source for the script for searching the screen and find the position of the house in screen i have some ideas how to make it using arrays and pixels read, but i want to see some opinions, maybe some ides, i will be glad to see new ideas, and i want you guys if you have an little free time to give your opinion about it, i don't have many experience in autoit, i mean i didn't do many tools to see the speed reaction for this kind of tool, can you tell me, it will work well? i mean it will be slow? how slow? thank you, and i waiting some opinions and maybe some ideas regards
×
×
  • Create New...