Jump to content

seangriffin

Active Members
  • Posts

    227
  • Joined

  • Last visited

  • Days Won

    3

seangriffin last won the day on August 5 2017

seangriffin had the most liked content!

4 Followers

About seangriffin

  • Birthday 11/03/1972

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

seangriffin's Achievements

Polymath

Polymath (5/7)

37

Reputation

  1. A huge thank you InunoTaishou 💗 This is a very helpful example that I am adopting for use in a new Jira client. Your script is easy to read and follow with plenty of comments. The best example of working with RichEdit that I've found.
  2. Hi everyone. Sharing some knowledge on how to compile sqlite and make it work with AutoIT in case it helps anyone. The SQLite website below explains how to compile SQLite into both an EXE and DLL. https://www.sqlite.org/howtocompile.html Initially I tried "gcc" with limited success. The EXE file (sqlite3.exe) worked both standalone and also through the AutoIT _SQLite_SQLiteExe command. But the DLL (sqlite3.dll) wouldn't be accepted by AutoIT _SQLite_Startup at all. I then tried Visual Studio's compiler "cl". This method is also described on the page above. Again the EXE file (sqlite3.exe) worked both standalone and also through the AutoIT _SQLite_SQLiteExe command. The DLL (sqlite3.dll) worked in _SQLite_Startup but _SQLite_LibVersion returned a "0" for the version. The compilation command that finally worked (specifically for the DLL) was this one: cl sqlite3.c -DSQLITE_API=__declspec(dllexport) -link -dll -out:sqlite3.dll This one works against all the SQLite commands in AutoIT. Note this assumes you want to create the 32-bit version of SQLite.
  3. No this works strictly with SQLite only. SQLite functions are already included within AutoIT (see the SQLite UDF already inside AutoIT). But we still need to provide additionally two files - sqlite3.exe and sqlite3.dll. sqlite3.exe provides the features to import and export CSV files to and from SQLite, and sqlite3.dll is required for all other SQLite functions.
  4. This UDF provides functions for editing CSV files. It uses the features of SQLite already existing within AutoIT to open, edit and save data in the CSV format. Because SQLite is used the performance of the UDF is fast and the functions are accurate. REQUIREMENTS: Windows 64-bit (not tested under Windows 32-bit) AutoIt3 3.3 or higher sqlite3.exe (included) sqlite3.dll (included) LIST OF FUNCTIONS: EXAMPLES: Note - To make this example work, you must make sure sqlite3.exe, sqlite3.dll and Item.csv are present in the same folder as the examples. #include-once #include "CSV.au3" ConsoleWrite(@CRLF & "Initialise the CSV handler ... ") _CSV_Initialise() ConsoleWrite("Done." & @CRLF) ConsoleWrite(@CRLF & "Open the CSV file 'Item.csv' ... ") Local $item_csv_handle = _CSV_Open("Item.csv") ConsoleWrite("Done." & @CRLF) ConsoleWrite(@CRLF & "Delete all CSV records with an 'Assigned to' value of 'DELI_SIT_S0003' ... ") _CSV_Exec($item_csv_handle, "delete from csv where `Assigned to` = 'DELI_SIT_S0003';") ConsoleWrite("Done." & @CRLF) ConsoleWrite(@CRLF & "Get all CSV records with the header and display the result ..." & @CRLF & @CRLF) Local $csv_result = _CSV_GetRecordArray($item_csv_handle, "", True) _CSV_DisplayArrayResult($csv_result) ConsoleWrite(@CRLF & "Get the first CSV record without the header and display the result ..." & @CRLF & @CRLF) Local $csv_result = _CSV_GetRecordArray($item_csv_handle, 1, False) _CSV_DisplayArrayResult($csv_result) ConsoleWrite(@CRLF & "Get all CSV records with an 'Assigned to' value of 'DELI_SIT_S0004' and display the result ..." & @CRLF & @CRLF) Local $csv_result = _CSV_GetRecordArray($item_csv_handle, "select * from csv where `Assigned to` = 'DELI_SIT_S0004';", False) _CSV_DisplayArrayResult($csv_result) ConsoleWrite(@CRLF & "Get a count of the number of records in the CSV file ... ") Local $number_of_records = _CSV_GetRecordCount($item_csv_handle) ConsoleWrite("There are " & $number_of_records & " records in the CSV." & @CRLF) ConsoleWrite(@CRLF & "Save the entire CSV file as 'Item complete.csv' ... ") _CSV_SaveAs($item_csv_handle, "Item complete.csv") ConsoleWrite("Done." & @CRLF) ConsoleWrite(@CRLF & "Sort and Save the entire CSV file as 'Item sorted.csv' ... ") _CSV_SaveAs($item_csv_handle, "Item sorted.csv", "select * from csv order by `Assigned to`, `Comment 1`;") ConsoleWrite("Done." & @CRLF) ConsoleWrite(@CRLF & "Query records with an 'Assigned to' value of 'DELI_SIT_S0004' and Save as 'Item DELI_SIT_S0004.csv' ... ") _CSV_SaveAs($item_csv_handle, "Item DELI_SIT_S0004.csv", "select * from csv where `Assigned to` = 'DELI_SIT_S0004';") ConsoleWrite("Done." & @CRLF) ConsoleWrite(@CRLF & "Cleanup the CSV handler ... ") _CSV_Cleanup() ConsoleWrite("Done." & @CRLF) DOWNLOAD: Source: https://github.com/seanhaydongriffin/CSV-UDF
  5. To give everyone an update on this UDF. I came to the realization that this was a little ambitious for a scripting language like AutoIT. I still love the performance of AutoIT for most endevours, but in this case (for realtime graphics) I needed something closer to the speed of a compiled language like C. Partly due to some posts by UEZ I was drawn towards several basic style languages, which seemed to offer the speed I was after with the simplicity of a basic language that is similar to that of AutoIT. These included FreeBasic, BlitzBasic and PureBasic. My attempts to get Box2D working in FreeBasic failed at the DLL level. I'm still not sure why to this day. I then moved to PureBasic and had immediate success there. PureBasic also has native OpenGL support. I initially tried the SFML library there. It was too slow. But after moving to direct OpenGL calls I got the great preformance I was looking for. I then attempted to integrate LiquidFun (http://google.github.io/liquidfun) into PureBasic and to my excitment that was successful also. So for now I'm continuing my developments of LiquidFun / Box2D physics within PureBasic. If anyone is interested in this then check out my recent post in the PureBasic forums here -> http://www.purebasic.fr/english/viewtopic.php?f=27&t=68874 The Github repository is also here -> https://github.com/seanhaydongriffin/PB-LiquidFun-C I'm really happy with where this is going, and perhaps I could later back-port my work and lessons learned from PureBasic to AutoIT.
  6. Really useful UEZ. I'm sure you are helping many people in need such as myself.
  7. Thanks UEZ. I had never developed graphics in Windows as low level as GDI before. Always preferring to use something simpler and higher level such as what Unity provides. I needed a graphics engine for Box2D and I knew that GDI might be my answer but I'd absolutely no clue where to start. Because of the popularity of your GDI loading screens topic I was immediately drawn to your work. Having fully functional GDI animation examples was the perfect way to explain to me, a novice, how GDI works. I've also admired your scripting skill for some time and knew it was going to be impressive, and it was. Your optimisation of the GDI calls is precisely whats required for a physics engine. also you introduced me to the low level and efficient timers in the Windows API that i didn't know existed. they help me run non time critical script away from the time critical physics animation loop in my script. If it weren't for your demos I would not be this far advanced with Box2D. A very big thanks to you UEZ you are brilliant! I really love the AutoIT community.
  8. This is my first release of Box2D for AutoIT. A very fun and exciting UDF to be bringing to you all. For those who don't know, Box2D is a physics engine (see http://box2d.org/). It simulates physical systems using rigid bodies and collision detection. It is arguably the most prevalent physics engine in existence, within popular physics-based games like Angry Birds using it, and is also at the core of other advanced physics engines such as Unity. For a quick demonstration of this UDF in action see the following YouTube video -> https://youtu.be/h5QH1O63Wik Or play "Angry Nerds", the demo game, for yourself. Visit the EXAMPLES section below. Box2D is purely a mathematical engine. It can model physics numerically. This in itself is quite interesting, however it really shines when applied to a good graphics engine. Recently I posted my SFML UDF over here ... After benchmarking several popular graphics engines (i.e. GDI+, Direct2D, Irrlicht and SFML) with this Box2D UDF I've selected SFML as my favourite, and the engine that I believe performs the best (fastest) with a rich set of functions appropriate for any physics engine. With Box2D married with SFML, and running on AutoIT, the results are stunning. A HUGE THANK-YOU to jRowe and linus (for the Irrlicht UDF) and UEZ for his post on GDI+ loading screens and trancexx and Eukalyptus for their work on Direct2D. Without their talents I would not have been able to reach this point on my own. The Box2D library is available for C++. Way back in 2010 it was ported to Pure C by "Paril" and made available on Google Code and known as "Box2C". Google Code has since been shut down but the but the archive of Box2C still exists to this day here -> https://code.google.com/archive/p/box2c. This is the library which I have ported to AutoIT in this UDF. SFML I am also porting to AutoIT under a separate UDF, as linked above. Building this UDF has been a dream come true. I've been fascinated by physics-based games as far back as the golden age of gaming in the 80's, with thrust style games like Asteroids and platformers like Donkey Kong. I admired game developers like Jeremy Smith who created what may have been the first true game physics engines for the home computers. I was astonished by their talents in games like Thrust and Exile for the C64. Over the years I've attempted to mimic at least some of their success in my own games but alas I can not match their skills. Now much older automation tools have become my game. I use them almost every day, AutoIT included. I've dabbled in other languages for physics game development, like Scratch and Unity, but sadly I had wondered why AutoIT, with all it's glorious capabilities and rapid scripting features, didn't have such a feature. Hence this UDF. This UDF demands a big time investment, and I am time poor, but I have a keen interest in the topic and will do my best to continue it's development. I am only a hobbyist game developer and welcome comments and suggestions from those far smarter than I on this topic. REQUIREMENTS: AutoIt3 3.2 or higher LIST OF FUNCTIONS (in progress): I've split this UDF into two halves. "Box2C.au3" is a UDF specifically for Box2C, the C API for Box2D. It provides the mathematics behind the engine. Additionally I'm providing "Box2CEx.au3" as an Extension that provides the graphics and gaming functions for Box2D. Within the core "Box2C.au3" UDF: _Box2C_Startup _Box2C_Shutdown _Box2C_b2Vec2_Constructor _Box2C_b2Vec2_Length _Box2C_b2Vec2_Distance _Box2C_b2World_Constructor _Box2C_b2World_CreateBody _Box2C_b2World_DestroyBody _Box2C_b2World_CreateFixture _Box2C_b2World_CreateFixtureFromShape _Box2C_b2World_Step _Box2C_b2BoxShape_Constructor _Box2C_b2CircleShape_Constructor _Box2C_b2PolygonShape_Constructor _Box2C_b2PolygonShape_Set _Box2C_b2PolygonShape_CrossProductVectorScalar _Box2C_b2PolygonShape_CrossProductVectorVector _Box2C_b2PolygonShape_Normalize _Box2C_b2PolygonShape_ComputeCentroid _Box2C_b2BodyDef_Constructor _Box2C_b2Body_DestroyFixture _Box2C_b2Body_GetPosition _Box2C_b2Body_SetPosition _Box2C_b2Body_GetAngle _Box2C_b2Body_SetAngle _Box2C_b2Body_SetAwake _Box2C_b2Body_SetTransform _Box2C_b2Body_GetLinearVelocity _Box2C_b2Body_SetLinearVelocity _Box2C_b2Body_GetAngularVelocity _Box2C_b2Body_SetAngularVelocity _Box2C_b2Body_ApplyForce _Box2C_b2Body_ApplyForceAtBody _Box2C_b2Body_ApplyDirectionalForceAtBody _Box2C_b2Body_ApplyTorque _Box2C_b2Fixture_GetShape _Box2C_b2Fixture_GetDensity _Box2C_b2Fixture_SetDensity _Box2C_b2Fixture_GetRestitution _Box2C_b2Fixture_SetRestitution _Box2C_b2Fixture_GetFriction _Box2C_b2Fixture_SetFriction _Box2C_b2Fixture_SetSensor Within y "Box2CEx.au3" extension: x_metres_to_gui_x y_metres_to_gui_y metres_to_pixels atan2 radians_to_degrees degrees_to_radians _Box2C_Setup_SFML _Box2C_b2Vec2_GetGUIPosition _Box2C_b2World_Setup _Box2C_b2World_GDIPlusSetup _Box2C_b2World_SetPixelsPerMetre _Box2C_b2World_SetGUIArea _Box2C_b2World_GetGUIArea _Box2C_b2World_GetGUIAreaCenter _Box2C_b2World_Create _Box2C_b2World_Step_Ex _Box2C_b2World_StartAnimation _Box2C_b2World_Animate_SFML _Box2C_b2World_Animate_GDIPlus _Box2C_b2World_WaitForAnimateEnd _Box2C_b2ShapeArray_AddItem_SFML _Box2C_b2ShapeArray_SetItem_SFML _Box2C_b2ShapeArray_GetItemImagePath_SFML _Box2C_b2PolygonShape_ArrayAdd_Irrlicht _Box2C_b2PolygonShape_ArrayAdd_GDIPlus _Box2C_b2BodyDefArray_AddItem _Box2C_b2FixtureArray_SetItemSensor _Box2C_b2FixtureArray_GetItemDensity _Box2C_b2FixtureArray_SetItemDensity _Box2C_b2FixtureArray_GetItemRestitution _Box2C_b2FixtureArray_SetItemRestitution _Box2C_b2FixtureArray_GetItemFriction _Box2C_b2FixtureArray_SetItemFriction _Box2C_b2BodyArray_AddItem_SFML _Box2C_b2Body_ArrayAdd_Irrlicht _Box2C_b2Body_ArrayAdd_GDIPlus _Box2C_b2BodyArray_GetItemCount _Box2C_b2BodyArray_GetItemPosition _Box2C_b2BodyArray_SetItemPosition _Box2C_b2BodyArray_GetItemAngle _Box2C_b2BodyArray_SetItemAngle _Box2C_b2BodyArray_GetItemLinearVelocity _Box2C_b2BodyArray_SetItemActive _Box2C_b2BodyArray_SetItemAwake _Box2C_b2BodyArray_SetItemImage_SFML _Box2C_b2BodyArray_SetItemDraw _Box2C_b2BodyArray_ApplyItemForceAtBody _Box2C_b2BodyArray_ApplyItemDirectionalForceAtBody _Box2C_b2BodyArray_Transform_SFML _Box2C_b2Body_Transform_GDIPlus _Box2C_b2BodyArray_Draw_SFML _Box2C_b2Body_ArrayDrawDisplay_SFML _Box2C_b2Body_Destroy _Box2C_b2Body_Destroy_SFML _Box2C_b2Body_Rotate_GDIPlus The SFML functions used in the tests and demos will be available in the SFML UDF post (see reference above). EXAMPLES: For such a powerful physics engine coupled to such a powerful graphics engine (SFML) it's sad that I've only had time to build one functional game, thus far. But it's a start. My self-titled "Angry Nerds" is merely a demo of the same game concept as the ever-so-popular Angry Birds game. Angry Birds itself is built on top of Box2D. Likewise Angry Nerds. AutoIT + Box2D + SFML to be exact. I've compiled Angry Nerds and provided an installer also, so you can quickly run the demo for yourself. From the Github site below (in the DOWNLOAD section) run "Box2C_Angry_Nerds_Game_SFML_installer.exe" to install the demo to a location on your computer (desktop by default). Go into this folder and run "Box2C_Angry_Nerds_Game_SFML.exe". All instructions are displayed in-game. Should be quite easy to work out. Aside from Angry Nerds there are also two test scripts: Box2C_linear_forces_test_SFML.au3 Box2C_angular_forces_test_SFML.au3 Feel free to run these for a basic demonstration of rigid bodies, forces and collisions. The heart of Box2D and any physics engine. Lastly I also have four speed tests as follows: Box2C_speed_test_SFML.au3 Box2C_speed_test_Irrlicht.au3 Box2C_speed_test_D2D.au3 Box2C_speed_test_GDIPlus.au3 These were my initial evaluations into a suitable graphics engine for Box2D. I've since settled on SFML, but feel free to execute these. Note they may become quick defective over time as the SFML functions slowly take over. DOWNLOADS: You can download this UDF, including the examples above and associated files, from the following GitHub page: https://github.com/seanhaydongriffin/Box2C-UDF Hope you all enjoy! I certainly am :-) Cheers, Sean.
  9. Thanks mLipok. I took a long break from posting in the forums due to some disagreements I had with moderators, after which I got super busy at work. I still love AutoIT and am still a heavy user of it in my professional line of work. But wish I had more time on my hands to develop more fun UDFs. I have a couple of fun UDFs to publish though. Stay tuned :-)
  10. Here's the beginnings of SFML (the Simple and Fast Multimedia Library) for AutoIT. This library provides a wealth of features for developing games and multimedia applications. You can read up more about SFML here -> http://www.sfml-dev.org. It uses OpenGL as the renderer for 2D graphics such as sprites, so it's performance is quite good. Currently my interest is in 2D sprite engines, so my focus is on the sprite and window APIs. This is the precursor to another separate UDF I'm working on and will release soon. If there's any interest I'll flesh out more of this API for the community. CSFML is the "C" binding / API for SFML, and it's this API that I'm building this UDF against. REQUIREMENTS: AutoIt3 3.2 or higher LIST OF FUNCTIONS (so far): _CSFML_Startup _CSFML_Shutdown _CSFML_sfClock_create _CSFML_sfClock_getElapsedTime _CSFML_sfClock_restart _CSFML_sfVector2f_Constructor _CSFML_sfVector2f_Update _CSFML_sfVector2f_Move _CSFML_sfColor_Constructor _CSFML_sfColor_fromRGB _CSFML_sfSizeEvent_Constructor _CSFML_sfEvent_Constructor _CSFML_sfVideoMode_Constructor _CSFML_sfRenderWindow_create _CSFML_sfRenderWindow_setVerticalSyncEnabled _CSFML_sfRenderWindow_isOpen _CSFML_sfRenderWindow_pollEvent _CSFML_sfRenderWindow_clear _CSFML_sfRenderWindow_drawText _CSFML_sfRenderWindow_drawSprite _CSFML_sfRenderWindow_display _CSFML_sfRenderWindow_close _CSFML_sfTexture_createFromFile _CSFML_sfSprite_create _CSFML_sfSprite_destroy _CSFML_sfSprite_setTexture _CSFML_sfSprite_setPosition _CSFML_sfSprite_setRotation _CSFML_sfSprite_rotate _CSFML_sfSprite_setOrigin _CSFML_sfFont_createFromFile _CSFML_sfText_create _CSFML_sfText_setString _CSFML_sfText_setFont _CSFML_sfText_setCharacterSize _CSFML_sfText_setFillColor EXAMPLE: Currently I only have one example, which is the "Short example" described in the CSFML API documentation, plus some extra features. Essentially a window (GUI) allowing you to move a sprite around with the keyboard (including rotation). DOWNLOAD: You can download this UDF, including the example and associated files, from the following GitHub page: https://github.com/seanhaydongriffin/CSFML-UDF Cheers, Sean.
  11. Hi all, I haven't posted updates to the AutoIT forums for a while now. But I needed to improve my cURL UDF to support HTTP headers and response codes. See my latest update (v0.3). Sorry I know the UDF was at v0.5, but somehow I've dropped back two versions. May have regressed the UDF slightly, but progressed in other areas ;-)
  12. This is a very early version of a Netgear SNR tweaking tool. I just wanted to get this up as a topic and improve on it later. The purpose of the tool is to improve line sync rates on a Netgear modem / router by automating the hidden SNR tweaking feature of the modem. The out-of-the-box firmware on Netgear modems doesn't retain any tweaked SNR settings, so this AutoIT script can be run everytime the modem is (re)booted / (re)started to get the desired SNR / line rate. At the moment all configuration is hard-coded into the script, including IP address of the modem, username and password of the modem and SNR percent. Netgear SNR tool.au3
  13. V0.5 of the UDF is now released. Python has now been replaced with AutoIT as the Native Messaging Host. This brings significant performance improvements over the previous Python solution, and also allows easier maintenance in the future with a complete AutoIT solution. If you already have a previous version of the UDF installated, then you must repeat Steps 1, 2 and 3 from the INSTALLATION section of the top post.
  14. Yes, it might seem odd that the registry value is escaped, though it must be this way or the native messaging host won't start. That's my experience. Here's more information to help in troubleshooting. Thanks for spending the time on this. Might help others too. To confirm the native messaging host is starting with Chrome as expected, I would first try starting Chrome on it's own, without loading any pages or using the UDF. Then go to Windows Task Manager and you should see the a process named autoit-chrome-native-messaging-host.exe. This will confirm that the registry value above is set correctly, as this points Chrome to the location of the Native Messaging Host such that it can start it when Chrome starts.. If autoit-chrome-native-messaging-host.exe isn't running when you start Chrome then get the value of the registry key above, and in Windows Explorer go to this location (i.e. C:UsersJOHNAppDataRoamingAutoIt3Chrome Native Messaging Host). Check the file autoit-chrome-native-messaging-host.exe and manifest.json exist. Open manifest.json in Notepad. Make sure "path" is set to the full path of autoit-chrome-native-messaging-host.exe, and the path includes double-backslashes. Also make sure the value for "allowed_origins"opmlbgppkkdeleedejakphgmgiigjjga/) matches the value in the ID field of the Chrome Extension. Check this by opening Chrome and go to the Tools -> Extensions menu item. In the Extensions page make sure Developer mode is ticked, and then locate the ID field for the AutoIT for Chrome extension. This value should match the value for "allowed_origins" in the manifest.json file. If the settings above are correct, then every time you start Chrome, irrespective of whether you are using AutoIT or not, you should also have the autoit-chrome-native-messaging-host.exe process running. The next step is to confirm if the AutoIT UDF is talking properly to the Native Messaging Host (autoit-chrome-native-messaging-host.exe). Run an AutoIT script that uses the UDF (Chrome.au3), like one of the Examples from the top post. When a function in the UDF is called, it should create a file named input.txt in the same location as autoit-chrome-native-messaging-host.exe (i.e. C:UsersJOHNAppDataRoamingAutoIt3Chrome Native Messaging Hostinput.txt). This file should contain some Javascript relating to the UDF function called (i.e. document.getElementsByName('ExampleForm')[0].method;). If Chrome and the Native Messaging Host (autoit-chrome-native-messaging-host.exe) are running, then the Native Messaging Host should immediately detect this file (i.e. C:UsersJOHNAppDataRoamingAutoIt3Chrome Native Messaging Hostinput.txt) whenever it's created, read it's contents and remove the file. The Native Messaging Host is so fast at doing this that you may not even see the existence of input.txt. Try running a UDF function without Chrome running and make sure input.txt is created. If input.txt is successfully created, then autoit-chrome-native-messaging-host.exe should automatically consume it (as described above), pass the Javascript onto the Chrome Extension, which uses it in Chrome and sends a response back to autoit-chrome-native-messaging-host.exe which should in turn create an output.txt file in the same location as input.txt. The Chrome UDF then detects this file, reads in the response, and the UDF function completes.
  15. Hmmm, odd that something is uploading. There certainly isn't anything in this solution that uploads or downloads. Here's a description of exactly what the 3 components to the UDF do (in case anyone was wondering): The Chrome UDF - is an AutoIT UDF that sends requests to the Native Messaging Host (below), via a text file, and waits for a response from the Native Messaging Host (below), via a text file. The Native Messaging Host - is a Python application that listens for requests from the AutoIT UDF (above), via a text file, and forwards those requests onto the Chrome Extension (below). It also listens for output from the Chrome Extension (below) and forwards that back to the AutoIT UDF (above), via a text file. The Chrome Extension - is a collection of Javascript files that wait for a request from the Native Message Host (above), and then injects that request (Javascript) into the page within Chrome to interact with the elements in that page. The response from this request is then sent back to the Native Message Host (above). All these components communicate to each other through a combination of text files and stdio. There are no HTTP requests involved, and as such I wouldn't expect any uploads or downloads to occur through the UDF. Try Example #2 because it works "offline". It should work without an internet connection, and that will eliminate any uploading or downloading going on.
×
×
  • Create New...