Advertisement
YuukiHaruka

Timer-Zinga_Texas_holdem.vbs

Apr 29th, 2017
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ### Timer-Zinga_Texas_holdem.vbs
  2. ### How to Use
  3. ### 1. Spin Your Lucky Bonus on Zinga Texas Holdem
  4. ### 2. Double click Timer-Zinga_Texas_holdem.vbs
  5. ### 3. The Timer Should Be Started
  6. ### 4. Enjoy!
  7.  
  8. Option Explicit
  9. Dim Title,ws,nMinutes,nSeconds,sMessage
  10. Title = "Counting Down to Shutdown"
  11. Set ws = CreateObject("wscript.Shell")
  12. nMinutes = 240
  13. nSeconds = 0
  14. sMessage = "<font color=Red size=2><b>Counting Down to Shutdown"
  15. 'Open a chromeless window with message
  16. with HTABox("lightBlue",100,250,0,630)
  17.     .document.title = "Counting Down Notification to Shutdown"
  18.     .msg.innerHTML = sMessage
  19.     do until .done.value or (nMinutes + nSeconds < 1)
  20.         .msg.innerHTML = sMessage & "<br>" & nMinutes & ":" & Right("0"&nSeconds, 2) _
  21.         & " remaining</b></font><br>"
  22.         wsh.sleep 1000 ' milliseconds
  23.        nSeconds = nSeconds - 1
  24.         if nSeconds < 0 then
  25.             if nMinutes > 0 then
  26.                 nMinutes = nMinutes - 1
  27.                 nSeconds = 59
  28.             end if
  29.         end if
  30.     loop
  31.     .done.value = true
  32.     .close
  33. end with
  34. ws.Popup "TIME IS OVER !","5",Title,0+48 'Afficher un Popup durant 5 secondes puis on quitte le script
  35. 'Command="cmd /c Shutdown.exe -s -t 30 -c " & DblQuote("Sauvegarder votre Travail car l'ordinateur va rebooter dans 30 secondes")
  36. 'Executer = WS.Run(Command,0,False)
  37. '*****************************************************************
  38. Function HTABox(sBgColor, h, w, l, t)
  39.     Dim IE, HTA, sCmd, nRnd
  40.     randomize : nRnd = Int(1000000 * rnd)
  41.     sCmd = "mshta.exe ""javascript:{new " _
  42.     & "ActiveXObject(""InternetExplorer.Application"")" _
  43.     & ".PutProperty('" & nRnd & "',window);" _
  44.     & "window.resizeTo(" & w & "," & h & ");" _
  45.     & "window.moveTo(" & l & "," & t & ")}"""
  46.     with CreateObject("WScript.Shell")
  47.         .Run sCmd, 1, False
  48.         do until .AppActivate("javascript:{new ") : WSH.sleep 10 : loop
  49.         end with  'WSHShell
  50.        For Each IE In CreateObject("Shell.Application").windows
  51.             If IsObject(IE.GetProperty(nRnd)) Then
  52.                 set HTABox = IE.GetProperty(nRnd)
  53.                 IE.Quit
  54.                 HTABox.document.title = "HTABox"
  55.                 HTABox.document.write _
  56.                 "<HTA:Application contextMenu=no border=thin " _
  57.                 & "minimizebutton=no maximizebutton=no sysmenu=no SHOWINTASKBAR=no >" _
  58.                 & "<body scroll=no style='background-color:" _
  59.                 & sBgColor & ";font:normal 10pt Arial;" _
  60.                 & "border-Style:inset;border-Width:3px'" _
  61.                 & "onbeforeunload='vbscript:if not done.value then " _
  62.                 & "window.event.cancelBubble=true:" _
  63.                 & "window.event.returnValue=false:" _
  64.                 & "done.value=true:end if'>" _
  65.                 & "<input type=hidden id=done value=false>" _
  66.                 & "<center><span id=msg>&nbsp;</span><br>" _
  67.                 & "<input type=button id=btn1 value=' OK ' "_
  68.                 & "onclick=done.value=true><center></body>"
  69.                 HTABox.btn1.focus
  70.                 Exit Function
  71.             End If
  72.         Next
  73.         MsgBox "HTA window not found."
  74.         wsh.quit
  75. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement