Jump to content
Sign in to follow this  
Glyph

_IsPressed function keeps looping -.-

Recommended Posts

Glyph

#Include <XSkin.au3>
#include <Misc.au3>
HotKeySet("{end}","_stop")
$winname="TB AutoSurfer v0.1"
$dll = DllOpen("user32.dll")
$main=XSkinGUICreate($winname,400,400,@ScriptDir & "\" & "Images")
        $Icon_Folder = @ScriptDir & "\Images"
        $XIcon = XSkinIcon( $main, 2 )
WinSetOnTop($winname, "", 1)
$colorz="0x00DF25"
$i=0
$hacks=0
GuiCtrlCreateLabel("Bottom Box Dimensions:", 40, 100)
GUICtrlSetColor(-1,$colorz)

$in5 = GuiCtrlCreateInput("x1:", 40, 115, 50)
GUICtrlSetColor(-1,$colorz)
GUICtrlSetbkColor(-1,"0x000000")
$in6 = GuiCtrlCreateInput("y1:", 90, 115, 50)
GUICtrlSetColor(-1,$colorz)
GUICtrlSetbkColor(-1,"0x000000")
$in7 = GuiCtrlCreateInput("x2:", 40, 135, 50)
GUICtrlSetColor(-1,$colorz)
GUICtrlSetbkColor(-1,"0x000000")
$in8 = GuiCtrlCreateInput("y2:", 90, 135, 50)
GUICtrlSetColor(-1,$colorz)
GUICtrlSetbkColor(-1,"0x000000")

$carrotcolor = GuiCtrlCreatelabel("Carrot:0xD6831B", 40, 40, 85)
$c1=StringSplit(guictrlread($carrotcolor),":")
GUICtrlSetColor(-1,$c1[2])


$hatcolor = GuiCtrlCreatelabel("Hat:0x1A2833", 125, 40, 85)
$h1=StringSplit(guictrlread($hatcolor),":")
GUICtrlSetColor(-1,$h1[2])
GUICtrlSetBkColor(-1,"0x000000")

$feetcolor = GUICtrlCreateLabel("Feet:0xDEC0F4", 40, 60, 85)
$f1=StringSplit(guictrlread($feetcolor),":")
GUICtrlSetColor(-1,$f1[2])


$earscolor = GUICtrlCreateLabel("Ears:0x2287BF", 125, 60, 85)
$e1=StringSplit(guictrlread($earscolor),":")
GUICtrlSetColor(-1,$e1[2])


GUICtrlCreateLabel("©2008",345,40)
GUICtrlSetColor(-1,$colorz)
;BlackHat
GUICtrlCreateLabel("B",330,40)
GUICtrlSetColor(-1,$colorz)
GUICtrlCreateLabel("l",330,52)
GUICtrlSetColor(-1,$colorz)
GUICtrlCreateLabel("a",329,62)
GUICtrlSetColor(-1,$colorz)
GUICtrlCreateLabel("c",329,74)
GUICtrlSetColor(-1,$colorz)
GUICtrlCreateLabel("k",330,88)
GUICtrlSetColor(-1,$colorz)

GUICtrlCreateLabel("H",330,105)
GUICtrlSetColor(-1,$colorz)
GUICtrlCreateLabel("a",330,115)
GUICtrlSetColor(-1,$colorz)
GUICtrlCreateLabel("t",332,127)
GUICtrlSetColor(-1,$colorz)

$copy=GUICtrlCreateLabel("Industries",340,127,50)
GUICtrlSetColor(-1,$colorz)
$BHI=GUICtrlCreatePic("48BHI.jpg",340,65,48,48)
$x="494"
$y="117"
;ears
$x1="508"
$y1="115"
;carrot
$x2="495"
$y2="124"
;feet
$x3="497"
$y3="123"

$time=Random(10000, 15500)
$clicks="0"

GUICtrlCreateLabel("Application Status:",292,330)
GUICtrlSetColor(-1,$colorz)
$on = GUICtrlCreateRadio ("Alive", 340, 345,50)
GUICtrlSetColor(-1,"0x00FFFF")

$off = GUICtrlCreateRadio ("Dead", 290, 345,50)
GUICtrlSetColor(-1,"0xFF0000")

GUICtrlSetState ($off, $GUI_CHECKED)
$color=GUICtrlCreateButton("Set Colors",40,300,60,17)
GUICtrlSetColor($color,$colorz)
GUICtrlSetbkColor($color,"0x000000")
$dimension=GUICtrlCreateButton("Set Dimensions",40,325,85,17)
GUICtrlSetColor($dimension,$colorz)
GUICtrlSetbkColor($dimension,"0x000000")

$clickshow=GUICtrlCreateLabel("Clicks: ["&$clicks&"]",40,345,75,17)
GUICtrlSetColor(-1,$colorz)




GUISetState (@SW_SHOW,$main)
While 1
          $msg = GUIGetMsg()
 If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $XIcon[1] Then Exit
  If $msg = $XIcon[2] Then GUISetState(@SW_MINIMIZE,$main)
      Select
          
          ;=============== Animation
case $msg = $BHI and ControlGetText($winname,"",$copy) = "Industries"
                                    GUICtrlSetData($copy,"Industries!")
case $msg = $BHI and ControlGetText($winname,"",$copy) = "Industries!"
                                    GUICtrlSetData($copy,"Industries!!")
case $msg = $BHI and ControlGetText($winname,"",$copy) = "Industries!!"
                                    GUICtrlSetData($copy,"Industries")
          ;===============> Animation

         
Case BitAND(GUICtrlRead($on), $GUI_CHECKED) = $GUI_CHECKED  
    if WinExists("Privacy Alert") Then
        ControlClick("Privacy Alert","","Button1")
        sleep(100)
        ControlClick("Privacy Alert","","Button3")
    EndIf
    ;HAT
    if PixelGetColor($x,$y) = "0x1A2833" Then
        _lookforhat()
    EndIf
    ;EARS
    if PixelGetColor($x1,$y1) = "0x2287BF" Then
        _lookforears()
    EndIf
    ;CARROT
    if PixelGetColor($x2,$y2) = "0xD6831B" Then
        _lookforCarrot()
    EndIf
    ;FEET
    if PixelGetColor($x3,$y3) = "0xDEC0F4" Then
        _lookforfeet()
    EndIf
    
case $msg = $dimension
_select()
    
case $msg = $color
_sethat()

    EndSelect
WEnd
    
;hat =>
func _lookforhat()
$coord = PixelSearch(238,140,452,174, 0x262721, 4 )
If Not @error Then
            $pos = MouseGetPos()
    MouseMove($coord[0],$coord[1],1)
    MouseClick("left",$coord[0],$coord[1],1)
            $clicks=$clicks+1
            ControlSetText($winname,"",$clickshow,"Clicks: ["&$clicks&"]")
    MouseMove($pos[0],$pos[1],1)
    sleep($time)
EndIf
EndFunc
;ears =>
Func _lookforears()
$coord = PixelSearch(238,140,452,174, 0x2889B6, 4 )
If Not @error Then
                $pos = MouseGetPos()
    MouseMove($coord[0],$coord[1],1)
    MouseClick("left",$coord[0],$coord[1],1)
            $clicks=$clicks+1
            ControlSetText($winname,"",$clickshow,"Clicks: ["&$clicks&"]")
                MouseMove($pos[0],$pos[1],1)
        sleep($time)
EndIf
EndFunc
;Carrot =>
Func _lookforCarrot()
$coord = PixelSearch(238,140,452,174, 0xF2931D, 4 )
If Not @error Then
                $pos = MouseGetPos()
    MouseMove($coord[0],$coord[1],1)
    MouseClick("left",$coord[0],$coord[1],1)
            $clicks=$clicks+1
            ControlSetText($winname,"",$clickshow,"Clicks: ["&$clicks&"]")
                MouseMove($pos[0],$pos[1],1)
        sleep($time)
EndIf
EndFunc
;feet =>
func _lookforfeet()
$coord = PixelSearch(238,140,452,174, 0xF7DDF8, 4 )
If Not @error Then
                $pos = MouseGetPos()
    MouseMove($coord[0],$coord[1],1)
    MouseClick("left",$coord[0],$coord[1],1)
            $clicks=$clicks+1
            ControlSetText($winname,"",$clickshow,"Clicks: ["&$clicks&"]")
                MouseMove($pos[0],$pos[1],1)
        sleep($time)
EndIf
EndFunc
func _stop()
    Exit
EndFunc


Func _Select()
    $i = 1
    $clickpoint = "Top Right: "
    Do
    $msg2=GuiGetMsg()
        $pos = MouseGetPos()
        $tooltip = ToolTip($ClickPoint & $pos[0] & "," & $pos[1],$pos[0]+10,$pos[1]+10)
            
          If _IsPressed("01", $dll) Then
              
            while _IsPressed("01", $dll)
            sleep(10)
            WEnd    

            $i += 1 
            ElseIf $i = 1 Then
                GuiCtrlSetData($in5 , $pos[0])
                GuiCtrlSetData($in6, $pos[1])
                
            Elseif $i = 2 Then
            $clickpoint = "Bottom Left: "
                GuiCtrlSetData($in7, $pos[0])
                GuiCtrlSetData($in8, $pos[1])
                
        EndIf   
            
        Until $i = 3
        $tooltip = ToolTip("")
            $i = 0

    EndFunc     
;=====================================================================
;
;                THIS FUNCTION DOES NOT WORK!
;
;=====================================================================
func _sethat()
    GuiGetMsg()
    $wees=0
$dll = DllOpen("user32.dll")
do
    sleep(10)
$pos = MouseGetPos()
$color = PixelGetColor($pos[0],$pos[1])
ToolTip("Color: "&hex($color,6)&" "&$pos[0] & "," & $pos[1],$pos[0]+10,$pos[1]+10)

If _IsPressed("01", $dll) Then
while _IsPressed("01", $dll)
sleep(10)
WEnd

$wees += 1
elseif $wees = 1 Then 
    msgbox(262144,"","Color: "&hex($color,6)&" "&$pos[0] & "," & $pos[1])
    $wees=2
EndIf
    Until $wees = 2
ToolTip("") 
EndFunc
;=====================================================================
;
;                THIS FUNCTION DOES NOT WORK!
;
;=====================================================================

Full source is here:

http://emeraldcityforums.com/rot/Source.zip

Problem: func _sethat()

What I want it to do: Same as the dimension function, Only, I don't want it to keep looping after every click.

Each time I click it, it ignores the click and keeps going.

I had my freind test it out, but he says it works fine after 1 click... but doesn't loop at all.

I have spent almost 5 hours trying to figure this out and i'm out of ideas!

ANY help is greatly appreciated!!!

Edited by BackStabbed

tolle indicium

Share this post


Link to post
Share on other sites
Glyph

Fixed.

I declared the variable $color twice, and it messed it up...


tolle indicium

Share this post


Link to post
Share on other sites
Valuater

This can help with your radio boxes

#Include <XSkin.au3>
#include <Misc.au3>
HotKeySet("{end}","_stop")
$winname="TB AutoSurfer v0.1"
$dll = DllOpen("user32.dll")
$main=XSkinGUICreate($winname,400,400,@ScriptDir & "\" & "Images")
        $Icon_Folder = @ScriptDir & "\Images"
        $XIcon = XSkinIcon( $main, 2 )
WinSetOnTop($winname, "", 1)
$colorz="0x00DF25"
$i=0
$hacks=0
GuiCtrlCreateLabel("Bottom Box Dimensions:", 40, 100)
GUICtrlSetColor(-1,$colorz)

$in5 = GuiCtrlCreateInput("x1:", 40, 115, 50)
GUICtrlSetColor(-1,$colorz)
GUICtrlSetbkColor(-1,"0x000000")
$in6 = GuiCtrlCreateInput("y1:", 90, 115, 50)
GUICtrlSetColor(-1,$colorz)
GUICtrlSetbkColor(-1,"0x000000")
$in7 = GuiCtrlCreateInput("x2:", 40, 135, 50)
GUICtrlSetColor(-1,$colorz)
GUICtrlSetbkColor(-1,"0x000000")
$in8 = GuiCtrlCreateInput("y2:", 90, 135, 50)
GUICtrlSetColor(-1,$colorz)
GUICtrlSetbkColor(-1,"0x000000")

$carrotcolor = GuiCtrlCreatelabel("Carrot:0xD6831B", 40, 40, 85)
$c1=StringSplit(guictrlread($carrotcolor),":")
GUICtrlSetColor(-1,$c1[2])


$hatcolor = GuiCtrlCreatelabel("Hat:0x1A2833", 125, 40, 85)
$h1=StringSplit(guictrlread($hatcolor),":")
GUICtrlSetColor(-1,$h1[2])
GUICtrlSetBkColor(-1,"0x000000")

$feetcolor = GUICtrlCreateLabel("Feet:0xDEC0F4", 40, 60, 85)
$f1=StringSplit(guictrlread($feetcolor),":")
GUICtrlSetColor(-1,$f1[2])


$earscolor = GUICtrlCreateLabel("Ears:0x2287BF", 125, 60, 85)
$e1=StringSplit(guictrlread($earscolor),":")
GUICtrlSetColor(-1,$e1[2])


GUICtrlCreateLabel("©2008",345,40)
GUICtrlSetColor(-1,$colorz)
;BlackHat
GUICtrlCreateLabel("B",330,40)
GUICtrlSetColor(-1,$colorz)
GUICtrlCreateLabel("l",330,52)
GUICtrlSetColor(-1,$colorz)
GUICtrlCreateLabel("a",329,62)
GUICtrlSetColor(-1,$colorz)
GUICtrlCreateLabel("c",329,74)
GUICtrlSetColor(-1,$colorz)
GUICtrlCreateLabel("k",330,88)
GUICtrlSetColor(-1,$colorz)

GUICtrlCreateLabel("H",330,105)
GUICtrlSetColor(-1,$colorz)
GUICtrlCreateLabel("a",330,115)
GUICtrlSetColor(-1,$colorz)
GUICtrlCreateLabel("t",332,127)
GUICtrlSetColor(-1,$colorz)

$copy=GUICtrlCreateLabel("Industries",340,127,50)
GUICtrlSetColor(-1,$colorz)
$BHI=GUICtrlCreatePic("48BHI.jpg",340,65,48,48)
$x="494"
$y="117"
;ears
$x1="508"
$y1="115"
;carrot
$x2="495"
$y2="124"
;feet
$x3="497"
$y3="123"

$time=Random(10000, 15500)
$clicks="0"

GUICtrlCreateLabel("Application Status:",292,330)
GUICtrlSetColor(-1,$colorz)
$on = _GUICtrlCreateRadio ("Alive", 340, 345, 50, 15, "", 0xFF0000)
;GUICtrlSetColor(-1,"0x00FFFF")

$off = _GUICtrlCreateRadio ("Dead", 290, 345, 50, 15, 0xFF0000, 0x00FFFF)
;GUICtrlSetColor(-1,"0xFF0000")

GUICtrlSetState ($off, $GUI_CHECKED)
$color=GUICtrlCreateButton("Set Colors",40,300,60,17)
GUICtrlSetColor($color,$colorz)
GUICtrlSetbkColor($color,"0x000000")
$dimension=GUICtrlCreateButton("Set Dimensions",40,325,85,17)
GUICtrlSetColor($dimension,$colorz)
GUICtrlSetbkColor($dimension,"0x000000")

$clickshow=GUICtrlCreateLabel("Clicks: ["&$clicks&"]",40,345,75,17)
GUICtrlSetColor(-1,$colorz)




GUISetState (@SW_SHOW,$main)
While 1
          $msg = GUIGetMsg()
 If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $XIcon[1] Then Exit
  If $msg = $XIcon[2] Then GUISetState(@SW_MINIMIZE,$main)
      Select
          
          ;=============== Animation
case $msg = $BHI and ControlGetText($winname,"",$copy) = "Industries"
                                    GUICtrlSetData($copy,"Industries!")
case $msg = $BHI and ControlGetText($winname,"",$copy) = "Industries!"
                                    GUICtrlSetData($copy,"Industries!!")
case $msg = $BHI and ControlGetText($winname,"",$copy) = "Industries!!"
                                    GUICtrlSetData($copy,"Industries")
          ;===============> Animation

         
Case BitAND(GUICtrlRead($on), $GUI_CHECKED) = $GUI_CHECKED    
    if WinExists("Privacy Alert") Then
        ControlClick("Privacy Alert","","Button1")
        sleep(100)
        ControlClick("Privacy Alert","","Button3")
    EndIf
    ;HAT
    if PixelGetColor($x,$y) = "0x1A2833" Then
        _lookforhat()
    EndIf
    ;EARS
    if PixelGetColor($x1,$y1) = "0x2287BF" Then
        _lookforears()
    EndIf
    ;CARROT
    if PixelGetColor($x2,$y2) = "0xD6831B" Then
        _lookforCarrot()
    EndIf
    ;FEET
    if PixelGetColor($x3,$y3) = "0xDEC0F4" Then
        _lookforfeet()
    EndIf
    
case $msg = $dimension
_select()
    
case $msg = $color
_sethat()

    EndSelect
WEnd
    
;hat =>
func _lookforhat()
$coord = PixelSearch(238,140,452,174, 0x262721, 4 )
If Not @error Then
            $pos = MouseGetPos()
    MouseMove($coord[0],$coord[1],1)
    MouseClick("left",$coord[0],$coord[1],1)
            $clicks=$clicks+1
            ControlSetText($winname,"",$clickshow,"Clicks: ["&$clicks&"]")
    MouseMove($pos[0],$pos[1],1)
    sleep($time)
EndIf
EndFunc
;ears =>
Func _lookforears()
$coord = PixelSearch(238,140,452,174, 0x2889B6, 4 )
If Not @error Then
                $pos = MouseGetPos()
    MouseMove($coord[0],$coord[1],1)
    MouseClick("left",$coord[0],$coord[1],1)
            $clicks=$clicks+1
            ControlSetText($winname,"",$clickshow,"Clicks: ["&$clicks&"]")
                MouseMove($pos[0],$pos[1],1)
        sleep($time)
EndIf
EndFunc
;Carrot =>
Func _lookforCarrot()
$coord = PixelSearch(238,140,452,174, 0xF2931D, 4 )
If Not @error Then
                $pos = MouseGetPos()
    MouseMove($coord[0],$coord[1],1)
    MouseClick("left",$coord[0],$coord[1],1)
            $clicks=$clicks+1
            ControlSetText($winname,"",$clickshow,"Clicks: ["&$clicks&"]")
                MouseMove($pos[0],$pos[1],1)
        sleep($time)
EndIf
EndFunc
;feet =>
func _lookforfeet()
$coord = PixelSearch(238,140,452,174, 0xF7DDF8, 4 )
If Not @error Then
                $pos = MouseGetPos()
    MouseMove($coord[0],$coord[1],1)
    MouseClick("left",$coord[0],$coord[1],1)
            $clicks=$clicks+1
            ControlSetText($winname,"",$clickshow,"Clicks: ["&$clicks&"]")
                MouseMove($pos[0],$pos[1],1)
        sleep($time)
EndIf
EndFunc
func _stop()
    Exit
EndFunc


Func _Select()
    $i = 1
    $clickpoint = "Top Right: "
    Do
    $msg2=GuiGetMsg()
        $pos = MouseGetPos()
        $tooltip = ToolTip($ClickPoint & $pos[0] & "," & $pos[1],$pos[0]+10,$pos[1]+10)
            
          If _IsPressed("01", $dll) Then
              
            while _IsPressed("01", $dll)
            sleep(10)
            WEnd    

            $i += 1    
            ElseIf $i = 1 Then
                GuiCtrlSetData($in5 , $pos[0])
                GuiCtrlSetData($in6, $pos[1])
                
            Elseif $i = 2 Then
            $clickpoint = "Bottom Left: "
                GuiCtrlSetData($in7, $pos[0])
                GuiCtrlSetData($in8, $pos[1])
                
        EndIf    
            
        Until $i = 3
        $tooltip = ToolTip("")
            $i = 0

    EndFunc        
;=====================================================================
;
;                THIS FUNCTION DOES NOT WORK!
;
;=====================================================================
func _sethat()
    GuiGetMsg()
    $wees=0
$dll = DllOpen("user32.dll")
do
    sleep(10)
$pos = MouseGetPos()
$colors = PixelGetColor($pos[0],$pos[1])
ToolTip("Color: "&hex($color,6)&" "&$pos[0] & "," & $pos[1],$pos[0]+10,$pos[1]+10)

If _IsPressed("01", $dll) Then
while _IsPressed("01", $dll)
sleep(10)
WEnd

$wees += 1
elseif $wees = 1 Then 
    msgbox(262144,"","Color: "&hex($color,6)&" "&$pos[0] & "," & $pos[1])
    $wees=2
EndIf
    Until $wees = 2
ToolTip("")    
EndFunc
;=====================================================================
;
;                THIS FUNCTION DOES NOT WORK!
;
;=====================================================================


Func _GUICtrlCreateRadio( $rText, $rLeft, $rTop, $rLength, $rHieght, $rBackColor = "" , $rTextColor = "" )
    Local $PCRadio = GUICtrlCreateRadio("", $rLeft, $rTop, 15, 15)
    Local $PCLabel = GUICtrlCreateLabel($rText, $rLeft + 15, $rTop, $rLength - 15, $rHieght)
    If $rTextColor <> "" Then GUICtrlSetColor(-1, $rTextColor)
    If $rBackColor <> "" Then GUICtrlSetBkColor(-1, $rBackColor)
    Return $PCRadio
EndFunc

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Glyph

Oooohhh!!!!

I was wondering why they weren't showing up on my buddies comp!

thanks!!


tolle indicium

Share this post


Link to post
Share on other sites
Valuater

Oooohhh!!!!

I was wondering why they weren't showing up on my buddies comp!

thanks!!

Welcome

8)


NEWHeader1.png

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.