Jump to content

AutoIt Chess


monoceres
 Share

Recommended Posts

monoceres

Hi friend!

Looks very nice! But doesn't work :) I get error

Subscript used with non-Array variable

From below function:

Func CanPieceMoveThere($PieceIndex, $Column, $Row)
    $struct = GetStructFromPieces()
    $call = DllCall($hDll, "int:cdecl", "CheckPieceMove", "ptr", DllStructGetPtr($struct), "int", $PieceIndex, "int", $Column, "int", $Row)
    

    
    Return $call[0]

    
    Return False
EndFunc   ;==>CanPieceMoveThere
Link to comment
Share on other sites

monoceres

Hi friend!

Looks very nice! But doesn't work :) I get error

From below function:

Func CanPieceMoveThere($PieceIndex, $Column, $Row)
    $struct = GetStructFromPieces()
    $call = DllCall($hDll, "int:cdecl", "CheckPieceMove", "ptr", DllStructGetPtr($struct), "int", $PieceIndex, "int", $Column, "int", $Row)
    

    
    Return $call[0]

    
    Return False
EndFunc   ;==>CanPieceMoveThere
After you install VC++ 2008 Redist?
Link to comment
Share on other sites

Thanks, I'm trying to implement a minmax algorithm right now so we can have a bot as well :)

@monoceres

Works fine but the window always flashes in white.... (I've vc 2008)

Hmm, I have no idea how that can happen. What OS and did you run something special when it happened? A screenshot would be nice as well.

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

Hmm, I have no idea how that can happen. What OS and did you run something special when it happened? A screenshot would be nice as well.

The problem is CursorXP because when I close it, its ok but I havnt cursor then... :)

Its always when i move cursor the window take white color...

Edited by FireFox
Link to comment
Share on other sites

  • 9 months later...

4M421N'! Th12 12 5o u53r Phr13ndLY 4nD Pr3TTy TH@ 5oM3 P3opL3 M1GHt Th1NK 1T W42 pHL45H! Good, goOd JO8!

This statement is a lie.˙uʍop-ǝpısdn sı ǝuo sıɥʇ ʇnq 'ǝıl ɐ ǝq ʎɐɯ ʇuǝɯǝʇɐʇs snoıʌǝɹd ǝɥʇ¡6u15nɟu0) ʎ||43ɹ 51 51ɥ7

Link to comment
Share on other sites

  • 4 years later...

FIRST, I now it is an old thread...but I just found this and found that a few things were broken, and it looks like a kiss a$$ script. I fixed, what I got errors about, but when trying to move the pieces, they take quite a few clicks to grab and also to move.

Here is what was broken:

AdlibRegister/AdlibUnRegister replaced the functions AdlibEnable() and AdlibDisable()

Also these two functions were already declared in later versions, but the first one was different, so changed the name and also changed the name of where it was called...

Func _GDIPlus_MatrixTranslate_Default($hMatrix, $nOffsetX, $nOffsetY, $fOrder = True)
$aResult = DllCall($ghGDIPDll, "int", "GdipTranslateMatrix", "ptr", $hMatrix, "float", $nOffsetX, "float", $nOffsetY, "int", $fOrder)
If @error Then Return SetError(@error, @extended, False)
Return SetError($aResult[0], 0, $aResult[0] = 0)
EndFunc ;==>_GDIPlus_MatrixTranslate_Default


Func _GDIPlus_MatrixScale_Default($hMatrix, $nScaleX, $nScaleY, $fOrder = False)
$aResult = DllCall($ghGDIPDll, "int", "GdipScaleMatrix", "ptr", $hMatrix, "float", $nScaleX, "float", $nScaleY, "int", $fOrder)
If @error Then Return SetError(@error, @extended, False)
Return SetError($aResult[0], 0, $aResult[0] = 0)

EndFunc ;==>_GDIPlus_MatrixScale_Default

Just to let you know, the EXE appears to work fine.

Thanks for all your hard work and what a very nice script..."HOW ABOUT A NICE GAME OF CHESS?"

 

EDIT RESOLVED

I went ahead and changed the code for _GDIPlus_MatrixTranslate, to call the new function, only adding the default FALSE, to the last paramater.

I was also able to fix the AdlibRegister issue, by calling it with the same timer that was used in the original calls to AdlibEnable(). I also added the funtion name to the AdlibUnRegister() call (it might not be needed) for the old AdlibDisable()

Edited by nitekram

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...