Jump to content

help with this script. please 2024 - (Locked)


Recommended Posts

Hello friends I have a problem I hope you can help me with this script. I want it to work. As soon as it arrives, after 10 seconds, it sounds a Beep every second and changes from white to red and when the time runs out a program closes, EXE thank you.

timer.au3

Link to comment
Share on other sites

I understand and thank you.

 

#include "cores.au3"
#include <misc.au3>


AdlibRegister("Clock", 1000)

; ----------------------temporizador para games---------------------


HotKeySet("{esc}", "sair")

$ficha = 0
$segundos = 0
$pressionado = False
$tecla_envia_ficha = 5

$dir2        =  "leer timer.txt"
 if Not FileExists($dir2)  Then     
FileWriteLine($dir2 , "(HORINZONTAL): numeros,centro (VERTICAL) : 0, cima, baixo  (CREDITOS) TECLA :5")
EndIf
$dir        =  "Timer.ini"

   if Not FileExists($dir)  Then
   IniWrite($dir, "Timer", "minutos por ficha", "1" & @crlf) ; Aqui ajusta os minutos, mas é preciso excluir o arquivo .ini antes.
   FileWriteLine($dir, "[Ajustar Timer]")
   FileWriteLine($dir, "tamanho da fonte   =     30")
   FileWriteLine($dir, "tipo de fonte      =  arial")
   FileWriteLine($dir, "horizontal         =   200")
   FileWriteLine($dir, "vertical           =      0")
   FileWriteLine($dir, "largura            =    200")
   FileWriteLine($dir, "altura             =     40")
EndIf

$ajust = "Ajustar Timer"
$minutos_por_ficha = IniRead($dir, "Timer", "minutos por ficha", "")
$largura    = IniRead($dir, $ajust, "largura",          "")
$altura     = IniRead($dir, $ajust, "altura",           "")
$horizontal = IniRead($dir, $ajust, "horizontal",       "")
$vertical   = IniRead($dir, $ajust, "vertical",         "")
$tam_fonte  = IniRead($dir, $ajust, "tamanho da fonte", "")
$fonte      = IniRead($dir, $ajust, "tipo de fonte",    "")

;Pocision de timer
If $vertical   == "cima"   Then $vertical   = 0
If $vertical   == "baixo"  Then $vertical   = @DesktopHeight - $altura
If $horizontal == "centro" Then $horizontal = @DesktopWidth/2 - $largura/2

 GUICreate("Timer", $largura, $altura, $horizontal, $vertical, 0x80000000)
GUISetBkColor(0x000000)
GUICtrlCreateLabel("00:00:00", 0, 0, 200, 70)
GUICtrlSetBkColor(-1, $COR_PRETO)
GUICtrlSetColor(-1, $COR_BRANCO)
GUICtrlSetFont(-1, $tam_fonte, 800, -1, $fonte)
GUISetState (@SW_SHOW)


While True
    ; Enviando Créditos
    If      _IsPressed($tecla_envia_ficha+30) Then $pressionado = True
   If Not  _IsPressed($tecla_envia_ficha+30) And $pressionado Then
         $ficha += 1
      $pressionado = False
  EndIf
  
  
    
          $segundos += $ficha * ($minutos_por_ficha * 60)
          $ficha     = 0
          $minutos      = Mod($segundos/60, 60)
          $horas          = $segundos/3600
          $display        = StringFormat("%02i:%02i:%02i", $horas, $minutos, Mod($segundos, 60))
          WinSetOnTop("Timer", "", 1)
     WEnd

Func clock()
      If $segundos >  0 Then
          $segundos -= 1
   EndIf
    GUICtrlSetData(-1,  $display)
EndFunc

Func sair()
      exit
EndFunc

Link to comment
Share on other sites

  • Developers

Welcome to the AutoIt forum.

Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked.

See you soon with a legitimate question I hope.

The Moderation team

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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