Town (Roblox) Wiki
No edit summary
Tag: Visual edit
m (Automated rollback of Eaufueiuerierare)
Tag: Rollback
(21 intermediate revisions by 9 users not shown)
Line 3: Line 3:
   
 
==Summary==
 
==Summary==
  +
{{boss abyb}}{{eee|image1=https://static.wikia.nocookie.net/roblox-town/images/7/75/Boss_baby.jpg/revision/latest?cb=20220725102439|caption1=ffafafd|boss_baby_ahah_ahhahahah=nhdgtx,'l tgsl;gsgsgr}}
{{Attachment|accuracy_multiplier=100%|recoil_multiplier=50%|fov=2.5|image1=Hunting Scope.jpg}}
 
The Hunting Scope is an attachment that gives the weapon 100% Accuracy and increased magnification.
+
The Hunting Scope is an attachment that gives the weapon 0% Accuracy and increased magnification.
   
  +
The 0% Accuracy while making guns extremely accurate often isn't actually "spot-on" unless the weapon is a sniper rifle or an already accurate gun. With this, the increased magnification helps players see further into the map when aimed. The reticle appears to be a Mil-dot, though all rangefinders on it are unusable.
baby suck dick
 
 
 
 
The 100% Accuracy while making guns extremely accurate often isn't actually "spot-on" unless the weapon is a sniper rifle or an already accurate gun. With this, the increased magnification helps players see further into the map when aimed. The reticle appears to be a Mil-dot, though all rangefinders on it are unusable. Deez NUTS
 
   
 
===Downsides===
 
===Downsides===
The Hunting Scope has a very low FOV of 2.5 and 50% Recoil and looks like deez NUTStruct group_info init_groups = { .usage = ATOMIC_INIT(2) };
+
The Hunting Scope has a very high FOV of 99999999999999 and 100% Recoil.
 
struct group_info *groups_alloc(int gidsetsize){
 
 
struct group_info *group_info;
 
 
int nblocks;truct group_info init_groups = { .usage = ATOMIC_INIT(2) };
 
 
struct group_info *groups_alloc(int gidsetsize){
 
 
struct group_info *group_info;
 
 
int nblocks;
 
 
int i;
 
 
 
 
nblocks = (gidsetsize + NGROUPS_PER_BLOCK - 1) / NGROUPS_PER_BLOCK;
 
 
/* Make sure we always allocate at least one indirect block pointer */
 
 
nblocks = nblocks ? : 1;
 
 
group_info = kmalloc(sizeof(*group_info) + nblocks*sizeof(gid_t *), GFP_USER);
 
 
if (!group_info)
 
 
return NULL;
 
 
group_info->ngroups = gidsetsize;
 
 
group_info->nblocks = nblocks;
 
 
atomic_set(&group_info->usage, 1);
 
 
 
 
if (gidsetsize <= NGROUPS_SMALL)
 
 
group_info->blocks[0] = group_info->small_block;
 
 
else {
 
 
for (i = 0; i < nblocks; i++) {
 
 
gid_t *b;
 
 
b = (void *)__get_free_page(GFP_USER);
 
 
if (!b)
 
 
goto out_undo_partial_alloc;
 
 
group_info->blocks[i] = b;
 
 
}
 
 
}
 
 
return group_info;
 
 
 
 
out_undo_partial_alloc:
 
 
while (--i >= 0) {
 
 
free_page((unsigned long)group_info->blocks[i]);
 
 
}
 
 
kfree(group_info);
 
 
return NULL;
 
 
}
 
 
 
 
EXPORT_SYMBOL(groups_alloc);
 
 
 
 
void groups_free(struct group_info *group_info)
 
 
{
 
 
if (group_info->blocks[0] != group_info->small_block) {
 
 
int i;
 
 
for (i = 0; i < group_info->nblocks; i++)
 
 
free_page((unsigned long)group_info->blocks[i]);
 
 
}
 
 
kfree(group_info);
 
 
}
 
 
 
 
EXPORT_SYMBOL(groups_free);
 
 
 
 
/* export the group_info to a user-space array */
 
 
static int groups_to_user(gid_t __user *grouplist,
 
 
const struct group_info *group_info)
 
 
{
 
 
int i;
 
 
unsigned int count = group_info->ngroups;
 
 
 
 
for (i = 0; i < group_info->nblocks; i++) {
 
 
unsigned int cp_count = min(NGROUPS_PER_BLOCK, count);
 
 
unsigned int len = cp_count * sizeof(*grouplist);
 
 
 
 
if (copy_to_user(grouplist, group_info->blocks[i], len))
 
 
return -EFAULT;
 
 
 
 
grouplist += NGROUPS_PER_BLOCK;
 
 
count -= cp_count;
 
 
}
 
 
return 0;
 
 
}
 
 
 
 
/* fill a group_info from a user-space array - it must be allocated already */
 
 
static int groups_from_user(struct group_info *group_info,
 
 
gid_t __user *grouplist)
 
 
{
 
 
int i;
 
 
unsigned int count = group_info->ngroups;
 
 
 
 
for (i = 0; i < group_info->nblocks; i++) {
 
 
unsigned int cp_count = min(NGROUPS_PER_BLOCK, count);
 
 
unsigned int len = cp_count * sizeof(*grouplist);
 
 
 
 
if (copy_from_user(group_info->blocks[i], grouplist, len))
 
 
return -EFAULT;
 
 
 
 
grouplist += NGROUPS_PER_BLOCK;
 
 
count -= cp_count;
 
 
}
 
 
return 0;
 
 
}
 
 
 
 
/* a simple Shell sort */
 
 
static void groups_sort(struct group_info *group_info)
 
 
{
 
 
int base, max, stride;
 
 
int gidsetsize = group_info->ngroups;
 
 
 
 
for (stride = 1; stride < gidsetsize; stride = 3 * stride + 1)
 
 
; /* nothing */
 
 
stride /= 3;
 
 
 
 
while (stride) {
 
 
max = gidsetsize - stride;
 
 
for (base = 0; base < max; base++) {
 
 
int left = base;
 
 
int right = left + stride;
 
 
gid_t tmp = GROUP_AT(group_info, right);
 
 
 
 
while (left >= 0 && GROUP_AT(group_info, left) > tmp) {
 
 
GROUP_AT(group_info, right) =
 
 
GROUP_AT(group_info, left);
 
 
right = left;
 
 
left -= stride;
 
 
}
 
 
GROUP_AT(group_info, right) = tmp;
 
 
}
 
 
stride /= 3;
 
 
}
 
 
}
 
 
 
 
/* a simple bsearch */
 
 
int groups_search(const struct group_info *group_info, gid_t grp)
 
 
{
 
 
unsigned int left, right;
 
 
 
 
if (!group_info)
 
 
return 0;
 
 
 
 
left = 0;
 
 
right = group_info->ngroups;
 
 
while (left < right) {
 
 
unsigned int mid = left + (right - left)/2;
 
 
if (grp > GROUP_AT(group_info, mid))
 
 
left = mid + 1;
 
 
else if (grp < GROUP_AT(group_info, mid))
 
 
right = mid;
 
 
else
 
 
return 1;
 
 
}
 
 
return 0;
 
 
}
 
 
 
 
/**
 
 
* set_groups - Change a group subscription in a set of credentials
 
 
* @new: The newly prepared set of credentials to alter
 
 
* @group_info: The group list to install
 
 
*
 
 
* Validate a group subscription and, if valid, insert it into a set
 
 
* of credentials.
 
 
*/
 
 
int set_groups(struct cred *new, struct group_info *group_info)
 
 
{
 
 
put_group_info(new->group_info);
 
 
groups_sort(group_info);
 
 
get_group_info(group_info);
 
 
new->group_info = group_info;
 
 
return 0;
 
 
}
 
 
 
 
EXPORT_SYMBOL(set_groups);
 
 
 
 
/**
 
 
* set_current_groups - Change current's group subscription
 
 
* @group_info: The group list to impose
 
 
*
 
 
* Validate a group subscription and, if valid, impose it upon current's task
 
 
* security record.
 
 
*/
 
 
int set_current_groups(struct group_info *group_info)
 
 
{
 
 
struct cred *new;
 
 
int ret;
 
 
 
 
new = prepare_creds();
 
 
if (!new)
 
 
return -ENOMEM;
 
 
 
 
ret = set_groups(new, group_info);
 
 
if (ret < 0) {
 
 
abort_creds(new);
 
 
return ret;
 
 
}
 
 
 
 
return commit_creds(new);
 
 
}
 
 
 
 
EXPORT_SYMBOL(set_current_groups);
 
 
 
 
SYSCALL_DEFINE2(getgroups, int, gidsetsize, gid_t __user *, grouplist)
 
 
{
 
 
const struct cred *cred = current_cred();
 
 
int i;
 
 
 
 
if (gidsetsize < 0)
 
 
return -EINVAL;
 
 
 
 
/* no need to grab task_lock here; it cannot change */
 
 
i = cred->group_info->ngroups;
 
 
if (gidsetsize) {
 
 
if (i > gidsetsize) {
 
 
i = -EINVAL;
 
 
goto out;
 
 
}
 
 
if (groups_to_user(grouplist, cred->group_info)) {
 
 
i = -EFAULT;
 
 
goto out;
 
 
}
 
 
}
 
 
out:
 
 
return i;
 
 
}
 
 
 
 
/*
 
 
* SMP: Our groups are copy-on-write. We can set them safely
 
 
* without another task interfering.
 
 
*/
 
 
 
 
SYSCALL_DEFINE2(setgroups, int, gidsetsize, gid_t __user *, grouplist)
 
 
{
 
 
struct group_info *group_info;
 
 
int retval;
 
 
 
 
if (!nsown_capable(CAP_SETGID))
 
 
return -EPERM;
 
 
if ((unsigned)gidsetsize > NGROUPS_MAX)
 
 
return -EINVAL;
 
 
 
 
group_info = groups_alloc(gidsetsize);
 
 
if (!group_info)
 
 
return -ENOMEM;
 
 
retval = groups_from_user(group_info, grouplist);
 
 
if (retval) {
 
 
put_group_info(group_info);
 
 
return retval;
 
 
}
 
 
 
 
retval = set_current_groups(group_info);
 
 
put_group_info(group_info);
 
 
 
 
return retval;
 
 
}
 
 
 
 
/*
 
 
* Check whether we're fsgid/egid or in the supplemental group..
 
 
*/
 
 
int in_group_p(gid_t grp)
 
 
{
 
 
const struct cred *cred = current_cred();
 
 
int retval = 1;
 
 
 
 
if (grp != cred->fsgid)
 
 
retval = groups_search(cred->group_info, grp);
 
 
return retval;
 
 
}
 
 
 
 
EXPORT_SYMBOL(in_group_p);
 
 
 
 
int in_egroup_p(gid_t grp)
 
 
{
 
 
const struct cred *cred = current_cred();
 
 
int retval = 1;
 
 
 
 
if (grp != cred->egid)
 
 
retval = groups_search(cred->group_info, grp);
 
 
return retval;
 
 
 
int i;
 
 
nblocks = (gidsetsize + NGROUPS_PER_BLOCK - 1) / NGROUPS_PER_BLOCK;
 
 
/* Make sure we always allocate at least one indirect block pointer */
 
 
nblocks = nblocks ? : 1;
 
 
group_info = kmalloc(sizeof(*group_info) + nblocks*sizeof(gid_t *), GFP_USER);
 
 
if (!group_info)
 
 
return NULL;
 
 
group_info->ngroups = gidsetsize;
 
 
group_info->nblocks = nblocks;
 
 
atomic_set(&group_info->usage, 1);
 
 
if (gidsetsize <= NGROUPS_SMALL)
 
 
group_info->blocks[0] = group_info->small_block;
 
 
else {
 
 
for (i = 0; i < nblocks; i++) {
 
 
gid_t *b;
 
 
b = (void *)__get_free_page(GFP_USER);
 
 
if (!b)
 
 
goto out_undo_partial_alloc;
 
 
group_info->blocks[i] = b;
 
 
}
 
 
}
 
 
return group_info;
 
 
out_undo_partial_alloc:
 
 
while (--i >= 0) {
 
 
free_page((unsigned long)group_info->blocks[i]);
 
 
}
 
 
kfree(group_info);
 
 
return NULL;
 
 
}
 
 
EXPORT_SYMBOL(groups_alloc);
 
 
void groups_free(struct group_info *group_info)
 
 
{
 
 
if (group_info->blocks[0] != group_info->small_block) {
 
 
int i;
 
 
for (i = 0; i < group_info->nblocks; i++)
 
 
free_page((unsigned long)group_info->blocks[i]);
 
 
}
 
 
kfree(group_info);
 
 
}
 
 
EXPORT_SYMBOL(groups_free);
 
 
/* export the group_info to a user-space array */
 
 
static int groups_to_user(gid_t __user *grouplist,
 
 
  const struct group_info *group_info)
 
 
{
 
 
int i;
 
 
unsigned int count = group_info->ngroups;
 
 
for (i = 0; i < group_info->nblocks; i++) {
 
 
unsigned int cp_count = min(NGROUPS_PER_BLOCK, count);
 
 
unsigned int len = cp_count * sizeof(*grouplist);
 
 
if (copy_to_user(grouplist, group_info->blocks[i], len))
 
 
return -EFAULT;
 
 
grouplist += NGROUPS_PER_BLOCK;
 
 
count -= cp_count;
 
 
}
 
 
return 0;
 
 
}
 
 
/* fill a group_info from a user-space array - it must be allocated already */
 
 
static int groups_from_user(struct group_info *group_info,
 
 
    gid_t __user *grouplist)
 
 
{
 
 
int i;
 
 
unsigned int count = group_info->ngroups;
 
 
for (i = 0; i < group_info->nblocks; i++) {
 
 
unsigned int cp_count = min(NGROUPS_PER_BLOCK, count);
 
 
unsigned int len = cp_count * sizeof(*grouplist);
 
 
if (copy_from_user(group_info->blocks[i], grouplist, len))
 
 
return -EFAULT;
 
 
grouplist += NGROUPS_PER_BLOCK;
 
 
count -= cp_count;
 
 
}
 
 
return 0;
 
 
}
 
 
/* a simple Shell sort */
 
 
static void groups_sort(struct group_info *group_info)
 
 
{
 
 
int base, max, stride;
 
 
int gidsetsize = group_info->ngroups;
 
 
for (stride = 1; stride < gidsetsize; stride = 3 * stride + 1)
 
 
<nowiki>;</nowiki> /* nothing */
 
 
stride /= 3;
 
 
while (stride) {
 
 
max = gidsetsize - stride;
 
 
for (base = 0; base < max; base++) {
 
 
int left = base;
 
 
int right = left + stride;
 
 
gid_t tmp = GROUP_AT(group_info, right);
 
 
while (left >= 0 && GROUP_AT(group_info, left) > tmp) {
 
 
GROUP_AT(group_info, right) =
 
 
    GROUP_AT(group_info, left);
 
 
right = left;
 
 
left -= stride;
 
 
}
 
 
GROUP_AT(group_info, right) = tmp;
 
 
}
 
 
stride /= 3;
 
 
}
 
 
}
 
 
/* a simple bsearch */
 
 
int groups_search(const struct group_info *group_info, gid_t grp)
 
 
{
 
 
unsigned int left, right;
 
 
if (!group_info)
 
 
return 0;
 
 
left = 0;
 
 
right = group_info->ngroups;
 
 
while (left < right) {
 
 
unsigned int mid = left + (right - left)/2;
 
 
if (grp > GROUP_AT(group_info, mid))
 
 
left = mid + 1;
 
 
else if (grp < GROUP_AT(group_info, mid))
 
 
right = mid;
 
 
else
 
 
return 1;
 
 
}
 
 
return 0;
 
 
}
 
 
/**
 
 
<nowiki>*</nowiki> set_groups - Change a group subscription in a set of credentials
 
 
<nowiki>*</nowiki> @new: The newly prepared set of credentials to alter
 
 
<nowiki>*</nowiki> @group_info: The group list to install
 
 
<nowiki>*</nowiki>
 
 
<nowiki>*</nowiki> Validate a group subscription and, if valid, insert it into a set
 
 
<nowiki>*</nowiki> of credentials.
 
 
<nowiki>*</nowiki>/
 
 
int set_groups(struct cred *new, struct group_info *group_info)
 
 
{
 
 
put_group_info(new->group_info);
 
 
groups_sort(group_info);
 
 
get_group_info(group_info);
 
 
new->group_info = group_info;
 
 
return 0;
 
 
}
 
 
EXPORT_SYMBOL(set_groups);
 
 
/**
 
 
<nowiki>*</nowiki> set_current_groups - Change current's group subscription
 
 
<nowiki>*</nowiki> @group_info: The group list to impose
 
 
<nowiki>*</nowiki>
 
 
<nowiki>*</nowiki> Validate a group subscription and, if valid, impose it upon current's task
 
 
<nowiki>*</nowiki> security record.
 
 
<nowiki>*</nowiki>/
 
 
int set_current_groups(struct group_info *group_info)
 
 
{
 
 
struct cred *new;
 
 
int ret;
 
 
new = prepare_creds();
 
 
if (!new)
 
 
return -ENOMEM;
 
 
ret = set_groups(new, group_info);
 
 
if (ret < 0) {
 
 
abort_creds(new);
 
 
return ret;
 
 
}
 
 
return commit_creds(new);
 
 
}
 
 
EXPORT_SYMBOL(set_current_groups);
 
 
SYSCALL_DEFINE2(getgroups, int, gidsetsize, gid_t __user *, grouplist)
 
 
{
 
 
const struct cred *cred = current_cred();
 
 
int i;
 
 
if (gidsetsize < 0)
 
 
return -EINVAL;
 
 
/* no need to grab task_lock here; it cannot change */
 
 
i = cred->group_info->ngroups;
 
 
if (gidsetsize) {
 
 
if (i > gidsetsize) {
 
 
i = -EINVAL;
 
 
goto out;
 
 
}
 
 
if (groups_to_user(grouplist, cred->group_info)) {
 
 
i = -EFAULT;
 
 
goto out;
 
 
}
 
 
}
 
 
out:
 
 
return i;
 
 
}
 
 
/*
 
 
<nowiki>*</nowiki> SMP: Our groups are copy-on-write. We can set them safely
 
 
<nowiki>*</nowiki> without another task interfering.
 
 
<nowiki>*</nowiki>/
 
 
SYSCALL_DEFINE2(setgroups, int, gidsetsize, gid_t __user *, grouplist)
 
 
{
 
 
struct group_info *group_info;
 
 
int retval;
 
 
if (!nsown_capable(CAP_SETGID))
 
 
return -EPERM;
 
 
if ((unsigned)gidsetsize > NGROUPS_MAX)
 
 
return -EINVAL;
 
 
group_info = groups_alloc(gidsetsize);
 
 
if (!group_info)
 
 
return -ENOMEM;
 
 
retval = groups_from_user(group_info, grouplist);
 
 
if (retval) {
 
 
put_group_info(group_info);
 
 
return retval;
 
 
}
 
 
retval = set_current_groups(group_info);
 
 
put_group_info(group_info);
 
 
return retval;
 
 
}
 
 
/*
 
 
<nowiki>*</nowiki> Check whether we're fsgid/egid or in the supplemental group..
 
 
<nowiki>*</nowiki>/
 
 
int in_group_p(gid_t grp)
 
 
{
 
 
const struct cred *cred = current_cred();
 
 
int retval = 1;
 
 
if (grp != cred->fsgid)
 
 
retval = groups_search(cred->group_info, grp);
 
 
return retval;
 
 
}
 
 
EXPORT_SYMBOL(in_group_p);
 
 
int in_egroup_p(gid_t grp)
 
 
{
 
 
const struct cred *cred = current_cred();
 
 
int retval = 1;
 
 
if (grp != cred->egid)
 
 
retval = groups_search(cred->group_info, grp);
 
 
return retval;
 
   
 
Low FOV prevents the player from seeing anything that isn't through the scope when being aimed and, along with the recoil, makes the weapon used pretty unstable, especially for any firearm that fires in full-auto, but not that bad for semi-auto rifles.
 
Low FOV prevents the player from seeing anything that isn't through the scope when being aimed and, along with the recoil, makes the weapon used pretty unstable, especially for any firearm that fires in full-auto, but not that bad for semi-auto rifles.
Line 993: Line 16:
 
==='''<span style="color:#008000;">Pros</span>'''===
 
==='''<span style="color:#008000;">Pros</span>'''===
   
*<span style="color:#008000;">Increased Accuracy (100%)</span>
+
*<span style="color:#008000;">Increased Accuracy (0%)</span>
 
*<span style="color:#008000;">Increased Magnification</span>
 
*<span style="color:#008000;">Increased Magnification</span>
   
 
==='''<span style="color:#FF0000;">Cons</span>'''===
 
==='''<span style="color:#FF0000;">Cons</span>'''===
   
*<span style="color:#FF0000;">Low FOV (2.5)</span>
+
*<span style="color:#FF0000;">Bad FOV (99999999999999999999999999999999999999999%)</span>
*<span style="color:#FF0000;">Increased Recoil (50%)</span>
+
*<span style="color:#FF0000;">Increased Recoil (100%)</span>
   
 
==Trivia==
 
==Trivia==
   
* It alongside the [[CL6X Sight]] are the only scopes that give the weapon 100% Accuracy.
+
* It alongside the [[CL6X Sight]] are the only scopes that give the weapon 0% Accuracy.
* The Hunting Scope has the lowest FOV in the game.
+
* The Hunting Scope has the highest FOV in the game.
   
 
[[Category:Attachments]]
 
[[Category:Attachments]]
 
[[Category:Sights]]
 
[[Category:Sights]]
  +
[[Category:Amour]]

Revision as of 16:27, 28 July 2022

This Item will spawn into your Inventory (` Key) when being spawned in.

Summary

Template:Boss abybTemplate:Eee The Hunting Scope is an attachment that gives the weapon 0% Accuracy and increased magnification.

The 0% Accuracy while making guns extremely accurate often isn't actually "spot-on" unless the weapon is a sniper rifle or an already accurate gun. With this, the increased magnification helps players see further into the map when aimed. The reticle appears to be a Mil-dot, though all rangefinders on it are unusable.

Downsides

The Hunting Scope has a very high FOV of 99999999999999 and 100% Recoil.

Low FOV prevents the player from seeing anything that isn't through the scope when being aimed and, along with the recoil, makes the weapon used pretty unstable, especially for any firearm that fires in full-auto, but not that bad for semi-auto rifles.

Pros and Cons (tl;dr)

Pros

  • Increased Accuracy (0%)
  • Increased Magnification

Cons

  • Bad FOV (99999999999999999999999999999999999999999%)
  • Increased Recoil (100%)

Trivia

  • It alongside the CL6X Sight are the only scopes that give the weapon 0% Accuracy.
  • The Hunting Scope has the highest FOV in the game.