xzaz Posted November 8, 2006 Share Posted November 8, 2006 Sorry for the wierd topic titel but didnt know how to explane it right: I got a exemple: While 1 Sleep("" & GUICtrlRead($wachten) & "") Send("" & GUICtrlRead($vraag) & "") If (BitAND(GUICtrlRead($check_2de), $GUI_CHECKED)) Then Send("{ENTER}") Send("" & GUICtrlRead($vraag2) & "") Endif Send("{ENTER}") If(BitAND(GUICtrlRead($check_buzzer), $GUI_Checked)) Then call ("buzzer") Endif Wend EndFunc The problem is: how can i activate de function buzzer every 15 seconds? Small Color Picker v0.2 | Travian bot Link to comment Share on other sites More sharing options...
rbhkamal Posted November 8, 2006 Share Posted November 8, 2006 (edited) Use :AdlibEnable()Edit: Take a look at the help file for more details (if you are using Scite).RK Edited November 8, 2006 by rbhkamal "When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix Link to comment Share on other sites More sharing options...
xzaz Posted November 8, 2006 Author Share Posted November 8, 2006 Alright! Tnx for the replay, dindt know ther was a function to call a function at a pacific time. I got it like this now: While 1 Sleep("" & GUICtrlRead($wachten) & "") Send("" & GUICtrlRead($vraag) & "") If(BitAND(GUICtrlRead($check_buzzer), $GUI_Checked)) Then AdlibEnable("buzzer",15000) Endif If (BitAND(GUICtrlRead($check_2de), $GUI_CHECKED)) Then Send("{ENTER}") Send("" & GUICtrlRead($vraag2) & "") Endif Send("{ENTER}") The problem now is that it wont do anithing. I tried a cupple of 'systems' to activate the function, should you alsow use AdlibDisable()? Small Color Picker v0.2 | Travian bot Link to comment Share on other sites More sharing options...
QA Stooge Posted November 8, 2006 Share Posted November 8, 2006 Local $buzzTime = TimerInit() While 1 if Mod(TimerDiff($buzzTime), 15000) == 0 then call("buzzer") WEnd EndFunc Link to comment Share on other sites More sharing options...
rbhkamal Posted November 8, 2006 Share Posted November 8, 2006 (edited) This is NOT OK: While 1 If(BitAND(GUICtrlRead($check_buzzer), $GUI_Checked)) Then AdlibEnable("buzzer",15000) Endif wend oÝ÷ Ù·jëz÷«Êئ{*.ºÇvXvëazئzºÞ±ël¶¬Ü"YÞ½êÞÅç.µì¨¹û§rب.².ØZ½æ¢^j{Ú®&ëajÛZë¢{k¢ZÊ«~éܶ*')¶¬jëh×6 $buzzerIsChecked = false AdlibEnable("buzzer",15000) While 1 If(BitAND(GUICtrlRead($check_buzzer), $GUI_Checked)) Then $buzzerIsChecked = true Endif wend func buzzer() if $buzzerIsChecked == false then return ;do your work here endfunc Note: There could be only one adlib running at the same time. Edit: QA Stooge's alternative sounds good. RK Edited November 8, 2006 by rbhkamal "When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix Link to comment Share on other sites More sharing options...
xzaz Posted November 8, 2006 Author Share Posted November 8, 2006 Its not working. I got this now:; Start function func starten() Local $buzzTime = TimerInit() If(BitAND(GUICtrlRead($check_buzzer), $GUI_Checked)) Then Tooltip("Test1",0,0) Else ToolTip("Test2",0,0) EndIf While 1 Sleep("" & GUICtrlRead($wachten) & "") Send("" & GUICtrlRead($vraag) & "") If (BitAND(GUICtrlRead($check_2de), $GUI_CHECKED)) Then Send("{ENTER}") Send("" & GUICtrlRead($vraag2) & "") Endif If(BitAND(GUICtrlRead($check_buzzer), $GUI_Checked)) Then Tooltip("Test3",0,0) if Mod(TimerDiff($buzzTime), 1500) == 0 then Tooltip("Test4",0,0) call("buzzer") EndIF EndIf Wend EndFunc He is not comming in to the "Tooltip Test 4" Whats the roblem here. Im think i am looking to straight to it Small Color Picker v0.2 | Travian bot Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 8, 2006 Moderators Share Posted November 8, 2006 Mod(TimerDiff($buzzTime), 1500)oÝ÷ Ø*.ÖÞjx¬²ç§ È ÜÛhrZ´Êv¬jëh×6 If (TimerDiff($buzzTime) / 1000) >= 4 Then ;4 = 4 seconds $buzzTime = TimerInit();Restart timer Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
xzaz Posted November 8, 2006 Author Share Posted November 8, 2006 Lol tnx. I watched to it but let it go, dunno why This is it now and it works Tnx all! func starten() Local $buzzTime = TimerInit() If(BitAND(GUICtrlRead($check_buzzer), $GUI_Checked)) Then Tooltip("Test",0,0) Else ToolTip("Test",0,0) EndIf While 1 Sleep("" & GUICtrlRead($wachten) & "") Send("" & GUICtrlRead($vraag) & "") If (BitAND(GUICtrlRead($check_2de), $GUI_CHECKED)) Then Send("{ENTER}") Send("" & GUICtrlRead($vraag2) & "") Endif If(BitAND(GUICtrlRead($check_buzzer), $GUI_Checked)) Then Tooltip("Test",0,0) If (TimerDiff($buzzTime) / 1000) >= 16 Then ;4 = 4 seconds $buzzTime = TimerInit();Restart timer call("buzzer") EndIF EndIf Send("{ENTER}") Wend EndFunc Tnx, i think this is to difficult for me now. Small Color Picker v0.2 | Travian bot Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now