Sign in to follow this  
Followers 0
Darknightx37

Need Help "Stopping function"

6 posts in this topic

Hay guys i Made a little bot that writes the "message of the day" for me in my server and restarts the server evry 4 hours.

now i have a problem i made it like this(example) :

while 1
if _ispressed(04) then ;mouse3

send("t")
sleep(20)
send($Messageoftheday)
send("{ENTER}")
endif
sleep(5)
wend
 
 
 know if i let the mouse3 up it should instantly stop the writing like this:
func stopp()
send("{ESC}") ;will close the chat


endfunc
 
thanks for your help

Share this post


Link to post
Share on other sites



How many times exactly do you want to send your message.

it looks like this :

 

send($message1)

send("{ENTER}")

 

send($message2)

send("{ENTER}")

 

send($message3)

send("{ENTER}")

 

send($message4)  ;all will be different stuff like rules and informations about admins

send("{ENTER}")

 

and if i will take my finger off from the mouse3 bttn (mouse3 up) it should stop writing thes messages

Share this post


Link to post
Share on other sites

While 1
    If _IsPressed(04) Then ;mouse3
        While _IsPressed(04)
            Send("t")
            Sleep(20)
            Send($Messageoftheday)
            Send("{ENTER}")
            Sleep(100)
        WEnd
    EndIf
    Sleep(5)
WEnd


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
While 1
    If _IsPressed(04) Then ;mouse3
        While _IsPressed(04)
            Send("t")
            Sleep(20)
            Send($Messageoftheday)
            Send("{ENTER}")
            Sleep(100)
        WEnd
    EndIf
    Sleep(5)
WEnd

this doesnt work for me but i already got a soloution i show you:

start()
func start()
while 1
if _ispressed(04) then

send($message1)
send("{ENTER}")
if not _ispressed(04) then
start()
endif

send($message2)
send("{ENTER}")
if not _ispressed(04) then
start()
endif

send($message3)
send("{ENTER}")
if not _ispressed(04) then
start()
endif


start()
endif
wend
endfunc

 this works perfect :)

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