Shoutbox

[Question] Temporary Ban - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [Question] Temporary Ban (/showthread.php?tid=65113)

[Question] Temporary Ban by MattyRid on 08-19-2006 at 08:09 AM

Would it be possible for someone to make a temporary ban script by Blocking someone for a period of time.

E.g. Someone is being annoying, ban them for a set period (24 hours as an example)

Perhaps different time periods could be used for each contact.

1 hour
1 day
1 week
1 month
1 year

Perhaps a text box could be used to enter a number and a list box to choose between hours, days, weeks, years.

So can this be done or not?


RE: [Question] Temporary Ban by Felu on 08-19-2006 at 08:16 AM

You can use a Timer for that but whenever you'll close Messenger the timer will end [Image: msn_sad.gif]. But if you use some date and time function(add me @ WLM for more info) to block or unblock a contact, it would be far more easier.


RE: [Question] Temporary Ban by MattyRid on 08-19-2006 at 08:19 AM

I'm not much of a programmer. Hence, why I have asked ;)

But going through a process of elimination, could it be stored somewhere in another file thus making the timer function irrelevant?


RE: [Question] Temporary Ban by Eljay on 08-19-2006 at 08:22 AM

well i cant be bothered coding it but for anyone who can heres the easiest way i can think of:

1. Get current unix timestamp (Math.round(new Date().getTime() / 1000))
2. Add the specified "block time" to the timestamp
3. Store it somewhere along with the blocked persons email
4. Start a timer with the timestamp to unblock - the current timestamp

You also have to loop through and start all these timers on sign in to make sure they still work after messenger has been ended (and if the time has already passed on sign in, immediately unblock)


RE: [Question] Temporary Ban by markee on 08-19-2006 at 08:24 AM

You could do this by getting the JScript to get the time and add the specified amount of time.  You can then put this value in the registry with the name of your contact and get a timer to keep checking this to see if it is past this time.  This script would take a bit but is possible.  One limitation though is it can only be a precise as the timer you set ad the shorter the timer, the more resources you use of your computer.

EDIT: looks like i was beaten to it :(