Sign in to follow this  
Followers 0
myth641

this script has a exit function how can i turn it to a pause function?

4 posts in this topic

#1 ·  Posted (edited)

heres the script btw im new and i dont know were to put it can somone help me

and this scipt isnt mine i just got from this website

#include <GUIConstants.au3>

$found = "no"
$searchcolor = 0xff0000

HotKeySet( "{ESC}" , "end" )
HotKeySet( "{F11}" , "f11" )

While 1
    If $found = "no" Then
                $coord = PixelSearch(10, 10, 800, 580, $searchcolor)
                If IsArray($coord) = 1 Then
                    MouseMove($coord[0], $coord[1], 0)
                    $found = "yes"
                EndIf
            Else
                $pos = MouseGetPos()
                $coord = PixelSearch(($pos[0] - 10) , ($pos[1] - 10) , ($pos[0] + 500) , ($pos[1] + 500), $searchcolor)
                If IsArray($coord) = 1 Then
                    MouseMove( $coord[0], $coord[1], 0)
                Else
                    $found = "no"
                EndIf
                While $found = "yes"
                    $pos = MouseGetPos()
                    $coord = PixelSearch(($pos[0] - 10) , ($pos[1] - 10) , ($pos[0] + 8) , ($pos[1] + 8), $searchcolor)
                    If IsArray($coord) = 1 Then
                        Sleep(500)
                    Else
                        $found = "no"
                    EndIf
                WEnd                    
    EndIf
    Sleep(50)
WEnd

Func end()
    Exit
EndFunc

Func RunBot() 
EndFunc
Edited by myth641

Share this post


Link to post
Share on other sites



heres the script btw im new and i dont know were to put it can somone help me

and this scipt isnt mine i just got from this website

#include <GUIConstants.au3>

$found = "no"
$searchcolor = 0x5b2b29

HotKeySet( "{ESC}" , "end" )

While 1
    If $found = "no" Then
                $coord = PixelSearch(10, 10, 800, 580, $searchcolor)
                If IsArray($coord) = 1 Then
                    MouseMove($coord[0], $coord[1], 0)
                    $found = "yes"
                EndIf
            Else
                $pos = MouseGetPos()
                $coord = PixelSearch(($pos[0] - 10) , ($pos[1] - 10) , ($pos[0] + 500) , ($pos[1] + 500), $searchcolor)
                If IsArray($coord) = 1 Then
                    MouseMove( $coord[0], $coord[1], 0)
                Else
                    $found = "no"
                EndIf
                While $found = "yes"
                    $pos = MouseGetPos()
                    $coord = PixelSearch(($pos[0] - 10) , ($pos[1] - 10) , ($pos[0] + 8) , ($pos[1] + 8), $searchcolor)
                    If IsArray($coord) = 1 Then
                        Sleep(500)
                    Else
                        $found = "no"
                    EndIf
                WEnd                    
    EndIf
    Sleep(50)
WEnd

Func end()
    Exit
EndFunc
Just add:

HotKeySet( "{F11}" , "f11" )

near:

HotKeySet( "{ESC}" , "end" )

and add:

Func f11()
;Write here what you need to do
EndFunc

near:

Func end()
    Exit
EndFunc

Share this post


Link to post
Share on other sites

Please don't post a script that isn't even yours and then ask where you can put it... Valik might be lurking. :)

:P

Now that I've (almost) stopped laughing: What was the question? You just want to change that script from the ESC key to F11? Or you want to write a different scirpt? Have you read the help file under HotKeySet? Did you try the example there?

:blink:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

heres the script btw im new and i dont know were to put it can somone help me

and this scipt isnt mine i just got from this website

#include <GUIConstants.au3>

$found = "no"
$searchcolor = 0xff0000

HotKeySet( "{ESC}" , "end" )
HotKeySet( "{F11}" , "f11" )

While 1
    If $found = "no" Then
                $coord = PixelSearch(10, 10, 800, 580, $searchcolor)
                If IsArray($coord) = 1 Then
                    MouseMove($coord[0], $coord[1], 0)
                    $found = "yes"
                EndIf
            Else
                $pos = MouseGetPos()
                $coord = PixelSearch(($pos[0] - 10) , ($pos[1] - 10) , ($pos[0] + 500) , ($pos[1] + 500), $searchcolor)
                If IsArray($coord) = 1 Then
                    MouseMove( $coord[0], $coord[1], 0)
                Else
                    $found = "no"
                EndIf
                While $found = "yes"
                    $pos = MouseGetPos()
                    $coord = PixelSearch(($pos[0] - 10) , ($pos[1] - 10) , ($pos[0] + 8) , ($pos[1] + 8), $searchcolor)
                    If IsArray($coord) = 1 Then
                        Sleep(500)
                    Else
                        $found = "no"
                    EndIf
                WEnd                    
    EndIf
    Sleep(50)
WEnd

Func end()
    Exit
EndFunc

Func RunBot() 
EndFunc
#include <GUIConstants.au3>

$found = "no"
$searchcolor = 0xff0000

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotkeySet("{ESC}", "End")
HotKeySet("{F11}" , "RunBot")

While 1
    If $found = "no" Then
                $coord = PixelSearch(10, 10, 800, 580, $searchcolor)
                If IsArray($coord) = 1 Then
                    MouseMove($coord[0], $coord[1], 0)
                    $found = "yes"
                EndIf
            Else
                $pos = MouseGetPos()
                $coord = PixelSearch(($pos[0] - 10) , ($pos[1] - 10) , ($pos[0] + 500) , ($pos[1] + 500), $searchcolor)
                If IsArray($coord) = 1 Then
                    MouseMove( $coord[0], $coord[1], 0)
                Else
                    $found = "no"
                EndIf
                While $found = "yes"
                    $pos = MouseGetPos()
                    $coord = PixelSearch(($pos[0] - 10) , ($pos[1] - 10) , ($pos[0] + 8) , ($pos[1] + 8), $searchcolor)
                    If IsArray($coord) = 1 Then
                        Sleep(500)
                    Else
                        $found = "no"
                    EndIf
                WEnd                    
    EndIf
    Sleep(50)
WEnd

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func End()
    Exit
EndFunc

Func RunBot() 
EndFunc

But it would be a good idea to learn the code otherwise you will always only be as creative as someone else.

Edit: Almost forgot to mention, hit the Pause/Break key to Pause/unPause it.

Edited by schilbiz

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