• user.adjust_minutes -- Not working..?

    From Noisome Poison@VERT/DIGI52 to All on Wed Jun 17 23:23:43 2009
    Hey there, I have a basic script, when run it just runs:ãã// Begin programãload("sbbsdefs.js");ãconsole.writeln(bbs.get_time_left());ãconsole.writeln(user.get_time_left());ãuser.adjust_minutes(-5)ãconsole.writeln(bbs.get_time_left());ãconsole.writeln(user.get_time_left());ãuser.adjust_minutes(5)ãconsole.writeln(bbs.get_time_left());ãconsole.writeln(user.get_time_left());ãuser.adjust_minutes(-5)ãconsole.writeln(bbs.get_time_left());ãconsole.writeln(user.get_time_left());ãuser.adjust_minutes(-5)ãconsole.writeln(bbs.get_time_left());ãconsole.writeln(user.get_time_left());ã//End ProgramããThe time is not adjusted by a negative 5 minutes the first time. The secondãadjustment is a postive 5 minutes, which works. The third adjustment, aãnegative 5 minutes works. The fourth adjustment, another negative 5 minutesãdoes not adjust the time.ããIt seems only a positive adjustment works then a negative adjustment.ãã//Begin Second programãconsole.writeln(bbs.get_time_left());ãconsole.writeln(user.get_time_left());ãuser.adjust_minutes(5);ãconsole.writeln(bbs.get_time_left());ãconsole.writeln(user.get_time_left());ãuser.adjust_minutes(-6);ãconsole.writeln(bbs.get_time_left());ãconsole.writeln(user.get_time_left());ãuser.adjust_minutes(7);ãconsole.writeln(bbs.get_time_left());ãconsole.writeln(user.get_time_left());ãuser.adjust_minutes(-20);ãconsole.writeln(bbs.get_time_left());ãconsole.writeln(user.get_time_left());ãuser.adjust_minutes(9);ãconsole.writeln(bbs.get_time_left());ãconsole.writeln(user.get_time_left());ã//End second programããThen I did 5 adjustments in this order: 5, -6, 7, -20, 9ãThe following results were, starting with seconds at 862: 1162, 802, 1222,ã322, 862 ããThis is a bit odd since it should not begin and end with the same time left,ã+21 minutes, -26 minutes. I even went +21 mins, -31 mins with the sameãseconds count at the beginning and end.ããAm I running something wrong?ããThanks,ããNoisomeãã---ã þ Synchronet þ Digital 52 - bbs.digital52.comã
  • From Noisome Poison@VERT/DIGI52 to Noisome Poison on Wed Jun 17 23:25:37 2009
    Hey there, I have a basic script, when run it just runs:ã...ã > Thanks,ã > ã > NoisomeãããForgot to post:ããSynchronet BBS for Win32 Version 3.15aãRevision a Jun 3 2009 05:05 SMBLIB 2.51 MSC 1200ãCopyright 2009 Rob Swindell - http://www.synchro.netãJavaScript-C 1.7.0 2007-10-03ãWinSock 2.0ãWindows NT Version 5.0 (Build 2195) Service Pack 4ãã---ã þ Synchronet þ Digital 52 - bbs.digital52.comã
  • From Digital Man@VERT to Noisome Poison on Wed Jun 17 22:22:56 2009
    Re: user.adjust_minutes -- Not working..?ã By: Noisome Poison to All on Wed Jun 17 2009 11:23 pmãã > Hey there, I have a basic script, when run it just runs:ã >ã > // Begin programã > load("sbbsdefs.js");ã > console.writeln(bbs.get_time_left());ã > console.writeln(user.get_time_left());ã > user.adjust_minutes(-5)ã > console.writeln(bbs.get_time_left());ã > console.writeln(user.get_time_left());ã > user.adjust_minutes(5)ã > console.writeln(bbs.get_time_left());ã > console.writeln(user.get_time_left());ã > user.adjust_minutes(-5)ã > console.writeln(bbs.get_time_left());ã > console.writeln(user.get_time_left());ã > user.adjust_minutes(-5)ã > console.writeln(bbs.get_time_left());ã > console.writeln(user.get_time_left());ã > //End Programã >ã > The time is not adjusted by a negative 5 minutes the first time. Theã > second adjustment is a postive 5 minutes, which works. The thirdã > adjustment, a negative 5 minutes works. The fourth adjustment, anotherã > negative 5 minutes does not adjust the time.ã >ã > It seems only a positive adjustment works then a negative adjustment.ã >ã > //Begin Second programã > console.writeln(bbs.get_time_left());ã > console.writeln(user.get_time_left());ã > user.adjust_minutes(5);ã > console.writeln(bbs.get_time_left());ã > console.writeln(user.get_time_left());ã > user.adjust_minutes(-6);ã > console.writeln(bbs.get_time_left());ã > console.writeln(user.get_time_left());ã > user.adjust_minutes(7);ã > console.writeln(bbs.get_time_left());ã > console.writeln(user.get_time_left());ã > user.adjust_minutes(-20);ã > console.writeln(bbs.get_time_left());ã > console.writeln(user.get_time_left());ã > user.adjust_minutes(9);ã > console.writeln(bbs.get_time_left());ã > console.writeln(user.get_time_left());ã > //End second programã >ã > Then I did 5 adjustments in this order: 5, -6, 7, -20, 9ã > The following results were, starting with seconds at 862: 1162, 802, 1222,ã > 322, 862ã >ã > This is a bit odd since it should not begin and end with the same timeã > left, +21 minutes, -26 minutes. I even went +21 mins, -31 mins with theã > same seconds count at the beginning and end.ã >ã > Am I running something wrong?ããI'm not really sure what you're trying to do.ããThe user.get_time_left() function requires an argument which indicates theãstart time (e.g. login time) to base the time-left calculation on. If the userãrepresented by the 'user' object when this script is run has the 'T' exemption,ãthen the user.get_time_left() return value is never going to change and theãstart-time argument value (if supplied) is irrelevant. You need to make sureãthe account doesn't have the 'T' exemption if you actually want theãuser.adjust_minutes() call to have an effect.ããThe bbs.get_time_left() return value will also not change if the current userãhas the 'T' exemption.ãã digital manããSnapple "Real Fact" #180:ãThe first VCR was made in 1956 and was the size of a piano. ã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From Noisome Poison@VERT/DIGI52 to Digital Man on Thu Jun 18 08:33:34 2009
    ã > I'm not really sure what you're trying to do.ã > ã > The user.get_time_left() function requires an argument which indicates theã > start time (e.g. login time) to base the time-left calculation on. If theã > user represented by the 'user' object when this script is run has the 'T'ã > exemption, then the user.get_time_left() return value is never going toã > change and the start-time argument value (if supplied) is irrelevant. Youã > need to make sure the account doesn't have the 'T' exemption if youã > actually want the user.adjust_minutes() call to have an effect.ã > ã > The bbs.get_time_left() return value will also not change if the currentã > user has the 'T' exemption.ã > ã > digital manã > ã > Snapple "Real Fact" #180:ã > The first VCR was made in 1956 and was the size of a piano. ã > ã > ---ã > þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.netããI'm just trying to reduce the user's time by five or ten minutes when aãprogram is run. The get_time_left I was using was just to verify that theãtime has changed, and will be removed later on. Is there a better option toãget the remaining time of the user than "bbs/user.get_time_left"?ããSorry for my ignorance, but what is the 'T' exemption? I have changedãeveryone's level to the default level 15, with 15 minutes per day and aãmaximum of 15 minutes per call, and the user I'm testing this on is on thatãlevel, a regular user account. ããThe door itself is not set on suspend time as well.ããThanks for your help!ããJeffãã---ã þ Synchronet þ Digital 52 - bbs.digital52.comã
  • From Digital Man@VERT to Noisome Poison on Thu Jun 18 17:26:51 2009
    Re: Re: user.adjust_minutes -- Not working..?ã By: Noisome Poison to Digital Man on Thu Jun 18 2009 08:33 amãã > >ã > > I'm not really sure what you're trying to do.ã > >ã > > The user.get_time_left() function requires an argument which indicatesã > > the start time (e.g. login time) to base the time-left calculation on.ã > > If the user represented by the 'user' object when this script is run hasã > > the 'T' exemption, then the user.get_time_left() return value is neverã > > going to change and the start-time argument value (if supplied) isã > > irrelevant. You need to make sure the account doesn't have the 'T'ã > > exemption if you actually want the user.adjust_minutes() call to have anã > > effect.ã > >ã > > The bbs.get_time_left() return value will also not change if the currentã > > user has the 'T' exemption.ãã > I'm just trying to reduce the user's time by five or ten minutes when aã > program is run. The get_time_left I was using was just to verify that theã > time has changed, and will be removed later on. Is there a better optionã > to get the remaining time of the user than "bbs/user.get_time_left"?ããbbs.get_time_left() is the correct method.ãã > Sorry for my ignorance, but what is the 'T' exemption?ããThe "Time Online" exemption. Seeãhttp://synchro.net/docs/user_editor.html#UserEditCommands for details.ãã > I have changedã > everyone's level to the default level 15, with 15 minutes per day and aã > maximum of 15 minutes per call, and the user I'm testing this on is on thatã > level, a regular user account.ããAh, okay good.ãã > The door itself is not set on suspend time as well.ããuser.adjust_minutes() is the correct function to call to add or subtractãminutes from the user's time bank. You need to understand that you cannotãsubtract from the number of minutes that the user is given based on theirãsecurity level using this function. What this function/method does is add orãsubtract from the user's "time bank", which normally has 0 minutes in. And youãcannot go less than 0. This time bank is automatically added to their availableãtime online.ããWhat you probably want to do instead is adjust the bbs.start_time property (inãseconds). The user's time online is based on their time per day, time per call,ãminutes (time bank), the current time, and this start time value. By adjustingãthe start time value you change their available time for the current "call".ãã digital manããSnapple "Real Fact" #161:ãThe first TV network kids show in the U.S. was "Captain Kangaroo." ã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From Noisome Poison@VERT/DIGI52 to Digital Man on Fri Jun 19 13:52:28 2009
    user.adjust_minutes() is the correct function to call to add or subtractã > minutes from the user's time bank. You need to understand that you cannotã > subtract from the number of minutes that the user is given based on theirã > security level using this function. What this function/method does is addã > or subtract from the user's "time bank", which normally has 0 minutes in.ã > And you cannot go less than 0. This time bank is automatically added toã > their available time online.ã > ããI did not realize it was for the time bank. I read the source to find out theãdifferent commands I can use and I did not see in the help that it was toãremove from the time bank. Thanks!ãã > What you probably want to do instead is adjust the bbs.start_time propertyã > (in seconds). The user's time online is based on their time per day, timeã > per call, minutes (time bank), the current time, and this start time value.ã > By adjusting the start time value you change their available time for theã > current "call".ã > ã > digital manããOkay, excellent. I did use the bbs.start_time property and it works. ããThank you very much for the help.ããNoisomeãã---ã þ Synchronet þ Digital 52 - bbs.digital52.comã
  • From Digital Man@VERT to Noisome Poison on Fri Jun 19 14:20:19 2009
    Re: Re: user.adjust_minutes -- Not working..?ã By: Noisome Poison to Digital Man on Fri Jun 19 2009 01:52 pmãã > > user.adjust_minutes() is the correct function to call to add or subtractã > > minutes from the user's time bank. You need to understand that youã > > cannot subtract from the number of minutes that the user is given basedã > > on their security level using this function. What this function/methodã > > does is add or subtract from the user's "time bank", which normally hasã > > 0 minutes in. And you cannot go less than 0. This time bank isã > > automatically added to their available time online.ã > >ã >ã > I did not realize it was for the time bank. I read the source to find outã > the different commands I can use and I did not see in the help that it wasã > to remove from the time bank. Thanks!ãã"Time bank" was never the official term (for Synchronet) - I used "minutes".ãThey're like credits. You can buy "minutes" (with credits), for example. I knowãit's confusing and I'll see about using the term "time bank" more to clarifyãthe usage of user "minutes".ãã > > What you probably want to do instead is adjust the bbs.start_timeã > > property (in seconds). The user's time online is based on their time perã > > day, time per call, minutes (time bank), the current time, and thisã > > start time value. By adjusting the start time value you change theirã > > available time for the current "call".ãã > Okay, excellent. I did use the bbs.start_time property and it works.ããAh, good.ãã > Thank you very much for the help.ããNo problem.ãã digital manããSnapple "Real Fact" #41:ãShrimp can only swim backward.ã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã