Jump to content

Recommended Posts

Guest BL@(K-R34P3R
Posted

I am still working on my game script... Anyways, here's the new problem. I got it to load fine, but now I am trying to get it to mouseclick the "Play" button. I open the game, (Maximized), then I start up WinSpy, then I put the mouse over the "Play" button, then I alt tab back to the win spy, it says the position on the desktop and in the window, both of them are the same. I put those coordinates into my mouse click, then I run the script, and it clicks the side of the screen somewhere.... It should be clicking the play button... Part of the problem is, every time I start the game, I put the cursor to the same place, over the "Play" button, and everytime I alt tab out of them program, and look at the x,y coordinates in the WinSpy, they are different, and I mean a LOT different... Like 500 from each of them. Either WinSpy has let me down, or I need to do something.... Help?

;Trains your Heavy Armor skill, which allows you to raise your Endurance.
;Works best if Heavy Armor is a Major or Minor Skill. (This will let you actually level up.)

;Starts up Morrowind, and continues a previously saved character. 
ContinueGameFunc()
Func ContinueGameFunc()
   Run('"C:\Program Files\Bethesda Softworks\Morrowind\Morrowind.exe"', "C:\Program Files\Bethesda Softworks\Morrowind")
   WinWaitActive("Morrowind")
   WinSetState("Morrowind", "", @SW_MAXIMIZE)
   Sleep(3000)
   Send("{ESC}")
   Sleep("10000")
   Send("{ESC}")
   WinActivate("Morrowind")
   Sleep(2000)
   MouseClick("left", 160, 557, 1)
EndFunc
Guest BL@(K-R34P3R
Posted

I wish there was an easier way then clicking... Is it possible to just detect the text then Send enter or something?

Posted (edited)

Couple things. Is the game running in the same resolution as your desktop? Personally, I would take a screenshot with Fraps, open it in paint or something and get the coords from there.

Edited by KnowledgeSponge
Guest BL@(K-R34P3R
Posted

Actually the game is running a slightly different resolution... Hmm.... I'll make them the same then try again! Thanks.

Posted

try using the "In Window: x:### y:###"

and before u alt+tab out press Ctrl+alt+f over the play button to freeze the au3 swindow spy with the play button coords....yea ive done thins b4 too...except to logon to diablo...

Guest BL@(K-R34P3R
Posted

The thing is, the In Window, and In Desktop coords. are the same. I tried the ctrl alt f thing but it's still not working. Maybe morrowind has some 3rd party program stopper or something.

Guest BL@(K-R34P3R
Posted

I don't know, I'll go check it out right now.

Posted (edited)

i had the same problem and wrote a scriptwriter to solve it ( "MouseGetPos()" )

U can test my scriptwriter for games ... i got a funktion, that other scriptwriters doesn't have: the function to avoid sleep() that isn't allways running proper, cause sometimes the delays are larger and then the script doesn't work

1. u take 2 Positions from the screen with hotkeys (alt+1 then alt+2) and the written script waits for the same pixelfield to show up and then continues ( the pixels must be taken from upleft to downright)

2. simple keylogger with alt+key to log the key and send it

3. mouselogger with hotkeys alt+3 (for left) and alt+4 for right click

4. logs strg+1(-5) at press and 1-5 too

5. alt+5 to exit :ph34r:

It not a very good Scriptwriter, but it worked fine for me and it was all that i needed

u need the file pixelfunc.au3 in the same folder to use the script

http://www.autoitscript.com/fileman/users/public/Konan/pixelfunc.au3

http://www.autoitscript.com/fileman/users/public/Konan/gamelogger.au3

Edit: wrong url

Edited by Konan--M
Guest BL@(K-R34P3R
Posted

I downloaded fraps, I'll go try it now. OO. I just thought it would work normally, because I wrote a similar script for my starcraft winbot, and it worked fine with just Alt +Tab to retrieve coordinates.

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
  • Recently Browsing   0 members

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