Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/27/2020 in all areas

  1. Beege

    Tiny CPU Bar

    Here is a small and simple little script for creating a tiny cpu indicator bar that sits right above the taskbar like in the pic below. I got the idea from an android phone app called micro cpu and liked the concept. _TinyCPU.au3
    3 points
  2. Purpose (from Microsoft's website) The HTTP Server API enables applications to communicate over HTTP without using Microsoft Internet Information Server (IIS). Applications can register to receive HTTP requests for particular URLs, receive HTTP requests, and send HTTP responses. The HTTP Server API includes SSL support so that applications can exchange data over secure HTTP connections without IIS. Description There have been several times in the past that I wanted to either retrieve information from one of my PCs or execute commands on one of my PCs, whether it was from across the world or sitting on my couch. Since AutoIt is one of my favorite tools for automating just about anything on my PC, I looked for ways to make to make it happen. Setting up a full blown IIS server seemed like overkill so I looked for lighter weight solutions. I thought about creating my own AutoIt UDP or TCP servers but that just wasn't robust enough, Then I found Microsoft's HTTP Server API and it looked very promising. After doing a little research into the APIs, I found that it was flexible & robust enough to handle just about any of the tasks that I required now and in the future. So a while back I decided to wrap the API functionality that I needed into an AutoIt UDF file to allow me to easily create the functionality I needed at the time. It has come in very handy over the years. Of course it wasn't all wrapped up with a nice little bow like it is now. That only happened when I decided to share it with anyone else who could use it or learn from it. The example file that I included is a very granular example of the steps required to get a lightweight HTTP Server up and listening for GET requests. The UDF is a wrapper for the Microsoft APIs. That means to do anything over and above what I show in the example, one would probably have to have at least a general knowledge of APIs or the ability to figure out which APIs/functions to use, what structures and data is needed to be passed to them, and in what order. However, the UDF gives a very solid foundation on which to build upon. Of course, if anyone has questions about the UDF or how to implement any particular functionality, I would probably help to the extent that I could or point you in the right direction so that you can figure out how to implement your own solution. Being that this is basically an AutoIt wrapper for the Microsoft API functions, there's no need to create AutoIt-specific documentation. All of the UDF functions, structures, constants, and enumerations are named after their Microsoft API counterparts. Therefore, you can refer to Microsoft's extensive documentation of their HTTP Server API. The APIs included in the UDF are the only ones that I have needed in the past to do what I needed to do. If you would like any additional APIs to be added to the UDF file, please suggestion them. Related Links Microsoft HTTP Server API - Start Page Microsoft HTTP Server API - API v2 Reference Microsoft HTTP Server API - Programming Model >>> See screen shots and DOWNLOAD in the Files section <<<
    1 point
  3. Hi here's another UDF for the serial port. It is very similar to CommAPI using kernel32.dll, but all code is packed into a single file without any dependencies, not even using WinAPI.au3. It differs from existing UDF that it doesn't allow a timeout when reading, instead it always returns immediately, either with the requested amount ob bytes read or with a failure status. And of course there is a function provided to query the amount of available bytes in the receive buffer. The reason behind this design decision: You can do 1000 other things in the main loop while checking from time to time if enough data bytes arrived. There's no point to block the program waiting for the serial port. It is currently a work-in-progress, as I didn't test all functions yet. The code was developed and tested on Windows 7 64 bit. The ComUDF-Tests.au3 shows some tests and basic usage of the UDF. Maybe there's no reason to use this UDF, given the existence of the others UDFs, but I did it to get to know DllCall better - I use structs no only to pass but also to get data back (I don't use the array returned by DllCall to read that data, unless required). You're welcome to test it on older and newer Windows versions. Here's a list of the implemented functions: ; _ComListPorts ; _ComOpenPort ; _ComSetTimeouts ; _ComClosePort ; ; _ComSetBreak ; _ComClearBreak ; _ComGetInputcount ; _ComGetOutputcount ; _ComClearOutputBuffer ; _ComClearInputBuffer ; ; _ComSendByte ; _ComReadByte ; _ComSendBinary ; _ComReadBinary ; ; _ComSendChar ; _ComReadChar ; _ComSendCharArray ; _ComReadCharArray ; _ComSendString ; _ComReadString ; ; __ComClearCommError ; __PurgeComm Maze ComUDF.au3 ComUDF-Tests.au3
    1 point
  4. About AutoIt-API-WS AutoIt-API-WS is a light weight web server with expressive syntax, with the sole purpose of wrapping your existing AutoIt app with little to no effort. With AutoIt-API-WS you can send and receive data between any application or framework, as long they can handle HTTP requests, which is an industry standard today. Like my other communcations UDF AutoIt-Socket-IO AutoIt-API-WS is heavily inspired from the big boys, but this time its Laravel and Ruby on Rails. Features Highlights No external or internal dependencies required RESTful mindset when designed Expressive syntax Small codebase Heavy use of Michelsofts Dictionary object Limitations Not complient with any RFC, so something important could be missing. Time will tell! One persons slow loris attack will kill the process forever. Example of implemetnation (With screenshots) This is a basic cRud operation with the RESTful mindset in use. #include "API.au3" #include <Array.au3> _API_MGR_SetName("My APP DB adapter") _API_MGR_SetVer("1.0 BETA") _API_MGR_SetDescription("This adapter allows you to get this n that") _API_MGR_Init(3000) _API_MGR_ROUTER_GET('/users', CB_GetUsers, 'string sortBy', 'Get all users, sortBy can be either asc or desc. asc is default') _API_MGR_ROUTER_GET('/users/{id}', CB_GetUsersById, 'int id*', 'Get user by id') While _API_MGR_ROUTER_HANDLE() WEnd Func DB_GetUsers() Local $userA = ObjCreate("Scripting.Dictionary") Local $userB = ObjCreate("Scripting.Dictionary") $userA.add('id', 1) $userA.add('name', 'TarreTarreTarre') $userA.add('age', 27) $userB.add('id', 2) $userB.add('name', @UserName) $userB.add('age', 22) Local $aRet = [$userA, $userB] Return $aRet EndFunc Func CB_GetUsers(Const $oRequest) Local $aUsers = DB_GetUsers() If $oRequest.exists('sortBy') Then Switch $oRequest.item('sortBy') Case Default Case 'asc' Case 'desc' _ArrayReverse($aUsers) EndSwitch EndIf Return $aUsers EndFunc Func CB_GetUsersById(Const $oRequest) Local Const $aUsers = DB_GetUsers() Local $foundUser = Null For $i = 0 To UBound($aUsers) -1 Local $curUser = $aUsers[$i] If $curUser.item('id') == $oRequest.item('#id') Then $foundUser = $curUser ExitLoop EndIf Next If Not IsObj($foundUser) Then Return _API_RES_NotFound(StringFormat("Could not find user with ID %d", $oRequest.item('#id'))) EndIf return $foundUser EndFunc When you visit http://localhost:3000 you are greeted with this pleasent view that will show you all your registred routes and some extra info you have provided. When you visit http://localhost:3000/users the UDF will return the array of objects as Json And here is an example of http://localhost:3000/users/1 More examples can be found here (NEWEST 2020-09-21) Autoit-API-WS-1.0.3-beta.zip OLD VERSIONS Autoit-API-WS-1.0.0-beta.zip Autoit-API-WS-1.0.1-beta.zip
    1 point
  5. I can TCP/IP in AutoIt, hence, make a HTTP deamon. Now, how can I HTTPS to use SSL !?? Well, Apache has this "mod_proxy.so" module that can let me have SSL and what not is in Apache. All that is needed is to tell Apache what I wanna do by editing httpd.conf . # Implements a proxy/gateway for Apache. # 1. Open /Applications/XAMPP/etc/httpd.conf # 2. Enable the following Modules by removing the # at the front of the line. # - LoadModule rewrite_module modules/mod_rewrite.so # - LoadModule proxy_module modules/mod_proxy.so # - LoadModule proxy_http_module modules/mod_proxy_http.so # # 3. Copy and Paste below to the bottom of httpd.conf # <IfModule mod_proxy.c> ProxyRequests On <Proxy *> Order deny,allow Allow from all </Proxy> ProxyVia Off ProxyPreserveHost Off ProxyPass /home/ http://127.0.0.1:84/home/ ProxyPassReverse /home/ http://127.0.0.1:84/home/ SetEnv proxy-nokeepalive 1 # ..since we are not using "keep-alive", we are using "close" </IfModule> ...et voila I'm using XAMPP ( https://www.apachefriends.org/download.html ) and this is my solution to avoid coding in PHP, as I feel more comfortable coding in AutoIt. A "muli-thread or concurrency" can be done by forking the socket ( https://www.autoitscript.com/forum/topic/199177-fork-udf-ish/ ) but responses are under 20 ms., so I feel fine with a single thread. I modified an example ( attached below ), so can try out the concept. PS: I am not an Apache guru. I just discovered this and it opens a world of possibilities. In my case, I'm thinking of an API to query SQLite PS2: I'm not gonna make Poll but do click like if you do 201673-json-http-post-serverlistener.au3
    1 point
  6. Aceguy

    FFXI CRAFTING BOT

    Its not perfect but give it a go. (dont carry any expensive items, wouldnt want it to drop them, tho its never happened to me) Done lots and lots and lots of testing..... you may have to change the pixel detection for the 6 crystal types..... Any comments or suggestion......... i also have a summoner bot which detcts low mp then rest till full then carrys on casting and casting and casting......... if your a SMN youll know what i mean.. Just a quick question is anyone can answer, why do i have to click 1x on top combo then 2x on one undernearth to bring up list (maybe once to activate it then another to bring up list) one last thing, a B I G thanks to all who helped me within these forums, i couldnt have done it without your help THANKS YOU. AutoItSetOption("SendKeyDelay", 45); AutoItSetOption("SendKeyDownDelay", 45); Global Const $WM_COMMAND = 0x0111 Global Const $LBN_SELCHANGE = 1 Global Const $LBN_DBLCLK = 2 #include <GUIConstants.au3> #include <GuiListView.au3> #include <Array.au3> #include <Guilist.au3> #include <Guicombo.au3> #Include <Misc.au3> Dim $Lastselected = "" Dim $IniFile = @MyDocumentsDir & "\Recipes.ini" $op = FileOpen($IniFile, 0) If $op = -1 Then msgbox (0,"PLEASE READ","This proram does not read or alter any FFXI files in anyway, however this is a bot program that reads the information on the screen. "&@CRLF&"Having said that please ensure you have Windower installed and running at 800x600 res. ENJOY",0) MsgBox(0, "", "Recipes File Not Found, Creating One", 2) If Not IsDeclared("sInputBoxAnswer") Then Dim $sInputBoxAnswer $sInputBoxAnswer = InputBox("Inventory Slots", "How many item slots do you have." & @CRLF, "", " ", "200", "100", "-1", "-1") Select Case @error = 0;OK - The string returned is valid Case @error = 1;The Cancel button was pushed Case @error = 3;The InputBox failed to open EndSelect IniWrite($IniFile, 'New', '', '') IniWrite($IniFile, 'Config', 0, $sInputBoxAnswer) MsgBox(0, "Learnin you Auction House Code", "Please ensure your but the A.H. and you have it targeted then click ok", 0) Sleep(1000) Dim $avArray[6], $I = 0 $c = 0 For $I = 0 To 5 $avArray[$I] = PixelGetColor(681 + $c, 539) $c = $c + 1 Next $sArrayString = _ArrayToString($avArray, "|") IniWrite($IniFile, 'Config', 1, $sArrayString) MsgBox(0,"","please use a crystal and Click ONCE in the Top left of the first box .Center.",0) While 1 sleep(200) If _IsPressed(01) Then $m_pos= MouseGetPos() MsgBox(0,"",$m_pos[0]&" "&$m_pos[1],0) IniWrite($IniFile,'Config',2,$m_pos[0]) IniWrite($IniFile,'Config',3,$m_pos[1]) ExitLoop EndIf WEnd EndIf Dim $inifile3 = @MyDocumentsDir & "\Locations.ini" $op3 = FileOpen($inifile3, 0) If $op3 = -1 Then MsgBox(0, "", "Locations File Not Found, Creating One", 2) FileWrite($inifile3, '[New]') EndIf Dim $Inifile2 = @MyDocumentsDir & "\Chars.ini" $op2 = FileOpen($Inifile2, 0) If $op2 = -1 Then MsgBox(0, "", "Chars File Not Found, Creating One", 2) FileWrite($Inifile2, '[New]') EndIf Global $number_gui, $rec, $chbx, $pice $Form1 = GUICreate("FFXI", 175, 425, 850, 150) GUISetBkColor(0x555555) $Go = GUICtrlCreateButton("Synth Recipie", 10, 75, 75, 25) GUICtrlSetResizing(-1, $GUI_DOCKALL) $show_recipie = GUICtrlCreateButton("EDIT", 95, 75, 75, 25) GUICtrlSetResizing(-1, $GUI_DOCKALL) $Recipie = GUICtrlCreateCombo("New", 10, 40, 160, 250, BitOR($CBS_DROPDOWNLIST, $WS_VSCROLL)) GUICtrlSetResizing(-1, $GUI_DOCKALL) GUICtrlSetFont(-1, 12) $checkCN = GUICtrlCreateCheckbox("Image Sup.", 10, 125) GUICtrlSetColor($checkCN,0xffffff) GUICtrlSetResizing(-1, $GUI_DOCKALL) GUICtrlSetFont(-1, 8) $auto_sort2 = GUICtrlCreateCheckbox("Auto Sort", 100, 125) GUICtrlSetResizing(-1, $GUI_DOCKALL) GUICtrlSetColor(-1,0xffffff) $as = GUICtrlRead($auto_sort2) GUICtrlSetFont(-1, 8) $AH_seller = GUICtrlCreateButton("Sell", 10, 155, 75, 20) GUICtrlSetResizing(-1, $GUI_DOCKALL) $Qty_synth = GUICtrlCreateInput(0, 10, 105, 50, 20, $ES_NUMBER) GUICtrlSetResizing(-1, $GUI_DOCKALL) GUICtrlSetBkColor(-1, 0xff0000) GUICtrlCreateLabel("Qty to Synth", 65, 105, 100, 20) GUICtrlSetResizing(-1, $GUI_DOCKALL) GUICtrlSetFont(-1, 12) GUICtrlSetColor(-1,0xffffff) $ah_price = GUICtrlCreateInput(0, 130, 155, 35, 20, $ES_NUMBER) GUICtrlSetResizing(-1, $GUI_DOCKALL) ControlDisable($Form1, "", $ah_price) GUICtrlSetBkColor($ah_price, 0xffffff) GUICtrlCreateLabel("Price", 90, 160) GUICtrlSetResizing(-1, $GUI_DOCKALL) GUICtrlSetFont(-1, 11) GUICtrlSetColor(-1,0xffffff) $wait_sell = GUICtrlCreateInput(0, 10, 185, 50, 25) GUICtrlSetResizing(-1, $GUI_DOCKALL) $wait_sell_updn = GUICtrlCreateUpdown($wait_sell, $UDS_ALIGNRIGHT) GUICtrlSetResizing(-1, $GUI_DOCKALL) GUICtrlSetLimit($wait_sell_updn, 60, 0) GUICtrlCreateLabel("Mins, 0=Do 1x only", 65, 190) GUICtrlSetResizing(-1, $GUI_DOCKALL) GUICtrlSetColor(-1,0xffffff) $recent = GUICtrlCreateList("", 10, 220, 155, 160, BitOR($WS_BORDER, $WS_VSCROLL,$WS_HSCROLL)) GUICtrlSetResizing(-1, $GUI_DOCKALL) GUICtrlSetFont(-1, 10) GUICtrlCreateLabel("Log Window, Recent at Bottom", 10, 375) GUICtrlSetResizing(-1, $GUI_DOCKALL) GUICtrlSetColor(-1,0xffffff) $ins = GUICtrlCreateButton("Show Ingred", 10, 400, 75, 20) GUICtrlSetResizing(-1, $GUI_DOCKALL) $craft = GUICtrlCreateButton("Craft Help", 90, 400, 75, 20) GUICtrlSetResizing(-1, $GUI_DOCKALL) GUICtrlSetTip(-1, "Inv. Sort") $Invent_tracker = GUICtrlCreateButton("Inv. Tracker", 10, 10, 80, 25) GUICtrlSetResizing(-1, $GUI_DOCKALL) $Guild = GUICtrlCreateCombo("Guild", 100, 10, 70, 25, BitOR($CBS_DROPDOWNLIST, $WS_VSCROLL)) GUICtrlSetResizing(-1, $GUI_DOCKALL) GUICtrlSetData($Guild, "Cooking|Woodworking|Alchemy|Goldsmithing|Clothcraft|Bonecraft") $craft_size = 0 $IT_size_1 = 0 GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND") GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $recent $Selected = GUICtrlRead ( $recent ) Case $msg = $Invent_tracker If $IT_size_1 = 0 Then $size_main = WinGetPos("FFXI") WinMove("FFXI", "", $size_main[0], $size_main[1], $size_main[2] + $size_main[2] + 50) $IT_size_1 = 1 ControlDisable($Form1, "", $Recipie) ControlDisable($Form1, "", $show_recipie) ControlDisable($Form1, "", $Go) Itracker() Else $size_main = WinGetPos("FFXI") WinMove("FFXI", "", $size_main[0], $size_main[1], ($size_main[2] - 50) / 2) $IT_size_1 = 0 ControlEnable($Form1, "", $show_recipie) ControlEnable($Form1, "", $Go) ControlEnable($Form1, "", $Recipie) EndIf Case $msg = $Qty_synth $q = GUICtrlRead($Qty_synth) If $q = 0 Then GUICtrlSetBkColor($Qty_synth, 0xff0000) Else GUICtrlSetBkColor($Qty_synth, 0xffffff) EndIf Case $msg = $auto_sort2 $as = GUICtrlRead($auto_sort2) Case $msg = $Guild GUICtrlSetData($Recipie, "") $var = IniReadSectionNames($IniFile) _ArraySort($var, 0, 1) For $i_n = 1 To $var[0] If $var[$i_n] <> "Config" Then $gn = IniRead($IniFile, $var[$i_n], 0, "") $g_n = StringSplit($gn, '|') if not @error then If $g_n[4] = "N/A" Then $gn = IniRead($IniFile, $var[$i_n], 1, "") $g_n = StringSplit($gn, '|') EndIf If $g_n[4] = GUICtrlRead($Guild) Then GUICtrlSetData($Recipie, $var[$i_n], "") EndIf EndIf EndIf Next Case $msg = $Recipie ;recipe editor $rec = GUICtrlRead($Recipie) $it_found_sell = 0 $it_found_synth = 0 For $var_split = 0 To 10 $info_split = IniRead(@MyDocumentsDir & "\Recipes.ini", $rec, $var_split, "") $splt = StringSplit($info_split, "|") If @error = 0 Then $id_crystal_ini = $splt[1] If $id_crystal_ini = "Sell" Then $price = $splt[5] $it_found_sell = 1 GUICtrlSetData($ah_price, $price) ElseIf $id_crystal_ini <> "Sell" Then $it_found_synth = 1 GUICtrlSetState($AH_seller, $GUI_ENABLE) EndIf EndIf Next If $it_found_sell = 0 Then GUICtrlSetState($AH_seller, $GUI_DISABLE) GUICtrlSetData($ah_price, 0) EndIf If $it_found_synth = 0 Then GUICtrlSetState($Go, $GUI_DISABLE) Else GUICtrlSetState($Go, $GUI_ENABLE) EndIf Case $msg = $show_recipie ControlDisable($Form1, "", $Invent_tracker) $edit_state = GUICtrlSetData($show_recipie, "Close Editor") $size_main = WinGetPos("FFXI") WinMove("FFXI", "", $size_main[0], $size_main[1], $size_main[2] + $size_main[2] + 50) If $craft_size = 1 Then $size_main = WinGetPos("FFXI") WinMove("FFXI", "", $size_main[0], $size_main[1], $size_main[2], $size_main[3] - 150) GUICtrlDelete($c_help) $craft_size = 0 EndIf recipies_add() Case $msg = $checkCN $chbx = GUICtrlRead($checkCN) Case $msg = $craft If $craft_size = 0 Then $size_main = WinGetPos("FFXI") WinMove("FFXI", "", $size_main[0], $size_main[1], $size_main[2], $size_main[3] + 150) $c_help = GUICtrlCreatePic( "C:\Documents and Settings\Us\My Documents\My Pictures\image1.jpg", 15, 430, 140, 140) GUICtrlSetResizing(-1, $GUI_DOCKALL) $craft_size = 1 ElseIf $craft_size = 1 Then $size_main = WinGetPos("FFXI") WinMove("FFXI", "", $size_main[0], $size_main[1], $size_main[2], $size_main[3] - 150) GUICtrlDelete($c_help) $craft_size = 0 EndIf Case $msg = $AH_seller ;************************************************************************************************ *********** ;************************************* START OF SELL ********************************************* ;************************************************************************************************ *********** GUICtrlSetData($recent, "") $time_at_start = GUICtrlRead($wait_sell) GUICtrlSetData($recent, "Please ensure your by the AH|") Do $rec = GUICtrlRead($Recipie) For $var_split = 0 To 10 $info_split = IniRead(@MyDocumentsDir & "\Recipes.ini", $rec, $var_split, "") $splt = StringSplit($info_split, "|") If @error = 0 Then $id_crystal_ini = $splt[1] $price = $splt[5] GUICtrlSetData($ah_price, $price) $id_read1 = $splt[6] $id_read2 = $splt[7] $id_read3 = $splt[8] If $id_crystal_ini = "Sell" Then If $price = 0 Then GUICtrlSetData($recent, "Price not set|") ElseIf $rec = "" Then GUICtrlSetData($recent, "Recipie Not Selected|") Else Sleep(1000) MouseMove(275, 15, 0) Sleep(200) MouseDown("Left") Sleep(200) MouseUp("left") Sleep(1000) $items = 7 $finish = 0 $line = 1 $yelow = 0 $ypix = 86 $sold = 0 Send("{f8}") Sleep(2000) $c = 0 $sell_start = 0 $in = IniRead($IniFile, "Config", 1, "") $insplit = StringSplit($in, "|") For $I = 1 To 6 If PixelGetColor(681 + $c, 539) = $insplit[$I]Then $sell_start = $sell_start + 1 EndIf $c = $c + 1 Next If $sell_start = 6 Then Sleep(1500) Send("{enter}") Sleep(1500) MouseMove(735, 123) Sleep(700) MouseDown("left") MouseUp("left") Sleep(2000) Send("{up}") Send("{up}") Send("{up}") Send("{up}") Send("{up}") Send("{up}") Send("{up}") Send("{up}") Sleep(500) $noitems = PixelSearch(59, 103, 275, 136, 16750261, 0, 2) If Not $noitems Then $yelow = 7 EndIf If $yelow = 0 Then Do Sleep(500) $items = PixelSearch(43, $ypix, 63, $ypix + 11, 12234894, 20) $gill = PixelSearch(292, $ypix, 299, $ypix + 11, 10588827, 10) If Not $items Then $yelow = $yelow + 1 $line = $line + 1 Send("{enter}") Sleep(1000) ElseIf $gill Then $yelow = $yelow + 1 Sleep(200) Send("{down}") $line = $line + 1 $ypix = $ypix + 18 Else Send("{down}") $line = $line + 1 $ypix = $ypix + 18 EndIf Until $line = 8 EndIf GUICtrlSetData($recent, $yelow & " Items Found!!!|") If $yelow > 0 Then Sleep(500) Send("{esc}") Sleep(500) Send("{up}") Sleep(500) Send("{enter}") Sleep(750) $line = 1 GUICtrlSetData($recent, "searching for " & $rec & "|") Do If PixelGetColor(38, 447) = $id_read1 And PixelGetColor(34, 460) = $id_read2 And PixelGetColor(51, 449) = $id_read3 Then GUICtrlSetData($recent, "Found it!!|") Sleep(500) Send("{enter}") Sleep(500) PixelSearch(26, 562, 34, 608, 16736644, 10) If @error = 1 Then $splt_price = StringSplit($price, "") $ct = $splt_price[0] - 1 Do Send("{LEFT}") $ct = $ct - 1 Until $ct = 0 $ct = $splt_price[0] For $xp = 1 To $splt_price[0] $c = $splt_price[$xp] If $c > 0 Then Do Send("{UP}") $c = $c - 1 Until $c = 0 EndIf $ct = $ct - 1 If $ct > 0 Then Send("{RIGHT}") EndIf Next $yelow = $yelow - 1 Send("{enter}") Sleep(750) Send("{up}") Sleep(500) Send("{enter}") Sleep(1500) Send("{left}") Sleep(200) Send("{enter}") Sleep(500) Send("{left}") Sleep(200) Send("{enter}") Sleep(1500) $sold = $sold + 1 If $yelow > 0 Then Send("{enter}") Sleep(1000) $line = 1 EndIf Else GUICtrlSetData($recent, "ERROR!|") $yelow = 0 Sleep(1000) Send("{esc}") Send("{esc}") EndIf Else Send("{down}") $line = $line + 1 EndIf Until $yelow = 0 Or $line > IniRead($IniFile, "Config", 0, "") EndIf Sleep(1000) Send("{esc}") Send("{esc}") Sleep(1000) Else GUICtrlSetData($recent, "Auction house not found!|") EndIf EndIf EndIf EndIf Next $time_new = GUICtrlRead($wait_sell) ;------------------------------ ;------------------------------- $rec = GUICtrlRead($Recipie) $it_found_sell = 0 $it_found_synth = 0 For $var_split = 0 To 10 $info_split = IniRead(@MyDocumentsDir & "\Recipes.ini", $rec, $var_split, "") $splt = StringSplit($info_split, "|") If @error = 0 Then $id_crystal_ini = $splt[1] If $id_crystal_ini = "Sell" Then $price = $splt[5] $it_found_sell = 1 GUICtrlSetData($ah_price, $price) ElseIf $id_crystal_ini <> "Sell" Then $it_found_synth = 1 GUICtrlSetState($AH_seller, $GUI_ENABLE) EndIf EndIf Next If $it_found_sell = 0 Then GUICtrlSetState($AH_seller, $GUI_DISABLE) GUICtrlSetData($ah_price, 0) EndIf If $it_found_synth = 0 Then GUICtrlSetState($Go, $GUI_DISABLE) Else GUICtrlSetState($Go, $GUI_ENABLE) EndIf ;---------------------------------- ;----------------------------------- Do If $time_at_start > 0 And $line < IniRead($IniFile, "Config", 0, "") Then GUICtrlSetData($recent, "") GUICtrlSetData($recent, "!!!Timer Active!!!") Sleep(60000) $time_new = $time_new - 1 GUICtrlSetData($wait_sell, $time_new) EndIf Until $time_new = 0 Or $line > IniRead($IniFile, "Config", 0, "") $time_new = $time_at_start GUICtrlSetData($wait_sell, $time_new) If $line > IniRead($IniFile, "Config", 0, "") Then GUICtrlSetData($recent, "Not Found!!!") EndIf Until $time_new = 0 Or $line > IniRead($IniFile, "Config", 0, "") ;************************************************************************************************ *********** ;*********************** END OF SELL ******************************************* ;************************************************************************************************ *********** Case $msg = $Go ;************************************************************************************************ *********** ;*********************** START OF SYNTH ******************************************* ;************************************************************************************************ *********** GUICtrlSetData($recent, "") $number_gui = GUICtrlRead($Qty_synth) $rec = GUICtrlRead($Recipie) ControlDisable($Form1, "", $Invent_tracker) ControlDisable($Form1, "", $show_recipie) If $number_gui = 0 Then GUICtrlSetData($recent, "You Can't Have 0 Synths|") ElseIf $rec = "" Then GUICtrlSetData($recent, "Recipie Not Selected|") Else GUICtrlSetData($recent, "Synthing " & $rec & " |") $end = 0 $synthdone = 0 $mousex = (IniRead($IniFile,'Config',2,"")-33) $mousey = IniRead($IniFile,'Config',3,"") $finish = 0 Do $cry = 0 $terminate = 0 $line = 1 Sleep(1000) MouseMove(275, 15, 0) Sleep(500) MouseDown("Left") Sleep(200) MouseUp("left") Sleep(1000) ;check for image support If $chbx = 1 Then $imsupp = PixelSearch(152, 86, 200, 98, 12697367, 1) If $imsupp Then Send("{F8}") Sleep(500) Send("{enter}") Sleep(2000) Send("{up}") Sleep(200) Send("{up}") Sleep(200) Send("{enter}") Sleep(200) Send("{up}") Sleep(200) Send("{enter}") Sleep(200) Send("{enter}") Sleep(5000) EndIf EndIf invent() For $var_split = 0 To 10 $info_split = IniRead(@MyDocumentsDir & "\Recipes.ini", $rec, $var_split, "") $splt = StringSplit($info_split, "|") If @error = 0 And $line < IniRead($IniFile, "Config", 0, "") And $cry <= 1 Then $id_crystal_ini = $splt[1] $id_name_ini = $splt[2] $no = $splt[3] $id_read1 = $splt[5] $id_read2 = $splt[6] $id_read3 = $splt[7] $id_read4 = $splt[8] If $id_crystal_ini <> "Sell" Then If $cry = 0 Then If $id_crystal_ini = "Water" Then $idc = 11985151 ElseIf $id_crystal_ini = "Fire" Then $idc = 13139580 ElseIf $id_crystal_ini = "Dark" Then $idc = 395526 ElseIf $id_crystal_ini = "Ice" Then $idc = 7120889 ElseIf $id_crystal_ini = "Earth" Then $idc = 12892794 ElseIf $id_crystal_ini = "Wind" Then $idc = 8174435 ElseIf $id_crystal_ini = "Lightning" Then $idc = 13613032 EndIf If $cry < 4 Then addcrystal() EndIf If $cry = 1 Then additem() EndIf Else If $cry < 4 Then additem() EndIf EndIf Else $terminate = 1 EndIf EndIf Next If $line <= IniRead($IniFile, "Config", 0, "") - 1 And $cry = 1 Then MouseMove(177, 117, 2) Sleep(500) MouseDown("left") Sleep(300) MouseUp("left") Sleep(20000) Send("{esc}") Send("{esc}") Send("{esc}") $mousex = IniRead($IniFile,'Config',2,"")-33 $mousey = IniRead($IniFile,'Config',3,"") $number_gui = $number_gui - 1 GUICtrlSetData($Qty_synth, $number_gui) GUICtrlSetData($recent, "") If $as = 1 Then inventory_sort() EndIf Else Send("{esc}") Send("{esc}") Send("{enter}") Sleep(500) Send("{esc}") Send("{esc}") Sleep(250) If $cry = 2 Then GUICtrlSetData($recent, "Ran out of " & $id_crystal_ini & " Crystals|") ElseIf $cry = 3 Then GUICtrlSetData($recent, "Crystal Found, but Inv. Full|") Send("^s{enter}") ElseIf $terminate = 1 And $cry = 0 Then GUICtrlSetData($recent, "Not A Synthable Recipie") Else GUICtrlSetData($recent, "Out of " & $id_name_ini & "'s|") EndIf SoundPlay("C:\Windows\media\Windows Xp Critical Stop.wav") $mousex = IniRead($IniFile,'Config',2,"") $mousey = IniRead($IniFile,'Config',3,"") EndIf Until $number_gui = 0 Or $line >= IniRead($IniFile, "Config", 0, "") Or $cry = 0 Or $cry >= 2 EndIf ControlEnable($Form1, "", $Invent_tracker) ControlEnable($Form1, "", $show_recipie) $q = GUICtrlRead($Qty_synth) If $q = 0 Then GUICtrlSetBkColor($Qty_synth, 0xff0000) EndIf ;************************************************************************************************ *********** ;*********************** END OF SYNTH ******************************************* ;************************************************************************************************ *********** Case $msg = $GUI_EVENT_CLOSE Or $msg = -3 GUIDelete() ExitLoop Case $msg = $ins $rec = GUICtrlRead($Recipie) $inientry = IniReadSection($IniFile, $rec) GUICtrlSetData($recent, "") If Not IsArray($inientry) Then GUICtrlSetData($recent, "No Data!!!") Else $Ingred = 0 $Ingred_2 = 0 $ingred_3 = 0 $a = IniRead($IniFile, $rec, 0, "") $aa = StringSplit($a, "|") If $aa[1] = "Sell" Then $a = IniRead($IniFile, $rec, 1, "") $aa = StringSplit($a, "|") EndIf GUICtrlSetData($recent, $aa[1] & " Crystal") For $I = 1 To $inientry[0][0] $string_split= (StringSplit($inientry[$I][1], "|")) If $string_split[1] <> "Sell" Then GUICtrlSetData($recent, $string_split[3] & " x " & $string_split[2]) $Ingred_2 = $Ingred_2 + 1 Else $Ingred = $Ingred + 1 EndIf Next If $Ingred = 1 And $Ingred_2 = 0 Then GUICtrlSetData($recent, "Not a Recipie") EndIf EndIf EndSelect WEnd ;********************************************************************************** ;************************** FUNCTIONS *********************************** ;********************************************************************************** Func MY_WM_COMMAND($hWnd, $Msg, $wParam, $lParam) $nNotifyCode = BitShift($wParam, 16) $nID = BitAnd($wParam, 0x0000FFFF) $hCtrl = $lParam If $nID = $recent Then Switch $nNotifyCode Case $LBN_DBLCLK doubleclick() Return 0 EndSwitch EndIf EndFunc func doubleclick() $Selected = GUICtrlRead ($recent) $read_double=StringSplit($Selected," ") if $read_double[0] >2 then for $ss=1 to $read_double[0] Next if $read_double[2] = "x" Then if $read_double[0] =4 then $r=$read_double[3]&" "&$read_double[4] Elseif $read_double[0]=5 Then $r=$read_double[3]&" "&$read_double[4]&" "&$read_double[5] Else $r=$read_double[3] EndIf EndIf GUICtrlSetData($recent,"") $var3 = IniReadSectionNames($inifile3) For $i_n2 = 1 To $var3[0] if $r=$var3[$i_n2] Then $var4=IniReadSection($inifile3,$var3[$i_n2]) for $i_n3= 1 to $var4[0][0] if $var4[$i_n3][1] = "Woodworking" or $var4[$i_n3][1] = "Cooking"then Else GUICtrlSetData($recent,$var4[$i_n3][1]) EndIf Next EndIf Next EndIf EndFunc Func addcrystal() Sleep(250) $cry = 0 Do $item = PixelSearch(39, 435, 50, 455, $idc, 10) If Not $item Then Sleep(200) Send("{enter}") Sleep(250) $inv_full = PixelSearch(24, 595, 33, 608, 16737678, 6) If Not $inv_full Then $cry = 3 Else $cry = 1 EndIf Else Send("{down}") $line = $line + 1 $cry = 2 EndIf Until $cry = 1 Or $cry = 3 Or $line > 10 $line = 1 EndFunc ;==>addcrystal Func additem() $finish = 0 If $line < IniRead($IniFile, "Config", 0, "") Then mmove() $line = 1 Do If PixelGetColor(42, 300) = $id_read1 And PixelGetColor(35, 290) = $id_read2 And PixelGetColor(33, 310) = $id_read3 And PixelGetColor(52, 302) = $id_read4 Then Sleep(300) Send("{enter}") Sleep(700) $qty = PixelSearch(50, 291, 65, 302, 8731199, 1) If Not $qty Then count() Else $no = $no - 1 If $no >= 1 Then $end = 1 mmove() EndIf EndIf Else Send("{down}") $line = $line + 1 EndIf Until $no <= 0 Or $line >= IniRead($IniFile, "Config", 0, "") EndIf EndFunc ;==>additem Func invent() Send("{f1}") Sleep(200) Send("{enter}") Sleep(100) Send("{down}") Sleep(100) Send("{down}") Sleep(100) Send("{down}") Sleep(100) Send("{enter}") Sleep(100) Send("{left}") Send("{left}") Send("{left}") Send("{left}") EndFunc ;==>invent Func mmove() Sleep(300) $mousex = $mousex + 33 If $mousex < ((IniRead($IniFile,'Config',2,"")*4)-10) Or $mousey < 151 Then If $mousex > 161 Then $mousex = IniRead($IniFile,'Config',2,"") $mousey = IniRead($IniFile,'Config',3,"")+33 EndIf MouseMove($mousex, $mousey, 0) Sleep(250) MouseDown("left") Sleep(200) MouseUp("left") Sleep(200) If $end = 0 Then Send("{left 6}") Else Send("{down}") EndIf Else $line = IniRead($IniFile, "Config", 0, "") EndIf EndFunc ;==>mmove Func count() $end = 0 $number = 1 If $no > 1 Then Do $checksum = PixelChecksum(60, 290, 72, 302) Send("{up}") Sleep(100) $checksum2 = PixelChecksum(60, 290, 72, 302) If $checksum = $checksum2 Then $end = 1 Else $number = $number + 1 EndIf Until $no = $number Or $end = 1 EndIf If $end = 1 Then $no = $no - $number Send("{enter}") mmove() Else Send("{enter}") $no = $no - $number EndIf EndFunc ;==>count Func inventory_sort() GUICtrlSetData($recent, "Sorting Inventory") MouseMove(275, 15, 0) Sleep(500) MouseDown("Left") Sleep(200) MouseUp("left") Sleep(1000) Send("^i") Sleep(1000) Send("{NUMPADADD}") Sleep(100) Send("{enter}") Sleep(100) Send("{up}") Sleep(100) Send("{enter}") Sleep(100) Send("{esc}{esc}{esc}") GUICtrlSetData($recent, "Inventory has been sorted") EndFunc ;==>inventory_sort Func recipies_add() $rec = GUICtrlRead($Recipie) ControlEnable($Form1, "", $ah_price) $Add = GUICtrlCreateButton("Add Record+Pixelsearch", 180, 180, 150, 25) $save = GUICtrlCreateButton("Save+Close", 180, 150, 75, 25) $crystal = GUICtrlCreateCombo("Select", 180, 110, 85, 25, BitOR($CBS_DROPDOWNLIST, $WS_VSCROLL)) GUICtrlSetData($crystal, "Sell|Fire|Water|Earth|Dark|Ice|Light|Lightning|Wind") $Input_1 = GUICtrlCreateInput("Item Name", 180, 55, 100, 25) $Input_2 = GUICtrlCreateInput(0, 370, 85, 25, 25, $ES_NUMBER) $ed_qty=GUICtrlCreateLabel("Qty",345,90) $Input_rname = GUICtrlCreateInput($rec, 180, 10, 200, 35) GUICtrlSetFont(-1, 16) $delete = GUICtrlCreateButton("Delete Record", 230, 210, 85, 25) $listview = GUICtrlCreateListView("Crys.|Item|Qty|Guild|Id1/Price|Id2|Id3|Id4", 180, 260, 220, 160) $rec = GUICtrlRead($Recipie) $inientry = IniReadSection($IniFile, $rec) $delete_all = GUICtrlCreateButton("Delete All", 330, 210, 65, 25) $cat = GUICtrlCreateCombo(GUICtrlRead($Guild), 180, 85, 85, 25, BitOR($CBS_DROPDOWNLIST, $WS_VSCROLL)) GUICtrlSetData(-1, "Cooking|Woodworking|Alchemy|Goldsmithing|Clothcraft|Bonecraft") $up = GUICtrlCreateButton("Up", 180, 210, 20, 20) $down = GUICtrlCreateButton("Dn", 180, 235, 20, 20) If Not IsArray($inientry) Then GUICtrlSetData($recent, "No Data!!!") Else ;_ArraySort($var, 0, 1) For $I = 1 To $inientry[0][0] GUICtrlCreateListViewItem($inientry[$I][1], $listview) Next EndIf $combo_inged=GUICtrlCreateCombo("New",290,55,110,150,BitOR($CBS_DROPDOWNLIST, $WS_VSCROLL)) ;-------------------------------------------------------------- $var3 = IniReadSectionNames($inifile3) _ArraySort($var3, 0, 1) For $i_n2 = 1 To $var3[0] if IniRead($inifile3,$var3[$i_n2],0,"") = guictrlread($cat) or IniRead($inifile3,$var3[$i_n2],1,"") = guictrlread($cat)Then GUICtrlSetData($combo_inged,$var3[$i_n2]) EndIf Next ;-------------------------------------------------------------- GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $up If _GUICtrlListViewGetSelectedCount($listview) = 1 And _GUICtrlListViewGetSelectedIndices($listview) + 1 > 1 Then $curindex = _GUICtrlListViewGetSelectedIndices($listview) For $x = 0 To _GUICtrlListViewGetSubItemsCount($listview) $x_i = _GUICtrlListViewGetItemText($listview, $curindex - 1, $x) _GUICtrlListViewSetItemText($listview, $curindex - 1, $x, _GUICtrlListViewGetItemText($listview, $curindex + 0, $x)) _GUICtrlListViewSetItemText($listview, $curindex - 0, $x, $x_i) Next _GUICtrlListViewSetItemSelState($listview, $curindex - 1, 1) _GUICtrlListViewSetItemSelState($listview, $curindex - 0, 0) EndIf Case $msg = $down If _GUICtrlListViewGetSelectedCount($listview) = 1 And _GUICtrlListViewGetSelectedIndices($listview) + 1 < _GUICtrlListViewGetItemCount($listview) Then $curindex = _GUICtrlListViewGetSelectedIndices($listview) For $x = 0 To _GUICtrlListViewGetSubItemsCount($listview) $x_i = _GUICtrlListViewGetItemText($listview, $curindex + 1, $x) _GUICtrlListViewSetItemText($listview, $curindex + 1, $x, _GUICtrlListViewGetItemText($listview, $curindex + 0, $x)) _GUICtrlListViewSetItemText($listview, $curindex - 0, $x, $x_i) Next _GUICtrlListViewSetItemSelState($listview, $curindex + 1, 1) _GUICtrlListViewSetItemSelState($listview, $curindex - 0, 0) EndIf Case $msg = $Add $id_crystal = GUICtrlRead($crystal) $id_name = GUICtrlRead($Input_1) if $id_name = "Item Name" or $id_name = "" Then $id_name = guictrlread($combo_inged) Else $id_name = GUICtrlRead($Input_1) EndIf $cat_2 = GUICtrlRead($cat) $id_qty = GUICtrlRead($Input_2) $true = 0 If $id_crystal <> "Sell" And $cat_2 = "Guild" Then $true = 1 EndIf If Not $id_name = "" And $id_qty > 0 And $id_crystal <> "Select" And $true = 0 Then GUICtrlSetData($recent, "CAPTURING|") Sleep(1000) MouseMove(275, 15, 0) Sleep(200) MouseDown("Left") Sleep(200) MouseUp("left") Sleep(1000) If $id_crystal <> "Sell" Then $id_read1 = PixelGetColor(42, 300) $id_read2 = PixelGetColor(35, 290) $id_read3 = PixelGetColor(33, 310) $id_read4 = PixelGetColor(52, 302) $incheck=IniReadSection($inifile3,$id_name) $test=iniread($inifile3,"Honey",0,"nothere") if @error=1 Then if $incheck[0][0] =1 and GUICtrlRead($cat) <> $test Then IniWrite($inifile3,$id_name,1,GUICtrlRead($cat)) GUICtrlSetData($combo_inged,$id_name) MsgBox(0,"","Exists, And different catagory as inifile",2) Elseif $incheck[0][0] =0 Then IniWrite($inifile3,$id_name,0,GUICtrlRead($cat)) GUICtrlSetData($combo_inged,$id_name) MsgBox(0,"","Not Exist, Creating entry",2) elseif $incheck[0][0]=1 and GUICtrlRead($cat) = $test Then MsgBox(0,"","Line exists and same catagory, not chainging",0) Else MsgBox(0,"","Nothing changed",0) EndIf Else IniWrite($inifile3,$id_name,0,GUICtrlRead($cat)) GUICtrlSetData($combo_inged,$id_name) MsgBox(0,"","Entry not found, Adding",0) EndIf Else $id_qty = 1 $id_read1 = PixelGetColor(38, 447) $id_read2 = PixelGetColor(34, 460) $id_read3 = PixelGetColor(51, 449) EndIf If $id_crystal <> "Sell" Then GUICtrlCreateListViewItem($id_crystal & "|" & $id_name & "|" & $id_qty & "|" & $cat_2 & "|" & $id_read1 & "|" & $id_read2 & "|" & $id_read3 & "|" & $id_read4 & "|", $listview) Else $price = GUICtrlRead($ah_price) If $price > 0 Then GUICtrlSetData($recent, "Setting price of " & $id_name & "|" & "... to " & $price & "|") GUICtrlCreateListViewItem($id_crystal & "|" & $id_name & "|" & $id_qty & "|" & "N/A" & "|" & $price & "|" & $id_read1 & "|" & $id_read2 & "|" & $id_read3, $listview) Else GUICtrlSetData($recent, "Selling Prince Not Set!!|") EndIf EndIf Else If $id_name = "Item Name" or $id_name = "New" Then GUICtrlSetData($recent, "Name or list not selected|") SoundPlay("C:\Windows\media\Windows XP Critical Stop.wav") ElseIf $id_qty = 0 Then GUICtrlSetData($recent, $id_qty & " Qty Not Allowed|") SoundPlay("C:\Windows\media\Windows XP Critical Stop.wav") ElseIf $id_crystal = "Select" Then GUICtrlSetData($recent, "Please Choose correct type|") SoundPlay("C:\Windows\media\Windows XP Critical Stop.wav") ElseIf $cat_2 = "Guild" And $id_crystal <> "Sell" Then GUICtrlSetData($recent, "Please Choose correct Guild|") SoundPlay("C:\Windows\media\Windows XP Critical Stop.wav") EndIf EndIf Case $msg = $delete If _GUICtrlListViewGetSelectedCount($listview) Then _GUICtrlListViewDeleteItemsSelected($listview) Else MsgBox(0, "", "Nothing selected!!!", 0) EndIf Case $msg = $GUI_EVENT_CLOSE Or $msg = $show_recipie ControlEnable($Form1, "", $Invent_tracker) GUICtrlSetData($Recipie, "") $var = IniReadSectionNames($IniFile) _ArraySort($var, 0, 1) For $i_n = 1 To $var[0] If $var[$i_n] <> "Config" Then $gn = IniRead($IniFile, $var[$i_n], 0, "") $g_n = StringSplit($gn, '|') if not @error then If $g_n[4] = "N/A" Then $gn = IniRead($IniFile, $var[$i_n], 1, "") $g_n = StringSplit($gn, '|') EndIf If $g_n[4] = GUICtrlRead($Guild) Then GUICtrlSetData($Recipie, $var[$i_n], "") EndIf EndIf EndIf Next ControlDisable($Form1, "", $ah_price) $edit_state = GUICtrlSetData($show_recipie, "Edit") $size_main = WinGetPos("FFXI") WinMove("FFXI", "", $size_main[0], $size_main[1], ($size_main[2] - 50) / 2) GUICtrlDelete($delete_all) GUICtrlDelete($cat) GUICtrlDelete($listview) GUICtrlDelete($Input_1) GUICtrlDelete($Input_2) GUICtrlDelete($Input_rname) GUICtrlDelete($crystal) GUICtrlDelete($save) GUICtrlDelete($Add) GUICtrlDelete($delete) GUICtrlDelete($up) GUICtrlDelete($down) GUICtrlDelete($combo_inged) GUICtrlDelete($ed_qty) ExitLoop Case $msg = $save ControlEnable($Form1, "", $Invent_tracker) $rn = GUICtrlRead($Input_rname) $item_count = _GUICtrlListViewGetItemCount($listview) IniDelete($IniFile, $rn) If $item_count > 0 Then For $x = 0 To _GUICtrlListViewGetItemCount($listview) - 1 If _GUICtrlListViewGetItemText($listview, $x, 0) = "Sell" Then $price = GUICtrlRead($ah_price) _GUICtrlListViewSetItemText($listview, $x, 4, $price) EndIf IniWrite($IniFile, $rn, $x, _GUICtrlListViewGetItemText($listview, $x)) Next GUICtrlSetData($Recipie, "") $var = IniReadSectionNames($IniFile) _ArraySort($var, 0, 1) For $i_n = 1 To $var[0] If $var[$i_n] <> "Config" Then $gn = IniRead($IniFile, $var[$i_n], 0, "") $g_n = StringSplit($gn, '|') if not @error Then If $g_n[4] = "N/A" Then $gn = IniRead($IniFile, $var[$i_n], 1, "") $g_n = StringSplit($gn, '|') EndIf If $g_n[4] = GUICtrlRead($Guild) Then GUICtrlSetData($Recipie, $var[$i_n], "") EndIf endif EndIf Next ControlDisable($Form1, "", $ah_price) $edit_state = GUICtrlSetData($show_recipie, "Edit") GUICtrlSetData($Recipie, $rn) $size_main = WinGetPos("FFXI") WinMove("FFXI", "", $size_main[0], $size_main[1], ($size_main[2] - 50) / 2) GUICtrlDelete($delete_all) GUICtrlDelete($cat) GUICtrlDelete($listview) GUICtrlDelete($Input_1) GUICtrlDelete($Input_2) GUICtrlDelete($Input_rname) GUICtrlDelete($crystal) GUICtrlDelete($save) GUICtrlDelete($Add) GUICtrlDelete($delete) GUICtrlDelete($up) GUICtrlDelete($down) GUICtrlDelete($combo_inged) GUICtrlDelete($ed_qty) ExitLoop Else MsgBox(0, "", "Nothing to Save!!", 0) EndIf Case $msg = $delete_all If Not IsDeclared("iMsgBoxAnswer") Then Dim $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(547, "Are You Sure......", "This will delete this record only." & @CRLF & "YES will return to main menu" & @CRLF) Select Case $iMsgBoxAnswer = 6;Yes $rn = GUICtrlRead($Input_rname) IniDelete($IniFile, $rn) GUICtrlSetData($Recipie, "") $var = IniReadSectionNames($IniFile) _ArraySort($var, 0, 1) For $i_n = 1 To $var[0] If $var[$i_n] <> "Config" Then If $var[$i_n] <> "Chars" Then GUICtrlSetData($Recipie, $var[$i_n], "") EndIf EndIf Next $edit_state = GUICtrlSetData($show_recipie, "Edit") $size_main = WinGetPos("FFXI") WinMove("FFXI", "", $size_main[0], $size_main[1], ($size_main[2] - 50) / 2) GUICtrlDelete($delete_all) GUICtrlDelete($cat) GUICtrlDelete($listview) GUICtrlDelete($Input_1) GUICtrlDelete($Input_2) GUICtrlDelete($Input_rname) GUICtrlDelete($crystal) GUICtrlDelete($save) GUICtrlDelete($Add) GUICtrlDelete($delete) GUICtrlDelete($up) GUICtrlDelete($down) GUICtrlDelete($combo_inged) GUICtrlDelete($ed_qty) ExitLoop Case $iMsgBoxAnswer = 7;No Case $iMsgBoxAnswer = 2;Cancel EndSelect Case $msg = $cat GUICtrlSetData($combo_inged,"") $var3 = IniReadSectionNames($inifile3) _ArraySort($var3, 0, 1) For $i_n2 = 1 To $var3[0] if IniRead($inifile3,$var3[$i_n2],0,"") = guictrlread($cat) Then ElseIf IniRead($inifile3,$var3[$i_n2],1,"") = guictrlread($cat) Then GUICtrlSetData($combo_inged,$var3[$i_n2]) EndIf Next EndSelect WEnd EndFunc ;==>recipies_add ;-------------------------------------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------------------------------------- Func Itracker() $char = GUICtrlCreateCombo("", 185, 10, 100, 35) $char_add = GUICtrlCreateButton("Add Char", 290, 10, 55, 25) $char_delete = GUICtrlCreateButton("Delete", 350, 10, 45, 25) $char_group = GUICtrlCreateGroup("", 180, 0, 220, 40) GUICtrlSetColor(-1, 0xff0000) $char_name = GUICtrlCreateInput("", 180, 50, 100, 25) GUICtrlSetFont(-1, 14) $char_qty = GUICtrlCreateInput("", 285, 50, 30, 25, $ES_NUMBER) GUICtrlSetFont(-1, 14) $char_level = GUICtrlCreateInput("", 320, 50, 30, 25, $ES_NUMBER) GUICtrlSetFont(-1, 14) $char_item_add = GUICtrlCreateButton("<-- Add", 355, 50, 50, 25) $char_items = GUICtrlCreateListView("Name|Qty|Level|", 180, 175, 220, 245) _GUICtrlListViewSetColumnWidth(-1, 0, 100) $char_list_item_delete = GUICtrlCreateButton("D.Item", 355, 80, 50, 25) $char_edit_qty = GUICtrlCreateButton("Edit", 285, 80, 30, 25) $var2 = IniReadSectionNames($Inifile2) If IsArray($var2) Then For $I = 1 To $var2[0] GUICtrlSetData($char, $var2[$I]) Next Else GUICtrlSetData($char, "New") EndIf Dim $B_DESCENDING[_GUICtrlListViewGetSubItemsCount($char_items) ] GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $char_edit_qty If _GUICtrlListViewGetSelectedCount($char_items) Then If GUICtrlRead($char_qty) <> "" Then _GUICtrlListViewSetItemText($char_items, _GUICtrlListViewGetSelectedIndices($char_items) + 0, 1, GUICtrlRead($char_qty)) Else GUICtrlSetData($recent, "No Input data") EndIf Else GUICtrlSetData($recent, "Select Item First") EndIf Case $msg = $char_items ; sort the list by the column header clicked on _GUICtrlListViewSort($char_items, $B_DESCENDING, GUICtrlGetState($char_items)) Case $msg = $char_list_item_delete; deletes item in listview If _GUICtrlListViewGetSelectedCount($char_items) Then _GUICtrlListViewDeleteItemsSelected($char_items) IniDelete($Inifile2, GUICtrlRead($char)) For $char_count1 = 0 To _GUICtrlListViewGetItemCount($char_items) - 1 IniWrite($Inifile2, GUICtrlRead($char), $char_count1, _GUICtrlListViewGetItemText($char_items, $char_count1)) Next Else GUICtrlSetData($recent, "Nothing selected!!!") EndIf Case $msg = $char_delete; as it says If GUICtrlRead($char) <> "" Then ;MsgBox features: Title=Yes, Text=Yes, Buttons=Yes and No, Default Button=Second, Icon=None If Not IsDeclared("iMsgBoxAnswer") Then Dim $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(260, "Are You Sure!!", "Warning All contents will be permantely deleted for this charcter.!!" & @CRLF) Select Case $iMsgBoxAnswer = 6;Yes IniDelete($Inifile2, GUICtrlRead($char)) GUICtrlSetData($char, "") $var2 = IniReadSectionNames($Inifile2) If IsArray($var2) Then For $I = 1 To $var2[0] GUICtrlSetData($char, $var2[$I]) Next Else GUICtrlSetData($char, "New") EndIf Case $iMsgBoxAnswer = 7;No EndSelect Else GUICtrlSetData($recent, "No char Selected") EndIf Case $msg = $char; is combo list $char2 = GUICtrlRead($char) $inientry2 = IniReadSection($Inifile2, $char2) _GUICtrlListViewDeleteAllItems($char_items) If Not IsArray($inientry2) Then GUICtrlSetData($recent, "No Data!!!") Else For $I = 1 To $inientry2[0][0] GUICtrlCreateListViewItem($inientry2[$I][1], $char_items) Next EndIf Case $msg = $Invent_tracker Or $msg = $GUI_EVENT_CLOSE If _GUICtrlListViewGetItemCount($char_items) > 0 Then For $char_count1 = 0 To _GUICtrlListViewGetItemCount($char_items) - 1 IniWrite($Inifile2, GUICtrlRead($char), $char_count1, _GUICtrlListViewGetItemText($char_items, $char_count1)) Next ElseIf GUICtrlRead($char) <> "" Then GUICtrlSetData($recent, "Nothing to save" & "|" & "Creating New Char.") IniWrite($Inifile2, GUICtrlRead($char), '', '') EndIf $size_main = WinGetPos("FFXI") WinMove("FFXI", "", $size_main[0], $size_main[1], ($size_main[2] - 50) / 2) $IT_size_1 = 0 ControlEnable($Form1, "", $show_recipie) ControlEnable($Form1, "", $Go) ControlEnable($Form1, "", $Recipie) GUICtrlDelete($char) GUICtrlDelete($char_add) GUICtrlDelete($char_name) GUICtrlDelete($char_items) GUICtrlDelete($char_item_add) GUICtrlDelete($char_qty) GUICtrlDelete($char_delete) GUICtrlDelete($char_list_item_delete) GUICtrlDelete($char_level) GUICtrlDelete($char_edit_qty) GUICtrlDelete($char_group) ExitLoop Case $msg = $char_add; adds character to combo list If GUICtrlRead($char_name) <> "" Then GUICtrlSetData($char, GUICtrlRead($char_name)) GUICtrlSetData($char_name, "") Else GUICtrlSetData($recent, "Nothing entered into input box") EndIf Case $msg = $char_item_add; adds item to list If GUICtrlRead($char) <> "" Then $char_it1 = GUICtrlRead($char_name) $char_it2 = GUICtrlRead($char_qty) $char_it3 = GUICtrlRead($char_level) If $char_it3 = "" Then $char_it3 = "N/A" EndIf If $char_it2 = "" Then $char_it2 = 1 EndIf If $char_it1 <> "" Then GUICtrlCreateListViewItem(GUICtrlRead($char_name) & "|" & $char_it2 & "|" & $char_it3, $char_items) For $char_count1 = 0 To _GUICtrlListViewGetItemCount($char_items) - 1 IniWrite($Inifile2, GUICtrlRead($char), $char_count1, _GUICtrlListViewGetItemText($char_items, $char_count1)) Next GUICtrlSetData($char_qty, "") GUICtrlSetData($char_level, "") Else GUICtrlSetData($recent, "boxes not filled in") EndIf Else GUICtrlSetData($recent, "Select a Charactert first") EndIf EndSelect WEnd EndFunc ;==>Itracker
    1 point
  7. Are you sure the script is actually executing? Maybe it's being "intercepted" by you AV software. Have you tried adding a MsgBox at the end that should always display to confirm that it actually ran?
    1 point
  8. Could you move the FileClose after the last FileWriteLine? This way the file is properly written to disk and the cache is emptied before calling _FileWriteToLine which reopens the file. #include <File.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> $sFileName = "C:\Temp\test.txt" $hFile = FileOpen($sFileName, 1) FileWriteLine($hFile, "test1") FileWriteLine($hFile, "test2") FileWriteLine($hFile, "test3") FileWriteLine($hFile, "test4") FileWriteLine($hFile, "test5") FileWriteLine($hFile, "test6") FileClose($hFile) _FileWriteToLine($sFileName, 3, "", True) If @error Then MsgBox(16, "error", @error)
    1 point
  9. hi test this #include <File.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> ;------------------ $sFilePath = "C:\Temp" If Not FileExists($sFilePath) Then DirCreate($sFilePath) EndIf ;--------- $FileName = "C:\Temp\test.txt" $hFile = FileOpen($FileName, 1) FileWriteLine($hFile, "test1") FileWriteLine($hFile, "test2") FileWriteLine($hFile, "test3") FileWriteLine($hFile, "test4") FileWriteLine($hFile, "test5") FileWriteLine($hFile, "test6") FileClose($hFile) ;--------- _FileWriteToLine("C:\Temp\test.txt", 3, "", True) if @error Then MsgBox(16, "error", @error) ;------------------
    1 point
  10. Well, idk how it is there, but i remember here on windows 10, if a program (32bit crimson editor in this case) is ran from the program files (x86), it saves the settings, but not in it's folder but in some virtual folder (called VirtualStore). (this happened with few other programs, which made me install/run all other apps from a different folder) If this happens on the server too, then there would be no error, because the changes were made, but the original file may be untouched. But ofc idk anything about the server version.
    1 point
  11. In this case _FileWriteToLine should return an error (3 - Error when opening file).
    1 point
  12. Maybe your executable needs admin permissions to delete/modify files on the win server ?
    1 point
  13. Which version of AutoIt do you run on the client and the server? IIRC the way how AutoIt deletes lines has been changed lately. discussed in this thread.
    1 point
  14. Then the 3rd line of your file should be empty... 🤨 at least in my tests, if I create a file 1 2 3 4 5 6 and run the script, the resulting file is (as it should be) 1 2 4 5 6 What does your resulting file look like?
    1 point
  15. Just tried it on a Server 2012R2, works fine (deleted line 3 of my test-file) How about adding another line if @error Then MsgBox(16, "error", @error) ?
    1 point
  16. 1 point
  17. Maybe a good place to start reading first:
    1 point
  18. jchd

    Use RegExp on binary data

    Please stop asserting that because it isn't true! Also you're confusing two distinct things: character set and encoding. EDIT: Also your links to regexes for validating UTF8 doesn't correctly apply to AutoIt, since we use UCS2 and not full UTF16. The high and low-surrogate codepoints are hence valid by themselves in UCS2, but not in UTF16. The correct validation should match WTF-8, not UF-8.
    1 point
  19. This is an update of the old Automating Windows Explorer example. The update includes Desktop automation. However, Windows XP code has been removed. ThreadsOther threads related to File/Windows Explorer: Implementing Windows Explorer right pane Implementing Windows Explorer address bar Enumerating and Browsing the Desktop Some of these threads are very old. I'm considering updating some of the examples: Remove Windows XP code. Implement some of the code in other ways. Enumerating and Browsing the Desktop is important to me personally because it was the first time I used the ObjCreateInterface() function. The first version of the example was based on _AutoItObject_WrapperCreate() from the AutoItObject UDF. Then I was told that you can use ObjCreateInterface() instead. Of course I had to try. Automating File/Windows Explorer and DesktopAutomating File/Windows Explorer The old example contains a description of the techniques for automating File/Windows Explorer. The techniques are based on COM interfaces. Initially, it's about getting an IShellBrowser interface based on a File/Windows Explorer window handle. An IDispatch interface for the window is important for creating the IShellBrowser interface. Through the IShellBrowser interface, you can generate a large number of interfaces that can be used to implement the automation functions. Automating DesktopBilgus figured out how to get an IDispatch interface for the Desktop in this post: $oIShellWindows.FindWindowSW( Null, Null, $SWC_DESKTOP, $hWnd, $SWFO_NEEDDISPATCH, $pIDispatch ) This is the part of the old code in the GetIShellBrowser() function that needs to be updated to include the Desktop: ; Get an IWebBrowserApp object for each window ; This is done in two steps: ; 1. Get an IDispatch object for the window ; 2. Get the IWebBrowserApp interface ; Check if it's the right window Local $pIDispatch, $oIDispatch Local $pIWebBrowserApp, $oIWebBrowserApp, $hWnd For $i = 0 To $iWindows - 1 $oIShellWindows.Item( $i, $pIDispatch ) If $pIDispatch Then $oIDispatch = ObjCreateInterface( $pIDispatch, $sIID_IDispatch, $dtag_IDispatch ) $oIDispatch.QueryInterface( $tRIID_IWebBrowserApp, $pIWebBrowserApp ) If $pIWebBrowserApp Then $oIWebBrowserApp = ObjCreateInterface( $pIWebBrowserApp, $sIID_IWebBrowserApp, $dtag_IWebBrowserApp ) $oIWebBrowserApp.get_HWND( $hWnd ) If $hWnd = $hExplorer Then ExitLoop EndIf EndIf Next And here the code to include the Desktop is added: ; Get an IWebBrowserApp object for each window ; This is done in two steps: ; 1. Get an IDispatch object for the window ; 2. Get the IWebBrowserApp interface ; Check if it's the right window Local $pIDispatch, $oIDispatch, $hRes Local $pIWebBrowserApp, $oIWebBrowserApp, $hWnd For $i = 0 To $iWindows $hRes = $i < $iWindows ? $oIShellWindows.Item( $i, $pIDispatch ) _ : $oIShellWindows.FindWindowSW( Null, Null, $SWC_DESKTOP, $hWnd, $SWFO_NEEDDISPATCH, $pIDispatch ) If $pIDispatch Then $oIDispatch = ObjCreateInterface( $pIDispatch, $sIID_IDispatch, $dtag_IDispatch ) $oIDispatch.QueryInterface( $tRIID_IWebBrowserApp, $pIWebBrowserApp ) If $pIWebBrowserApp Then $oIWebBrowserApp = ObjCreateInterface( $pIWebBrowserApp, $sIID_IWebBrowserApp, $dtag_IWebBrowserApp ) $oIWebBrowserApp.get_HWND( $hWnd ) If $hWnd = $hExplorer Then ExitLoop EndIf EndIf Next The For loop runs an extra round if a File/Explorer Window has not been identified. In this last loop, the FindWindowSW() method returns a window corresponding to the Desktop. Here, the method always returns the Program Manager window. a consequence of this implementation is that if you specify a non-existent window as a parameter to the GetIShellBrowser() function, then the function will return the Program Manager window. Thus, the Program Manager window is the default window for the function. The IDispatch interface is the important thing in terms of automating the Desktop. Then all the functions used in connection with a File/Windows Explorer window can also be used in connection with the Desktop. Except for a few functions that are not relevant for the Desktop. Functions The automation functions are coded in FileExplorer.au3. The functions are implemented using a number of Shell API functions and Shell COM interfaces coded in ShellFunctions.au3 and ShellInterfaces.au3. The old example contains a list of implemented functions. New functions GetSortColumns() GetSortColumnsEx() SetSortColumns() Examples The 7z-file contains examples for automating the Desktop and a File/Windows Explorer window. These are the same examples as in this post. Note that the examples GetFiles.au3 and GetFolders.au3 also show how to make a list of selected files and folders. Note that the GetSetIconView.au3 example can change the order of icons on the Desktop. If you don't want this, run this example only in a File/Windows Explorer window. The GUI application that was used to demonstrate the features in the old version is not included. The small examples seems to be much more useful. This post contains new examples. In both the old and the new post, the examples are shown for a File/Windows Explorer window. But the 7z-file contains similar examples for the Desktop. Forum examplesThis is a list of the most interesting examples in the old thread: The original collection of small examples Automate a file search with UI Automation code. The question that led to this answer was asked in a slightly earlier post. Execute a function on a double-click in empty space of the listview. Based on UI Automation code. Here the question was asked somewhat earlier. UI Automation code to make a selected item visible by scrolling the listview up or down 7z-fileThe 7z-file contains source code for the UDF and examples. You need AutoIt 3.3.12 or later. Tested on Windows 7 and Windows 10. Comments are welcome. Let me know if there are any issues. FileExplorerAndDesktop.7z
    1 point
×
×
  • Create New...