Jump to content

Halp to make an ingame timers pllz


Recommended Posts

Im new in AutoIt, and now im working at Eve Online inGame Bot, in some places i need a timers, now im using that simple code:

ToolTip("Approaching to the roid 1:30", 50, 30) 
    sleep (30000)
    ToolTip("Approaching to the roid 1:00", 50, 30) 
    sleep (30000)
    ToolTip("Approaching to the roid 0:30", 50, 30) 
    sleep (5000)
    ToolTip("Approaching to the roid 0:25", 50, 30) 
    sleep (5000)
    ToolTip("Approaching to the roid 0:20", 50, 30) 
    sleep (5000)
    ToolTip("Approaching to the roid 0:15", 50, 30) 
    sleep (5000)
    ToolTip("Approaching to the roid 0:10", 50, 30) 
    sleep (5000)
    ToolTip("Approaching to the roid 0:05", 50, 30) 
    sleep (1000)
    ToolTip("Approaching to the roid 0:04", 50, 30) 
    sleep (1000)
    ToolTip("Approaching to the roid 0:03", 50, 30) 
    sleep (1000)
    ToolTip("Approaching to the roid 0:02", 50, 30) 
    sleep (1000)
    ToolTip("Approaching to the roid 0:01", 50, 30) 
    sleep (1000)

I tried to use

$timer = 120
do
$timer = $timer - 1
ToolTip("Approaching to the roid $timer second left", 50, 30)
sleep(1000)
Until $timer = 0

But i dont know how to use $timer in the ToolTip, it just printing to me "Approaching to the roid $timer second left" all the time. Can any one help me to make such kind of ToolTip timer? And is it possible with using minutes and seconds in that ToolTip timer?

Sorry for my bad Eanglish :)

[size="1"]My bear is so cute asleep in the closet, not even drinking vodka. My nuclear bomb name is Natasha.[/size]

Link to comment
Share on other sites

Im new in AutoIt, and now im working at Eve Online inGame Bot, in some places i need a timers, now im using that simple code:

ToolTip("Approaching to the roid 1:30", 50, 30) 
    sleep (30000)
    ToolTip("Approaching to the roid 1:00", 50, 30) 
    sleep (30000)
    ToolTip("Approaching to the roid 0:30", 50, 30) 
    sleep (5000)
    ToolTip("Approaching to the roid 0:25", 50, 30) 
    sleep (5000)
    ToolTip("Approaching to the roid 0:20", 50, 30) 
    sleep (5000)
    ToolTip("Approaching to the roid 0:15", 50, 30) 
    sleep (5000)
    ToolTip("Approaching to the roid 0:10", 50, 30) 
    sleep (5000)
    ToolTip("Approaching to the roid 0:05", 50, 30) 
    sleep (1000)
    ToolTip("Approaching to the roid 0:04", 50, 30) 
    sleep (1000)
    ToolTip("Approaching to the roid 0:03", 50, 30) 
    sleep (1000)
    ToolTip("Approaching to the roid 0:02", 50, 30) 
    sleep (1000)
    ToolTip("Approaching to the roid 0:01", 50, 30) 
    sleep (1000)

I tried to use

$timer = 120
do
$timer = $timer - 1
ToolTip("Approaching to the roid $timer second left", 50, 30)
sleep(1000)
Until $timer = 0

But i dont know how to use $timer in the ToolTip, it just printing to me "Approaching to the roid $timer second left" all the time. Can any one help me to make such kind of ToolTip timer? And is it possible with using minutes and seconds in that ToolTip timer?

Sorry for my bad Eanglish :)

How about something like

Func _Sleepy()
    For $Days = 0 to 0 Step -1
        For $Hours = 0 to 0 Step -1
            For $Minutes = 1 to 0 Step -1
                For $Seconds = 59 to 0 Step -1
                    Sleep (1000)
                    ToolTip ("Sleeping for " & $Days & " days, " & $Hours & " hours, " & $Minutes & " minutes, " & $Seconds & " seconds.", 0, 0)
                Next
            Next
        Next
    Next
EndFunc
Link to comment
Share on other sites

I tried to use this code in this way:

Func Dock()     
    $TTMinutes = 1
    $TTSeconds = 30
    ToolTip ("w8ing docking attempt" & $Minutes & ":" & $Seconds &".", 50, 30)
    Timer()
EndFunc

Func Warp()
    $TTMinutes = 2
    $TTSeconds = 59
    ToolTip ("Warping to belt" & $Minutes & ":" & $Seconds &".", 50, 30)
    Timer()
EndFunc

Func Belt()
    $TTMinutes = 0
    $TTSeconds = 30
    ToolTip ("Warping to base" & $Minutes & ":" & $Seconds &".", 50, 30)
    Timer()
EndFunc


Func Timer()
    For $Minutes = $TTMinutes to 0 Step -1
        For $Seconds = $TTSeconds to 0 Step -1
            Sleep (1000)
        Next
    Next
    Sleep(5000)
EndFunc

While ( WinActive("EVE") )
    Dock()
    Warp()
    Belt()
WEnd

But it dont works. It works just this way:

Func Dock()     
    $TTMinutes = 1
    $TTSeconds = 30
    Timer1()
EndFunc

Func Warp()
    $TTMinutes = 2
    $TTSeconds = 59
    Timer2()
EndFunc

Func Belt()
    $TTMinutes = 2
    $TTSeconds = 59
    Timer3()
EndFunc


Func Timer1()
    For $Minutes = $TTMinutes to 0 Step -1
        For $Seconds = $TTSeconds to 0 Step -1
            Sleep (1000)
            ToolTip ("w8ing docking attempt" & $Minutes & ":" & $Seconds &".", 50, 30)
        Next
    Next
    Sleep(5000)
EndFunc

Func Timer2()
    For $Minutes = $TTMinutes to 0 Step -1
        For $Seconds = $TTSeconds to 0 Step -1
            Sleep (1000)
            ToolTip ("Warping to belt" & $Minutes & ":" & $Seconds &".", 50, 30)
        Next
    Next
    Sleep(5000)
EndFunc

Func Timer3()
    For $Minutes = $TTMinutes to 0 Step -1
        For $Seconds = $TTSeconds to 0 Step -1
            Sleep (1000)
            ToolTip ("Warping to base" & $Minutes & ":" & $Seconds &".", 50, 30)
        Next
    Next
    Sleep(5000)
EndFunc

While ( WinActive("EVE") )
    Dock()
    Warp()
    Belt()
WEnd

Is it possible to use one timer in more then 1 ToolTip? Not for timer per each ToolTip?

[size="1"]My bear is so cute asleep in the closet, not even drinking vodka. My nuclear bomb name is Natasha.[/size]

Link to comment
Share on other sites

You've got way more functions than you need...

While (WinActive("EVE"))
    Timer(1, 30, "W8ing docking attempt ")
    Timer(2, 59, "Warping to belt ")
    Timer(0, 30, "Warping to base ")
WEnd

Func Timer($TTMinutes, $TTSeconds, $Action)
    For $Minutes = $TTMinutes to 0 Step -1
        For $Seconds = $TTSeconds to 0 Step -1
            Sleep (1000)
            ToolTip ($Action & $Minutes & ":" & $Seconds &".", 50, 30)
        Next
    Next
    Sleep(5000); I really don't know what the extra 5 second sleep is for
EndFunc
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...