Leaderboard
Popular Content
Showing content with the highest reputation on 07/04/2015 in all areas
-
Running this function here (in this simple test script) takes 16 seconds. The exact same function running inside my program takes over 22 seconds! WT*?!? This bamboozled me for a bit. After some trial and error I discovered what was making the difference and thought I might share this nugget which I will keep in mind for future intensive operations and if possible, set/reset at each side of said operation! In short, one, or rather two (each has an effect) common AutoIt script settings will cause some intensive code operations to run more slowly. The example searches in millions of lines of text from a file. I wasn't quite sure where to post this, so I thought I'd leave in the actual function and put it in example scripts as a bonus! It's a fast, low-memory way to find a string inside any size of file. ; First, nice and fast.. ;AutoItSetOption("TrayOnEventMode", 0) ;AutoItSetOption("GUIOnEventMode", 0) ;;---------- RUN x64 ---------- ;;Searching for : ->one million a characters.txt ;;Time =>16.23 seconds ;;.\StringInFileSimpleTest.au3 (46) : ==> $found_array: ;;[0] [0] = 100084 [1] = This is a line which contains the string "one million a characters.txt" ;;[1] [0] = 100085 [1] = This is another line which contains the string "one million a characters.txt" ; uncomment the following two lines for almost 40% slower times! ;AutoItSetOption("TrayOnEventMode", 1) ;AutoItSetOption("GUIOnEventMode", 1) ;;---------- RUN x64 ---------- ;;Searching for : ->one million a characters.txt ;;Time =>22.63 seconds ;;.\StringInFileSimpleTest.au3 (46) : ==> $found_array: ;;[0] [0] = 100084 [1] = This is a line which contains the string "one million a characters.txt" ;;[1] [0] = 100085 [1] = This is another line which contains the string "one million a characters.txt" ; init.. $string = "one million a characters.txt" ; a string to search for (this happens to be a file name) $test_file = "B:\Test\2,040,000 lines.data" ; 2,040,000 longish (ave' 70 chr) lines of text in this file $begin_time = TimerInit() ;; this would fix it, if your program UI design allows.. ;local $old_tray_mode = AutoItSetOption("TrayOnEventMode", 0) ;local $old_menu_mode = AutoItSetOption("GUIOnEventMode", 0) $found_array = StringInFileSimple($test_file, $string, default, true) ; (must search to end of file) ConsoleWrite("Time =>" & Round(TimerDiff($begin_time)/1000, 2) & " seconds") ;; revert back to previous settings.. ;AutoItSetOption("TrayOnEventMode", $old_tray_mode) ;AutoItSetOption("GUIOnEventMode", $old_menu_mode) ;if $do_debug = $ON then PrintArray($found_array, "$found_array", 0, @ScriptLineNumber);debug ; ; StringInFileSimple() ; ; A low memory way to find a string inside any size of file. ; This is also fairly fast and handles UTFx strings & files. ; ; In its simplest form, you send a file path and a string and it returns the ; line number where the string was first found, or false if not found in the file. ; ; You can force this function to return an array by passing the third param as ; true. It is a 2D array with one main element which looks like this: ; ; [0][0] = {int} line number of matching line, [0][1] = {string} entire line containing found string ; ; This is handy when you need to return the entire found line. ; ; It will also return an array if you set the fourth parameter, return_all=true, ; which returns ALL the matches found in the file, in the same two-dimensional ; array format as before, elements starting at 0, e.g.: ; ; ; [0][0] = line number of matching line, [0][1] = entire line containing found string ; [1][0] = line number of 2nd matching line, [1][1] = entire line containing found string ; [2][0] = line number of 3rd matching line, [2][1] = entire line containing found string ; [3][0] = etc. ; ; This was designed to search within a file for relative or absolute file paths ; using a single search operation, but works great for any string. ; func StringInFileSimple($file_path, $string_to_find, $return_array=false, $return_all=false) local $line_number = false local $file_handle = FileOpen($file_path, 0) ; or make a param out of the "0", or omit. if $return_all then $return_array = true if $return_array then local $array_count = 1 local $ret_array[$array_count][2] endif local $this_line while true local $found = false $this_line = FileReadLine($file_handle) if @error then $line_number = false exitloop endif $line_number += 1 if StringInStr($this_line, $string_to_find) then $found = true if $return_array then $ret_array[$array_count-1][0] = $line_number $ret_array[$array_count-1][1] = $this_line endif if $return_all then $array_count += 1 redim $ret_array[$array_count][2] else exitloop endif endif wend FileClose($file_handle) if $return_array then if $return_all then redim $ret_array[$array_count-1][2] ; chop off last (empty) element return $ret_array endif if $found then return $line_number endif return false endfunc ; I also have a StringInFile() which allows you to optionally pass an array of ; search terms. But even asking if $x = true on each iteration of a 1,000,000 ; lines can cost you a second, so this is the "simple" version. All speed-up ; tips for this code warmly welcomed! So there you have it! ;o) Cor2 points
-
Great. Array UDF has this by the way if people are interested.1 point
-
You try use _SQLite_FastEscape($sString) ?1 point
-
A little thing for you to think about: If "j" is the prefix, what is the name of the variable?1 point
-
trademaid, I think you are misunderstanding "speed step" technology...see this thread... kylomas1 point
-
Hey, I didn't expect a Nobel for this, but BEJEEEZUS!FuxnFuk! Not only one but two pretty startling AutoIt discoveries (and workarounds) but a free super-useful, super-fast function to boot! Six months, nada. You are a dry bunch! ;o) Cor1 point
-
GUICtrlCreateProgress Help!
argumentum reacted to JuanFelipe for a topic
OK, when I finished all my process I will send my code to you.1 point -
Csv and arrays
Alexxander reacted to mikell for a topic
You loop through the sell folder If the product was found in a file then a value was assigned to $sold BUT the For loop continued testing next files... the product was not found and $sold was reset to 0 It's the reason why you always got $sold =0, except for the last file1 point -
ScanTron
argumentum reacted to NitNG4le for a topic
Don't worry JohnOne.....I'm far from quitting on the idea. I'll keep it on the back burner while I organize/structure the database. I'm going to continue with the GUI creation for the technicians that prefer the manual form of entry. I guess I'm trying to provide them with options. I came up with another possible solution. I have written spreadsheet type programs with "In-Sight Explorer" to analyze images taken by our Cognex network-based cameras. We often use them to find and measure features on parts. I have a few extra cameras lying around. I could actually build a "station" where the scan-tron forms could be set under the camera. Finding the "filled-in" circles would be an easy job for the program, simply by placing a small "X" or dot or whatever in one corner of the sheet for the program to reference from. Once I have some nice code down, and a few sample images, I will be glad to post them. I, too, believe the project is possible; and thanks for your support!1 point -
I knew you would, you just need a little push to sort it out by yourself in stead of always asking everything that looks difficult. Jos1 point
-
I found out my answer Local $aArray[4] = [0, 1, 2, 3] Func ExpandArray(ByRef $aArray, $iExpandCount) ReDim $aArray[UBound($aArray) + ($iExpandCount - 1)] EndFunc1 point
-
I'll move it. So can in the mean time play a little with ReDim so you understand it. Jos1 point
-
This is my first take at recreating the game called Nibbles available in Ubuntu. I remember an older version of the game where there weren't any computer competitors, so for this first draft, I'm staying more in that vein. Ergo, I changed the name to the oh-so-creative "Long long snake" The goal of the game is to eat as many 'treats' as possible (the treats are your score, not the length of the snake). The challenge is that your tail (which you may not run into) grows every time you get a treat (and grows even more if you don't get a treat in time). Also, you move faster as time goes on. Use the keyboard arrows to move around, and don't run into the walls! In the next version, I hope to have level advancement when you eat a certain number of treats; later levels will have computer-controlled snakes as well. I'll use A* to help them navigate, if I can manage it, and more difficult AI players would calculate the odds of getting the treat first, and go into a 'holding pattern' if it's unlikely they'll get there first...that would make it harder than everyone blindly trying to get the treat first, because they'll have a better chance of being closer to the treat than you. It will also be an easy matter to add other barriers to the playing field...expect to see that as well.edit:now included! I've powered the collision-detection using the #included SQLite functions- it works quite well! I've also included a function that will create the 'treat' picture in the same directory as the script to display...that way I didn't have to mess with any FileInstall functions when I post just the script. Hotkeys are the best way of running this game, but it's got an alternative method (_isPressed) if they're not available. Also, the script unregisters the hotkeys and pauses when the window loses focus. That way, it "plays nice with others", at least as best as I'm able to make it do. It's pretty rough- when you die, for instance, it shows you a bit of debugging information. I'll polish this up a bit as time goes on. For now, just give it a shot and post some feedback, if you would! Thanks! #include <Misc.au3> #include <SQLite.dll.au3> #include <SQLite.au3> Global $OrigSpeed=InputBox("Speed","Enter speed"&@CRLF&"(15-200 recommended)",30) If @error OR NOT $OrigSpeed>0 Then Exit Global $Speed=1/$OrigSpeed*1000 Global $Size=3, $Grow=0, $GrowAmt=4, $NumEaten=0, $Paused=0, $GUIWidth=640, $GUIHeight=480, $WinTitle="Long long snake", $TreatSize=12, $SinceTurn=1 Global $Direction=0, $PlayerCoord[2]=[($Size+1)*Round(.5*(1/($Size+1))*$GUIWidth),($Size+1)*Round(.5*(1/($Size+1))*$GUIHeight)], $WallIDs[1], $QueueKeystroke="", $NewQueueKeystroke="" Global $SpeedTimer=TimerInit(), $DifficultyTimer=TimerInit(), $TreatTimer=TimerInit() Global $aResult, $iRows, $iCols Global $HotkeyMode=1 _SQLite_Startup() _SQLite_Open() _SQLite_Exec(-1,"Create table positions (lbl,num,x,y);") For $x=0 To $GUIWidth Step $Size+1 _SQLite_Exec(-1,"Insert into positions values ('the edge','',"&$x&",-"&$Size+1&"); Insert into positions values('the edge','',"&$x&","&$GUIHeight+1&");") Next For $y=0 To $GUIHeight Step $Size+1 _SQLite_Exec(-1,"Insert into positions values ('the edge','',-"&$Size+1&","&$y&"); Insert into positions values('the edge','',"&$GUIWidth+1&","&$y&");") Next $NibblesGUI=GUICreate($WinTitle,$GUIWidth,$GUIHeight) GUIRegisterMsg(0x0086,"WinActivated") CreatePlayer() $TreatPic=GUICtrlCreatePic(@ScriptDir&"\CherryTreat.bmp",0,0,$TreatSize,$TreatSize) If $TreatPic=0 Then MakeTreatPic() $TreatPic=GUICtrlCreatePic(@ScriptDir&"\CherryTreat.bmp",0,0,$TreatSize,$TreatSize) EndIf If $TreatPic=0 Then $TreatPic=GUICtrlCreateLabel("",0,0,$TreatSize,$TreatSize) GUICtrlSetBkColor($TreatPic,0xFF0000) SpawnTreat() If HotKeySet("{Right}","Hotkeys")<>1 Then $HotkeyMode=0 If HotKeySet("{Up}","Hotkeys")<>1 Then $HotkeyMode=0 If HotKeySet("{Left}","Hotkeys")<>1 Then $HotkeyMode=0 If HotKeySet("{Down}","Hotkeys")<>1 Then $HotkeyMode=0 If $HotkeyMode=0 Then HotKeySet("{Right}") HotKeySet("{Up}") HotKeySet("{Left}") HotKeySet("{Down}") TrayTip("Warning","Another program has registered the arrow keys as hotkeys- the game may not be as responsive",10) EndIf GUISetState() While 1 While $Paused sleep(10) WEnd If GUIGetMsg()=-3 Then Exit If $HotkeyMode=0 Then If $QueueKeystroke<>"" Then Send(StringLeft($QueueKeystroke,StringLen($QueueKeystroke)-1)&" down}") $NewQueueKeystroke="" If _IsPressed(27) AND $Direction <> 2 Then If $SinceTurn>0 Then $Direction=0;right $SinceTurn=0 Else $NewQueueKeystroke="{Right}" EndIf EndIf If _IsPressed(26) AND $Direction <> 3 Then If $SinceTurn>0 Then $Direction=1;up $SinceTurn=0 Else $NewQueueKeystroke="{Up}" EndIf EndIf If _IsPressed(25) AND $Direction <> 0 Then If $SinceTurn>0 Then $Direction=2;left $SinceTurn=0 Else $NewQueueKeystroke="{Left}" EndIf EndIf If _IsPressed(28) AND $Direction <> 1 Then If $SinceTurn>0 Then $Direction=3;down $SinceTurn=0 Else $NewQueueKeystroke="{Down}" EndIf EndIf If $QueueKeystroke<>"" Then Send(StringLeft($QueueKeystroke,StringLen($QueueKeystroke)-1)&" up}") $QueueKeystroke=$NewQueueKeystroke Else If $QueueKeystroke<>"" Then Send($QueueKeystroke) EndIf If TimerDiff($DifficultyTimer) > 30000 Then $DifficultyTimer=TimerInit() $Speed=Round($Speed*.8) EndIf If TimerDiff($TreatTimer) > $Speed*500 Then SpawnTreat() $Grow=1 $GrowAmt=35 EndIf If TimerDiff($SpeedTimer) < $Speed Then ContinueLoop $SinceTurn+=1 Local $FoundBarrier=0 Switch $Direction Case 0 _SQLite_GetTable2d(-1,"Select * from positions where (x BETWEEN "&$PlayerCoord[0]+1&" AND "&$PlayerCoord[0]+$Size*2+1&") and (y BETWEEN "&$PlayerCoord[1]-$Size&" AND "&$PlayerCoord[1]+$Size&") and NOT lbl='treat';",$aResult,$iRows,$iCols) Case 2 _SQLite_GetTable2d(-1,"Select * from positions where x BETWEEN "&$PlayerCoord[0]-$Size*2-1&" AND "&$PlayerCoord[0]-1&" and y BETWEEN "&$PlayerCoord[1]-$Size&" AND "&$PlayerCoord[1]+$Size&" and NOT lbl='treat';",$aResult,$iRows,$iCols) Case 1 _SQLite_GetTable2d(-1,"Select * from positions where (x BETWEEN "&$PlayerCoord[0]-$Size&" AND "&$PlayerCoord[0]+$Size&") and (y BETWEEN "&$PlayerCoord[1]-$Size*2-1&" AND "&$PlayerCoord[1]-1&") and NOT lbl='treat';",$aResult,$iRows,$iCols) Case 3 _SQLite_GetTable2d(-1,"Select * from positions where (x BETWEEN "&$PlayerCoord[0]-$Size&" AND "&$PlayerCoord[0]+$Size&") and (y BETWEEN "&$PlayerCoord[1]+1&" AND "&$PlayerCoord[1]+$Size*2+1&") and NOT lbl='treat';",$aResult,$iRows,$iCols) EndSwitch If $iRows>0 Then Died() Local $FoundTreat=0 Switch $Direction Case 0 _SQLite_GetTable2d(-1,"Select * from positions where (x BETWEEN "&$PlayerCoord[0]+1&" AND "&$PlayerCoord[0]+$Size*2+1&") and (y BETWEEN "&$PlayerCoord[1]-$Size&" AND "&$PlayerCoord[1]+$Size&") and lbl='treat';",$aResult,$iRows,$iCols) Case 2 _SQLite_GetTable2d(-1,"Select * from positions where x BETWEEN "&$PlayerCoord[0]-$Size*2-1&" AND "&$PlayerCoord[0]-1&" and y BETWEEN "&$PlayerCoord[1]-$Size&" AND "&$PlayerCoord[1]+$Size&" and lbl='treat';",$aResult,$iRows,$iCols) Case 1 _SQLite_GetTable2d(-1,"Select * from positions where (x BETWEEN "&$PlayerCoord[0]-$Size&" AND "&$PlayerCoord[0]+$Size&") and (y BETWEEN "&$PlayerCoord[1]-$Size*2-1&" AND "&$PlayerCoord[1]-1&") and lbl='treat';",$aResult,$iRows,$iCols) Case 3 _SQLite_GetTable2d(-1,"Select * from positions where (x BETWEEN "&$PlayerCoord[0]-$Size&" AND "&$PlayerCoord[0]+$Size&") and (y BETWEEN "&$PlayerCoord[1]+1&" AND "&$PlayerCoord[1]+$Size*2+1&") and lbl='treat';",$aResult,$iRows,$iCols) EndSwitch If $iRows>0 Then $Grow=1 $GrowAmt=Random(5,20,1) SpawnTreat() $NumEaten+=1 If Mod($NumEaten,5)=0 Then AddRandBarrier() EndIf $SpeedTimer=TimerInit() _SQLite_Exec(-1,"UPDATE positions set num=num+1 WHERE lbl='Player 1';") If NOT $Grow Then _SQLite_Exec(-1,"DELETE from positions WHERE lbl='Player 1' AND num="&UBound($Player)+1&";") ElseIf $Grow <= $GrowAmt Then _SQLite_GetTable2d(-1,"SELECT * from positions WHERE lbl='Player 1' AND num="&UBound($Player)+1&";",$aResult,$iRows,$iCols) ReDim $Player[UBound($Player)+1] $Player[UBound($Player)-1]=GUICtrlCreateLabel("",$aResult[1][2],$aResult[1][3],$Size,$Size) GUICtrlSetBkColor(-1,0x0000FF) _SQLite_Exec(-1,"INSERT into positions VALUES ('Player 1',"&UBound($Player)&","&$aResult[1][2]&","&$aResult[1][3]&");") $Grow+=1 WinSetTitle($NibblesGUI,"",$WinTitle&" (Length: "&UBound($Player)&", Treats eaten: "&$NumEaten&")") Else _SQLite_Exec(-1,"DELETE from positions WHERE lbl='Player 1' AND num="&UBound($Player)+1&";") $Grow=0 EndIf Switch $Direction Case 0 $PlayerCoord[0]+=$Size+1 Case 1 $PlayerCoord[1]-=$Size+1 Case 2 $PlayerCoord[0]-=$Size+1 Case 3 $PlayerCoord[1]+=$Size+1 EndSwitch _SQLite_Exec(-1,"INSERT into positions VALUES('Player 1',1,"&$PlayerCoord[0]&","&$PlayerCoord[1]&");") $temp=$Player[UBound($Player)-1] For $i=UBound($Player)-1 To 1 Step -1 $Player[$i]=$Player[$i-1] Next $Player[0]=$temp GUICtrlSetPos($Player[0],$PlayerCoord[0],$PlayerCoord[1]) WEnd Func CreatePlayer() Global $Player[4] $PlayerCoord[0]=($Size+1)*Round(.5*(1/($Size+1))*$GUIWidth) $PlayerCoord[1]=($Size+1)*Round(.5*(1/($Size+1))*$GUIHeight) $Direction=0 For $i=0 To 3 $Player[$i]=GUICtrlCreateLabel("",$PlayerCoord[0]-(($Size+1)*$i),$PlayerCoord[1],$Size,$Size) GUICtrlSetBkColor(-1,0x0000FF) _SQLite_Exec(-1,"Insert into positions values ('Player 1',"&$i+1&","&$PlayerCoord[0]-(($Size+1)*$i)&","&$PlayerCoord[1]&");") Next WinSetTitle($NibblesGUI,"",$WinTitle&" (Length: 4, Treats eaten: 0)") EndFunc Func Hotkeys() If $SinceTurn=0 Then $QueueKeystroke=@HotKeyPressed Return EndIf If @HotKeyPressed="{Right}" AND $Direction <> 2 Then $Direction=0 If @HotKeyPressed="{Up}" AND $Direction <> 3 Then $Direction=1 If @HotKeyPressed="{Left}" AND $Direction <> 0 Then $Direction=2 If @HotKeyPressed="{Down}" AND $Direction <> 1 Then $Direction=3 $QueueKeystroke="" $SinceTurn=0 EndFunc Func Died() MsgBox(0,"Score "&UBound($Player),"Oops! You hit "&$aResult[1][0]&"!"&@CRLF&"Barrier: "&$aResult[1][2]&","&$aResult[1][3]&@CRLF&"You: "&$PlayerCoord[0]&","&$PlayerCoord[1]) _SQLite_Exec(-1,"Delete from positions where lbl='Player 1';") For $i=0 To UBound($Player)-1 GUICtrlDelete($Player[$i]) Next $Grow=0 $Speed=1/$OrigSpeed*1000 $NumEaten=0 For $i=0 To UBound($WallIDs)-1 GUICtrlDelete($WallIDs[$i]) Next ReDim $WallIDs[1] $WallIDs[0]="" _SQLite_Exec(-1,"Delete from positions where lbl='a wall';") $TreatTimer=TimerInit() CreatePlayer() EndFunc Func SpawnTreat() $TreatTimer=TimerInit() _SQLite_Exec(-1,"Delete from positions where lbl='treat';") Do Local $RandX=Random(0,(1/($Size+1))*($GUIWidth-12),1)*($Size+1), $RandY=Random(0,(1/($Size+1))*($GUIHeight-12),1)*($Size+1) _SQLite_GetTable2d(-1,"Select * from positions where x between "&$RandX-$Size&" and "&$RandX+$TreatSize+1&" AND y between "&$RandY-$Size&" and "&$RandY+$TreatSize+1&";",$aResult,$iRows,$iCols) Until $iRows=0 For $y=0 To Round($TreatSize/$Size)-1 For $x=0 To Round($TreatSize/$Size)-1 _SQLite_Exec(-1,"INSERT into positions Values ('treat','1',"&$RandX+($x*($Size+1))&","&$RandY+($y*($Size+1))&");") Next Next GUICtrlSetPos($TreatPic,$RandX,$RandY) EndFunc Func AddRandBarrier() Local $BarrierDir=Random(0,1,1) If $BarrierDir=0 Then $BarrierLen=Random((.2*$GUIWidth)/($Size+1),(.67*$GUIWidth)/($Size+1),1)*($Size+1) Do Local $BarrierX=Random(0,($GUIWidth/($Size+1))*.8,1)*($Size+1), $BarrierY=Random(0,($GUIHeight/($Size+1))*.8,1)*($Size+1) _SQLite_GetTable2d(-1,"Select * from positions where x between "&$BarrierX&" AND "&$BarrierX+$BarrierLen&" and y between "&$BarrierY-$Size&" AND "&$BarrierY+$Size+1&" and (lbl like 'Treat' or lbl like 'Player %');",$aResult,$iRows,$iCols) Until $iRows=0 If $WallIDs[UBound($WallIDs)-1]<> "" Then ReDim $WallIDs[UBound($WallIDs)+1] $WallIDs[UBound($WallIDs)-1] = GUICtrlCreateLabel("",$BarrierX,$BarrierY,$BarrierLen,$Size) GUICtrlSetBkColor(-1,0x999999) For $i=0 To $BarrierLen Step $Size+1 _SQLite_Exec(-1,"Insert into positions values ('a wall','',"&$BarrierX+$i&","&$BarrierY&");") Next Else $BarrierLen=Random((.2*$GUIHeight)/($Size+1),(.67*$GUIHeight)/($Size+1),1)*($Size+1) Do Local $BarrierX=Random(0,($GUIWidth/($Size+1))*.8,1)*($Size+1), $BarrierY=Random(0,($GUIHeight/($Size+1))*.8,1)*($Size+1) _SQLite_GetTable2d(-1,"Select * from positions where x between "&$BarrierX-$Size&" AND "&$BarrierX+$Size+1&" and y between "&$BarrierY&" AND "&$BarrierY+$BarrierLen&" and (lbl like 'Treat' or lbl like 'Player %');",$aResult,$iRows,$iCols) Until $iRows=0 If $WallIDs[UBound($WallIDs)-1]<> "" Then ReDim $WallIDs[UBound($WallIDs)+1] $WallIDs[UBound($WallIDs)-1] = GUICtrlCreateLabel("",$BarrierX,$BarrierY,$Size,$BarrierLen) GUICtrlSetBkColor(-1,0x999999) For $i=0 To $BarrierLen-$Size Step $Size+1 _SQLite_Exec(-1,"Insert into positions values ('a wall','',"&$BarrierX&","&$BarrierY+$i&");") Next EndIf EndFunc Func MakeTreatPic() Local $TreatPicFile=FileOpen(@ScriptDir&"\CherryTreat.bmp",2) If $TreatPicFile=-1 Then Return FileWrite($TreatPicFile,Binary("0x424DC60400000000000036040000280000000C0000000C000000010008000000000090000000000000000000000000 0000000000000000000000000080000080000000808000800000008000800080800000C0C0C000C0DCC000F0CAA600002040 0000206000002080000020A0000020C0000020E00000400000004020000040400000406000004080000040A0000040C00000 40E00000600000006020000060400000606000006080000060A0000060C0000060E000008000000080200000804000008060 00008080000080A0000080C0000080E00000A0000000A0200000A0400000A0600000A0800000A0A00000A0C00000A0E00000 C0000000C0200000C0400000C0600000C0800000C0A00000C0C00000C0E00000E0000000E0200000E0400000E0600000E080 0000E0A00000E0C00000E0E00040000000400020004000400040006000400080004000A0004000C0004000E0004020000040 2020004020400040206000402080004020A0004020C0004020E00040400000404020004040400040406000404080004040A0 004040C0004040E00040600000406020004060400040606000406080004060A0004060C0004060E000408000004080200040 80400040806000408080004080A0004080C0004080E00040A0000040A0200040A0400040A0600040A0800040A0A00040A0C0 0040A0E00040C0000040C0200040C0400040C0600040C0800040C0A00040C0C00040C0E00040E0000040E0200040E0400040 E0600040E0800040E0A00040E0C00040E0E00080000000800020008000400080006000800080008000A0008000C0008000E0 0080200000802020008020400080206000802080008020A0008020C0008020E0008040000080402000804040008040600080 4080008040A0008040C0008040E00080600000806020008060400080606000806080008060A0008060C0008060E000808000 00808020008080400080806000808080008080A0008080C0008080E00080A0000080A0200080A0400080A0600080A0800080 A0A00080A0C00080A0E00080C0000080C0200080C0400080C0600080C0800080C0A00080C0C00080C0E00080E0000080E020 0080E0400080E0600080E0800080E0A00080E0C00080E0E000C0000000C0002000C0004000C0006000C0008000C000A000C0 00C000C000E000C0200000C0202000C0204000C0206000C0208000C020A000C020C000C020E000C0400000C0402000C04040 00C0406000C0408000C040A000C040C000C040E000C0600000C0602000C0604000C0606000C0608000C060A000C060C000C0 60E000C0800000C0802000C0804000C0806000C0808000C080A000C080C000C080E000C0A00000C0A02000C0A04000C0A060 00C0A08000C0A0A000C0A0C000C0A0E000C0C00000C0C02000C0C04000C0C06000C0C08000C0C0A000F0FBFF00A4A0A00080 8080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFFFFFFF0B4545010AFFFFFFFFFFFF4B4E 4E4E4645FFFF4D4E46454D4F4F4F4E460B4D4F4F4F4E4E5757574F4E4B4F57574F4F4E5757574F4EFF575757574F4E4D4F5B 4EFFFF54575756564DFFFF21FFFFFFFF544E5529FFFFFF21FFFFFFFFFFFFFFFF21FFFF21FFFFFFFFFFFFFFFFFF21FF1919FF FFFFFFFFFFFFFFFF215A21FFFFFFFFFFFFFFFFFFFF2102FFFF")) FileClose($TreatPicFile) EndFunc Func WinActivated($hWndGUI,$MsgID,$WParam,$LParam) If $WParam=1 AND $hWndGUI=$NibblesGUI Then $Paused=0 $NewHotkeyMode=1 If HotKeySet("{Right}","Hotkeys")<>1 Then $NewHotkeyMode=0 If HotKeySet("{Up}","Hotkeys")<>1 Then $NewHotkeyMode=0 If HotKeySet("{Left}","Hotkeys")<>1 Then $NewHotkeyMode=0 If HotKeySet("{Down}","Hotkeys")<>1 Then $NewHotkeyMode=0 If $NewHotkeyMode=0 Then HotKeySet("{Right}") HotKeySet("{Up}") HotKeySet("{Left}") HotKeySet("{Down}") EndIf If $NewHotkeyMode=1 AND $HotkeyMode=0 Then TrayTip("Hotkey Information","The arrow hotkeys have been released by the other program; the game will run at full responsiveness now",10) If $NewHotkeyMode=0 AND $HotkeyMode=1 Then TrayTip("Warning","Another program has stolen the arrow hotkeys while the game was paused; the game will not be as responsive now",10) $HotkeyMode=$NewHotkeyMode Else GUISetState($GUI_SHOW,$hWndGUI) $Paused=1 HotKeySet("{Right}") HotKeySet("{Up}") HotKeySet("{Left}") HotKeySet("{Down}") EndIf EndFuncEdit: The forum is breaking the binary string instead of wrapping it. When you copy it, hit delete on each of the hex lines so it's on one long line...sorry for the manual process Or you can just add a "Return" to the beginning of that function and delete the hex lines entirely and it'll display a red box instead of the picture.1 point