anom1234 Posted October 9, 2008 Share Posted October 9, 2008 (edited) Hello! Let me start off by saying that I've used both the search function of this site and the help file within the program. Both were very useful, so thanks! What I'm trying to accomplish: Have the mouse click on the word "NOW" on a webpage, every 15-16 minutes or so. The word is all capitalized, and is a different color than most of the other words on the page. Every now and then the word changes from "NOW" to random other words, so when it see's those other words, I'll need to have it stop the script and display a msgBox. Currently I have successfully set up a program that: 1. Waits 5 seconds after execution before doing anything (Gives me time to put the mouse manually over the word "NOW" 2. Left clicks the mouse button once 3. Waits between 15 and 16.5 minutes (Randomly) and then clicks again. For additional features I've added a "Time Left" and a "Time Total" to the task menu tray. A few minor issues: The "time total" I've gotten to display in seconds by dividing it by 60,000, but the same trick does not work for the "TimeLeft" function. Notes: It needs to work on different resolutions monitors Thanks again for any help you can offer. What I've currently got below: expandcollapse popup#include <Constants.au3> #Include <Timers.au3> #NoTrayIcon $i = 0 $RandomTimer = 915000 Sleep (5000); Wait 5 Seconds before the first click. $iTimerProgress = _Timer_SetTimer($RandomTimer); create timer Opt("TrayOnEventMode",1) Opt("TrayMenuMode",1); Default tray menu items (Script Paused/Exit) will not be shown. TraySetClick(16); Only secondary mouse button will show the tray menu. $infoitem = TrayCreateItem("Time Gone By") TrayItemSetOnEvent(-1,"TimeLeft") $infoitem = TrayCreateItem("Total Time Waiting") TrayItemSetOnEvent(-1,"TimeTotal") TrayCreateItem("");line in the tray between exit and time left options $exititem = TrayCreateItem("Exit") TrayItemSetOnEvent(-1,"ExitScript") TraySetState() Do MouseClick ( "left" ) $i = $i + 1;increase $i $begin = TimerInit() $RandomTimer = Random(915000, 990000, 1) $iTimerProgress = ($RandomTimer/60000);This is needed to make a number show up when right clicking. Also converts it to minutes! Sleep($RandomTimer); Wait between 15.25 and 16.5 minutes before clicking. Until $i = 100 Exit ; Functions Func TimeLeft() $dif = TimerDiff($begin) MsgBox(0,"Time Gone By",$dif) EndFunc Func TimeTotal() Msgbox(0,"Total Time Waiting", $iTimerProgress+" ", 3) EndFunc Func ExitScript() Exit EndFunc Edited October 10, 2008 by anom1234 Link to comment Share on other sites More sharing options...
anom1234 Posted October 9, 2008 Author Share Posted October 9, 2008 Saw I was on page 2 with no response. SHAMELESS BUMP! Link to comment Share on other sites More sharing options...
anom1234 Posted October 10, 2008 Author Share Posted October 10, 2008 Shameless bump # 2 Link to comment Share on other sites More sharing options...
dbzfanatic Posted October 10, 2008 Share Posted October 10, 2008 Please keep bumping. You'll be banned for forum abuse. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
TehWhale Posted October 10, 2008 Share Posted October 10, 2008 (edited) Please keep bumping. You'll be banned for forum abuse. Obviously he put some effort, look at the Original Post. Maybe you should tell him not to bump before 24 hours of the last post of his thread. Maybe you should be nicer Edited October 10, 2008 by SwiftBurns Link to comment Share on other sites More sharing options...
anom1234 Posted October 10, 2008 Author Share Posted October 10, 2008 Obviously he put some effort, look at the Original Post. Maybe you should tell him not to bump before 24 hours of the last post of his thread. Maybe you should be nicer Thanks, I'll make sure to wait 24 hours from this post. Link to comment Share on other sites More sharing options...
anom1234 Posted October 11, 2008 Author Share Posted October 11, 2008 Thanks, I'll make sure to wait 24 hours from this post.bump Link to comment Share on other sites More sharing options...
Joseph Posted October 11, 2008 Share Posted October 11, 2008 you might be able to try to use WinWaitActive or WinExists with the word NOW something like if the word NOW is there then it clicks that spot and if its not then keep going WinWaitActive("Title of Webpage - Browser", "NOW", 1000) or If WinExists("Title of Webpage - Browser", "NOW") Then MouseClick("left", xcoord,ycoord,1,10) EndIf http://runecrue.awardspace.comhttp://demopros.awardspace.com Link to comment Share on other sites More sharing options...
anom1234 Posted October 11, 2008 Author Share Posted October 11, 2008 you might be able to try to use WinWaitActive or WinExists with the word NOW something like if the word NOW is there then it clicks that spot and if its not then keep goingWinWaitActive("Title of Webpage - Browser", "NOW", 1000)or If WinExists("Title of Webpage - Browser", "NOW") Then MouseClick("left", xcoord,ycoord,1,10) EndIfAs I understand it, that would only work in the case of "NOW" being in the title correct? Thanks for the suggestion, but the word now is unfortunately not in the title . Really do appreciate your thoughts though! Link to comment Share on other sites More sharing options...
Joseph Posted October 11, 2008 Share Posted October 11, 2008 no i think that will scan the title of the window and search for the text too http://runecrue.awardspace.comhttp://demopros.awardspace.com Link to comment Share on other sites More sharing options...
FaT3oYCG Posted October 11, 2008 Share Posted October 11, 2008 (edited) i have done this before for an auto login script that i made here find the number of tabs you require to get to the text input control from when you open a new tab and do it like that i made this code. #include <GuiConstantsEx.au3> ;hotkey HotKeySet("^kl", "_NET_LOGIN") func _NET_LOGIN() msgbox(0, "Loading...", "Loading Your Favy Sites!!!") ShellExecute("firefox.exe") WinWaitActive("Google - Mozilla Firefox") send("^l") send("^t") Send("http://www.acidmods.com/forum/index.php?PHPSESSID=79dc6ebd6c91ce53cefc2b731dde8fb5&board=2.0") send("{ENTER}") sleep(100) send("^t") Send("http://forums.qj.net/forumdisplay.php?f=11") send("{ENTER}") EndFunc GuiSetState() While GuiGetMsg() <> $GUI_EVENT_CLOSE wend Edited October 11, 2008 by FaT3oYCG Interpreters have great power!Although they live in the shadow of compiled programming languages an interpreter can do anything that a compiled language can do, you just have to code it right. Link to comment Share on other sites More sharing options...
anom1234 Posted October 12, 2008 Author Share Posted October 12, 2008 i have done this before for an auto login script that i made here find the number of tabs you require to get to the text input control from when you open a new tab and do it like that i made this code. #include <GuiConstantsEx.au3> ;hotkey HotKeySet("^kl", "_NET_LOGIN") func _NET_LOGIN() msgbox(0, "Loading...", "Loading Your Favy Sites!!!") ShellExecute("firefox.exe") WinWaitActive("Google - Mozilla Firefox") send("^l") send("^t") Send("http://www.acidmods.com/forum/index.php?PHPSESSID=79dc6ebd6c91ce53cefc2b731dde8fb5&board=2.0") send("{ENTER}") sleep(100) send("^t") Send("http://forums.qj.net/forumdisplay.php?f=11") send("{ENTER}") EndFunc GuiSetState() While GuiGetMsg() <> $GUI_EVENT_CLOSE wendWhat a great idea! I'll give that a try and let you know! 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