Repository navigation
lod114d: Control.click sleeps before, between and after the button events - #92
Closed
ResurrectedTrader wants to merge 1 commit into
Closed
ResurrectedTrader wants to merge 1 commit into
ResurrectedTrader wants to merge 1 commit into
Conversation
…ents Reference clickControl (reference/d2bs/Control.cpp) sleeps 100 ms before the button-down, between down and up, and after the button-up, so a click takes about 300 ms and the script's next getControl sees the screen the click led to. Control::Click only slept between the two events and returned right after the button-up. Click now sleeps at all three points. The createGame / joinGame / createCharacter clicks ran inside GameThread::Execute, which would put those sleeps on the game thread; they now run on the calling thread as login's already do (Control::Find and Click take their own read lock), and only the edit-box text is still set on the game thread. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Owner
Author
|
This works fine, so lets skip. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
d2bs:
clickControl(reference/d2bs/Control.cpp) doesSleep(100), button down,Sleep(100), button up,Sleep(100)- about 300 ms per click.control.click()and the click steps oflogin/createGame/joinGameall go through it.d2bsng before:
Control::Clickposted button down, slept 100 ms, posted button up and returned at once. A script that looks up the next control right after a click (kolbotLocations.jsclicks the TCP/IP button and then looks up and clicks the Host / Join button straight after) could still see the old screen.Fix:
Control::Clicksleeps 100 ms before, between and after the two events, as d2bs does. The sleeps run without any game lock held (the click position is resolved in an inner scope first, and the binding already callsClickon a copy of the handle after its lock is dropped).createGame,joinGameandcreateCharacterran some of their clicks insideGameThread::Execute, which would have put the new sleeps on the game thread and stalled frames. Those clicks now run on the calling thread, aslogin's already do;Control::FindandClicktake their own read lock. Only the edit-box text is still set on the game thread.Restores: scripts that call
getControlright aftercontrol.click()see the screen the click opened.createGamealso waits about 400 ms after clicking the Create tab before it checks that the tab opened, as d2bs does, instead of 200 ms.Not live-tested. Built Win32 Release,
build.ps1 testpasses,check-formatclean.🤖 Generated with Claude Code