Sign in to follow this  
Followers 0
mHt

What can be done better?

5 posts in this topic

#include <GUIConstants.au3>
#include <misc.au3>
$destination = @scriptdir&"\img\c.jpg"
SplashImageOn("Created By fiNk!", $destination,250,50)
Sleep(1300)
SplashOff()
MsgBox ( 1, "INFO!", "Before you hit start, make sure you have opened www.usmafia.com...To stop the bot, press STOP button, or hit ESCAPE", 10 )
hotkeyset("{esc}","stop")
$win=guicreate("US-Mafia Ranker",223,60,-1,-1)
$startbtn=guictrlcreatebutton("Start",50,15,60,30)
$stopbtn=guictrlcreatebutton("Stop",110,15,60,30)
GUISetState(@SW_SHOW)
GUISetBkColor (0x212121) 
$running=0
while 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        case $GUI_EVENT_CLOSE
            Exit
        case $startbtn
            $running=1
        case $stopbtn
            $running=0
    EndSwitch
    if $running=1 then
do
; Login Function ( You have 4 seconds from you run the exe until you must have opened USmafia window )
sleep (4000)
if $running=0 then exitloop
MouseClick("Primary", 612, 524, 1, 10 )
if $running=0 then exitloop
send ("username")
MouseClick("Primary", 605, 555, 1, 10 )
if $running=0 then exitloop
send ("password")
if $running=0 then exitloop
MouseClick("Primary", 642, 593, 1, 10 )
sleep (3500)
if $running=0 then exitloop
; Car Stealing
MouseClick("Primary", 37, 743, 1, 10 )
sleep (1000)
if $running=0 then exitloop
MouseClick("Primary", 403, 454, 1, 10 )
sleep (1000)
if $running=0 then exitloop
MouseClick("Primary", 746, 480, 1, 10 )
sleep (2000)
if $running=0 then exitloop
; Regual Crime
MouseClick("Primary", 37, 778, 1, 10 )
sleep (1000)
if $running=0 then exitloop
MouseClick("Primary", 402, 551, 1, 10 )
sleep (1000)
if $running=0 then exitloop
MouseClick("Primary", 747, 576, 1, 10 )
sleep (2000)
if $running=0 then exitloop
; Extortion
MouseClick("Primary", 35, 878, 1, 10 )
sleep (1000)
if $running=0 then exitloop
MouseClick("Primary", 626, 449, 1, 10 )
sleep (2000)
until $running=0
endif
WEnd


func stop()
    $running=0
EndFunc

Share this post


Link to post
Share on other sites



1

always use "Tidy" in SciTE to check and ckean your script

#include <GUIConstants.au3>
#include <misc.au3>
$destination = @ScriptDir & "\img\c.jpg"
SplashImageOn("Created By fiNk!", $destination, 250, 50)
Sleep(1300)
SplashOff()
MsgBox(1, "INFO!", "Before you hit start, make sure you have opened www.usmafia.com...To stop the bot, press STOP button, or hit ESCAPE", 10)
HotKeySet("{esc}", "stop")
$win = GUICreate("US-Mafia Ranker", 223, 60, -1, -1)
$startbtn = GUICtrlCreateButton("Start", 50, 15, 60, 30)
$stopbtn = GUICtrlCreateButton("Stop", 110, 15, 60, 30)
GUISetState(@SW_SHOW)
GUISetBkColor(0x212121)
$running = 0
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $startbtn
            $running = 1
        Case $stopbtn
            $running = 0
    EndSwitch
    If $running = 1 Then
        Do
            ; Login Function ( You have 4 seconds from you run the exe until you must have opened USmafia window )
            Sleep(4000)
            If $running = 0 Then ExitLoop
            MouseClick("Primary", 612, 524, 1, 10)
            If $running = 0 Then ExitLoop
            Send("username")
            MouseClick("Primary", 605, 555, 1, 10)
            If $running = 0 Then ExitLoop
            Send("password")
            If $running = 0 Then ExitLoop
            MouseClick("Primary", 642, 593, 1, 10)
            Sleep(3500)
            If $running = 0 Then ExitLoop
            ; Car Stealing
            MouseClick("Primary", 37, 743, 1, 10)
            Sleep(1000)
            If $running = 0 Then ExitLoop
            MouseClick("Primary", 403, 454, 1, 10)
            Sleep(1000)
            If $running = 0 Then ExitLoop
            MouseClick("Primary", 746, 480, 1, 10)
            Sleep(2000)
            If $running = 0 Then ExitLoop
            ; Regual Crime
            MouseClick("Primary", 37, 778, 1, 10)
            Sleep(1000)
            If $running = 0 Then ExitLoop
            MouseClick("Primary", 402, 551, 1, 10)
            Sleep(1000)
            If $running = 0 Then ExitLoop
            MouseClick("Primary", 747, 576, 1, 10)
            Sleep(2000)
            If $running = 0 Then ExitLoop
            ; Extortion
            MouseClick("Primary", 35, 878, 1, 10)
            Sleep(1000)
            If $running = 0 Then ExitLoop
            MouseClick("Primary", 626, 449, 1, 10)
            Sleep(2000)
        Until $running = 0
    EndIf
WEnd
Func stop()
    $running = 0
EndFunc   ;==>stop

2

You may wish to look at the idea of how the pause works in the HotKeySet() demo at the bottom of the help page

3

Maybe.... XSkin or EzSkin to make it look cool

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

How ya gonna know if you post - leave - and don't check-in????

Last Seen: Yesterday, 01:35 PM

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

How ya gonna know if you post - leave - and don't check-in????

Last Seen: Yesterday, 01:35 PM

8)

Info by osmosis?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

LOL

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  
Followers 0