Overlay Timer

Help each other out

Overlay Timer

Postby escort on Wed Mar 19, 2008 4:34 pm

Anyone ever make a time down for a overlay? Basicly if somone brings up a overlay it will wait 10 seconds then go away so it is not there when the next person comes up to xlobby.
escort
 
Posts: 41
Joined: Sat Mar 25, 2006 12:07 am

Re: Overlay Timer

Postby Marbles_00 on Wed Mar 19, 2008 6:34 pm

Just create an event with the following commands:
show overlay (your overlay)
wait (10000ms for 10 seconds)
close overlay

Just tried it and it works.

Hope this helps
Marbles_00
 
Posts: 1867
Joined: Wed Apr 06, 2005 12:44 pm
Location: Canada

Re: Overlay Timer

Postby dalanik on Wed Mar 19, 2008 10:01 pm

I did it the more complex way - via timers in VB.NET, that is, XScriptNG. :) Works Ok.

something like this: (it's even more complex or me because I'm checkin xlobby variables etc, so I stripped it off) :-)

Code: Select all
Module Script

Private tx As XTimer = new XTimer(45000)

Public Sub Main()
      tx.StartTimer
End Sub

End Module

Class XTimer

   ' *** The system timer
   Private tx As System.Timers.Timer

   ' *** The class constructor
   Public Sub New(pElapsed As Integer)

      '  *** Initialize the timer
      tx = new System.Timers.Timer(pElapsed)

      ' *** Add the event handler
      AddHandler tx.Elapsed, AddressOf TimerFired
   End Sub

   ' *** Starts the timer
   Public Sub StartTimer()
      tx.Enabled = true
   End Sub

   ' *** Stops the timer
   Public Sub StopTimer()
      tx.Enabled = false
   End Sub

   ' **** Executes when the elapsed event occurs
   Public Sub TimerFired(ByVal Sender As Object, ByVal e As System.Timers.ElapsedEventArgs)
      StopTimer()
'      Xlobby.SendCommand("xlobby", "close overlay")
      Xlobby.SendCommand("plugin", "command", "xTransition", "Close Overlay:", "fade")
   End Sub
End Class
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Re: Overlay Timer

Postby escort on Thu Mar 20, 2008 1:00 am

WOW, thanks you guy's. !!!!! Perfect
escort
 
Posts: 41
Joined: Sat Mar 25, 2006 12:07 am

Re: Overlay Timer

Postby alamata on Wed Apr 09, 2008 8:41 pm

hey,

i use this thread because
i cant realise this event !!!

i use the version of the 04 mars 2007

Marbles_00 wrote:Just create an event with the following commands:
show overlay (your overlay)
wait (10000ms for 10 seconds)
close overlay

Just tried it and it works.

Hope this helps


i test the separate command and it is ok for each command
but when i try to test the complete event
i doesnt work :shock:

is there kown bug with this version and the timer...

i have "repair" my .net2...
always the same result :shock:

any idea's...
alamata
 
Posts: 70
Joined: Thu Jan 11, 2007 12:03 pm

Re: Overlay Timer

Postby Marbles_00 on Wed Apr 09, 2008 9:29 pm

Nope no need to panic. It doesn't work with testing the event. I think this is a bug, which will unfortunately never be fixed (well, at least not in this version). It does work though when you place a button on a screen then tie the button to the this event.
Marbles_00
 
Posts: 1867
Joined: Wed Apr 06, 2005 12:44 pm
Location: Canada

Re: Overlay Timer

Postby alamata on Thu Apr 10, 2008 2:37 am

thanks a lot for the information.. :)

it s ok now....
alamata
 
Posts: 70
Joined: Thu Jan 11, 2007 12:03 pm