Jump to content

Timedif


Recommended Posts

Hi My code doesnt work it closes after a minute or so

it should close after 15 min :\

so I figured if time dif is in milisec then 15 min is 90000 right?

; <AUT2EXE VERSION: 3.1.1.0>
#NoTrayIcon
if FileExists (@ScriptDir & "config.ini\") Then
    Dim $SkillButton = IniRead( @ScriptDir & "config.ini\" , "BuffCheckers" , "HealButton" , 1)
        Dim $SkillButton = IniRead( @ScriptDir & "config.ini\" , "BuffCheckers" , "SkillButton" , 5)
            Dim $SkillButton = IniRead( @ScriptDir & "config.ini\" , "BuffCheckers" , "DefenseButton" , 2)
                Dim $SkillButton = IniRead( @ScriptDir & "config.ini\" , "BuffCheckers" , "AttackButton" , 3)
            Else
                Dim $SkillButton = 5 , $HealButton = 1 , $DefenseButton = 2 , $AttackButton = 1
            EndIf
            $TimeFirst = TimerInit()
            Dim $TimerDif = 0
HotKeySet ("+{F5}",  "AE_Pattern"    )
HotKeySet ("+{F6}",  "AE_Pattern_Plus")
HotKeySet ("+{F9}",  "Left_Click"    )
HotkeySet ("+{F10}", "Stop"        )
HotKeySet ("+{F11}", "Right_Click"  ); + = Shift Key

Opt ("WinTitleMatchMode", 3   )
Opt ("MouseClickDownDelay", 55)
Opt ("MouseClickDelay", 1    )
Opt ("SendKeyDownDelay", 10   )
Opt ("SendKeyDelay", 1      )
Opt ("CaretCoordMode", 2      )

Dim $Skill_Delay, $Buff_Delay1, $Key_Delay = 1, $HC = 0 , $AC = 0 , $DC = 0 ,$APRC,$APLC,$APBC,$APHC,$Msg

GuiCreate( "Hybrid Bot V1.3", 400, 300,50,50)
GUISetFont(8,100,1,"")
$FileMenu=GuiCtrlCreateMenu( "File")
$Save=GuiCtrlCreateMenuItem( "Save",$FileMenu)
$defualt=GuiCtrlCreateMenuItem( "Default",$FileMenu)
$AboutMenu=GUICtrlCreateMenu( "Other")
$About=GUICtrlCreateMenuitem("About",$AboutMenu)
GuiCtrlCreateGroup( "Options of Buff" , 10 , 10, 150,110)
$HealCheck=GuiCtrlCreateCheckBox( "Heal" , 20 , 30, 100,20)
$DefenseCheck=GuiCtrlCreateCheckBox( "Defense" , 20 , 50,100,20)
$AttackCheck=GUICtrlCreateCheckbox( "Attack" , 20 , 70,100,20)
GUISetFont(9 ,400,4,"Maryiad Web Pro Bold")
GUICtrlCreateLabel( "Enjoy!",20,90,100,20)
GUISetFont(8,100,1,"")
GuiCtrlCreateGroup( "Options of Keys" , 10 ,120 , 150 , 145)
$SkillInput = GUICtrlCreateInput ("5",20, 140, 50,20)
$SkillUpdown = GUICtrlCreateUpdown($SkillInput)
GuiCtrlCreateLabel( "Attack Skill",75,143,60,20)
GuiCtrlSetLimit( $SkillUpdown, 9,1)
$HealInput = GuiCtrlCreateInput ("1",20,165,50,20)
$HealUpdown = GUICtrlCreateUpdown($HealInput)
GUICtrlCreateLabel( "Heal Buff" , 75,168,60,20)
GuiCtrlSetLimit( $HealUpdown, 9 ,1)
$DefenseInput = GuiCtrlcreateInput( "2",20 ,193,50,20)
$DefenseUpdown = GUICtrlCreateUpdown($DefenseInput)
GuiCtrlCreateLabel( "Def Buff", 75 , 198 ,60 ,20)
GuiCtrlSetLimit ( $DefenseUpdown, 9,1)
$AttackInput = GuiCtrlCreateInput("3",20,223,50,20)
$AttackUpdown = GUICtrlCreateUpdown($AttackInput)
GUICtrlCreateLabel( "Attack Buff" , 75 ,228 ,60 ,20)
GuiCtrlSetLimit($AttackUpdown, 9 ,1 )
GuiCtrlCreateGroup( "AutoPickers" , 170, 10, 150,110)
$APB=GuiCtrlCreateCheckBox( "While AE",180,30,100,20)
$APH=GUICtrlCreateCheckbox( "While Hybrid",180,50,100,20)
$APL=GUICtrlCreateCheckbox( "While LeftClick",180,70,100,20)
$APR=GUICtrlCreateCheckbox( "While RightClick",180,90,100,20)

GuiCtrlCreateGroup( "Instructions",170,120,200,145)

GUICtrlCreateLabel( "Welcome to the Hybrid bot V1.3" & @CRLF & "To use it press Shift + Button" & @Crlf & "Here is the list of buttons" & @CRLF & "Shift+F5 - AE Bot" & @CRLF & "Shift+F6 - Hybrid Bot" & @CRLF & "Shift+F9 - LeftClicker" & @CRLF & "Shift+F10 - Stoping all Functions" & @CRLF & "Shift+F11 - RightClicker" & @CRLF & "Enjoy. Made By zzxxzzxx and Misha", 180,140,170,120)
GUISetState ()


Func Left_Click (); Continuously Pressing Left Click.
        While $TimerDif <= 90000
        $TimerDif = TimerDiff()
        If WinActive("MU") Then
            MouseClick ("Left")
            if $APLC = 1 Then
            Send (" ", 1)
            Endif
            MouseUp ("Right")
        Else
            MouseClick ("Left")
            if $APLC = 1 Then
            Send (" ", 1)
            EndIf
            MouseUp ("Right")
        EndIf
    WEnd
EndFunc

Func Right_Click (); Continuously Pressing Right Click.
        While $TimerDif <= 90000
        $TimerDif = TimerDiff()
        If WinActive("MU") Then
            MouseClick ("Right")
            if $APRC = 1 Then
            Send (" ", 1)
            EndIf
            MouseUp ("Right")
        Else
            MouseClick ("Right")
            if $APRC =1 Then
            Send (" ", 1)
            EndIf
            Sleep(25)
            MouseUp ("Right")
            EndIf
    WEnd
EndFunc

Func AE_Pattern (); Skills In Fixed Pattern (L, R, LUU, RUU, LD, RD, LU, RU, U, D).
    Dim $x[11] = ['', 315, 495, 320, 480, 355, 440, 315, 495, 405, 405]
    Dim $y[11] = ['', 290, 290, 180, 180, 320, 310, 245, 245, 150, 320]
        While $TimerDif <= 90000
        $TimerDif = TimerDiff()
        If WinActive("MU") Then
            For $p = 1 To 10
                $Skill_Delay = 25
                if $APBC = 1 Then
                Send ("{"&$SkillButton&"} ")
            Else
                Send($SkillButton)
                EndIf
                Sleep ($Key_Delay)
                MouseClick ("Right", $x[$p] ,$y[$p] , 1)
                Skill_Delay ()
            Next
        EndIf
    WEnd
EndFunc

Func AE_Pattern_Plus (); Buff & Skills In Fixed Pattern (L, R, LUU, RUU, LD, RD, LU, RU, U, D).
    Local $x[11] = ['', 335, 440, 355, 445, 390, 420, 390, 420, 405, 405]
    Local $y[11] = ['', 290, 290, 245, 245, 300, 300, 280, 280, 270, 300]
    $Buff_Delay = 15; Change Here For Buff Delay.
        While $TimerDif <= 90000
        $TimerDif = TimerDiff()
        If WinActive("MU") Then
                $Buff_Delay1 = $Buff_Delay
                if $DC = 1 Then
                Send ("{"&$DefenseButton&"} ")
            EndIf
            if $AC = 1 Then
                Send ("{"&$AttackButton&"} ")
                EndIf
                MouseClick ("Right", 410, 285, 1); Clicks On Self.
                MouseUp ("Right")
                Buff_Delay ()
            For $p = 1 To 10
                $Skill_Delay = 36; Change Here For Skill Delay.
                Send ("{"&$SkillButton&"} "); Skill number.
                Sleep ($Key_Delay)
                MouseClick ("Right", $x[$p] ,$y[$p] , 1)
                Skill_Delay ()
            Next
            $Buff_Delay1 = $Buff_Delay
            if $HC = 1 Then
            Send ("{"&$HealButton&"} "); Heal
            MouseClick ("Right", 410, 285, 1)
            MouseUp ("Right")
            EndIf
            Buff_Delay ()
        EndIf
    WEnd
EndFunc

Func Stop (); Stops The Program.
    While $TimerDif <= 90000
        $TimerDif = TimerDiff()
    Select
        Case $Msg   = $Gui_event_close
            Exit
        Case $Msg = $defualt
            Dim $SkillButton = 5 , $HealButton = 1 , $DefenseButton = 2 , $AttackButton = 1
        Case $msg = $About
            MsgBox(0 ,"About", "This bot was created by zzxxzzx and Misha" & @CRLF & "If you have any problems go on irc://irc.rizon.net and join #mpc_mu")
        Case $Msg = $Save
            if FileExists(@ScriptDir & "config.ini\") Then
                IniWrite( @ScriptDir & "config.ini\","BuffCheckers","HealButton",$HealButton)
                IniWrite( @ScriptDir & "config.ini\","BuffCheckers","DefButton",$DefenseButton)
                IniWrite( @ScriptDir & "config.ini\","BuffCheckers","AttackButton",$AttackButton)
                    IniWrite( @ScriptDir & "config.ini\","BuffCheckers","SkillButton",$SkillButton)
                Else
                    _FileCreate( @ScriptDir & "config.ini\")
                    EndIf
        Case $Msg == $HealCheck
            If GuiCtrlRead($HealCheck) == $GUI_CHECKED Then
                $HC = 1
            Else
                $HC = 0
                EndIf
            If GUICtrlRead($DefenseCheck) == $GUI_CHECKED Then
                $DC = 1
            Else 
                $DC = 0 
                EndIf
            If GuiCtrlRead($AttackCheck) == $GUI_CHECKED Then
                $AC = 1
            Else
                $AC = 0 
            EndIf
        Case $Msg == $SkillUpdown
            $SkillButton = GuiCtrlRead($SkillInput)
        Case $Msg = $HealUpdown
            $HealButton = GuiCtrlRead($HealInput)
        Case $Msg == $DefenseUpdown
            $DefenseButton = GuiCtrlRead($DefenseInput)
        Case $Msg = $AttackUpdown
            $AttackButton = GuiCtrlRead($AttackInput)
        Case $Msg == $APB
            if GuiCtrlRead($APB) == $GUI_CHECKED Then
                $APBC = 1
            Else
                $APBC = 0
                EndIf
            Case $Msg == $APH
                if GUICtrlRead($APH) == $GUI_CHECKED Then
                    $APHC = 1
                Else 
                    $APHC = 0
                    EndIf
                Case $Msg == $APL
                    If GUICtrlRead($APL) == $GUI_CHECKED Then
                        $APLC = 1
                    Else 
                        $APLC = 0
                        EndIf
                    Case $Msg == $APR
                        if GuiCtrlRead($APR) == $GUI_CHECKED Then
                            $APRC = 1
                        Else 
                            $APRC = 0
                        EndIf
                        EndSelect

    Sleep (1)
WEnd
EndFunc

Func Skill_Delay (); Delay Interval In Between Skills.
    While $Skill_Delay > 0
        MouseClick ("Right")
        Send (" ", 1)
        $Skill_Delay = $Skill_Delay - 1
    WEnd
EndFunc

Func Buff_Delay (); Delay Interval In Between Buffs.
    While $Buff_Delay1 > 0
        Send (" ", 1)
        $Buff_Delay1 = $Buff_Delay1 - 1
    WEnd
EndFunc

While $TimerDif <= 90000
        $TimerDif = TimerDiff($TimeFirst)   ; Continuous Loop Of Program.
    $Msg = GUIGetMsg()
    Select
        Case $msg = $Gui_event_close
            Exit
        Case $Msg = $defualt
            Dim $SkillButton = 5 , $HealButton = 1 , $DefenseButton = 2 , $AttackButton = 1
        Case $msg = $About
            MsgBox(0 ,"About", "This bot was created by zzxxzzx and Misha" & @CRLF & "If you have any problems go on irc://irc.rizon.net and join #mpc_mu")
        Case $Msg = $Save
            if FileExists(@ScriptDir & "config.ini\") Then
                IniWrite( @ScriptDir & "config.ini\","BuffCheckers","HealButton",$HealButton)
                IniWrite( @ScriptDir & "config.ini\","BuffCheckers","DefButton",$DefenseButton)
                IniWrite( @ScriptDir & "config.ini\","BuffCheckers","AttackButton",$AttackButton)
                    IniWrite( @ScriptDir & "config.ini\","BuffCheckers","SkillButton",$SkillButton)
                Else
                    _FileCreate( @ScriptDir & "config.ini\")
                    EndIf
        Case $Msg == $HealCheck
            If GuiCtrlRead($HealCheck) == $GUI_CHECKED Then
                $HC = 1
            Else
                $HC = 0
                EndIf
            If GUICtrlRead($DefenseCheck) == $GUI_CHECKED Then
                $DC = 1
            Else 
                $DC = 0 
                EndIf
            If GuiCtrlRead($AttackCheck) == $GUI_CHECKED Then
                $AC = 1
            Else
                $AC = 0 
            EndIf
        Case $Msg == $SkillUpdown
            $SkillButton = GuiCtrlRead($SkillInput)
        Case $Msg == $HealUpdown
            $HealButton = GuiCtrlRead($HealInput)
        Case $Msg == $DefenseUpdown
            $DefenseButton = GuiCtrlRead($DefenseInput)
        Case $Msg == $AttackUpdown
            $AttackButton = GuiCtrlRead($AttackInput)
        Case $Msg == $APB
            if GuiCtrlRead($APB) == $GUI_CHECKED Then
                $APBC = 1
            Else
                $APBC = 0
                EndIf
            Case $Msg == $APH
                if GUICtrlRead($APH) == $GUI_CHECKED Then
                    $APHC = 1
                Else 
                    $APHC = 0
                    EndIf
                Case $Msg == $APL
                    If GUICtrlRead($APL) == $GUI_CHECKED Then
                        $APLC = 1
                    Else 
                        $APLC = 0
                        EndIf
                    Case $Msg == $APR
                        if GuiCtrlRead($APR) == $GUI_CHECKED Then
                            $APRC = 1
                        Else 
                            $APRC = 0
                        EndIf
                        EndSelect

    Sleep (1)
WEnd
; ----------------------------------------------------------------------------
; <AUT2EXE INCLUDE-END: X:\Programs\[Games]\MuOnline\[Add On]\(2005-09-01) - (zzxxzzxx) 800x600\AE Bot\AE Bot v2.0\joytokey.au3>
; ----------------------------------------------------------------------------


; ----------------------------------------------------------------------------
; <AUT2EXE INCLUDE-END: G:\Documents and Settings\TEMP.WINDOWS2000PRO.000\Рабочий стол\AE Bot v2.0\joytokey.au3>
; ----------------------------------------------------------------------------
Edited by Misha
Link to comment
Share on other sites

not having gone though the entire script

Hi My code doesnt work it closes after a minute or so

it should close after 15 min :\

so I figured if time dif is in milisec then 15 min is 90000 right?

ok.... 90000 is about 1.5 minutes... sounds about right for the timing you stated

Sleep( 15 * 60 * 1000) will sleep for 15 minutes

thats 15 minutes times 60 seconds times 1000 miliseconds = 15 minutes

1 second = 1000

60 sec = 1 min or 60000

15 minutes = 900000

8)

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