Jump to content

3 functions each repeating at different time


Recommended Posts

heya guys!

so i want to make a script with 3 different functions

"function 1"

"function 2"

"function 3"

i would like it like this:

function 1 repeats itself the whole time (also between function 2 and 3)

but function 2 repeats itself every 15 secs

and function 3 repeats itself every 50 minutes

anyone who can help me on this one...?

kind regards !

Link to comment
Share on other sites

  • Moderators

seppeke999,

Welcome to the AutoIt forum. ;)

Run your first function within an infinite loop (While...WEnd) and use AdlibRegister to fire the other 2 at the appropriate intervals. Take in look at the Help file to see how these functions work. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

While 1
    fight
WEnd
AdlibRegister ( "shortbuff", 15000 )
AdlibRegister ( "longbuff", 3000000 )
AdlibRegister ( "money", 120000 )
Func fight
send ( "T" )
sleep ( 50 )
Send ( "Z" )
Sleep ( 2500 )
Send ( "Z" )
sleep ( 50 )
Send ( "Z" )
sleep ( 50 )
Send ( "Z" )
sleep ( 50 )
Send ( "Z" )
sleep ( 50 )
Send ( "Z" )
sleep ( 50 )
send ( "R" )
Sleep ( 50 )
send ( "E" )
EndFunc
  
Func shortbuff
Send ( "Q" )
sleep ( 50 )
Send ( "F" )
sleep ( 50 )
Send ( "W" )
EndFunc
Func longbuff
Send ( "S" )
sleep ( 50 )
Send ( "A" )
sleep ( 50 )
Send ( "D" )
sleep ( 3500 )
Send ( "X" )
sleep ( 3500 )
EndFunc  
Func money
MouseClick ( "left" , 1465, 348, 1, 1)
sleep ( 50 )
MouseClick ( "left" , 1465, 348, 1, 1)
EndFunc

does anyone see what i do wrong ?

Link to comment
Share on other sites

okay so now i got this

it says badly formatted func statement line 8 when executing...

anyone knows what to do ? ;)

AdlibRegister ( "shortbuff", 15000 )
AdlibRegister ( "longbuff", 3000000 )
AdlibRegister ( "money", 120000 )

While 1
     fight
WEnd
Func ( fight )
    send ( "T" )
sleep ( 50 )
Send ( "Z" )
Sleep ( 2500 )
Send ( "Z" )
sleep ( 50 )
Send ( "Z" )
sleep ( 50 )
Send ( "Z" )
sleep ( 50 )
Send ( "Z" )
sleep ( 50 )
Send ( "Z" )
sleep ( 50 )
send ( "R" )
Sleep ( 50 )
send ( "E" )
EndFunc

Func ( shortbuff )
    Send ( "Q" )
sleep ( 50 )
Send ( "F" )
sleep ( 50 )
Send ( "W" )
EndFunc

Func ( longbuff )
    Send ( "S" )
sleep ( 50 )
Send ( "A" )
sleep ( 50 )
Send ( "D" )
sleep ( 3500 )
Send ( "X" )
sleep ( 3500 )
EndFunc  

Func ( money )
    MouseClick ( "left" , 1465, 348, 1, 1)
sleep ( 50 )
MouseClick ( "left" , 1465, 348, 1, 1)
EndFunc
Link to comment
Share on other sites

  • Moderators

seppeke999,

If you post code which is obviously for a game then expect the same treatment as if you explicitly state it. Thread locked. ;)

Please read the Forum Rules before posting again. :)

M23

Edited by Melba23
Typo

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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