Results 1 to 24 of 24

Thread: Need Help with Code

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2013
    Posts
    22

    Question Need Help with Code

    hello guys im new here and i need you help i want to make a program taht reads a picture from a folder and search on the screen taht picture and click it
    example : printscreen the search in google and i want my program to have a start button when i press the start the mouse read the picture and go to search and click it automaticaly
    i want my program to have 1 txt box how mutch time it click
    3-4 option button (1st search , 2nd feeling luck etc..)
    and 1 start button
    pls help me as fast as you can im using vb2010

  2. #2
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: Need Help with Code

    We know you need help with code, you are posting in a help forum. Please give your threads a relevant title.

    Your question does not make sense. Clicking on a picture does not do anything, it is a picture. Clicking on a button within a website is a different type of area. Which one is it? How are pictures involved?
    Take the time to give a full clear response, you want a fast response, we need to know what you actually want help with.

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: Need Help with Code

    I have to concur with Grimfort. Presumably English is not your first language but your post is fairly incoherent. If we have to spend ages working out what the question is then you're not likely to get an answer. It sounds rather like you're just describing what you want your app to do and then expecting us to explain how to do everything. What have you done so far and where exactly are you stuck? If you haven't done anything then that's your issue. If you have no idea where to start then the project is obviously beyond you at this point and you should either tackle something easier or work your way through a tutorial first. Doing things that push you is one thing but if you're asking us to do everything then that's not really pushing you at all.

  4. #4
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,537

    Re: Need Help with Code

    Same here... I tried to read it three or four time (or possibly five) and just got even more confused... on one hand it sounded like you wanted something that will look at an image file, then search the screen for it... but then it sounds like you want it to perform a google search and either display the results, or just take the first result... but I don't see what that has to do with an image.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Oct 2013
    Posts
    22

    Re: Need Help with Code

    ok i'm sorry i will try to explain as better as i can and thanks for the fast reply ....
    lets start with the images...i need the image to specify where the mouse will click
    the vb will read the picture and find the same thing on the screen and click it i created a image how will my form be Name:  srg.PNG
Views: 165
Size:  9.3 KB

  6. #6
    Hyperactive Member
    Join Date
    Jun 2013
    Posts
    312

    Re: Need Help with Code

    Wow, Ia m more confused now than I was after reading your first reply. Try providing detail for detail what each button textbox etc is meant to do. I know its clear in your head, but you need to explain in as much detail as you can. i think your are asking......... i don't know what you are asking, where is your picture box in the form??? without one you cant show image.

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Oct 2013
    Posts
    22

    Re: Need Help with Code

    Quote Originally Posted by Mucker View Post
    Wow, Ia m more confused now than I was after reading your first reply. Try providing detail for detail what each button textbox etc is meant to do. I know its clear in your head, but you need to explain in as much detail as you can. i think your are asking......... i don't know what you are asking, where is your picture box in the form??? without one you cant show image.
    i found a video with something like that he uses it in a game his dropdown menu is my option buttons and his start is my click
    http://www.youtube.com/watch?v=l2R-15xc1Dw

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Oct 2013
    Posts
    22

    Re: Need Help with Code

    Quote Originally Posted by techgnome View Post
    Same here... I tried to read it three or four time (or possibly five) and just got even more confused... on one hand it sounded like you wanted something that will look at an image file, then search the screen for it... but then it sounds like you want it to perform a google search and either display the results, or just take the first result... but I don't see what that has to do with an image.

    -tg
    ok so i want the vb to read a picture and find it on the screen then click it i found this : http://www.autohotkey.com/board/topi...mage-and-more/
    but its not vb...or maybe i can use the library of that program somehow?

  9. #9
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: Need Help with Code

    Ok, so you want to use an image on disk as a template, go looking for the image on the screen (or in this case a game) and then send a click to that position on the screen where the image is found. To use for a trainer type application on a game?

  10. #10

    Thread Starter
    Junior Member
    Join Date
    Oct 2013
    Posts
    22

    Re: Need Help with Code

    Quote Originally Posted by Grimfort View Post
    Ok, so you want to use an image on disk as a template, go looking for the image on the screen (or in this case a game) and then send a click to that position on the screen where the image is found. To use for a trainer type application on a game?
    someone understood me xD yeah this is what i mean
    is this posible in vb?

  11. #11
    PowerPoster kaliman79912's Avatar
    Join Date
    Jan 2009
    Location
    Ciudad Juarez, Chihuahua. Mexico
    Posts
    2,593

    Re: Need Help with Code

    Of course it is possible, but as other posters have asked before... what do you have so far? do you want us to develop your application?
    More important than the will to succeed, is the will to prepare for success.

    Please rate the posts, your comments are the fuel to keep helping people

  12. #12

    Thread Starter
    Junior Member
    Join Date
    Oct 2013
    Posts
    22

    Re: Need Help with Code

    Quote Originally Posted by kaliman79912 View Post
    Of course it is possible, but as other posters have asked before... what do you have so far? do you want us to develop your application?

    i need the code to read the picture and find it on screen and click it only
    i have the code for autohotkey i get the code from someone with the same kind of program but i cant convert it to vb
    ; <COMPILER: v1.1.07.03>
    GoSub initGUI
    initGUI:
    Gui, Destroy
    Gui, Margin, 15, 15
    Gui, Font, s20 bold, Verdana
    Gui, Add, Text,, PP Crew Develop Tool
    Gui, font, s12 bold, Verdana
    Gui, Add, Text,, Contact: Msg "Ezreal" on S12
    Gui, font, s12 bold cRed, Verdana
    Gui, Add, Text,, !! USE AT YOUR OWN RISK !!
    Gui, font, s12 norm cBlack, Verdana
    Gui, Add, Text,, Choose attribute to develop:
    Gui, Add, DDL, vDDL, Strength||Intelligence|Physique|Agility
    Gui, Add, Text,, Enter # of develop tries:
    Gui, Add, Edit, w60 r1 Number Limit vCount, 1
    Gui, Add, Button, Default, Start
    Gui, Show,, PP Crew Develop Tool - S12 Ezreal
    return
    ButtonStart:
    Gui, Submit, Hide
    SetTitleMatchMode, 2
    Sleep 1000
    attr := DDL
    if(attr="Strength")
    {
    attr := "str"
    yinc := 1
    }
    else if(attr="Intelligence")
    {
    attr := "int"
    yinc := 2
    }
    else if(attr="Physique")
    {
    attr := "phy"
    yinc := 3
    }
    else if(attr="Agility")
    {
    attr := "agi"
    yinc := 4
    }
    else
    {
    MsgBox Wrong attribute!
    ExitApp
    }
    IfWinExist, - Google Chrome
    {
    x := A_ScreenWidth
    y := A_ScreenHeight
    WinActivate
    Sleep 1000
    ImageSearch, px, py, 0, 0, x, y, *50 images\newattribute.PNG
    Tooltip %errorlevel%
    if(ErrorLevel=0)
    {
    x1 := px-60
    ys := py+17
    x2 := px+147
    }
    else
    {
    MsgBox Couldn't find "Develop" tab!
    ExitApp
    }
    Loop %Count%
    {
    ImageSearch, px, py, 0, 0, x, y, *50 images\refine.PNG
    if(ErrorLevel=0)
    {
    Click % px ", " py
    MouseMove 0, 0
    Loop
    {
    ImageSearch, px, py, 0, 0, x, y, *50 images\maintain.PNG
    if(ErrorLevel=0)
    {
    break
    }
    Sleep 100
    }
    y1 := ys+(yinc-1)*24
    y2 := y1+24
    ImageSearch, px, py, x1, y1, x2, y2, *50 images\%attr%.PNG
    if(ErrorLevel=0)
    {
    ImageSearch, px, py, x1, y1, x2, y2, *50 images\posarrow.PNG
    if(ErrorLevel=0)
    {
    ImageSearch, px, py, 0, 0, x, y, *50 images\replace.PNG
    if(ErrorLevel=0)
    {
    Click % px ", " py
    MouseMove 0, 0
    Loop
    {
    ImageSearch, px, py, 0, 0, x, y, *50 images\refine.PNG
    if(ErrorLevel=0)
    {
    break
    }
    Sleep 100
    }
    }
    else
    {
    MsgBox Couldn't find "Replace" button!
    ExitApp
    }
    }
    else
    {
    ImageSearch, px, py, 0, 0, x, y, *50 images\maintain.PNG
    if(ErrorLevel=0)
    {
    Click % px ", " py
    MouseMove 0, 0
    Loop
    {
    ImageSearch, px, py, 0, 0, x, y, *50 images\refine.PNG
    if(ErrorLevel=0)
    {
    break
    }
    Sleep 100
    }
    }
    else
    {
    MsgBox Couldn't find "Maintain" button!
    ExitApp
    }
    }
    }
    else
    {
    MsgBox Couldn't find attribute %attr%!
    ExitApp
    }
    }
    else
    {
    MsgBox Couldn't find "Refine" button!
    ExitApp
    }
    }
    }
    else
    {
    MsgBox Couldn't find Chrome window!
    ExitApp
    }
    MsgBox Done developing! Thanks for using
    return
    #p::
    ExitApp
    return
    this is it

  13. #13
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,398

    Re: Need Help with Code

    Oh right a game cheat for yourself. Seen many of these released for games like bejeweled etc. Why should any One just make this for you? You clearly have no knowledge of visual basic & i am not even sure if this violates vb forums rules.

  14. #14

    Thread Starter
    Junior Member
    Join Date
    Oct 2013
    Posts
    22

    Re: Need Help with Code

    Quote Originally Posted by ident View Post
    Oh right a game cheat for yourself. Seen many of these released for games like bejeweled etc. Why should any One just make this for you? You clearly have no knowledge of visual basic & i am not even sure if this violates vb forums rules.
    i dont want to make a cheat this is just an explenation i added the code to see what i'm trying to do ....i just want the code to find the image on the screen and press it nothing more the rest i will do by myself and yeah i'm not very good at vb i can make simple programs with if or calculations or cmd commands run i can make many tings but now i dont know that code ... find and click ( not coordinates )

  15. #15
    PowerPoster kaliman79912's Avatar
    Join Date
    Jan 2009
    Location
    Ciudad Juarez, Chihuahua. Mexico
    Posts
    2,593

    Re: Need Help with Code

    I agree with ident. If you do not know visual basic it would be impossible for us to tell you how to do such a complex undertaking. And also, it smells fishy. There is no point at doing an application that searches for a button on google main page and then click on it if you could much easier just use the hyperlink.

    I have seen things like this looking for specific colors in a specific area of the screen and not looking for an entire image. But again, if you do not know vb, this is a bit too much.
    More important than the will to succeed, is the will to prepare for success.

    Please rate the posts, your comments are the fuel to keep helping people

  16. #16

    Thread Starter
    Junior Member
    Join Date
    Oct 2013
    Posts
    22

    Re: Need Help with Code

    Quote Originally Posted by kaliman79912 View Post
    I agree with ident. If you do not know visual basic it would be impossible for us to tell you how to do such a complex undertaking. And also, it smells fishy. There is no point at doing an application that searches for a button on google main page and then click on it if you could much easier just use the hyperlink.

    I have seen things like this looking for specific colors in a specific area of the screen and not looking for an entire image. But again, if you do not know vb, this is a bit too much.
    you think? i'm not profesion at vb as i told before but i can create some programs . so this is a bit hard to make ? i searched in google but i found only the mouse click on coorfinates that's why im asking here the only thing i need to know how to make mouse find the picture in screen

  17. #17
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,537

    Re: Need Help with Code

    the script you posted "works" because the foundation on which it was built is designed to that... so the script makes it deceptively easy. VB on the other hand... has no such functionality built into it... and it's not something that would be feasible to do... I'm not saying impossible... just... it's not something a sane person would take on... it's probably not something most insane people would take on... it would be slow, cumbersome and prone to failure.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  18. #18
    PowerPoster kaliman79912's Avatar
    Join Date
    Jan 2009
    Location
    Ciudad Juarez, Chihuahua. Mexico
    Posts
    2,593

    Re: Need Help with Code

    OK, I have to give you the benefit of the doubt and not assume the worst. The complexity of what you are asking is because you are not searching just for a single value, as it would be if you are looking for a single color pixel. An entire picture as you know is madeup of many pixels, so you would have to store that in some kind of array and then make a sweep of the window you are searching and compare. There should be more advanced, technical methods to do it but this is what I suggest you do. It will make a lot of calculations and comparisons so the process may not be fast. You may find also the problem that the same web page can be redered different depending on various factors so the image may not be identical to the one you have stored on your hard drive and the procedure will fail.
    More important than the will to succeed, is the will to prepare for success.

    Please rate the posts, your comments are the fuel to keep helping people

  19. #19
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,398

    Re: Need Help with Code

    It's to much for a beginner to understand.

  20. #20

    Thread Starter
    Junior Member
    Join Date
    Oct 2013
    Posts
    22

    Re: Need Help with Code

    Quote Originally Posted by techgnome View Post
    the script you posted "works" because the foundation on which it was built is designed to that... so the script makes it deceptively easy. VB on the other hand... has no such functionality built into it... and it's not something that would be feasible to do... I'm not saying impossible... just... it's not something a sane person would take on... it's probably not something most insane people would take on... it would be slow, cumbersome and prone to failure.

    -tg
    you think so? uhh and i wanted that bad to make it ..well i have plenty on free time so i will keep trying :P never give up ok so i have other question is possible to use the library that the code is made in vb? ( code is made from autohotkey)

  21. #21
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,398

    Re: Need Help with Code

    Here is a small part of a Bejeweled bot that i know was written that use to work (might still do). I have nothing to do with this project or ever gone through it but does this make any sense to you? I highly doubt it.

    http://pastebin.com/WCEXNvyU

  22. #22

    Thread Starter
    Junior Member
    Join Date
    Oct 2013
    Posts
    22

    Re: Need Help with Code

    Quote Originally Posted by kaliman79912 View Post
    OK, I have to give you the benefit of the doubt and not assume the worst. The complexity of what you are asking is because you are not searching just for a single value, as it would be if you are looking for a single color pixel. An entire picture as you know is madeup of many pixels, so you would have to store that in some kind of array and then make a sweep of the window you are searching and compare. There should be more advanced, technical methods to do it but this is what I suggest you do. It will make a lot of calculations and comparisons so the process may not be fast. You may find also the problem that the same web page can be redered different depending on various factors so the image may not be identical to the one you have stored on your hard drive and the procedure will fail.
    yeah i understand that and i know the image is full of pixels so basicaly vg must search those pixels in the screen

  23. #23
    PowerPoster kaliman79912's Avatar
    Join Date
    Jan 2009
    Location
    Ciudad Juarez, Chihuahua. Mexico
    Posts
    2,593

    Re: Need Help with Code

    You might also look into "Scar Divi", in it you have to know a bit of pascal as it is a pascal like scripting languaje and its purpose is to create macros to be applied to external windows' and it has a bunch of graphic functions. I really hope you are not looking into cheating.
    More important than the will to succeed, is the will to prepare for success.

    Please rate the posts, your comments are the fuel to keep helping people

  24. #24

    Thread Starter
    Junior Member
    Join Date
    Oct 2013
    Posts
    22

    Re: Need Help with Code

    Quote Originally Posted by kaliman79912 View Post
    You might also look into "Scar Divi", in it you have to know a bit of pascal as it is a pascal like scripting languaje and its purpose is to create macros to be applied to external windows' and it has a bunch of graphic functions. I really hope you are not looking into cheating.
    nah i realy dont look into cheating if i wanted to cheat i will use the other program that i send the code coz its ready i just like the vb and i want to learn more things on how to do and what is possible vb to do and its not very hard ...i know a little turbo paskal (case and more ) but i dont like it much ..i created one program in vb that opens the form2 500times+ on all over the screen it took me some time but i did it (the good thing is that the program crashes coz i was bored to close all the windows) :P everyone can make everything they want just never give up and that is it what keeps me going

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width