 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Rubberduck Guest
|
Posted: Sat Apr 23, 2005 9:14 pm Post subject: Can Zuma Deluxe be play (solved) by AutoHotKey ?? |
|
|
I have problems solving the 12th Level of Zuma Deluxe.
I thought about writing a program that ist playing Zuma itself.
So the program must examine, where the balls are in the
Zumawindow (or on screen), set the mouse on the right
position and click the mousebutton to fire the target-ball.
Of course the logic must be programmed by hand (where are
two same colored balls together, where to fire the targetball
and so on). My question is now: Can this be done with Autohotkey?
If yes, may be we can start a own Zuma-Solver-Thread here.
I think wthis would be fun. |
|
| Back to top |
|
 |
Rubberduck Guest
|
Posted: Sat Apr 23, 2005 9:49 pm Post subject: same as above |
|
|
I have read the thread:
http://www.autohotkey.com/forum/viewtopic.php?t=829&postdays=0&postorder=asc&start=0
so may be it is possible to send keys to the Zumawindow,
but is Autohotkey capable of reading colors of definded
positions in another window, and is the macro-language
of AHK mighty enough to program the logic of a program
that can autoplay Zuma ?
I only want to dig dipper in the AHK-macro-language if someone
tells me that it is possible to do such things. I think there are a
lot of AHK-profis in this forum to tell me.
Thanks. |
|
| Back to top |
|
 |
Rubberduck Guest
|
Posted: Sat Apr 23, 2005 10:16 pm Post subject: same as above |
|
|
OK, I have read know some Threads in thie forum and
found that there is a function
called PixelGetColor or PixelSearch.
So it seems possible to get a Pixelcolor in another window:
I know think about program that somehow looks like this
(my own pseudocode):
//where to look for the colors of the zumaballs and to what
//position shoot the targetball
const Array of positions [1..200] x,y, shootx, shooty : integer = {...definitions}
//here we save the colors of the balls at all positions
var Array of colors [1..200] color;
loopstart:
For i =1 to 200 do color[ i ]) = getcolor (x [ i ],y [ i ]);
getcolor of targetball(); //get the color of the ball the frog
//is having in his mouth
For i=1 to 199 do if (color[ i ] == color [i++]) AND
( color [ i ]=targetballcolor) then
begin
setmouse(shootx[ i ],shooty [ i ] );
leftmouseclick; //shoot the ball
end;
loopend;
Can such things be done in AHK?
Sorry for the 3 posts (and my bad english).
This is my last post in this thread if no one is anwsering. |
|
| Back to top |
|
 |
Rubberduck Guest
|
Posted: Sun Apr 24, 2005 12:18 am Post subject: My first script for the Zuma Deluxe Game |
|
|
Ok, no one seems interrested in my Zuma Deluxe Solver ,
so I tried to figure out my first own AHK-Script.
You must have Zuma installed on your System.
My Script shows a Easteregg that is hidden in Zuma.
It can be found here:
http://www.sharewareorder.com/ZUMA-DELUXE-download-32346.htm
Here my script:
| Code: |
gui, color, FFFFFF
gui, add, text, x10 y10,Start Zuma (do nothing within Zuma)`nThen click the Button in this AHK-Script
gui, add, button, x10 y40,Show Zuma UFO and Credits
gui, show
return
RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
return
MoveZumaLeftUpAndStartit()
{
IfWinExist, Zuma Deluxe 1.0
WinActivate
WinMove, 0, 0
CoordMode, Mouse, Screen
MouseMove, 315, 483, 0
MouseClick, left
}
ButtonShowZumaUFOandCredits:
MoveZumaLeftUpAndStartit()
CoordMode, Mouse, Screen
Loop, 3
{
MouseMove, 620, 70, 0 ; Zur Startposition
MouseMove, 440, 378, 100 ;Links runter fahren über drei Knöpfe
MouseMove, 620, 378, 100 ;über den rechten Knopf fahren
}
MouseMove, 280, 249, 0 ;Zur UFOposition fahren
Sleep, 2000 ; wait 2 seconds until UFO arrives
ToolTip, Click the UFO for the Credits`nBut be fast before it disappears.
SetTimer, RemoveToolTip, 5000
return
exitapp
|
|
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Sun Apr 24, 2005 12:35 am Post subject: Re: My first script for the Zuma Deluxe Game |
|
|
| Rubberduck wrote: | | Ok, no one seems interrested in my Zuma Deluxe Solver | It's not so much that no one is interested. It's more that you're just a very fast learner  |
|
| Back to top |
|
 |
dijiyd
Joined: 01 Apr 2004 Posts: 90 Location: Philippines
|
Posted: Sun Apr 24, 2005 12:38 am Post subject: |
|
|
Uh... well, I guess you pretty much answered all your own questions.
Oh yeah, the thing is, we don't have the population for at least one person to be around at any time. Try waiting for at most a day, I'm sure you'll get a reply by then. I mean, if no one replies to your post in three hours, then no one just has probably come by yet. So don't worry about it.
edit:
um.. yeah, what chris said. |
|
| Back to top |
|
 |
Rubberduck* Guest
|
Posted: Sun Apr 24, 2005 12:55 am Post subject: No one interrested ? |
|
|
A, someone anwsered:
Yes I think I learn fast, but only because the script-language
is very good, and the documentation too.
I really get more and more used with AHK.
The upper script was done quite quick.
I find it funny how the script is playing Zuma for me, also it
does in this state not really play it.
I only was writing it to test if AHK can do what I want.
Next I want to try do the following things:
1: The script should check If Zuma is running, If not it should start it.
Can AHK read the registry (I have not yet checked if it can)?
2: I don't want to move the Zuma-Window in the upper left corner.
I want it to be played with relative coordinates where it is on screen,
but I have not yet figured out, how to get the window-Coordinates of
the zuma-windows.
3: The script should check how much stages the User already played
(how much temples he has uncovered) and then automatically
start the last stage.
There are a lot of things to do, but I think I can manage it.
AHK is really a f***ing good Programming-language (I call it so).
All good wishes to Chris, who has done a great job.
P.S.: I think I should sign on to this Forum as a new member.
Can I ????  |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Sun Apr 24, 2005 5:58 pm Post subject: Re: No one interrested ? |
|
|
| Rubberduck wrote: | | Can AHK read the registry | Yes, RegRead/Write/Delete.
| Quote: | I think I should sign on to this Forum as a new member. Can I  | Yes, there is a link somewhere to register a username. It's very quick because no e-mail validation is required. |
|
| Back to top |
|
 |
Rubberduck
Joined: 24 Apr 2005 Posts: 96
|
Posted: Mon Apr 25, 2005 1:50 am Post subject: Ok, my Script is now better |
|
|
Here is my current scriptstate.
The Script does nothing more, than to center Zuma on screen
and allow the user to see the Zuma-Ufo-Easteregg and to quickly
move to his latest Adventure-Stage (the program makes some
comments about his progress).
I startet with AHK-scriptlanguage yesterday and the script is not
yet ready and is having a bug I am to tired to fix now.
IF you have Zuma Deluxe installed, you can test it and make
comments.
| Code: |
;/// Build up a little Gui for the script
gui, color, FFFFFF
gui, add, text, x10 y10,Start Zuma (do nothing within Zuma)`nThen click the Button in this AHK-Script
gui, add, button, x10 y40,Show Zuma UFO and Credits
gui, add, button, x10 y70,Play highest Zuma Adventure Stage
gui, show
return
;///removes a tooltip after some time
RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
return
;///later used to fire the Zumaball
ShootBall:
MouseClick, left
return
;///global variables
ZumaX = 0; ZumaY = 0 ;// X-X-Position on screen
ZumaWidth = 0; ZumaHeight = 0 ;// Width and Height of the window
ZumaState = 0; ;// In which of the different Zuma-Windows are we
;// I do check this, because the User can start this script while he was
;// playing Zuma. If he wants my script to help him, I directly can take
;// Control of the current stage and solve it for him. If he is not currently
;// playing I automatically start the last stage he succeded and solve this.
;// 0 = Startwindow, 1 = Mainmenü, 2 = Adenture Stage Selection
;// 3 = Gauntlet Stage Selection, 4 = Instructions Screen
BestAdventureStage = 1; ;//The Stage the User reached best in Zuma
;///Mostly for debugging I give out some Screenmessages
DoAlert(Was)
{
MsgBox, %was%
}
;//Ok, in real this Funktion is not needed to let this script play the last
;//stage the user has reached, but I tried to make some comments on his progress.
;//Also I know, that there should be a way to read the users stageprogress out
;//of a file in the Zumadirectory I thought it would be fun to show what AHK can
;//do. Great job Chris ;)
GetBestAdventureStage()
{
;//Some constants. Sorry, but I am not yet common with Arrays in AHK
TempleArray12 = 393,100,0x00B1FC
TempleArray11 = 322,100,0x00A6FD
TempleArray10 = 257,100,0x00A2FF
TempleArray9 = 600,211,0x00B8FF
TempleArray8 = 534,205,0x0578F7
TempleArray7 = 479,207,0x00B3FF
TempleArray6 = 149,207,0x0198FF
TempleArray5 = 100,218,0x0095FD
TempleArray4 = 32,236,0x02A2FF
TempleArray3 = 388,365,0x00A5FE
TempleArray2 = 331,365,0x027AFF
TempleArray1 = 267,365,0x01B5FC
global BestAdventureStage
global ZumaState
;//To get this Info, we must got to the Adventure-Selection-Screen
MakeZumaActiveAndCenterIt() ;//Make sure Zuma is active and centered
ZumaStateCheck() ;//Look on what screen in Zuma we are
SetZumaState(2) ;//and from there go to the Adventure Screen
Sleep, 500 ;//Wait a little for Zuma to switch Screen
ZumaStateCheck() ;//For security we check it again
if (ZumaState <> 2) ;//something went wrong
{
DoAlert("I was not able to call the Adventure-Screen.`nScript is stopping now.")
MsgBox, %ZumaState%
exitapp
}
;//How do we know, which stage the User has reached? We move the Mouse over the
;//Temple-Portals from highest Portal to lowest and check if we find the Orange
;//Last-Stage-Color. A few lines up we always have gone over
;//the Main-menu-Screen to the Adventurescreen. This makes sure the last stage
;//is always marked orange, also if the User had selected another stage before
LoopCounter = 12 ;//There are 12 temples
Loop
{
StringSplit,SplitArray,TempleArray%LoopCounter%,`, ;//extract X,Y, and Color
X = %SplitArray1%
Y = %SplitArray2%
Testcolor = %SplitArray3%
PixelGetColor, RealColor, X, Y, ;//Read color at temple-entrance
if (Realcolor = Testcolor) ;//Ok, we found the Users last stage, lets break
break
LoopCounter-=1 ;//decrease LoopCounter
if (LoopCounter=1) ;//At least here we must break
break
}
If (LoopCounter >= 10)
MsgBox, Hey, already reached Stage %Loopcounter%`nMaybe you are a f***ing good`,`nZumaplayer or you cheated.
else
If (LoopCounter >= 7)
MsgBox, Already reached Stage %Loopcounter%`nOnly a few stages to go.
else
If (LoopCounter >= 4)
MsgBox, Hey, there are 12 stages and you only reached Stage %Loopcounter% till now.
else
If (LoopCounter >= 1)
MsgBox, Hey, only reached stage %Loopcounter%.`nHow heavy is your "Mouse"`nBuy a easier modell.
return
}
CallTheMainMenu()
{
global ZumaState
if (ZumaState = 0) ;//We are in the Startscreen
{
PlaceMouseInZuma(319,481,0) ;//Place Mouse on the Start-Zuma-Link
MouseClick, left ;// Click it
} else
if (ZumaState = 2) or (ZumaState = 3) ;//We are Adventure or Gauntlet-Screen
{
PlaceMouseInZuma(63,483,0) ;// Go on Main-Menu-Button
MouseClick, left ;// Click it
}
else
if (ZumaState = 4) ;//We are Instructions-Screen
{
PlaceMouseInZuma(561,481,0) ;//Go in OK-Button, this starts an Zuma-Level
MouseClick, left ;// Click it
PlaceMouseInZuma(580,43,0) ;//Go on Menu-Button in upper right corner
MouseClick, left ;// Click it
PlaceMouseInZuma(317,331,0) ;//Go on Go-back-to-Main-Menu-Button
MouseClick, left ;// Click it
}
return
}
;///This function tries to open the Screen given in "StateNr"
SetZumaState(StateNr)
{
global ZumaState
If (ZumaState = StateNr)
{
return
} else
{
if (StateNr = 0) ;//We want in the Zuma-Start-Page
{
DoAlert("It is not possible to got back to the Zuma-Start-Page`nTo do this Zuma must be closed and restartet")
return
} else
if (StateNr = 1) ;//We want in the Main-Menu-Screen
{
CallTheMainMenu()
} else
if (StateNr = 2) ;//We want in the Adventure-Selection-Screen
{
CallTheMainMenu() ;//Bring us back to Main-Menu-Screen
PlaceMouseInZuma(523,132,0) ;//Place Mouse on the Adventure Button
MouseClick, left ;//Click it
} else
if (StateNr = 3) ;//We want in the Gauntlet-Selection-Screen
{
CallTheMainMenu() ;//Bring us back to Main-Menu-Screen
PlaceMouseInZuma(512,212,0) ;//Place Mouse on the Gauntlet Button
MouseClick, left ;//Click it
}
}
return
}
;///Checks in what State (window, gamemode and so on) we are
ZumaStateCheck()
{
global ZumaState ;//reference to global Variable
;///////////////// NOW we try to get the color at the desirered position /////////////////////////
PixelGetColor, RealColor, 639, 264
if (Realcolor = 0x08144A)
ZumaState = 0
else if (Realcolor = 0x5A5245)
ZumaState = 1
else if (Realcolor = 0x26481F)
ZumaState = 2
else if (Realcolor = 0x678EBB)
ZumaState = 3
else if (Realcolor = 0x65BECC)
ZumaState = 4
}
;/// Places the Mouse with relative coordinates within the ZUMA-Gamewindow
PlaceMouseInZuma(X,Y,Speed)
{
CoordMode, Mouse, Relative ;// Be sure to work with relative coordinates
MouseMove, X, Y,Speed ;// Move Mouse to the right position
}
;/// Make Zuma active window, centers it on Screen and clicks the Start-The-Game-Link
MakeZumaActiveAndCenterIt()
{
IfWinExist, Zuma Deluxe 1.0
WinActivate ;//Activate Zuma Window
global ZumaX ZumaY ZumaWidth ZumaHeight ;//referenz to the global variables
WinGetPos,ZumaX, ZumaY, ZumaWidth, ZumaHeight, Zuma Deluxe 1.0 ;//get the Position and Size of the Zuma Window
ZumaX := (A_ScreenWidth / 2) - (ZumaWidth / 2) ;//Calc centered screenpostion X
ZumaY := (A_ScreenHeight / 2) - (ZumaHeight / 2) ;//Calc centered screenpostion Y
WinMove, ZumaX, ZumaY ;//center Window on Screen
; PlaceMouseInZuma(319,481,50) ;//Place Mouse on the Start-Zuma-Link
; MouseClick, left ;//and Click it REMOVED FOR DEBUGGING
}
;//User wants to see the UFO-Animation and Credits of Zuma
UFOSubRoutine()
{
global ZumaState ;//reference to global Variable
;////Make sure Zuma is active and centered on screen
MakeZumaActiveAndCenterIt()
;////Now we check in which State Zuma currently is
ZumaStateCheck()
if (ZumaState <> 1) ;//We are NOT in the Mainmenu-Screen
{
SetZumaState(1) ;//Must be 1 !!! Try to call Main-Menu-Page
sleep, 1000 ;//Give Zuma some time to show the window
ZumaStateCheck() ;//Do a securitycheck
if (ZumaState<>1) ;//something went wrong
{
DoAlert("I was not able to call the Zuma-Main-Menu.`nScript is stopping now.")
exitapp
}
}
;//// To see the UFO, we must three times make the Menu-Buttons play a sound
;//// in the right order. The sound you here is from the movie
;//// "Close Encounters Of The Third Kind". In the movie they played this
;//// sound to call the Aliens for landing on earth
Loop, 3
{
PlaceMouseInZuma(523,132,0) ;//Move on Adventure Button and stay 1 second
Sleep , 1000
PlaceMouseInZuma(512,212,0) ;//Move on Gaunlet Button and stay 1 second
Sleep , 1000
PlaceMouseInZuma(503,292,0) ; ;//Move on Options Button and stay 1 second
Sleep , 1000
PlaceMouseInZuma(445,381,0) ; ;//Move on More Games Button and stay 1 second
Sleep , 1000
PlaceMouseInZuma(545,397,0) ; ;//Move on Quit Button and stay 1 second
Sleep , 2000
}
PlaceMouseInZuma(313,261,50) ;
ToolTip, Click the UFO to see the Credits`nBut be fast before it disappears.
SetTimer, RemoveToolTip, 7000
}
ButtonShowZumaUFOandCredits:
UFOSubRoutine()
return
ButtonPlayhighestZumaAdventureStage:
GetBestAdventureStage() ;//Make some comments about the Users Zuma-Capabilities ;)
PlaceMouseInZuma(594,490,0) ; ;//Move mouse on the Play-Button
MouseClick, left ;// Click Play-Button
;//Now we must check if we are on the Instructions-Screen. The User can
;//select, if this Screen is shown on Startup of a stage or not. If we
;//are on the Instructions-Screen we click it away, else the level is
;//already startet.
sleep, 500 ;//wait a little for Zuma to change the Screen
ZumaStateCheck() ;//Where are we
if (ZumaState = 4) ;//We are on the Instructions-Screen
{
PlaceMouseInZuma(561,481,0) ;//Go in OK-Button, to close Instructions-Screen
MouseClick, left ;// Click it
}
;//At least now we are in the last stage. ;
;//Find North position of FrogMouthBall
return
exitapp
|
Edit: P.S. @Chris, I am now an Forummember  _________________ Wer keine Antworten hat muss nicht dumm sein,
dumm ist nur der welcher keine Fragen hat. |
|
| Back to top |
|
 |
CForce
Joined: 27 Oct 2007 Posts: 16 Location: Hawaii
|
Posted: Tue Oct 30, 2007 10:04 am Post subject: yo |
|
|
hey dude i just got into autohotkey to and i was wondering if you had msn maybe we could work togeter some time if you do pm me K.I.T.  _________________ Club Live Bots |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Oct 31, 2007 6:28 pm Post subject: |
|
|
you can own zuma by slowing it down :d
try speederxp :googleit:
good luck |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|