Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fenetre minimized #2

Open
Raphael0010 opened this issue Jan 8, 2021 · 14 comments
Open

Fenetre minimized #2

Raphael0010 opened this issue Jan 8, 2021 · 14 comments
Labels

Comments

@Raphael0010
Copy link

Hello je voulais savoir si ton bot gérer le cas quand la fenêtres est minimized ?

@AXeL-dev
Copy link
Member

AXeL-dev commented Jan 9, 2021

Normalement le bot envoie des fake click à la fenêtre du jeu et donc il est censé fonctionner même quand cette dernière est minimisée, après je n'ai pas retesté le bot depuis 2016 donc il se peut que ça ne soit plus fonctionnel.

@Raphael0010
Copy link
Author

Je suis en plein développement de quelque chose de semblable, je me posais la question si c'était possible mais après plusieurs rechercher j'ai vu que non

@AXeL-dev
Copy link
Member

AXeL-dev commented Jan 9, 2021

Je suis en plein développement de quelque chose de semblable, je me posais la question si c'était possible mais après plusieurs rechercher j'ai vu que non

Sur windows je crois que si, y'a des dll/librairies qui te permettent d'envoyer des fakes clicks, je l'avais déja testé et ça fonctionnait (check https://github.com/AXeL-dev/Pixus-Bot/blob/master/Pixus/Lib/FakeClick.cs)

Edit: Après je ne suis pas sur si le client dofus supporte toujours ça ou si ça a été contourné.

@Raphael0010
Copy link
Author

J'ai déjà cette implémentation dans mon bot, comment gère-tu la map de départ ? Quand le bot se connecte pour qu'il sache ou il se situe ?

@AXeL-dev
Copy link
Member

AXeL-dev commented Jan 10, 2021

Pour ça tu peux soit utiliser un cache/fichier log ou tu enregistre la dernière position ou le bot s'est arrêté, si non tu peux simplement utiliser une potion de rappel ou de bonta pour te déplacer à une map dont tu connait les coordonnées. Plus poussé que ça tu peux utiliser l'OCR pour lire la position actuelle depuis l'écran du jeu (la bibliothèque openCV permet de faire cela).

Edit: tu peux aussi utiliser ton havre sac pour te déplacer à un zaap connu juste après la connexion du bot.

@Raphael0010
Copy link
Author

C'est déjà ce que je fais , j'ai mis en place un OCR avec tesseract, je prenais une capture du jeu et je faisais un ocr dessus mais le soucis c'est qu’une fois la fenêtre minimisée ça marche pas :/ . Je pense demandé à l'utilisateur sa position de départ.

@AXeL-dev
Copy link
Member

AXeL-dev commented Jan 10, 2021

C'est déjà ce que je fais , j'ai mis en place un OCR avec tesseract, je prenais une capture du jeu et je faisais un ocr dessus mais le soucis c'est qu’une fois la fenêtre minimisée ça marche pas :/ .

Effectivement, la capture d'image quand la fenêtre est minimisée ne fonctionne(ra) pas (t'aura une image toute noire), après c'est normal vu que la fenêtre ne s'affiche même pas (je pense que c'est dû au faite que l'OS repaint uniquement les fenêtres affichées), mais si non pour les "fake" clicks je pense que ça fonctionne.

Je pense demandé à l'utilisateur sa position de départ.

Bonne idée 👍.

@diego658745
Copy link

Hi, i saw your project for Dofus, and its amazing, and i have a question, i want to know whats the usefull to take screenshot? and why the picker of pixel color from jobs doesnt take it, thanks a lot for your answer.

@AXeL-dev
Copy link
Member

Hi, i saw your project for Dofus, and its amazing, and i have a question, i want to know whats the usefull to take screenshot?

Hey, in case of a pixel bot taking screenshots can be useful when you want to check for map changes, for example: you can set your player on a map, take a screenshot, then move to a far point on the map & take a second screenshot once player stops moving, if you compare the 2 screenshots with an image diff tool (or an algorithm) you can get the degree of change & even better you can know the path your player has take & which way he was going (this might require an AI or some advanced image processing algorithms).

and why the picker of pixel color from jobs doesnt take it, thanks a lot for your answer.

I don't remember well how Pixus was working, so if something has broke it might be because the project is outdated.

@diego658745
Copy link

Thanks for your answer, i want to work on your project but i never use a getpixel, lockbit and unlockbit and i dont find any example to use on this project, can you help me on this?, when i finish what i want to do i will sent the project to your email, the problem is that the program dont get the pixels and i dont find if is the getpixel method or lockbit/unlockbit, thanks for your answer i think that this project is amazing.

@diego658745
Copy link

diego658745 commented Jan 29, 2021

Hi!!, actually i repair and it get the pixels now, but i want to get the pixels from a windows with an arquitecture of 64bits, can you help me on that?, thanks a lot for your help.

@AXeL-dev
Copy link
Member

AXeL-dev commented Jan 29, 2021

Hi!!, actually i repair and it get the pixels now, but i want to get the pixels from a windows with an arquitecture of 64bits, can you help me on that?, thanks a lot for your help.

Hey again, i don't think that the the x86 or x64 architecture does have anything to do with getting pixels from screen, so maybe your issue isn't coming from that, & honestly i stopped working with .net & windows from more than 4 years now, i even don't have visual studio to compile & test any code that i may propose, in addition that the .net documentation is quite poor, so i don't know how i can help on that 🙏 .

Edit: Also, it would be better if you can open a new issue with more specific details, like the part of code where you're facing issues & what kind of error message or whatever you get.

@diego658745
Copy link

diego658745 commented Jan 29, 2021

Thank you so much for your answer i will search a lot what happens if i find the problem ill send you the program if you want, thanks a lot for this project is so amazing.

Edit: it doesnt throw any error, the problem is that all pixels on window with 64bits its black .

@AXeL-dev
Copy link
Member

AXeL-dev commented Jan 30, 2021

Edit: it doesnt throw any error, the problem is that all pixels on window with 64bits its black .

Are you trying with the window in minimized mode? 'cause i still remember that i got the same black screenshot issue when the game window was minimized, otherwise, you can even change the screen capture code/algorithm, just search on the net for: window screen capture under .net/C# (you should find some good code examples).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants