Jump to content
Sign in to follow this  
Helmeh220

Pause button not working

Recommended Posts

As can been seen in my code the pause button wont work, i was trying to understand off someone else's post how to save the time then continue it but it really confused me. What i was wondering someone could help with is just making it so when i press numpad4 it pauses everything including the countdown. If someone could help it would be much appreciated.

 

Global $Paused, $two, $_CompteArebour = random(113126 , 121734), $_Seconds
   HotKeySet("{NUMPAD7}" , "On_Exit")
   HotKeySet ("{=}" , "_one")
   HotKeySet("{NUMPAD4}", "TogglePause")

$Form1 = GUICreate("Form1", 419, 144, 404, 220)
$Label1 = GUICtrlCreateLabel("'=' Starts First and Second skill Scipt", 80, 8, 260, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
$Label2 = GUICtrlCreateLabel("'Numpad 7' Exits First and Second Skill Script Completely", 8, 40, 405, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
$Label3 = GUICtrlCreateLabel("'Numpad 4' Pauses Skill 1 and 2", 96, 72, 229, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
$Label4 = GUICtrlCreateLabel("Countdown Until Use:", 88, 112, 178, 24)
GUICtrlSetFont(-1, 12, 800, 4, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
$Label5 = GUICtrlCreateLabel("", 272, 112, 58, 24)
GUICtrlSetFont(-1, 12, 800, 4, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
GUISetState(@SW_SHOW)
$TimeTicks = TimerInit ( )


While 1
   Sleep(10)
WEnd

Func TogglePause()
    $Paused = Not $Paused
    While $Paused
        Sleep(100)
        ToolTip('Script is "Paused"', 0, 0)
    WEnd
    ToolTip("")
 EndFunc   ;==>TogglePause

Func _one()
    Sleep(10)
    Send("{2}")
    Sleep(Random(52, 506))
    Send("{1}")
   $two = Not $two
   While $two

   $_CompteArebour -= TimerDiff ( $TimeTicks )
   $TimeTicks = TimerInit ( )

    Local $_SecCalc = $_CompteArebour
    $_SecCalc = Int ( $_SecCalc / 1000)

    If $_CompteArebour <= 0 Then
    Sleep(10)
    Send("{2}")
    Sleep(Random(52, 506))
    Send("{1}")
    $_CompteArebour = Random(113126 , 121734)

 Else
        If $_SecCalc <> $_Seconds Then
            $_Seconds = $_SecCalc
            GUICtrlSetData($Label5, StringFormat ("%02u", $_Seconds ))

            EndIf
         EndIf
         WEnd
 EndFunc




  Func On_Exit()
    Exit
 EndFunc

 

Share this post


Link to post
Share on other sites

I would do it differently, the code you have there cannot stop anything that's running in the function.

Instead, if you add a condition(s) in the main loop, or in whatever function, you can control it better imo.


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

Share this post


Link to post
Share on other sites

Ok so i have tried disabling the code using True and False statement and i cant get the countdown to stop, i have also tried storing the number on another string then forcing that number onto the countdown for it to continue to count but no matter what i do it just keeps counting down. Does anyone have any ideas?

Share this post


Link to post
Share on other sites
27 minutes ago, Helmeh220 said:

cant get the countdown to stop,

You must add if statements to the loop that controls the countdown, how else would it cut off the countdown? 

The countdown loop doesn't care about togglepause function until it is done with whatever it's doing.

Does this make sense to you?


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

Share this post


Link to post
Share on other sites
34 minutes ago, careca said:

You must add if statements to the loop that controls the countdown, how else would it cut off the countdown? 

The countdown loop doesn't care about togglepause function until it is done with whatever it's doing.

Does this make sense to you?

I tried adding an if statement but i dont really know how to stop the counter. Ive tried exitloop which just freezes it until it skips ahead alot and still continues counting. I dont know how to interupt the count down to stop it and even if i somehow managed to do that i need it to continue the countdown from where it left off.

Share this post


Link to post
Share on other sites
3 hours ago, Helmeh220 said:

Skill 1 and 2

Can you explaîn this ? 


My video tutorials : HERE ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

removed

Edited by careca

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

Share this post


Link to post
Share on other sites
31 minutes ago, caramen said:

Can you explaîn this ? 

Its a simple script for auto skilling in a game so i dont have to micro manage the skills and die.

Share this post


Link to post
Share on other sites

Wrong answer.


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

Share this post


Link to post
Share on other sites

As I thought. 

 

Cya.


My video tutorials : HERE ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

@careca please remove all your pointers. Thx. Protect AutoIT with us Thanks.


My video tutorials : HERE ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

@Helmeh220

Dont worry you wont be banned. 

 

You will be warned. And pointed to the forum rules. 

 

Doing AutoIT script for game automation will result to false positive virus. Among other.


My video tutorials : HERE ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
2 minutes ago, caramen said:

@Helmeh220

Dont worry you wont be banned. 

 

You will be warned. And pointed to the forum rules. 

 

Doing AutoIT script for game automation will result to false positive virus. Among other.

Ok still sorry tho, tbh i didnt read the rules before i posted, even tho i should have.

Share this post


Link to post
Share on other sites

Helmeh220,

The previous posters are quite right - please read the Forum rules - particularly the bit about not discussing game automation - before you post again.  Thread locked.

M23

 


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...