Sign in to follow this  
Followers 0
seppeke999

3 functions each repeating at different time

10 posts in this topic

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 !

Share this post


Link to post
Share on other sites



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


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

thnx

Share this post


Link to post
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 ?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

use brackets after the function names.

Put adlibs before the while loop.

Edited by forumer100

My UDFs, Abbrevs and Snippets
If you like my post, just click the like button :) 

Share this post


Link to post
Share on other sites

use brackets after the function names.

Put adlibs before the while loop.

still says badly formatted "Func" statement ...

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

thnx !

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

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

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0