Jump to content

Recommended Posts

Posted

I have a scanner that I use to scan my inventory. I want to drag and delete the old one after I scan the new item in. If it takes 2.3 seconds for the new scan to display, I copy that into the  $Scan variable to use in the while loop, but it never kicks off.  I currently am trying to checking when the time starts and if it is greater than or equal to my scan time delete old one. I looked at some examples and this runs when I just do it straight to a message box, so my logic in the timers must be incorrect. My guess is maybe the timer is still running during my If statement? The help manual shows this exact way to use the timer.

$Scan = 2300

While 1
    Local $hTimer = TimerInit() ; Begin the timer 
    Local $fDiff =  TimerDiff($hTimer) ; Find the difference in time from the previous call of TimerInit.
    If $fDiff >= $Scan Then
        MouseClickDrag("left", 2485, 1025,2485,372)
        MsgBox($MB_SYSTEMMODAL, "Deleted", "Old file deleted",2)
    EndIf
    Sleep(1000)
WEnd

Posted
#include <MsgBoxConstants.au3>
Local $Scan = 2300
Local $hTimer = TimerInit() ; Begin the timer

While 1
    Local $fDiff =  TimerDiff($hTimer) ; Find the difference in time from the previous call of TimerInit.
    If $fDiff >= $Scan Then
        $hTimer = TimerInit()
        MouseClickDrag("left", 2485, 1025,2485,372)
        MsgBox($MB_SYSTEMMODAL, "Deleted", "Old file deleted",2)
    EndIf
    Sleep(1000)
WEnd

Maybe this?

When you set the timerinit in the loop, you reset the time continuously, the difference never builds up, you see what i mean?

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Posted

It doesn't mention probably because it's one of those, self-evident facts. 😉

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

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
×
×
  • Create New...