Jump to content

My final obstical


Go to solution Solved by Edano,

Recommended Posts

Hello again all, and thank you all for being so helpful (especially you Edano) After another 2 hours of research, i find myself lost again. As always i will start with the code first.

HotKeySet("{ESC}", "Terminate")
While 1
    Do
        sleep(2000)
        MouseClick("left", 362, 146)
        Sleep(3000)
    Until PixelGetColor (977, 239) <> 0xDAE1DF
    MouseClick("left", 520, 287)
    Sleep(3000)
    MouseClick("left", 697, 334)
    Do
       Sleep(2000)
    Until PixelGetColor (1037, 477) <> 0xCF6B66
    MouseClick("left", 1037, 477)
WEnd
Func Terminate()
   Exit 0
EndFunc

Now onto the issue, as i was scripting along, i forgot about an issue i had in coding the Admin panel for my website. ( i can always piece things together until they make sense and get them to work, but not always work the best )

In my hopes of being able to process activations while i am away for 10-20 minutes eating, or using the bathroom i set out on this wonderful ( jokes ) script. My newest problem is the second set of DO.... UNTIL script. particularly the ( Until Pixelgetcolor (1037, 477) <> 0xCF6B66 ) line.

to make it all make sense i will cover what the script does (sorry if thats not allowed)

it will

1. click the refresh button on my admin panel

2. check to see if i have any pending activations

3. if there is, it clicks the button to send the activation e-mail / welcome e-mail

4. then confirms that it sent ok

5. then repeats the process

My issue is this, for visual fancyness, i made all the buttons on my admin.php page change color when whatever it was that they do was done. they all work but one sometimes dosnt work, which makes it hard for the Pixelgetcolor part of the script. when sending the activation e-mail / welcome mail. once they are both sent, the (SEND) buton turns from red to green. which would be perfect if it worked all the time, but sometimes it dosnt, and the script will get hung up there at that part indefinatly, well until i get back at least.

So, what i am trying to do....... is a, Do (this) Until (This OR That) kind of thing

or to be exact,

Sleep for two seconds, Then check to see if the button is not red anymore, reapeated until it is not red, OR Wait 4 minutes then click anyways incase my failed attempt at coding a button in PHP to change color when the task is done happened.

I hope i was clear enough in describing my issue, And thank you to anyone who can lend a hand

 

Link to comment
Share on other sites

Would'nt it be easier to use the _IE* functions to manipulate your Web page?

 

Do not, will never, dont even have installed, Windows Internet explorer is the least secure, slowest loading, most un user friendly web browser known to man. But i truly do apprciate your input, If IE was something i used, that would be an easier solution.

Link to comment
Share on other sites

  • Solution

;http://www.autoitscript.com/forum/topic/153523-my-final-obstical/
;Post #1
;D:\DOKUME~1\ADMINI~1\LOKALE~1\Temp\SLICER\Avatar\photo-thumb-81575.png
;by NomadByNature

;Script grabbed by SLICER by Edano here: http://www.autoitscript.com/forum/topic/152402-slicer-autoit-forum-script-grabber/?p=1093575

HotKeySet("{ESC}", "Terminate")
While 1
    Do
        sleep(2000)
        MouseClick("left", 362, 146)
        Sleep(3000)
    Until PixelGetColor (977, 239) <> 0xDAE1DF
    MouseClick("left", 520, 287)
    Sleep(3000)
    MouseClick("left", 697, 334)
    Local $timer=TimerInit()
    Do
       Sleep(2000)
    Until PixelGetColor (1037, 477) <> 0xCF6B66 Or TimerDiff($timer)>240000
    MouseClick("left", 1037, 477)
WEnd
Func Terminate()
   Exit 0
EndFunc

[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Link to comment
Share on other sites

Do not, will never, dont even have installed, Windows Internet explorer is the least secure, slowest loading, most un user friendly web browser known to man. But i truly do apprciate your input, If IE was something i used, that would be an easier solution.

Unfortunately you've demonstrated what can only be described as misinformation.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Do not, will never, dont even have installed, Windows Internet explorer is the least secure, slowest loading, most un user friendly web browser known to man. But i truly do apprciate your input, If IE was something i used, that would be an easier solution.

.

every windows os has ie installed, it's part of the system and not working without it.

[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Link to comment
Share on other sites

Do not, will never, dont even have installed, Windows Internet explorer is the least secure, slowest loading, most un user friendly web browser known to man. But i truly do apprciate your input, If IE was something i used, that would be an easier solution.

If you live anywhere but Western Europe, you probably do have it installed.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Edano, again your my savior,

 

.

every windows os has ie installed, it's part of the system and not working without it.

 

For those of us familiar with kernel editing, and other advanced coding, removing the actual IE browser while still leaving its Resource files (mainly so i can use them in visual studio) is very doable. but for the average user, you are very correct.

None the less. thanks for solving my issue AGAIN Edano, it seems your one of only two who could provide an "on topic" reply.

Link to comment
Share on other sites

Run this and see if it create an instance of IE.  If it does then use the _IE* funcitons.

edit:  Nevermind, I see that you have what you think is a good solution.

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

 

Run this and see if it create an instance of IE.  If it does then use the _IE* funcitons.

#include <ie.au3>

filewrite(@scriptdir & '\test1.txt','Line 1' & @crlf & 'Line 2')
_iecreate(@scriptdir & '\test1.txt')

Thanks Kylomas, but it was easier than i thought, as Edano pointed out for me. but your help was much appreciated as the only other person to post an on topic reply.

Link to comment
Share on other sites

...provide an "on topic" reply.

I see it as being quite "on-topic", as I replied to your rant about IE. If it were "off-topic" then I would have said something like..."Hey did you check out that article in the New York Times about hedgehogs?"

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

I see it as being quite "on-topic", as I replied to your rant about IE. If it were "off-topic" then I would have said something like..."Hey did you check out that article in the New York Times about hedgehogs?"

 

Thanks for the extra 2 cents worth, but this issue was already resolved.

Link to comment
Share on other sites

well, the use of _IE* functions at the present state of the OP's autoit knowledge may seem a little bit sophisticated, but we advanced coders, familiar with the use and benefit of com objects, do appreciate its enormous value for modern scripting.

[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Link to comment
Share on other sites

Thanks for the extra 2 cents worth.

You're welcome.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...