Need a little help

Discussion in 'Archives' started by superman1478, Jun 28, 2007.

Need a little help
  1. Unread #1 - Jun 28, 2007 at 6:58 PM
  2. superman1478
    Joined:
    Jan 21, 2007
    Posts:
    701
    Referrals:
    2
    Sythe Gold:
    0

    superman1478 Apprentice

    Need a little help

    I have an auto alcher. Sometimes i lagg and it starts clicking use yew longbow on yew longbow. To solve that problem i had my program press the F6 key every almost every 500 alchs. To do so i used:

    label3.caption is uped by 1 every 2 clicks.
    Code:
    Private Sub label3_Change()
    If Label3.Caption = 490 Then
    SendKeys "{F6}"
    End If
    
    If Label3.Caption = 1003 Then
    SendKeys "{F6}"
    End If
    
    If Label3.Caption = 1520 Then
    SendKeys "{F6}"
    End If
    
    If Label3.Caption = 2002 Then
    SendKeys "{F6}"
    End If
    
    If Label3.Caption = 2508 Then
    SendKeys "{F6}"
    End If
    
    If Label3.Caption = 3009 Then
    SendKeys "{F6}"
    End If
    End Sub
    
    Some people need the key pressed more frequently then that.

    If i keep adding if statements i'm afraid that the program will slow down.

    Anyone got any ideas on how to shorten the code Or anything?
     
  3. Unread #2 - Jun 28, 2007 at 7:30 PM
  4. Jazz00006
    Joined:
    Aug 26, 2005
    Posts:
    807
    Referrals:
    0
    Sythe Gold:
    0

    Jazz00006 Apprentice
    Visual Basic Programmers

    Need a little help

    well for you, since your skill with VB isnt that great, I'd recomend using some getpixel or if you're up to it, getdibits, for some checking of what your clicking on.


    or if you just want to be silly
    Code:
    Private Sub Label3_Change()
        For i = 0 To 50
        Rem-> Increase this if you need to
            If Label3.Caption = i * 490 Then SendKeys "{F6}"
            Rem-> So we move from 490 -> 980 etc and keep checking
        Next i
        Rem->  Continue looping
    End Sub
     
  5. Unread #3 - Jun 28, 2007 at 8:55 PM
  6. superman1478
    Joined:
    Jan 21, 2007
    Posts:
    701
    Referrals:
    2
    Sythe Gold:
    0

    superman1478 Apprentice

    Need a little help

    I'll be silly for now, but i will see how hard it would be to use getpixel, getdibits or getbitmap.

    Edit: Forgot to say Thanks
     
< I need a loan | Erica: The Middle Woman >

Users viewing this thread
1 guest


 
 
Adblock breaks this site