Gamerium / Pixus-Bot

A pixel bot for Dofus game
5 stars 5 forks source link

Fenetre minimized #2

Open Raphael0010 opened 3 years ago

Raphael0010 commented 3 years ago

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

AXeL-dev commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 :+1:.

diego658745 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

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 commented 3 years ago

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 commented 3 years ago

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