Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/01/2018 in all areas

  1. Fixed Redim_To_Settings issue causing crash for new users. Changed World Save, Load to use User Documents\MapIt\Worlds Fixed World_Create_Dialog() wasn't updating tile palette when tiles were loaded. Changed lasers to damage the side of tile hit. Very cool forests now :/ A closer look at the new forest lasers: A new download is available from the MapIt website.
    2 points
  2. I can't be responsible for any impact of your script or services you would run in production. | _Services_UDF v4 | | By Arcker | Run your script as a service | Req. AutoIt 3.3.8.1 min, last beta recommended ( tested in 3.3.9.21 ) |_______________________________________ ++ Preparing v5 !! Checked on 27/04/2015 <> Updated on 10/23/2013 <> Updated 07/29/2013 <> Best practices Updated 24/02/2012 -- Removed GUI code, and old codes. == Warning : 26/02/2012 <> New Version (v3 ) : 29/07/2013 | Thx to ShminkyBoy, wraithdu, Udgeen and HolmesShelock for their great contributions. Special thx to bitboy, Downloads see end of this post : ServiceExample_v4, Services.au3, ServicesConstants.au3 Presentation Here is my _Service _ UDF With this UDF, you can compile your autoit script and run it as service. Any comments are welcome. Hope you'll like it, 1 - changelog Update V4 : 23/10/2013,27/04/2015 Update : V3 on 29/07/2013 Compile the service example to see how to do then you can use the main function for your proper scriptChoose an appropriate location and copy the script here.open a command prompt, and execute the compiled script with option –I ( must be admin right since vista )start / execute "services.msc" . You will see a service called "Autoit_service". you can execute "sc query" in a command prompt too.Launch it : it will run the previous compile script. The main function will be executed after the service_init.stop and relaunch the service as you wish. Examples / Session Change / uses v1 (lock, logon, etc) By HolmesShelock. Awesome work. Edit : this example doesn't use v2 or v3 method SessionChange Service.zip Example output to give you an idea Examples demos Synoptic And for End Users, I've tried to explain the service control manager and the way it works with programs. see below Best Practice, by arcker : /! please read this if you encounter stability issues I've had to rework on services.au3 to reflect threadsafe. Threadsafe means each dll call must be on "dllopened" instead of calling dll directly for example, if you need a function in kernel32.dll, you have to open it and call it after. That's contraignant since a lot of integrated functions in autoit are not programmed this way. If you take my services.au3, at the end, you'll see reworked function to handle this change. I've not tried services for a while, since i don't need it for now, but i can help you only if your provide whole script, to see how you call every functions. I can tell that fix stability issues in callback, but i don't think it's need for your script, as far as you don't use callback. Best Practice, by udgeen : Good news! Probably i've found the working method of integrating service.au3 with other projects I realised it after ASock.au3 project by Zatorg (please, sorry if im wrong) - ASock is asynck socket - tcp on event (uses ws2_32.dll). Asock & sqlite didnt work together. The only reason for that was..._ArrayDisplay() func with gui!!! Ok. I made special sqlite.au3 without dependences. It works, but my udf seemed too be much heavy to use at another project. Few weeks ago I returned to service.au3 and found TCP UDF, Event driven project based on ASock.au3. It seemed to work as example, but didn't work at all as service. In my variant of service_example.au3 i posted msdn words about service_main procedure, that it must contain all global vars of project I'll try to post that project as an another service_example.au3 in some weeks here. If it will works. Some advice: use SysInternals Process Explorer (free gui based), or kill.exe from support tools to stop suspended service process. U can start-stop service even net start/net stop commands. Use file logging while debuging. No need to install-uninstall service after every recompilation: only stop, recompile, start. See, if it was suspended (while stopping) - kill process. The only reason not to stop service correctly i've found for today is unclean exit: opened sockets, maybe some dlls. Edit : Arcker note: too bad, that would be too easy. unclean exit is not due to opened dll, but by some more internal exit checks or something. FAQ. 1 - Hey, I've got error 1063 or error 0, what does that mean ? It simply means that you intend to run your script in scite or directly by executing it. Your script has to be installed as service and run from it. Several ways to do it : You have to combine all Globals in one place: for example at the the begining. You have to make it with other udfs too... silly workThen sort Global Const and other Global statements. If u see something like global $x = 1 do that way: global $x leeve at top. $x =1 insert into module's (udf or project) Init func.U have to do it even with standart udf... or use only necessary functions from it in your own include. Or... maybe u have another plan?Try to build your project with modified udfs - does it works now? Hmm... But it have to Maybe later after everything will work fine i'll say "msdn is wrong, microsoft lies"... But maybe i'll say that microsoft - is not so bad, because autoit works in itnet start "yourservicename"Services.mscUse API provided _Service_start, Service_stop. 2 - I want to make a GUI ! It's not possible in a service. Create another process and communicate with your service by using IPC. 3 - I've to let the main function that way ? That's contraignant. Hey, a script intended to run as service is special no ? Autoit is not C++. The only way to have a "Main" in autoit is to have a function. If you find another way, please share it ServiceExample_ThreadSafe.au3 Services.au3 ServiceExample_v4.au3 ServicesConstants.au3
    1 point
  3. Sleep(1000) SplashOff ; _CopyFolder funchtion is use to copy a folder while displaying a progress bar should be: SplashOff()
    1 point
  4. ptrex, you can use Ctrl+a to check/uncheck all items. New zip above.
    1 point
  5. Also a new Overworld file: http://songersoft.com/programming/mapit/worlds/Overworld_Tile_Changes.zip (It's the world map in the post above) To use. Run MapIt. World Menu \ File \ Load - Navigate to the Overworld_Tile_Changes.txt. Located in the Extracted: Overworld_Tile_Changes.zip [ _IsPressed( 'x' ) deletes tiles. ] The Accelerator keys seem to get bogged down. So now you can set an Accelerator delete key or use the _IsPressed( 'x') to fire lasers.
    1 point
  6. Checkbox Combo A Checkbox Combo control for multiple selections must be owner drawn to display Checkboxes. And the ListBox must remain open after an item is in/un-checked. Owner drawn Combo An owner drawn Combo control is discussed in first post. But there was one thing I forgot. For both WM_DRAWITEM and WM_MEASUREITEM messages, controlId is contained in wParam. In case of multiple Combo controls, the correct Combo can be determined by comparing controlId with wParam. Of course, it's much faster than first to create $tDIS and $tMIS structures from lParam, then extract CtlID from the structures, and finally compare controlId and CtlID. UDF and zip-file in first post updated. ListBox control An owner drawn Combo control can be implemented by subclassing the parent window. To keep the ListBox open, it's necessary to subclass the ListBox itself, and respond to WM_LBUTTONUP messages this way: Case $WM_LBUTTONUP Return 0 ; Prevents ListBox from closing This looks relatively easy in first place, but it has significant impact on the functionality of the entire Combo control. A number of smaller pieces of code must be added to make the control work normally again. Among other things AutoIt events are no longer generated for the corresponding controlID. This can be corrected by generating events for a Dummy control instead of: Case $WM_COMMAND Switch BitShift( $wParam, 16 ) ; _WinAPI_HiWord Case $CBN_CLOSEUP ; $idComboBox (Dummy control) event is generated when ListBox is closed GUICtrlSendToDummy( $aCheckboxCombo_Info[$iIdx][5] ) ; Dummy control EndSwitch Functions CheckboxCombo_Create() creates the Combo control but returns a Dummy control as mentioned above. CheckboxCombo_GetChecked() takes controlID (Dummy control) as input and returns checked items. CheckboxCombo_Delete() takes controlID (Dummy control) as input and deletes control. Example CheckboxCombo, 2D array.au3: ;#include <Array.au3> #include <GUIConstantsEx.au3> #include "..\Includes\CheckboxCombo.au3" Example() Func Example() ; Create GUI GUICreate( "Checkbox Combo", 220, 244 ) ; Combo items Local $aItems = [ [ "Item0" ], _ [ "Item1" ], _ [ "Item2", 1 ], _ ; Item2 is checked [ "Item3" ], _ [ "Item4", 1 ], _ ; Item4 is checked [ "Item5" ], _ [ "Item6", 1 ], _ ; Item6 is checked [ "Item7" ], _ [ "Item8" ], _ [ "Item9" ] ] ; Create Checkbox Combo Local $idComboBox = CheckboxCombo_Create( 10, 10, 200, 20, 10, $aItems ) ; Show GUI GUISetState() ; Message loop While 1 Switch GUIGetMsg() Case $idComboBox ConsoleWrite( "Checked items: " & CheckboxCombo_GetChecked( $idComboBox ) & @CRLF ) ;Local $aChecked = CheckboxCombo_GetChecked( $idComboBox, 1 ) ;_ArrayDisplay( $aChecked ) Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Cleanup GUIDelete() EndFunc Zip-file 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. CheckboxCombo.7z
    1 point
  7. Melba23

    New MVPs

    Hi, Some good news today: Danp2, RTFC and junkew have accepted the invitation to become MVPs. I am sure you will all join me in congratulating them on their new status. M23
    1 point
  8. SmOke_N

    Keaft

    Keaft was warned to leave things alone via PM, Keaft chose not. Keaft is on a 43 day vacation using Valiks Random() method.
    1 point
  9. Goodbye you hypocrite. You are not coming here, insulting us by calling us "script kiddies" and suggesting we are "poor managers" then trying to make moronic comments like "you don't have any right to insult me". As far as I'm concerned you are just trash who doesn't have any right to live. Since I can't (legally) correct that problem I'll do the next best thing: Make you go away for awhile. Maybe spend your time porting your scripts to a deprecated language. 26 day ban for you. Why 26 days? Because this code returned 26: ConsoleWrite(Random(1, 100, 1) & @CRLF) Have a nice... 26 days.
    1 point
×
×
  • Create New...