Sign in to follow this  
Followers 0
Ethereal401

Removing Timers, Adding Pixel Detection

2 posts in this topic

My goal here is instead of using timers or a specified number of clicks, is to take a color from the screen (healthbar) and use that to determine rather or not to stop swinging.

This is what I have now....

Dim $a, $b, $c


$c = InputBox( "Question", "How long would you like to rest? (1 sec = 1000)", "120000" )
$a = 0
$b = InputBox( "Question", "How many times would you like to swing?", "10" )

$Weapon = 1


Sleep ( 10000 )





while 1
   sleep ( 100 )

      Call ("EquipAttack")
      sleep ( 500 )
      Call("Attack")
      sleep ( 500 )
      Call ("Rest")
  WEnd
  
  
  Func EquipAttack()
   Sleep(1000)
   ;send ("{1} - {4}") ; Weapon
   Send("{" & $Weapon & "}")
   $Weapon = $Weapon + 1
   If $Weapon = 2 Then
      $Weapon = 1
  EndIf
    Send ( "r" )
    Sleep ( 1000 )

   Sleep(1000)
EndFunc


Func Attack()
   Do
      sleep ( 100 )
      Mouseclick ( "Left" )
      sleep ( 100 )
     
      sleep ( 100 )
     
      sleep ( 1000 )
    
      sleep ( 500 )
    
      sleep ( 1000 )
      $a = $a + 1
   Until $a = $b
   $a = 0
EndFunc

Func Rest()
   Send ( "R" )
   Sleep ( 1500 )
   Send ( "0" )
   Sleep ( 1500 )
   Mouseclick ( "Left" )
   Sleep ( 1500 )

   Sleep ( 1500 )
   Send ( "R" )
   Sleep ( 1500 )
   Send ( "0" )
   Sleep ( 1500 )
   Mouseclick ( "Left" )
   Sleep ( 1500 )

   Sleep ( $c )
   Send ( "w" )
   Sleep ( 1500 )

   Sleep ( 1500 )

   Sleep ( 2000 )
  
 
EndFunc

I would like to make a message box pop up to tell me to place the mouse cursor over the health bar, and when that pixel changes than stop left clicking.

Share this post


Link to post
Share on other sites



I think PixelGetColor is what you are looking for.


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0