pileot Posted March 5, 2008 Share Posted March 5, 2008 So i want somthing to trigger more than once.... An if statment seemed to be the obvious choice... heres my whole script, because chances are thats whats gonna be asked for anyways... expandcollapse popup#include <IE.au3> $email = "" $pass = "" $oIE = _IECreate("https://login.facebook.com/login.php") $timer = TimerInit() Do if timerdiff($timer) = (1000*60*5) then;try to make this happen every 5 mins login('*******','******"');format: email, password Onlinecheck();check for online friends EndIf if timerdiff($timer) = (1000*60*60) then;try to make this happen every 60 mins login('*******','******"');format: email, password ;different functions to be added later if until 1 = 2 func Login($email,$pass);log out if logged in, log in under specified username _IELinkClickByText ($oIE, "logout") _ieloadwait($oIE) $oForm = _IEFormGetCollection ($oIE, 0) $oEmail = _IEFormElementGetObjByName ($oForm, "email") _IEFormElementSetValue ($oEmail, $email) $oPass = _IEFormElementGetObjByName ($oForm, "pass") _IEFormElementSetValue ($oPass, $pass) _IEFormSubmit ($oForm) _ieloadwait($oIE) EndFunc func Onlinecheck() _IENavigate($oIE, "http://www.facebook.com/friends/?online") _ieloadwait($oIE) if stringinstr($oIE,"name1") Then;add options for more names later msgbox(0,"","Friends are online!",60) endif EndFunc my question is thus i want to have some events happen every 5 mins, other every hour... If timerdiff($timer) = 5 mins or 10 mins or 15 mins or.... takes forever to write... is there a better way of doing this? Link to comment Share on other sites More sharing options...
Kickassjoe Posted March 5, 2008 Share Posted March 5, 2008 (edited) Just add a For loop to it. For $x = 0 to 11 if timerdiff($timer) = (1000*60*(($x + 1) * 5)) then;try to make this happen every 5 mins login('*******','******"');format: email, password Onlinecheck();check for online friends EndIf Next I think that should do it. Edited March 5, 2008 by Kickassjoe What goes around comes around... Payback's a bitch. Link to comment Share on other sites More sharing options...
pileot Posted March 12, 2008 Author Share Posted March 12, 2008 but i want some stuff to happen like every 5 mins, and other stuff to happen every 20 or so mins... im confused as to the best way to do that Link to comment Share on other sites More sharing options...
Zepx Posted March 12, 2008 Share Posted March 12, 2008 That's multi timer. Search for GaryFrost's timer. Note: The timer isn't available under the current stable version but available via the beta version (can be found under Developer's Chat) 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