Jump to content

restart the script


koekje
 Share

Recommended Posts

hey, im new to this, but i like it pretty much!

i almost made a WoW fishing bot, the only thing is when it catched a fish, it wont throw in a line again, i mean, is there a function to restart the script?

if so, please tell me, i really need it ;)

Thanx in advance :P

Link to comment
Share on other sites

TQ:D

i think the code sux:P but its my first:P

here it comes:

WinActivate('World of Warcraft')
winwaitactive('World of Warcraft')

HotKeySet('{TAB}')


$dobber = 0x251104
;standaard kleur
$dobber2 = 0x4a6c72
;bij mouseover, als hij lichter word
$splash = 0x97a6af
;kleur van de splash (opspattend water)

$boven = 100
$rechts = 520
$onder = 400
$links = 4

$lootx = 24
$looty = 142

$lootx2 = 24
$looty2 = 173

while 1

        send('0')
        sleep(2000)
        $i = 0
    
        while $i < 1
        
            $waar = PixelSearch($links, $boven, $rechts, $onder, $dobber,10,3)
            if not @error then
                
                $x = $waar[0]
                $y = $waar[1]
                
                MouseMove($x, $y)
                
                
                    
                $1 = $x - 10
                $2 = $y - 10
                $3 = $x + 10
                $4 = $y + 10            
                
                
                $waar2 = PixelSearch($1, $2, $3, $4, $dobber2,15,2)
                if not @error Then
                                    

                    
            ;we hebben de dobber gevonden en de cursor staat erop               
                    
                    wachtopbeet ()
                
                Else
                
                    restart()
                
                endif
            
            EndIf
            
            
            
            
        WEnd
        
        
    
wend
    
func wachtopbeet()
    
    $i = 0

    while $i < 1
    
            
            
            $waar2 = PixelSearch($1, $2, $3, $4, $splash,10,1)
            if not @error Then
                MouseClick('right', $x, $y)
                sleep(1000)
                
                MouseClick('left', $lootx, $looty)
                MouseClick('left', $lootx2, $looty2)
                
                restart()
                
            endif
        
        
    WEnd
    
EndFunc

func restart()
            
                run('"C:\Documents~\Eigenaar\Bureaublad\AI~\mijnvisbot2.au3"')
                Exit
endfunc

the restart() funtion wont work:( plz fix it ;)

Edited by koekje
Link to comment
Share on other sites

almost hard to believe that this had no errors and it worked for you as well as it did.... anyway

i ran it through "tidy" included in the SciTE program under tools...

and i added "call" to calll the functions... you can read about this in help

heres the some-what cleaned-up code

WinActivate('World of Warcraft')
WinWaitActive('World of Warcraft')

HotKeySet('{TAB}')


$dobber = 0x251104
;standaard kleur
$dobber2 = 0x4a6c72
;bij mouseover, als hij lichter word
$splash = 0x97a6af
;kleur van de splash (opspattend water)

$boven = 100
$rechts = 520
$onder = 400
$links = 4

$lootx = 24
$looty = 142

$lootx2 = 24
$looty2 = 173

While 1
    
    Send('0')
    Sleep(2000)
    $i = 0
    
    While $i < 1
        
        $waar = PixelSearch($links, $boven, $rechts, $onder, $dobber, 10, 3)
        If Not @error Then
            
            $x = $waar[0]
            $y = $waar[1]
            
            MouseMove($x, $y)
            
            $1 = $x - 10
            $2 = $y - 10
            $3 = $x + 10
            $4 = $y + 10
            
            $waar2 = PixelSearch($1, $2, $3, $4, $dobber2, 15, 2)
            If Not @error Then
                
            ;we hebben de dobber gevonden en de cursor staat erop
                
                Call("wachtopbeet")
                
            Else
                
                Call("restart")
                
            EndIf
            
        EndIf
        
    WEnd

WEnd


Func wachtopbeet()
    
    $i = 0
    
    While $i < 1
        
        $waar2 = PixelSearch($1, $2, $3, $4, $splash, 10, 1)
        If Not @error Then
            MouseClick('right', $x, $y)
            Sleep(1000)
            
            MouseClick('left', $lootx, $looty)
            MouseClick('left', $lootx2, $looty2)
            
            Call("restart")
            
        EndIf
        
        
    WEnd
    
EndFunc  ;==>wachtopbeet

Func restart()
    
    Run('"C:\Documents~\Eigenaar\Bureaublad\AI~\mijnvisbot2.au3"')
    Exit
    
EndFunc  ;==>restart

hope that helps

8)

ps

noticed that the spacing was lost.... hmmm???

NEWHeader1.png

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...