Advertisement
saisri

time left

Jul 15th, 2012
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. _SECTION_BEGIN("system Ticker");
  2. function GetSecondNum()
  3. {
  4. Time = Now( 4 );
  5. Seconds = int( Time % 100 );
  6. Minutes = int( Time / 100 % 100 );
  7. Hours = int( Time / 10000 % 100 );
  8. SecondNum = int( Hours * 60 * 60 + Minutes * 60 + Seconds );
  9. return SecondNum;
  10. }
  11. RequestTimedRefresh( 1 );
  12. //----------------------------------------------------------------------------
  13. //----------------------------------------------------------------------------
  14. TimeFrame = Interval();
  15. SecNumber = GetSecondNum();
  16. Newperiod = SecNumber % TimeFrame == 0;
  17. SecsLeft = SecNumber - int( SecNumber / TimeFrame ) * TimeFrame;
  18. SecsToGo = TimeFrame - SecsLeft;
  19.  
  20. x=Param(" xposn",100,100,1000,1000);
  21. y=Param(" yposn",170,40,1000,1);
  22.  
  23. GfxSelectSolidBrush( colorPink );
  24. GfxSelectPen( colorBlack, 2 );
  25. if ( NewPeriod )
  26. {
  27. GfxSelectSolidBrush( colorBlack );
  28. GfxSelectPen( colorBlack, 2 );
  29. Say( "New candle" );
  30. }
  31. GfxRoundRect( x+55, y+17, x-4, y-2, 0, 0 );
  32. GfxSetBkMode(1);
  33. GfxSelectFont( "Arial", 9, 700, False );
  34. GfxSetTextColor( colorBlack );
  35. GfxTextOut( "" +SecsToGo+" / "+NumToStr( TimeFrame, 1.0 ), x, y );
  36. _SECTION_END();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement