how fast are you to write?, ficooo! xD

« Older   Newer »
  Share  
I.Ren
icon4  CAT_IMG Posted on 23/2/2008, 18:24     +1   -1




Questo programma, o forse meglio chiamarlo giochetto, dove tu puoi scrivere un testo e ricopiarlo.. questo può essere utile per vedere chi scrive più veloce fra due o + persone...

Il codice autoit è questo -\/- ma se volete alla fine c'è lo zip..

CODICE
#include <GuiStatusBar.au3>

Global $Exit = 0, $aParts[2] = [300, 150], $Read[3], $Compare[3]
$Form = GUICreate("How fast are you to write?", 483, 495, 193, 125)
$Edit1 = GUICtrlCreateEdit("", 8, 8, 465, 209, BitOR($ES_AUTOVSCROLL, $ES_WANTRETURN, $WS_VSCROLL))
$Edit2 = GUICtrlCreateEdit("", 8, 224, 465, 209, BitOR($ES_AUTOVSCROLL, $ES_WANTRETURN, $WS_VSCROLL))
GUICtrlSetState($Edit2, $GUI_DISABLE)
GUICtrlSetData($Edit1, "Questo è un testo di prova per vedere quanto veloce sei a scrivere.. basta che premi il bottone 'start' se vuoi scrivere questo testo, in caso contrario, cambia il testo e premi lo stesso 'start'... Una volta iniziato a scrivere, basta che premi il bottone 'stop'.." & @CRLF & "Buona fortuna!")
$Button = GUICtrlCreateButton("Start", 8, 440, 467, 25, 0)
$hStatus = _GUICtrlStatusBar_Create($Form, $aParts)
_GUICtrlStatusBar_SetMinHeight($hStatus, 20)
$Progress = GUICtrlCreateProgress(0, 0, -1, -1, $PBS_SMOOTH)
$hProgress = GUICtrlGetHandle($Progress)
_GUICtrlStatusBar_EmbedControl($hStatus, 1, $hProgress)
_SendMessage($hProgress, $PBM_SETMARQUEE, True, 200)
_GUICtrlStatusBar_SetText($hStatus, "How fast are you to write?  ~•~  By I.Ren  ~•~")
GUISetState()
HotKeySet ('^v','_nononono')

While 1
  $msg = GUIGetMsg()
  Switch $msg
      Case $GUI_EVENT_CLOSE
          Exit
      Case $Button
          $Wrong = 0
          GUICtrlSetState($Edit1, $GUI_DISABLE)
          GUICtrlSetData($Edit2, "")
          GUICtrlSetData($Button, "Stop")
          $Len = StringLen(GUICtrlRead($Edit1))
          $Words = StringSplit(GUICtrlRead($Edit1), " ", 1)
          Sleep(500)
          GUICtrlSetState($Edit2, BitOR($GUI_FOCUS, $GUI_ENABLE))
          $Timer = TimerInit()
          Do
              $msg2 = GUIGetMsg()
              If $msg2 = $Button Then
                  $Exit = 1
                  ExitLoop
              ElseIf $msg2 = $GUI_EVENT_CLOSE Then
                  Exit
              EndIf
              $Len2 = StringLen(GUICtrlRead($Edit2))
              $Perc = Round(($Len2 / $Len) * 100, 0)
              _GUICtrlStatusBar_SetText($hStatus, "Letters count : " & $Len2 & " ( " & $Perc & "% )")
              GUICtrlSetData($Progress, $Perc)
          Until $Len2 >= $Len
          If $Exit = 0 Then
              $TimerDiff = Round(TimerDiff($Timer) / 1000, 2)
              $LPS = Round($Len / $TimerDiff, 2)
              $LPM = Round($LPS * 60, 2)
              $WPS = Round((UBound($Words) - 1) / $TimerDiff, 2)
              $WPM = Round($WPS * 60, 2)
              $Read[1] = GUICtrlRead($Edit1)
              $Read[2] = GUICtrlRead($Edit2)
              For $i = 1 To $Len
                  For $z = 1 To 2
                      $Compare[$z] = StringLeft($Read[$z], $i)
                      If $i <> 1 Then $Compare[$z] = StringTrimLeft($Read[$z], $i - 1)
                  Next
                  If $Compare[1] <> $Compare[2] Then $Wrong += 1
              Next
              MsgBox("", "Result", "Completed in " & $TimerDiff & " second." & @CRLF & "Total Letters : " & $Len & @CRLF & _
              "Total Words : " & UBound($Words) - 1 & @CRLF & _
                              "Wrong letter count : " & $Wrong & " ( " & Round(($Wrong / $Len) * 100, 0) & "% )")
          EndIf
          GUICtrlSetState($Edit1, $GUI_ENABLE)
          GUICtrlSetState($Edit2, $GUI_DISABLE)
          GUICtrlSetData($Button, "Start")
          GUICtrlSetData($Progress, 0)
          _GUICtrlStatusBar_SetText($hStatus, "")
          $Exit = 0
  EndSwitch
WEnd

Func _nononono ()
TrayTip ('Cosa credi di fare, subdolo essere?','Cosa credi di fare, eh?!' & @crlf & 'Sei così impedito da non saper neanche ricopiare un testo mezzasega??',5)
Send ('Beccati questo, mezzasega' & @CRLF & "INFO: Questo l'ho scritto in ita xchè non sapevo come si scriveva in inglese :(")
MsgBox (0,'Una mezzasega in più al mondo',"Notizia STRARORDINAIA, è stata scoperta un'altra mezzasega!" & @crlf & "E sapete perchè?? Copia e incolla un testo da ricopiare, non sa ricopiare! vi rendete conto amici ascoltatori??" & @crlf & "Secondo me c'è solo da vergognarsi")
EndFunc




Download attachment
How_fast_are_you_to_write.zip ( Number of downloads: 49 )

 
Top
gesucristo91
CAT_IMG Posted on 1/3/2008, 20:57     +1   -1




fiko fiko :lol:
 
Top
I.Ren
CAT_IMG Posted on 2/3/2008, 11:19     +1   -1




grazie..
 
Top
x-H4ck3r-x
CAT_IMG Posted on 21/3/2008, 13:37     +1   -1




figata
 
Top
3 replies since 23/2/2008, 18:24   233 views
  Share