Jump to content

Paint bot error


Recommended Posts

I dont know why but my script makes mouse go to position 0,0 and keeps clicking it, ctrl+pause_break doesnt stop it, heres script;d:

$s1=62 ;; where starts [pixel, 0]
$s2=53 ;; where starts [pixel, 1]
$k1=799 ;; where ends [pixel,0]
$k2=493 ;; where ends [pixel,1]
$l0=Random($s1,$s2,1) 
$l1=Random($k1,$k2,1)
$m=2
$l2=Random($s1,$s2,1)
$l3=Random($k1,$k2,1)
While 1 ;;main loop
    WinActivate("- Paint") ;;activates my paint;d
    While $m=0 ;;starts loop which just clicks at start[0,1] and end[0,1]
        MouseClick("left",$l0,$l1,1,1) ;; clicks at random start to max
        $l0=Random($s1,$s2,1) ;; generates new randoms for click
        $l1=Random($k1,$k2,1) ;; generates new randoms for click
        $m=Random(0,2,1) ;;generates new random which choose action
        If $m <> 0 Then ;;chooses if exit loop
            ExitLoop
        EndIf
    WEnd ;;ends clicking loop
    While $m=1 ;;starts drawing loop
        $l0=Random($s1,$s2,1) ;; from [0]
        $l1=Random($k1,$k2,1) ;; from [1]
        $l2=Random($s1,$s2,1) ;; to [0]
        $l3=Random($k1,$k2,1) ;; to [1]
        MouseClickDrag("left",$l0,$l1,$l2,$l3,1) ;; drags at just generated numbers
        $m=Random(0,2,1) ;; like last loop
        If $m <> 1 Then ;; same o_o
            ExitLoop
        EndIf
    WEnd ;;ends drawing loop
    $m=Random(0,2,1) ;;chooses new action [here will be color choosing actions]
WEnd ;;main loop end

I will be happy if someone help me cause im just learning and this script was training for me:P

Link to comment
Share on other sites

You probably mesedup starting and ending positions :blink:

To add some other way to exit try hotkey func, i addad to thisone while paint win is active

$s1=62 ;; where starts [pixel, 0]
$s2=53 ;; where starts [pixel, 1]
$k1=799 ;; where ends [pixel,0]
$k2=493 ;; where ends [pixel,1]
$l0=Random($s1,$k1,1) 
$l1=Random($s2,$k2,1)
$m=2
$l2=Random($s1,$k1,1)
$l3=Random($s2,$k2,1)
MsgBox(0,$s2,$s1)
MsgBox(0,$k2,$k1)

WinActivate("untitled - Paint") ;;activates my paint;d
WinSetState("untitled - Paint","",@SW_MAXIMIZE)
WinWaitActive("untitled - Paint")
While WinActive("untitled - Paint")
    While $m=0 ;;starts loop which just clicks at start[0,1] and end[0,1]
        MouseClick("left",$l0,$l1,1,1) ;; clicks at random start to max
$l0=Random($s1,$k1,1) 
$l1=Random($s2,$k2,1)
        $m=Random(0,2,1) ;;generates new random which choose action
        If $m <> 0 Then ;;chooses if exit loop
            ExitLoop
        EndIf
    WEnd ;;ends clicking loop
    While $m=1 ;;starts drawing loop
$l0=Random($s1,$k1,1) 
$l1=Random($s2,$k2,1)
$l2=Random($s1,$k1,1)
$l3=Random($s2,$k2,1)
        MouseClickDrag("left",$l0,$l1,$l2,$l3,1) ;; drags at just generated numbers
        $m=Random(0,2,1) ;; like last loop
        If $m <> 1 Then ;; same o_o
            ExitLoop
        EndIf
    WEnd ;;ends drawing loop
    $m=Random(0,2,1) ;;chooses new action [here will be color choosing actions]
WEnd ;;main loop end

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

Dont know if you ask me

Larger loop = more time

$s1=62 ;; where starts [pixel, 0]
$s2=53 ;; where starts [pixel, 1]
$k1=799 ;; where ends [pixel,0]
$k2=493 ;; where ends [pixel,1]
HotKeySet("{ESC}","_exit")

WinActivate("untitled - Paint") ;;activates my paint;d
WinSetState("untitled - Paint","",@SW_MAXIMIZE)
WinWaitActive("untitled - Paint")
While 1
    MouseClickDrag("left",Random($s1,$k1,1) ,Random($s2,$k2,1),Random($s1,$k1,1),Random($s2,$k2,1),0)
WEnd
    
Func _exit()
    Exit    
EndFunc

You can try to put your last mousedrag parametar(speed) to 0 "A speed of 0 will move the mouse instantly"

Well on my comp it isnt so instantly :blink:

you can try it like this

$s1=62 ;; where starts [pixel, 0]
$s2=53 ;; where starts [pixel, 1]
$k1=799 ;; where ends [pixel,0]
$k2=493 ;; where ends [pixel,1]
HotKeySet("{ESC}","_exit")

WinActivate("untitled - Paint") ;;activates my paint;d
WinSetState("untitled - Paint","",@SW_MAXIMIZE)
WinWaitActive("untitled - Paint")
While 1
    MouseMove(Random($s1,$k1,1) ,Random($s2,$k2,1),0)
    MouseDown ( "left" )
    MouseMove(Random($s1,$k1,1) ,Random($s2,$k2,1),0)
    MouseUp ( "left" )
;   Sleep(10)
WEnd
    
Func _exit()
    Exit    
EndFunc

Maby i shud put some sleep in a lop so that it dont go that fast but thats not fun :0)

(if you dont put sleep dont call me if it messup your comp when you forgot to hit esc to stop the script ^^ )

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

lols:P

Can u explain me what this part does?

While 1

MouseMove(Random($s1,$k1,1) ,Random($s2,$k2,1),0)

MouseDown ( "left" )

MouseMove(Random($s1,$k1,1) ,Random($s2,$k2,1),0)

MouseUp ( "left" )

; Sleep(10)

WEnd

Btw thx, i learned another trick - i dont have to make 9999 lines instead of 1 o_o

Link to comment
Share on other sites

it teleport mouse to the start position, press it down teleport mouse to end position, and relise mouse ;)

Did you tested it? if you did not pls put sleep(10) to b on the safe side :blink:

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
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...