Jump to content

Datenshi

Active Members
  • Posts

    167
  • Joined

  • Last visited

About Datenshi

  • Birthday 02/02/1987

Profile Information

  • Location
    Sweden
  • WWW
    http://www.fetgrek.com

Recent Profile Visitors

677 profile views

Datenshi's Achievements

Prodigy

Prodigy (4/7)

0

Reputation

  1. Eh, first of this isn't the help section of the forums. Second, i can hardly understand what you mean...I guess you want to replace "1.366680386.0". You either do that with StringRegExpReplace() Or use _StringBetween() which will give you the string(word/number) between two strings. For Example _StringBetween($string,'extension="0" root=', '/>') would return '"1.366680386.0"' You then use that string with StringReplace()
  2. Oyeah its quite buggy =) Found a couple of problems which are tied to the table generation. Fixed it but it took way too long to generate new sudoku tables so i'm thinking of some smart algo that'll solve it. Current way is pretty much pure bruteforce which has issues in itself
  3. Made this Sudoku game yesterday for fun. The coding is pretty rough and not at all optimized but i think its working fine Anyway, you're welcome to try it. I'm probably gonna work some more on it later on so if you're interested check back for an update later on. Source: #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.6.1 Author: Datenshi @ Autoit Forums Script Function: Sudoku Game. Enjoy #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #region ### START Koda GUI section ### Form= $SudokuGUI = GUICreate("Sudoku", 408, 334, 192, 124) Opt("GUIDataSeparatorChar", "|") ;# DRAW GRID LABELS GUICtrlCreateLabel("", 25, 110, 262, 5) GUICtrlSetBkColor(-1, 0x00000) GUICtrlCreateLabel("", 25, 200, 262, 5) GUICtrlSetBkColor(-1, 0x00000) GUICtrlCreateLabel("", 108, 25, 5, 265) GUICtrlSetBkColor(-1, 0x00000) GUICtrlCreateLabel("", 197, 25, 5, 265) GUICtrlSetBkColor(-1, 0x00000) ;# DRAW GRID LABELS $GenSudoku = GUICtrlCreateButton("Generate Sudoku", 296, 288, 97, 41) $Check = GUICtrlCreateButton("Check", 296, 240, 97, 41) $Solve = GUICtrlCreateButton("Solve it!", 296, 190, 97, 41) $Combo1 = GUICtrlCreateCombo("", 312, 16, 89, 25) GUICtrlSetData($Combo1, "Easy|Medium|Hard", "Easy") #endregion ### END Koda GUI section ### Global $_aGUICtrlTableBordersINTERNALSTORE[1][2] $genstart = 0 Dim $array[1] Dim $SudArray[10][10] $Table1 = _GUICtrlTableEDIT_Create(25, 27, 20, 20, 9, 9, 10) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $GenSudoku $genstart = 1 $LAbel = GUICtrlCreateLabel("Generating Table", 130, 6, 97, 21) Do SudokuEngine() Until GUICtrlRead($SudArray[UBound($SudArray, 1) - 1][UBound($SudArray, 2) - 1]) <> "" GUICtrlDelete($LAbel) ;SudokuEngine() Switch GUICtrlRead($Combo1) Case "Easy" SudokuFill(25) Case "Medium" SudokuFill(20) Case "Hard" SudokuFill(15) EndSwitch Case $Check If $genstart = 1 Then SudokuCheck() Case $Solve SudokuFill(81) EndSwitch WEnd Func _GUICtrlTableEDIT_Create($iLeft, $iTop, $iWidth, $iHeight, $iRows, $iColumns, $iGapWidth = 1) ; ; Table UDF Author ........: AndyBiochem ; Modified by Datenshi Local $i, $j, $iCurrBoxLeft = 0, $iCurrBoxTop = 0, $aTemp Global $array[$iRows + 1][$iColumns + 1] If $iGapWidth < 0 Then $iGapWidth = 0 $iGapWidth = Round($iGapWidth) For $i = 1 To $iRows For $j = 1 To $iColumns $array[$i][$j] = GUICtrlCreateEdit("", $iLeft + $iCurrBoxLeft, $iTop + $iCurrBoxTop, $iWidth, $iHeight, 0x2000) ;GUICtrlCreateLabel("", $iLeft + $iCurrBoxLeft, $iTop + $iCurrBoxTop, $iWidth, $iHeight) GUICtrlSetBkColor(-1, 0xFFFFFF) $iCurrBoxLeft += $iWidth + $iGapWidth Next $iCurrBoxLeft = 0 $iCurrBoxTop += $iHeight + $iGapWidth Next ReDim $_aGUICtrlTableBordersINTERNALSTORE[UBound($_aGUICtrlTableBordersINTERNALSTORE, 1) + 1][2] Dim $aTemp[$iRows + 1][$iColumns + 1][5] $_aGUICtrlTableBordersINTERNALSTORE[UBound($_aGUICtrlTableBordersINTERNALSTORE) - 1][0] = $array[1][1] $_aGUICtrlTableBordersINTERNALSTORE[UBound($_aGUICtrlTableBordersINTERNALSTORE) - 1][1] = $aTemp Return $array EndFunc ;==>_GUICtrlTableEDIT_Create Func SudokuEngine() ReDim $SudArray[10][10] Local $Collision, $break = 0, $NumberPool = "123456789" For $i = 1 To 9 $NumberPool = "123456789" For $j = 1 To 9 $NrPick = RandomizeString($NumberPool, $i - 1, $j) $SudArray[$i][$j] = $NrPick Sleep(0) $NumberPool = StringReplace($NumberPool, $NrPick, "") Next Next EndFunc ;==>SudokuEngine Func RandomizeString($String, $last, $coll) If $last > 0 Then For $e = 1 To $last $String = StringReplace($String, $SudArray[$e][$coll], "") Next EndIf $Len = StringLen($String) $Rndm = Random(1, $Len, 1) If $Len = 1 Then $Rndm = 1 Return StringMid($String, $Rndm, 1) EndFunc ;==>RandomizeString Func SudokuFill($diff) ;#Clear table For $x = 1 To 9 For $h = 1 To 9 GUICtrlSetData($array[$x][$h], "") Next Next ;#Clear table For $d = 1 To $diff Do $Next = 0 $RandomClue1 = Random(1, 10) $RandomClue2 = Random(1, 10) If GUICtrlRead($array[$RandomClue1][$RandomClue2]) = "" Then GUICtrlSetData($array[$RandomClue1][$RandomClue2], $SudArray[$RandomClue1][$RandomClue2]) GUICtrlSetState($array[$RandomClue1][$RandomClue2], $GUI_DISABLE) $Next = 1 EndIf Until $Next = 1 Next EndFunc ;==>SudokuFill Func SudokuCheck() $key = 0 For $o = 1 To 9 For $a = 1 To 9 If GUICtrlRead($array[$o][$a]) = $SudArray[$o][$a] Then $key = 1 ContinueLoop Else MsgBox(0, "Bad Luck!", "Incorrect match at -> " & " Row: " & $o & " Collumn: " & $a & " Square # " & $o * $a) $key = 0 ExitLoop (2) EndIf Next Next If $key = 1 Then MsgBox(0, "WINNER!", "You've solved the soduko. !!Good Work!!") EndFunc ;==>SudokuCheck Executable is attached. Sudoku.exe
  4. excellent work, I've had a need for this on quite a few occasions
  5. That's right, it doesn't work with the new RS site, actually this time its no small change on Rapidshare which would be easily solved. They completely changed how the download process work, and incorporated it with their API. This means yet another complete rewrite of RQs downloading procedure. I hardly have any time at all to code now a days, which I'm sure you've noticed. The little time ive had, i put into extending RQ to work with Megaupload and improving the GUI. However now that the whole RS code is obsolete its going to take even more time until i can get a stable release out. To be frank I'm kinda annoyed with Rapidshare, recently they've made poor choices with their service, for example since a few months back they've lowered the average bandwidth for free users by quite a bit, hence download speeds are slower. Furthermore Megaupload is imo a much better service although they lack a proper API to use. Reading the updated API documentation on Rapidshare, they tell you its forbidden to automate the process of downloading queued links(RapidQueuer). In other words its OK to download 1 file after another but you have to manually start the process of each single download, this goes against the very reason for RQ to exist and obviously pisses me off. So basically, what I'm trying to say is you guys should look for alternatives to RQ at this point, its going to take quite a while until i can get an updated version of RQ out, if ever. I might completely drop Rapidshare support because I'm so disappointed with them.
  6. Think you're being a bit hard on the guy, he's no scientist, but he's contributing to the AutoIT community which he should be commended for, big or small
  7. Good work Melba
  8. huh? Opt("TCPTimeout",100)
  9. Next time, don't use strange chars in the rar archive. It messed up the files for me. the i is not a standard i.
  10. Needed this so i put it together in 10min, someone might find it useful. If you're wondering what it does then read help for _ArrayFindAll. Basically returns an array of elements that contain a certain string. iPartial = 1 means $vValue of "hello", will match byehellobye. Default is 0 is exact match, "hello" matches only "hello". Func _ArrayLookup(Const ByRef $avArray, $vValue, $iStart = 0, $iEnd = 0,$iPartial = 0) ; Quickly searches an array for a specific value and return element if found. Local $iResSize = 0, $avSize = UBound($avArray) - 1 If $iStart > $avSize Then Return SetError(2) ; out of bound Dim $avResult[$avSize] If $iEnd <> 0 And $iEnd <= $avSize Then $avSize = $iEnd ; If End param is valid set it. For $iIndex = $iStart To $avSize Switch $iPartial Case 0 If StringInStr($avArray[$iIndex], $vValue) <> 0 Then ; allows partial match $avResult[$iResSize] = $iIndex $iResSize += 1 EndIf Case 1 If $avArray[$iIndex] = $vValue Then ; allows only exact match $avResult[$iResSize] = $iIndex $iResSize += 1 EndIf Next If $iResSize = 0 Then Return SetError(1) ; nothing found ReDim $avResult[$iResSize] Return $avResult EndFunc ;==>_ArrayLookup
  11. Post for update: Minor bugfix update in 2.4.4, Rapidshare updated their source code which messed up some stuff in error checking, causing it to crash. Also added support for the not so common error "The file is not fully saved at RapidShare yet. This file is possibly still being uploaded." Project update: I haven't had much time to code, a lot of studying =) However I got more free time now during the summer so, to start I've been looking into improving the GUI as RQ is starting to outgrow its current GUI. I've also developed a script which automates downloads from Megaupload, its in beta stage which lacks quite a lot of polishing, however I'm probably going to incorporate it into RQ later on. It'll require quite a few rewrites which might as well be done since i think i can optimize the code further. ENJOY!
  12. yeah, i was kinda sloppy when i put it together =) ah well, hopefully fixed it now
  13. Yo Fmen, actually..its the same coder that did the Greasemonkey script and the python one which i use. I have no idea how to translate the javascript(greasemoney) or the python one, into AutoIT. I doubt its possible tbh cause there's some serious image manipulation which is hard to follow. I put it up on Megaupload, you can get it here *removed due to crap compile* new link in OP
  14. Putting it up here for people to try it out, MuGrab automates download from Megaupload, decoding the captcha using a neural net written in python(By Shaun Friedle) Paste Megaupload links in the "links.txt" file then start MuGrab, Remember this is Beta and so you might run into bugs and stuff, if you're able to report them please do. I may incorporate the final code in RapidQueuer, which is another project of mine, we'll see. Download Hosted on my site due to size restrictions. Here too http://www.megaupload.com/?d=8IJS0XK7 Zipfile includes script exe, Anticaptcha(python)<- reason the file is 2mb. There's no source rls until i can clean it up and get some more stuff done.
  15. Love this project of yours Stumpii. I'm on Win7 x64 as well, and for the most part it works well, i ran into problems yesterday but fixed it somehow(cant remember), if i stumbled upon any more I'll make sure to submit it. One thing tho! the debugger seem to crash for me when copying rather large variables, For example i had a variable containing a HTML source, the Watch section didn't show anything and didn't seem to work at all for such a large variable. When i then tried to copy the content the debugger crashed. This may or may not be a Win7 X64 issue but i seem to vaguely remember the size limit of variables being an issue on XP as well. Thanks!
×
×
  • Create New...