- --[[
- Minesweeper Solver via Lua Example
- by atom0s
- ]]--
- -- ## DO NOT EDIT BELOW THIS LINE!! ##
- local Minesweeper_Example = { }
- ----------------------------------------------------------------------------------
- -- func: Minesweeper_Example.CallStepSquare( .. )
- -- desc: Calls our StepSquare cave to internally call left-click function.
- ----------------------------------------------------------------------------------
- function Minesweeper_Example.CallStepSquare( x, y )
- -- Write current X and Y to memory.
- autoAssemble(
- "alloc(tempFunc, 1024)\n" ..
- "CreateThread(tempFunc)\n" ..
- "tempFunc:\n" ..
- "mov [currXPos], " .. tostring( x ) .. "\n" ..
- "mov [currYPos], " .. tostring( y ) .. "\n" ..
- "ret\n"
- );
- -- Create thread calling our StepSquare function.
- autoAssemble( "CreateThread(StepSquareCave)\n" );
- -- Cleanup temp function.
- autoAssemble( "dealloc(tempFunc)\n" );
- end
- ----------------------------------------------------------------------------------
- -- func: Minesweeper_Example.CallMakeGuess( .. )
- -- desc: Calls our MakeGuess cave to internally call right-click function.
- ----------------------------------------------------------------------------------
- function Minesweeper_Example.CallMakeGuess( x, y )
- -- Write current X and Y to memory.
- autoAssemble(
- "alloc(tempFunc, 1024)\n" ..
- "CreateThread(tempFunc)\n" ..
- "tempFunc:\n" ..
- "mov [currXPos], " .. tostring( x ) .. "\n" ..
- "mov [currYPos], " .. tostring( y ) .. "\n" ..
- "ret\n"
- );
- -- Create thread calling our MakeGuess function.
- autoAssemble( "CreateThread(MakeGuessCave)\n" );
- -- Cleanup temp function.
- autoAssemble( "dealloc(tempFunc)\n" );
- end
- ----------------------------------------------------------------------------------
- -- func: Minesweeper_Example.Main( .. )
- -- desc: Main script function that handles everything of the script.
- ----------------------------------------------------------------------------------
- function Minesweeper_Example.Main ( )
- -- Obtain current board sizes.
- Minesweeper_Example.BoardWidth = readInteger( "10056AC" );
- Minesweeper_Example.BoardHeight = readInteger( "10056A8" );
- -- Board layout starting position.
- Minesweeper_Example.BoardStart = 16798528;
- -- Allocate memory locations for x and y positions.
- autoAssemble(
- "globalalloc(currXPos, 4)\n" ..
- "globalalloc(currYPos, 4)\n"
- );
- -- Allocate cave for StepSquare function.
- autoAssemble(
- "globalalloc(StepSquareCave, 1024)\n" ..
- "StepSquareCave:\n" ..
- "push [currYPos]\n" ..
- "push [currXPos]\n" ..
- "mov eax, 01003512\n" ..
- "call eax\n" ..
- "ret\n"
- );
- -- Allocate cave for MakeGuess function.
- autoAssemble(
- "globalalloc(MakeGuessCave, 1024)\n" ..
- "MakeGuessCave:\n" ..
- "push [currYPos]\n" ..
- "push [currXPos]\n" ..
- "mov eax, 0100374F\n" ..
- "call eax\n" ..
- "ret\n"
- );
- -- Attempt to solve the board.
- local boardX = 1;
- local boardY = 1;
- for boardX = 1, Minesweeper_Example.BoardWidth do
- for boardY = 1, Minesweeper_Example.BoardHeight do
- local bCurrentPos = Minesweeper_Example.BoardStart + ( boardX + ( boardY * 32 ) );
- local bValue = readBytes( bCurrentPos, 1 );
- if( bValue ~= 0x8F ) and ( bValue == 0x0F ) then
- Minesweeper_Example.CallStepSquare( boardX, boardY );
- else
- Minesweeper_Example.CallMakeGuess( boardX, boardY );
- end
- end
- end
- -- Cleanup allocations.
- autoAssemble(
- "dealloc(currXPos)\n" ..
- "dealloc(currYPos)\n" ..
- "dealloc(MakeGuessCave)\n" ..
- "dealloc(StepSquareCave)\n"
- );
- return true;
- end
- -- Execute our script.
- Minesweeper_Example.Main();
Moving To Discord: https://discord.gg/UmXNvjq
Hello everyone, due to bugs with the forum software that I do not have time to care about, I am going to be shutting down these forums and moving my discussions to Discord instead. I will eventually keep releases here on the site but the forums will be removed sooner or later. I encourage people to join my personal Discord if you have questions, if you are looking for any of my projects, etc.
Registration Code (Part 1): w%kQ6
Registration Code (Part 2): b<#$1[*(cw~
In order to register on this forum, you must use the codes above. Combine them into one code (copy paste).
Hello everyone, due to bugs with the forum software that I do not have time to care about, I am going to be shutting down these forums and moving my discussions to Discord instead. I will eventually keep releases here on the site but the forums will be removed sooner or later. I encourage people to join my personal Discord if you have questions, if you are looking for any of my projects, etc.
Registration Code (Part 1): w%kQ6
Registration Code (Part 2): b<#$1[*(cw~
In order to register on this forum, you must use the codes above. Combine them into one code (copy paste).
Cheat Engine 6.x Minesweeper Auto-Solver
- atom0s
- Site Admin
- Posts:450
- Joined:Sun Jan 04, 2015 11:23 pm
- Location:127.0.0.1
- Contact:
Derp~
Need a great web host? Check out: AnHonestHost.com
Donations can be made via Paypal:
https://www.paypal.me/atom0s
Need a great web host? Check out: AnHonestHost.com
Donations can be made via Paypal:
https://www.paypal.me/atom0s
Who is online
Users browsing this forum: No registered users and 1 guest