Jump to content

strange window behavior


t0ddie
 Share

Recommended Posts

This is a problem with a Diablo II window.

I am not making a bot, or asking for help with one. I just noticed a strange behavior with this particular window and was wondering if there was a way to compensate for this behavior.

so I am trying to move the mouse in a certain place on the screen. for testing i am just trying the center of the screen.

Here is an example of the problem

http://tinypic.com/player.php?v=2h6tufn&s=6

this code should put the mouse right in the middle of the screen and it does in regular window mode and in fullscreen mode

Opt("MouseCoordMode", 2) 
sleep(5000)
$size = WinGetClientSize("[active]")
    MouseMove($size[0] / 2,$size[1] / 2,0)

however when you maximize the window in window mode the cursor coordinates start to misalign as you move it to the right and does not end up in the middle of the screen (as you can see in the video).

since the mouse coordinates do not seem to work in the window when its maximized,

is there some formula where you can get the users screen resolution (@destopwidth/height), and window size and position and use that to determine the center of the window according to the game cursor (not according to the windows cursor)?

I want to always click in the middle of the window without having to write a hardcoded value for each possible window size/position and screen resolution if at all possible. this only seems to happen when in window mode and maximized but it is in interesting phenomenon and I would like to make a workaround for it.

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

BUMP

*waited 3 days

*edited original post to make it more clear

*added a link to a video I uploaded which demonstrates the problem.

thank you.

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

do you reset the wingetclientsize variable after the window has been minimized, restored, or maximized?

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Link to comment
Share on other sites

do you reset the wingetclientsize variable after the window has been minimized, restored, or maximized?

Yes.

I put the window in maximize and then I run the script.

the variable starts out new each time I run the script.

it is not in a loop. I am resetting the script each time.

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

If you use WinGetClientSize once when the window is normal or first opened and use the same coordinate values when the window is maximized where does the cursor go then?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

exactly where it is told to go

Opt("MouseCoordMode", 2) 
sleep(5000)
$size = WinGetClientSize("[active]")

HotKeySet("1","test")

while 1
    sleep(100)
WEnd

func test()
    MouseMove($size[0] / 2,$size[1] / 2,0)
EndFunc

I am glad it is such an easy solution and its too bad i overlooked it

I assumed the client size would change when maximizing so i did not even bother to do this, but its not the client size that changes, its the resolution size that changes when the window is maximized.

Thanks!

p.s. in Diablo II single player mode you are not connected to the game servers and you can mod the game and use scripts without worry. There are also private servers that people play on which do not have a tos/eula. Just because a script COULD be run online on battle.net as a "game bot" it is still up to the user to use discretion. There are still legitimate uses for gaming scripts without breaking any tos/eula. Furthermore battle.net in particular has an anti-cheating monitor program making it pointless to run third party programs because its detectable. Not supporting "game bot" threads in general because of a possibility, could be applied to any autoit script. There is the same "possibility" that someone could be making any kind of nefarious script when they are asking for help, and those scripts are usually much worse than scripts which are merely the breaking of a tos/eula. Besides a tos/eula is a contract between 2 parties and this forums is a third party which is not effected. I understand that you dont want to give a bad name to autoit, but this is not the way.

Just wanted to get that out in case any mods happen to read this... and again thank you for helping me in my thread.

It is appreciated.

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

  • Moderators

t0ddie,

Not supporting "game bot" threads in general because of a possibility, could be applied to any autoit script. There is the same "possibility" that someone could be making any kind of nefarious script when they are asking for help, and those scripts are usually much worse than scripts which are merely the breaking of a tos/eula. Besides a tos/eula is a contract between 2 parties and this forums is a third party which is not effected.

I disagree with quite a lot of that.

The "probability" of game bots being used and giving AutoIt a bad name is infinitely higher than the "possibility" of other scripts being used for nefarious purposes. We do try very hard to prevent giving out information which could be used for doing "unpleasant" things - Jon's edict on keyloggers is a case in point. Just look at the number of threads that have been locked for that reason.

I might believe that you personally are only going to use your bot when it is "legal" to do so, but what about the other, less-scrupulous guy who sees the solution posted to help you? The gamers here (of whom I am not one, by the way) prefer to play on level playing fields and I quite understand that.

I see our stand on game bots as the direct equivalent of most nations demanding ID when buying alcohol/knives/solvents/whatever - it is a pain for law-abiding citizens (and some of their kids who might want craft knives and solvents for legitimate purposes) but it is done in the wider interest of society. Oh, and if you believe that the forum would not be liable if there were ever to be a legal dispute over botting, you need another lawyer!

But my most important reason for trying to protect AutoIt is this: I have helped people in hospitals, schools, universities, public services, etc, to create scripts which enable them to help others every day. When we get an AV company deleting/flagging these scripts it causes a lot of havoc to these well-meaning, hard-working and entirely innocent users of AutoIt. So I have absolutely no problem in refusing to help those whose use of the language to satify their virtual desires could well jeopardise the ability of those who use it for the concrete benefit of real people in the real world.

And you should see the behaviour of these "script-kiddies" when we do refuse to help them - the "expletive-deleted" content of their responses in both open forum and in PMs are quite something, believe me. Some have even invested a lot of effort into trying to disrupt/destroy the forum. They do not deserve to be helped.

I understand that you dont want to give a bad name to autoit, but this is not the way.

We think it is! The bottom line is this: we play here under Jon's rules - it is not a democracy. :mellow:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

I understand your position.

however like anything, it is unfortunate that a few have to ruin it for the many.

I know this is no democracy, just stating my opinion.

keyloggers and the like have nothing to do with "game bots" unless they are attached to them.

I got my answer and this does not need to be discussed further and go off topic. just expressing my thoughts.

your argument might have merit in some games BUT...

It is really pointless to argue that helping with bots for diablo 2 could cause a problem because as i mentioned the game has a program (warden) which monitors the game, making the scripts detectable and therefore useless on battle.net.

another thing is that this forums would not be held liable for botting as it is not a botting forum it is a scripting forum. if it was specifically for botting like what happened to the guy who made the "WoW Glider" that is different... but he wrote that in c++ or something didnt he? are the makers of that language being sued?

My final thought is this... autoit is still being flagged by some a/v. people are also still using autoit to make bots whether they are being helped on this forums or not. has this stance really effected the false positive rate?

you can tell when a person is asking for something questionable

as for language... have you seen some of the language used here by MODERATORS? lol forget script kiddies haha.

i respectively disagree but I respect the position of the forums and wont discuss game bots... however this post really does not discuss this and i made it clear from the first post just for the record.

@finalversion the help I was asking for was not bot related. it was related to an issue with wingetclientsize and I was just using the Diablo II window as an example that illustrated the issue.

EDIT: FINAL POINT is when you give up rights for security you end up with neither.

it should apply accross the board.

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

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...