Re: Synchronet API Documentation?ã > By: Jagossel to All on Sun May 05 2019 19:21:53ãã > Ja> Would anyone have a link to some sort of API or SDK documentation? Iã > Ja> have an idea for a project in Synchronet for an ad bot. I think itã > Ja> might be possible to do it in JavaScript.ãã > http://synchro.net/docs/jsobjs.htmlããuser.security.restrictions (and exemptions) are integers, so how would oneãchange say restrictions A CD F N P to just CD? I am not sure of the integerãrepresentations of exemptions/restrictions.ãããããã ããWhen life gets tough, drop a gear and disappear!ãã---ã þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81ã
Re: Re: Synchronet API Documentation?ã > By: Mortifis to echicken on Sat Jul 13 2019 01:16 pmãã > > > Re: Synchronet API Documentation?ã > > > By: Jagossel to All on Sun May 05 2019 19:21:53ãã > > > Ja> Would anyone have a link to some sort of API or SDKã > > > Ja> documentation? I have an idea for a project in Synchronet for anã > > > Ja> ad bot. I think it might be possible to do it in JavaScript.ãã > > > http://synchro.net/docs/jsobjs.htmlãã > > user.security.restrictions (and exemptions) are integers, so how wouldã > > one change say restrictions A CD F N P to just CD? I am not sure ofã > > the integer representations of exemptions/restrictions.ãã > There are lot of examples in exec/*.js, but most of them are setting orã > clearing a single flag at a time. To set (or clear) multiple flags at aã > time, use the | bit-wise operator:ãã > user.security.restrictions = UFLAG_C | UFLAG_D;ãã > digital manããexcellent, thank you!ãã ããWhen life gets tough, drop a gear and disappear!ãã---ã þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81ã
Re: Re: Synchronet API Documentation?ã > By: Mortifis to echicken on Sat Jul 13 2019 01:16 pmãã > > > Re: Synchronet API Documentation?ã > > > By: Jagossel to All on Sun May 05 2019 19:21:53ãã > > > Ja> Would anyone have a link to some sort of API or SDKã > > > Ja> documentation? I have an idea for a project in Synchronet for anã > > > Ja> ad bot. I think it might be possible to do it in JavaScript.ãã > > > http://synchro.net/docs/jsobjs.htmlãã > > user.security.restrictions (and exemptions) are integers, so how wouldã > > one change say restrictions A CD F N P to just CD? I am not sure ofã > > the integer representations of exemptions/restrictions.ãã > There are lot of examples in exec/*.js, but most of them are setting orã > clearing a single flag at a time. To set (or clear) multiple flags at aã > time, use the | bit-wise operator:ãã > user.security.restrictions = UFLAG_C | UFLAG_D;ããIs there an easy way to clear all flags for a user account with noãrestrictions? or a var NEW_UFLAG_SET = ... ?ããã ããWhen life gets tough, drop a gear and disappear!ãã---ã þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81ã
Re: Re: Synchronet API Documentation?ã > By: Mortifis to Digital Man on Sat Jul 13 2019 06:49 pmãã > > > Re: Re: Synchronet API Documentation?ã > > > By: Mortifis to echicken on Sat Jul 13 2019 01:16 pmãã > > > > > Re: Synchronet API Documentation?ã > > > > > By: Jagossel to All on Sun May 05 2019 19:21:53ãã > > > > > Ja> Would anyone have a link to some sort of API or SDKã > > > > > Ja> documentation? I have an idea for a project in Synchronetã > > > > > Ja> for an ad bot. I think it might be possible to do it inã > > > > > Ja> JavaScript.ãã > > > > > http://synchro.net/docs/jsobjs.htmlãã > > > > user.security.restrictions (and exemptions) are integers, so howã > > > > would one change say restrictions A CD F N P to just CD? I amã > > > > not sure of the integer representations of exemptions/restrictions.ãã > > > There are lot of examples in exec/*.js, but most of them are settingã > > > or clearing a single flag at a time. To set (or clear) multiple flagsã > > > at a time, use the | bit-wise operator:ãã > > > user.security.restrictions = UFLAG_C | UFLAG_D;ãã > > Is there an easy way to clear all flags for a user account with noã > > restrictions? or a var NEW_UFLAG_SET = ... ?ãã > To set an account to have no restrictions,ã > user.security.restrictions = 0;ãã > I'm not sure what you're implying by the NEW_UFLAG_SET var.ãã > digital manããI am modifying emailval.js ... user.security.restrictions = 0; is good toãclear all restrictions, thank you. Is there an easy way to declare a flag setãvariable (I called it NEW_UFLAG_SET as an example) similar to NEW_UFLAG_SET =ã"UFLAG_C | UFLAG_D | UFLAG_E ... etc"; ?ãã ããWhen life gets tough, drop a gear and disappear!ãã---ã þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81ã
Re: Re: Synchronet API Documentation?ã > By: Mortifis to Digital Man on Sat Jul 13 2019 22:33:38ãã > Mo> clear all restrictions, thank you. Is there an easy way to declare aã > Mo> flag set variable (I called it NEW_UFLAG_SET as an example) similar toã > Mo> NEW_UFLAG_SET = "UFLAG_C | UFLAG_D | UFLAG_E ... etc"; ?ãã > If your goal is to do something like:ãã > user.security.restrictions = NEW_UFLAG_SET;ãã > then your example is close to what you'd want:ãã > const NEW_UFLAG_SET = UFLAG_C|UFLAG_D|UFLAG_E; // And so onãã > Note that you don't want quotes around the right operand, which would makeã > it a string instead of a bunch of numbers that you're OR-ing together.ãã > This is kind of a flyswatter approach, which is probably what you wantã > anyway. If you don't want to overwrite the user's entire flag set, it'sã > also possible to add a single flag:ãã > user.security.restrictions |= UFLAG_C;ãã > or unset a single flag:ãã > user.security.restrictions &=~ UFLAG_C;ãããExcellent; very helpful, thank you!ã ããWhen life gets tough, drop a gear and disappear!ãã---ã þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81ã
Sysop: | Karloch |
---|---|
Location: | Madrid, Spain |
Users: | 54 |
Nodes: | 8 (0 / 8) |
Uptime: | 129:37:41 |
Calls: | 700 |
Files: | 17,895 |
D/L today: |
128 files (60,769K bytes) |
Messages: | 66,010 |