Leaderboard
Popular Content
Showing content with the highest reputation on 01/03/2018 in all areas
-
Chrome Tabs
DynamicRookie and 2 others reacted to water for a topic
DR, it is not necessary to quote every post you want to reply to. It just clutters the thread. Simply click on the Reply button. And if needed refer to a post number or the name of the other poster3 points -
DragonWarrior3_Remake
argumentum and one other reacted to JLogan3o13 for a topic
If you look back through the OP's record of work on this forum you will see a constantly high level of intellect and coding acumen, which led to @TheSaint's comment (which I happen to agree with). Just curious what astounding contributions you could point to, that you feel it is okay to disparage a long time member of this forum?2 points -
runwait with Quotes
goodmanjl531 and one other reacted to Jos for a topic
You guys are missing a space in front of the /c which for sure makes them fail. Jos2 points -
Welcome to AutoIt 1-2-3
KeiosStarqua reacted to Valuater for a topic
November 26, 2007 Ver 1.4.8 * Over 19 InterActive GUI's * Over 50 Step-by-Step Scripts * Verbal Instructions * Complete with Demonstrations. * and Answers * Exe Format for New People DOWNLOAD AUTOIT 1-2-3 Written completely with AutoIt to Demonstrate some of the Capabilities of AutoIt May not Work with Windows 98 ( tested once = fail) Re-Testing is now possible ( Click "Search Help" then type in "me dummy, you fix" ) Enjoy!!! Valuater 8) When you have completed Autoit 1-2-3, be sure to see XSkin.au3 Due to Jon's request to "trim" this thread.... Only Level III Exams will remain....Thanks1 point -
NOTE: TOPIC HAS BEEN MERGED TO HERE: MapIt Quest I am currently developing NPCs they cannot yet be added. Items only exist in database. Enemies only in sprite. This project has been on the shelf a couple years. I decided to learn DLLStruct at the beginning of this project. I'm not sure if using them was a good idea or not. I'm open to converting them to pure array and Enum. Developing multiplayer system UDP clients / server. I'm looking for some advice on how to setup the packets. I was thinking the best way was to convert packets to Hex and convert back at the destination. That's probably the way I have it setup. Anyhow they all talk to each other, clients and server. Where the avatars appear on screens doesn't work. My Enums are used for data members of arrays. I exclude the 'g' even though they are all Global. I put the array names they describe in the Enum: ePlayer_x. In some cases I abbreviate the array name; aWorld_info probably has: aWorld_info[eWi_layers] Most gaming things are done better with a nice engine: GameMaker, Unity, Unreal. My buddy made a time machine in BASIC. I know you can make a better time machine in other languages, but there is something to be said for doing it in BASIC. Many things are ugly with this, just broken, or extraneous blocks of code I threw together for some one-off task. I put this here to see if it generates interest. I'm happy to change this thing around. I do many things in favor of speed, but I know some of it's crap. Package contains a Server and a Map Editor. The Map Editor is meant to be able to add and edit: World Files, worlds have 2 layers. 0.txt background 1.txt forground. The files are formatted with a header: width, height, and the largest tile number. The largest tile number is used to pad the world files. So that the world files could be edited by hand. WorldN Tile X_Y.txt (a subset cord of tile to specify frame): World Tile X_Y is stored in a separate file per layer so that the world layer files remain pretty. World Directory Structure: Example: World_1_Overworld. In folder above we can notice only layer 1 has a Tile_X_Y file. This is because atm only trees use the system and trees are foreground. Areas: areas are to subdivide worlds in effort to section the worlds and divide lists for: hotspots, NPCs, Items, and area properties such as: Out-of-Bounds: Destination and Repeat Tile, enemy encounters, etc.. Areas have: Global Enum $eArea_x, $eArea_y, $eArea_w, $eArea_h, _ ; Area World Bound Rect $eArea_ob_tile, $eArea_ob_world, $eArea_ob_x, $eArea_ob_y, _ ; Out of Bounds Repeat Tile and World Destination if Out of Bounds $eArea_hotspots, $eArea_items, $eArea_NPCs ; Total Hotspots per Area, Items and People Hotspots: hotspots are locations on the board that relocate the player Global Enum $eHotspot_x, $eHotspot_y, _; the spot in world that moves player $eHotspot_dest_world, $eHotspot_dest_x, $eHotspot_dest_y; the destination world and position Board: A rectangle of world tiles is pre-drawn on aBoard[layer_max] centered on player, you can change the size to consume less RAM but requires drawing world to board more often. Animated Background: Before anything is drawn a moving BG image is drawn. Creating beautiful water AI. So if no tiles are drawn from world, BG water animation is shown. Map Editor should be able to test all of the systems of the game: Player, Worlds, Areas, Hotspots, NPCs, Items, Shops, Battles, Netplay, etc.. (Not all systems exist yet) Download site: http://songersoft.com/programming/dw3_remake/dw3_remake_about.phtml It's going to say that the files might be malicious. Probably b/c of the DLLs and I hosted an unmoderated forum from the site years ago were people posted malicious links. Let me know if it's malicious! PS: I tried posting the source but I keep getting errors. I think the source might be too large to post. 6308 lines. Idk.1 point
-
I'm more of an array manipulator.... There are better GUI people than me who will probably beat me to it, but im trying.1 point
-
I dont quite understand the question, does this help? #include<array.au3> $arr1 = stringsplit("test" & @CR & "test" & @CR & "123" & @CR & "abcd" , @CR , 2) ; strinsplit the fileread or _FRTA $arr2 = stringsplit("test" & @CR & "test" & @CR & "123" & @CR & "abc" , @CR , 2) local $aOut[0] $arr1 = _ArrayUnique($arr1 , 0 , 0 , 0 , 0) ; unique each arr $arr2 = _ArrayUnique($arr2 , 0 , 0 , 0 , 0) For $i = ubound($arr1) - 1 To 0 step - 1 If $arr1[$i] = $arr2[$i] Then ; do the things _ArrayAdd($aOut , $arr1[$i]) _ArrayDelete($arr1 , $i) _ArrayDelete($arr2 , $i) EndIf Next _ArrayDisplay($aOut , "Matches") ; all the options for output _ArrayDisplay($arr1 , "Only in arr1") _ArrayDisplay($arr2 , "Only in arr2") _ArrayConcatenate($arr1 , $arr2) ; and concatenate to get all nons _ArrayDisplay($arr1 , "nonmatches")1 point
-
Table Help - Add more checkboxes
Earthshine reacted to Jos for a topic
Lets think about this one for a moment: there are 34 entries in the table and we have 3 columns, so my wild guess would be 12 rows to make that 36. Jos1 point -
Table Help - Add more checkboxes
Earthshine reacted to Jos for a topic
You make it sound we are in agreement but that is not the case. You need the 2 for/next loops to for the 3 column 8 rows in the current GUI. What I was eluding too is the fact that when you want to see more column or rows because you increase the table, you have to do exactly that. It really is quite simply when you think about it. Let me play mister nice guy for a change and force feed the few simple changes that need to be made: ;~ #RequireAdmin #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ; Declare arrays Global $aRadio[34] Global $aApps[34] ; List the path to your scripts $aApps[0] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\J_Common - HP_Terrell.au3"' $aApps[1] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\K_Common - WYLIE.au3"' $aApps[2] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\M_Common - Stonewall.au3"' $aApps[3] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\Z_Common - CCMFS.au3"' $aApps[4] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\K_Filer - Public.au3"' $aApps[5] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_CCW Sales.au3"' $aApps[6] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Credit.au3"' $aApps[7] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Cust_Serv.au3"' $aApps[8] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Design.au3"' $aApps[9] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Engineering.au3"' $aApps[10] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_FSR.au3"' $aApps[11] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_HR.au3"' $aApps[12] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_IT.au3"' $aApps[13] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Marketing.au3"' $aApps[14] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Sales.au3"' $aApps[15] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Shipping.au3"' $aApps[16] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Strategic.au3"' $aApps[17] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Versicar.au3"' $aApps[18] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Warranty.au3"' $aApps[19] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - Plant 4.au3"' $aApps[20] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - Plant 6.au3"' $aApps[21] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\x.au3"' $aApps[22] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - TERRELL.au3"' $aApps[23] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - WYLIE.au3"' $aApps[24] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Sales.au3"' $aApps[25] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Shipping.au3"' $aApps[26] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Strategic.au3"' $aApps[27] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Versicar.au3"' $aApps[28] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Warranty.au3"' $aApps[29] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - Plant 4.au3"' $aApps[30] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - Plant 6.au3"' $aApps[31] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\x.au3"' $aApps[32] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - Plant 6.au3"' $aApps[33] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\x.au3"' $hGUI = GUICreate("Vince's Network Drive Script :D", 510, 340, 200, 200) GUICtrlCreateLabel("Add which drives?", 10, 10, 126, 17) GUICtrlCreateGroup("", 20, 20, 470, 270) For $i = 0 To 2 For $j = 0 To 11 if UBound($aApps) > ($i * 12) + $j Then ; Extract the name of the app from the path $sName = StringRegExpReplace($aApps[($i * 12) + $j], "^.*\\|\..*$", "") ; Fill the array with the ControlIDs of the checkboxes $aRadio[($i * 12) + $j] = GUICtrlCreateCheckbox($sName, 30 + ($i * 150), 30 + ($j * 20), 135, 17) EndIf Next Next $hButton1 = GUICtrlCreateButton("Start", 30, 300, 129, 25, 0) $hButton2 = GUICtrlCreateButton("Select All", 180, 300, 129, 25, 0) $hButton3 = GUICtrlCreateButton("UnSelect All", 330, 300, 129, 25, 0) GUISetState() ; You only need this once While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hButton1 ; ownage has arrived For $i = 0 To 33 If BitAND(GUICtrlRead($aRadio[$i]), $GUI_CHECKED) = $GUI_CHECKED Then RunWait($aApps[$i]) ConsoleWrite("Running: " & $aApps[$i] & @CRLF) ; testing EndIf Next Exit Case $hButton2 For $i = 0 To 33 GUICtrlSetState($aRadio[$i], $GUI_CHECKED) Next Case $hButton3 For $i = 0 To 33 GUICtrlSetState($aRadio[$i], $GUI_UNCHECKED) Next EndSwitch WEnd Jos1 point -
Ha ha ha happens to the best of us. I only read what you wrote and watched the video, because as you know my current system can't handle your demanding games ... and they don't need to be too demanding before my Netbook spits the dummy. But hopefully only a couple more months before I am cooking with gas again.1 point
-
My 286 chocked, crashed, and died. Keep up the good work.1 point
-
How to select the drop down menu in existing application using autoit?
Earthshine reacted to JLogan3o13 for a topic
You are still trying to automate the GUI, why? Did you look up the WPR commands in their documentation?1 point -
Not able to run the AutoIT script through Jenkins
Earthshine reacted to Danp2 for a topic
The forum has a search feature. You should try using it to search on the word "Jenkins" to find some possible solutions to your issue.1 point -
Accessing phone storage (advice needed)
Earthshine reacted to Danyfirex for a topic
It's a little complex. I think the better alternative for you is use adb commandline tool. But if you want to implement it using Raw AutoIt code. You would need maybe check MSDN's C++ examples and convert them to AutoIt. I really have not time to do it. Saludos1 point -
DragonWarrior3_Remake
Xandy reacted to DynamicRookie for a topic
Wish i could say the same. The GUI of the game, the game itself, doesn't load the GUI correctly. It crashes right after loading a black image. Still, seems like a incredible project that my toaster can't handle it's awesomeness Good job for those 6901 lines1 point -
Table Help - Add more checkboxes
232showtime reacted to JLogan3o13 for a topic
@vincepr0 as I seem to be explaining a lot tonight the AutoIt forum is not a pizza parlor. We operate on the "Teach a man to fish" motto; this is not a place where you put in an order and someone barfs up code for you. You stated you tried something and you guess you "did it wrong", care to expand on this? How about showing the code where you added the additional 10, and explaining what errors you saw? Help us help you1 point -
Fast Sudoku solver (insane) in pure SQL[ite]
argumentum reacted to Gianni for a topic
I've done a very little modification. Changed only few lines to generate a new random puzzle on each run (don't know if it's an hard or simple puzle) also changed the output so to be in plain ascii chars #include <SQLite.au3> ;~ #include <SQLite.dll.au3> ; download the most recent suitable DLL once and comment this out ; save the sqlite3.dll along with this script Local $hDB _SQLite_Startup() ; _SQLite_Startup('.\sqlite3.dll") $hDB = _SQLite_Open() ; an empty puzzle Local $aSudokus[1][2] = [["Random", " "]] Local $aRows, $iRows, $iCols Local $sProblem ; generate a sequence of numbers 1 to 9 in a random order using an SQL query Local $aRandom, $sSQL_Query = "WITH RECURSIVE cnt(x) AS (SELECT 1 UNION ALL SELECT x+1 FROM cnt LIMIT 9) SELECT x FROM cnt ORDER BY random();" _SQLite_GetTable(-1, $sSQL_Query, $aRandom, $iRows, $iCols) ; generate a random sudoku puzzle For $i = 0 To 8 $aSudokus[0][1] = StringReplace($aSudokus[0][1], $i * 9 + Random(1,9,1) , $aRandom[$i + 2], 1) Next Local $sTempCreate = "" & _ "create temporary table i (" & _ "i integer primary key, " & _ "name char, " & _ "word0, " & _ "word1, " & _ "peers0, " & _ "peers1)" & _ ";" & _ "insert into i " & _ "select i, " & _ "char(65+y)||(x+1) as name, " & _ "case when iword=0 then 1<<ibit else 0 end AS word0, " & _ "case when iword=1 then 1<<ibit else 0 end AS word1, " & _ "CASE WHEN iword=0 THEN (512-1)<<(y*9) ELSE 0 END | " & _ "((1+512*(1+512*(1+512*(1+512*(1+512)))))<<x) | " & _ "CASE WHEN iword=0 THEN ((8-1)*(1+512*(1+512)))<<(y/3*3*9+x/3*3) ELSE 0 END AS peers0, " & _ "CASE WHEN iword=1 THEN (512-1)<<((y%6)*9) ELSE 0 END | " & _ "((1 + 512 * (1 + 512)) << x) | " & _ "CASE WHEN iword=1 THEN ((8-1)*(1+512*(1+512)))<<((y%6)/3*3*9+x/3*3) ELSE 0 END AS peers1 " & _ "from (" & _ "with xy AS (SELECT 0 AS xy UNION ALL SELECT xy+1 FROM xy WHERE xy < 80) " & _ "select xy+1 AS i, " & _ "xy%9 AS x, " & _ "xy/9 AS y, " & _ "xy/54 AS iword, " & _ "xy%54 AS ibit " & _ "from xy" & _ ")" & _ ";" _SQLite_Exec($hDB, $sTempCreate) Local $sInsaneSolver = "" & _ "with z AS (SELECT 1 AS z UNION ALL SELECT z+1 FROM z WHERE z < 9), " & _ "input as (" & _ "select input, " & _ "sud, " & _ "ifnull (sum (word0), 0) as w0, " & _ "ifnull (sum (word1), 0) as w1, " & _ "ifnull (sum (case when z=1 then word0 end), 0) as w10, " & _ "ifnull (sum (case when z=1 then word1 end), 0) as w11, " & _ "ifnull (sum (case when z=2 then word0 end), 0) as w20, " & _ "ifnull (sum (case when z=2 then word1 end), 0) as w21, " & _ "ifnull (sum (case when z=3 then word0 end), 0) as w30, " & _ "ifnull (sum (case when z=3 then word1 end), 0) as w31, " & _ "ifnull (sum (case when z=4 then word0 end), 0) as w40, " & _ "ifnull (sum (case when z=4 then word1 end), 0) as w41, " & _ "ifnull (sum (case when z=5 then word0 end), 0) as w50, " & _ "ifnull (sum (case when z=5 then word1 end), 0) as w51, " & _ "ifnull (sum (case when z=6 then word0 end), 0) as w60, " & _ "ifnull (sum (case when z=6 then word1 end), 0) as w61, " & _ "ifnull (sum (case when z=7 then word0 end), 0) as w70, " & _ "ifnull (sum (case when z=7 then word1 end), 0) as w71, " & _ "ifnull (sum (case when z=8 then word0 end), 0) as w80, " & _ "ifnull (sum (case when z=8 then word1 end), 0) as w81, " & _ "ifnull (sum (case when z=9 then word0 end), 0) as w90, " & _ "ifnull (sum (case when z=9 then word1 end), 0) as w91, " & _ "count (*) as fixed, " & _ "ifnull (sum (z=1), 0) as f1, " & _ "ifnull (sum (z=2), 0) as f2, " & _ "ifnull (sum (z=3), 0) as f3, " & _ "ifnull (sum (z=4), 0) as f4, " & _ "ifnull (sum (z=5), 0) as f5, " & _ "ifnull (sum (z=6), 0) as f6, " & _ "ifnull (sum (z=7), 0) as f7, " & _ "ifnull (sum (z=8), 0) as f8, " & _ "ifnull (sum (z=9), 0) as f9 " & _ "from ( " & _ "select '" & $aSudokus[0][0] & "' as input, " & _ "'" & $aSudokus[0][1] & "' as sud " & _ ") " & _ "join i " & _ "join z on z = cast (substr (sud, i.i, 1) as int) " & _ "where input='#####' " & _ ") " & _ ", " & _ "sudoku as (" & _ "select " & _ "'' as text, " & _ "fixed, " & _ "f1,f2,f3,f4,f5,f6,f7,f8,f9, " & _ "0 as zfixed, " & _ "0 as i0, " & _ "w0, w1, " & _ "w10, w11, " & _ "w20, w21, " & _ "w30, w31, " & _ "w40, w41, " & _ "w50, w51, " & _ "w60, w61, " & _ "w70, w71, " & _ "w80, w81, " & _ "w90, w91 " & _ "from input " & _ "union all " & _ "select " & _ "(fixed+1)||','|| " & _ "name||','|| " & _ "( " & _ "(w10&peers0 or w11&peers1) + " & _ "(w20&peers0 or w21&peers1) + " & _ "(w30&peers0 or w31&peers1) + " & _ "(w40&peers0 or w41&peers1) + " & _ "(w50&peers0 or w51&peers1) + " & _ "(w60&peers0 or w61&peers1) + " & _ "(w70&peers0 or w71&peers1) + " & _ "(w80&peers0 or w81&peers1) + " & _ "(w90&peers0 or w91&peers1) " & _ ") ||','|| " & _ "z||','|| " & _ "'', " & _ "fixed+1, " & _ "f1+(z=1), " & _ "f2+(z=2), " & _ "f3+(z=3), " & _ "f4+(z=4), " & _ "f5+(z=5), " & _ "f6+(z=6), " & _ "f7+(z=7), " & _ "f8+(z=8), " & _ "f9+(z=9), " & _ "case z " & _ "when 1 then f1 " & _ "when 2 then f2 " & _ "when 3 then f3 " & _ "when 4 then f4 " & _ "when 5 then f5 " & _ "when 6 then f6 " & _ "when 7 then f7 " & _ "when 8 then f8 " & _ "when 9 then f9 " & _ "end, " & _ "i.i, " & _ "w0+word0, " & _ "w1+word1, " & _ "case when z=1 then w10+word0 else w10 end, " & _ "case when z=1 then w11+word1 else w11 end, " & _ "case when z=2 then w20+word0 else w20 end, " & _ "case when z=2 then w21+word1 else w21 end, " & _ "case when z=3 then w30+word0 else w30 end, " & _ "case when z=3 then w31+word1 else w31 end, " & _ "case when z=4 then w40+word0 else w40 end, " & _ "case when z=4 then w41+word1 else w41 end, " & _ "case when z=5 then w50+word0 else w50 end, " & _ "case when z=5 then w51+word1 else w51 end, " & _ "case when z=6 then w60+word0 else w60 end, " & _ "case when z=6 then w61+word1 else w61 end, " & _ "case when z=7 then w70+word0 else w70 end, " & _ "case when z=7 then w71+word1 else w71 end, " & _ "case when z=8 then w80+word0 else w80 end, " & _ "case when z=8 then w81+word1 else w81 end, " & _ "case when z=9 then w90+word0 else w90 end, " & _ "case when z=9 then w91+word1 else w91 end " & _ "from sudoku " & _ "join i " & _ "on i = ifnull ( " & _ "( " & _ "select i " & _ "from i " & _ "where i > i0 " & _ "and not (word0&w0 or word1&w1) " & _ "and ( " & _ "(w10&peers0 or w11&peers1) + " & _ "(w20&peers0 or w21&peers1) + " & _ "(w30&peers0 or w31&peers1) + " & _ "(w40&peers0 or w41&peers1) + " & _ "(w50&peers0 or w51&peers1) + " & _ "(w60&peers0 or w61&peers1) + " & _ "(w70&peers0 or w71&peers1) + " & _ "(w80&peers0 or w81&peers1) + " & _ "(w90&peers0 or w91&peers1) " & _ ") = 8 " & _ "limit 1 " & _ ") " & _ ", " & _ "( " & _ "select i " & _ "from ( " & _ "select i, " & _ "max ( " & _ "(w10&peers0 or w11&peers1) + " & _ "(w20&peers0 or w21&peers1) + " & _ "(w30&peers0 or w31&peers1) + " & _ "(w40&peers0 or w41&peers1) + " & _ "(w50&peers0 or w51&peers1) + " & _ "(w60&peers0 or w61&peers1) + " & _ "(w70&peers0 or w71&peers1) + " & _ "(w80&peers0 or w81&peers1) + " & _ "(w90&peers0 or w91&peers1) " & _ ") as maxfixed " & _ "from i " & _ "where not (word0&w0 or word1&w1) " & _ ") " & _ "where maxfixed is not null " & _ ")) " & _ "join z " & _ "on " & _ "case z " & _ "when 1 then not (w10&peers0 or w11&peers1) " & _ "when 2 then not (w20&peers0 or w21&peers1) " & _ "when 3 then not (w30&peers0 or w31&peers1) " & _ "when 4 then not (w40&peers0 or w41&peers1) " & _ "when 5 then not (w50&peers0 or w51&peers1) " & _ "when 6 then not (w60&peers0 or w61&peers1) " & _ "when 7 then not (w70&peers0 or w71&peers1) " & _ "when 8 then not (w80&peers0 or w81&peers1) " & _ "when 9 then not (w90&peers0 or w91&peers1) " & _ "end " & _ "order by fixed desc, " & _ "zfixed desc " & _ ") " & _ ", " & _ "output as ( " & _ "select * " & _ "from ( " & _ "select 1 as i, " & _ "w10, w11, " & _ "w20, w21, " & _ "w30, w31, " & _ "w40, w41, " & _ "w50, w51, " & _ "w60, w61, " & _ "w70, w71, " & _ "w80, w81, " & _ "w90, w91, " & _ "'' as sud " & _ "from sudoku " & _ "where fixed = 81 limit 1 " & _ ") " & _ "union all " & _ "select nullif (output.i + 1, 82), " & _ "w10, w11, " & _ "w20, w21, " & _ "w30, w31, " & _ "w40, w41, " & _ "w50, w51, " & _ "w60, w61, " & _ "w70, w71, " & _ "w80, w81, " & _ "w90, w91, " & _ "sud || replace (cast ( " & _ "case 1 " & _ "when w10&word0 OR w11&word1 then 1 " & _ "when w20&word0 OR w21&word1 then 2 " & _ "when w30&word0 OR w31&word1 then 3 " & _ "when w40&word0 OR w41&word1 then 4 " & _ "when w50&word0 OR w51&word1 then 5 " & _ "when w60&word0 OR w61&word1 then 6 " & _ "when w70&word0 OR w71&word1 then 7 " & _ "when w80&word0 OR w81&word1 then 8 " & _ "when w90&word0 OR w91&word1 then 9 " & _ "else 0 " & _ "end " & _ "as char), '0', '.') " & _ "from output " & _ "join i on i.i = output.i " & _ ") " & _ ", " & _ "result as (select sud s from input union all select sud from output WHERE i is null) " & _ "SELECT " & _ "'+-----------------+' || x'0d0a' || " & _ "'|' || substr(s, 1,1) || '|' || substr(s, 2,1) || '|' || substr(s, 3,1) || '|' || " & _ "substr(s, 4,1) || '|' || substr(s, 5,1) || '|' || substr(s, 6,1) || '|' || " & _ "substr(s, 7,1) || '|' || substr(s, 8,1) || '|' || substr(s, 9,1) || '|' || x'0d0a' || " & _ "'|-+-+-+-+-+-+-+-+-|' || x'0d0a' || " & _ "'|' || substr(s,10,1) || '|' || substr(s,11,1) || '|' || substr(s,12,1) || '|' || " & _ "substr(s,13,1) || '|' || substr(s,14,1) || '|' || substr(s,15,1) || '|' || " & _ "substr(s,16,1) || '|' || substr(s,17,1) || '|' || substr(s,18,1) || '|' || x'0d0a' || " & _ "'|-+-+-+-+-+-+-+-+-|' || x'0d0a' || " & _ "'|' || substr(s,19,1) || '|' || substr(s,20,1) || '|' || substr(s,21,1) || '|' || " & _ "substr(s,22,1) || '|' || substr(s,23,1) || '|' || substr(s,24,1) || '|' || " & _ "substr(s,25,1) || '|' || substr(s,26,1) || '|' || substr(s,27,1) || '|' || x'0d0a' || " & _ "'|-+-+-+-+-+-+-+-+-|' || x'0d0a' || " & _ "'|' || substr(s,28,1) || '|' || substr(s,29,1) || '|' || substr(s,30,1) || '|' || " & _ "substr(s,31,1) || '|' || substr(s,32,1) || '|' || substr(s,33,1) || '|' || " & _ "substr(s,34,1) || '|' || substr(s,35,1) || '|' || substr(s,36,1) || '|' || x'0d0a' || " & _ "'|-+-+-+-+-+-+-+-+-|' || x'0d0a' || " & _ "'|' || substr(s,37,1) || '|' || substr(s,38,1) || '|' || substr(s,39,1) || '|' || " & _ "substr(s,40,1) || '|' || substr(s,41,1) || '|' || substr(s,42,1) || '|' || " & _ "substr(s,43,1) || '|' || substr(s,44,1) || '|' || substr(s,45,1) || '|' || x'0d0a' || " & _ "'|-+-+-+-+-+-+-+-+-|' || x'0d0a' || " & _ "'|' || substr(s,46,1) || '|' || substr(s,47,1) || '|' || substr(s,48,1) || '|' || " & _ "substr(s,49,1) || '|' || substr(s,50,1) || '|' || substr(s,51,1) || '|' || " & _ "substr(s,52,1) || '|' || substr(s,53,1) || '|' || substr(s,54,1) || '|' || x'0d0a' || " & _ "'|-+-+-+-+-+-+-+-+-|' || x'0d0a' || " & _ "'|' || substr(s,55,1) || '|' || substr(s,56,1) || '|' || substr(s,57,1) || '|' || " & _ "substr(s,58,1) || '|' || substr(s,59,1) || '|' || substr(s,60,1) || '|' || " & _ "substr(s,61,1) || '|' || substr(s,62,1) || '|' || substr(s,63,1) || '|' || x'0d0a' || " & _ "'|-+-+-+-+-+-+-+-+-|' || x'0d0a' || " & _ "'|' || substr(s,64,1) || '|' || substr(s,65,1) || '|' || substr(s,66,1) || '|' || " & _ "substr(s,67,1) || '|' || substr(s,68,1) || '|' || substr(s,69,1) || '|' || " & _ "substr(s,70,1) || '|' || substr(s,71,1) || '|' || substr(s,72,1) || '|' || x'0d0a' || " & _ "'|-+-+-+-+-+-+-+-+-|' || x'0d0a' || " & _ "'|' || substr(s,73,1) || '|' || substr(s,74,1) || '|' || substr(s,75,1) || '|' || " & _ "substr(s,76,1) || '|' || substr(s,77,1) || '|' || substr(s,78,1) || '|' || " & _ "substr(s,79,1) || '|' || substr(s,80,1) || '|' || substr(s,81,1) || '|' || x'0d0a' || " & _ "'+-+-+-+-+-+-+-+-+-+'" & _ "FROM result;" For $n = 0 To UBound($aSudokus) - 1 $sProblem = StringReplace($sInsaneSolver, "#####", $aSudokus[$n][0]) _SQLite_GetTable($hDB, $sProblem, $aRows,$iRows, $iCols) _ConsoleWrite($aSudokus[$n][0] & " problem" & @LF & $aRows[2] & @LF & @LF) _ConsoleWrite($aSudokus[$n][0] & " solution" & @LF & $aRows[3] & @LF & @LF) Next Func _ConsoleWrite($s) ;ConsoleWrite(BinaryToString(StringToBinary($s, 4), 1)) ConsoleWrite($s) EndFunc1 point -
AutoIt Snippets
Earthshine reacted to tcurran for a topic
This function offers a simple way to roughly calibrate the speed of animations on various computers and OSes. It calculates the number of loops iterated within a given number of milliseconds. #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 Global $iAnimSpeed _SetAnimSpeed() AdlibRegister("_SetAnimSpeed", 300000) ;wait 5 minutes for Windows startup to finish, then every 5 minutes, recalibrate animation speed Func _SetAnimSpeed() $iAnimSpeed = _CalibrateLoopTime(1000, 1) ;get the number of loops within a second with 1 Sleep() ;AdlibUnRegister("_SetAnimSpeed") ;uncomment this line if you only want to recalibrate once EndFunc ;==>_SetAnimSpeed ConsoleWrite("On this computer, 1 second of animation = " & $iAnimSpeed & " for-next loops, including 1 sleep." & @CRLF) ; #FUNCTION# ==================================================================================================================== ; Name ..........: _CalibrateLoopTime ; Description ...: Calculates the number of loops iterated within a given number of milliseconds. A simple way to *roughly* ; calibrate the speed of animations on various computers and OSes. ; Syntax ........: _CalibrateLoopTime($iMilliseconds[, $iSleep = 0]) ; Parameters ....: $iMilliseconds - number of milliseconds to calibrate. Longer is more accurate, shorter is less disruptive. ; Remember to divide or multiply to get the length of the animation. ; $iSleep - [optional] manually adjust this to correct for the how fast animation gets generated. ; Default is 0. ; Return value ..: integer number of loops within given milliseconds ; Author ........: Tim Curran (tim/at/timcurran/dot/com) ; Modified ......: ; Remarks .......: The longer the Sleep() adjustment, the less accurate this calibration, as computer speed performing the task ; (e.g. building the animation) becomes a greater factor. ; Example .......: See above. ; =============================================================================================================================== Func _CalibrateLoopTime($iMilliseconds, $iSleep = 0) Local $iLoopCounter, $hCaliTimer $hCaliTimer = TimerInit() Do $iLoopCounter += 1 Sleep($iSleep) Until TimerDiff($hCaliTimer) >= $iMilliseconds Return $iLoopCounter EndFunc ;==>_CalibrateLoopTime1 point -
How to convert AutoIT and AutoHotKey script to Powershell ?
Xandy reacted to JLogan3o13 for a topic
@pztlmx yes, it would be great. It would also be nice if you could convert batch files to fully functional python with a click of a button, but it doesn't work that way. Powershell and AutoIt are vastly different languages, with different syntax and abilities. There are some options if you search the forum for using AutoItX to call AutoIt in PS, as well as running powershell commands from an AutoIt script, but you're not going to find a one-button convert/export feature. Edit: try this one for running PS commands in AutoIt, by our benevolent leader:1 point