Updates and Features
This commit is contained in:
49
rpcg.go
49
rpcg.go
@@ -25,8 +25,7 @@ import (
|
||||
|
||||
/*
|
||||
RndPortal - Random Portalcode generator
|
||||
Requires no input required
|
||||
Returns a string
|
||||
Requires no input required and returns a string
|
||||
*/
|
||||
|
||||
func RndPortal() (final string) {
|
||||
@@ -45,3 +44,49 @@ func RndPortal() (final string) {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
/*RndAtlas genorates a semi-random atlas code
|
||||
Requires no input and returns a string
|
||||
|
||||
This is not a true random atlas genorator. Insted this will create a Planet id of 1, Solar System Index of 0x07A and random Y, Z, X
|
||||
SSI 0x07A always has an Atlas Interface.
|
||||
|
||||
REF: https://nomanssky.fandom.com/wiki/Portal_address#Solar_System_Index https://nomanssky.fandom.com/wiki/Star_system#Classification
|
||||
*/
|
||||
func RndAtlas() (final string) {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
min := 0x1
|
||||
ymax := 0xFF
|
||||
xzmax := 0xFFF
|
||||
|
||||
x := rand.Intn(xzmax-min+1) + min
|
||||
z := rand.Intn(xzmax-min+1) + min
|
||||
y := rand.Intn(ymax-min+1) + min
|
||||
|
||||
final = fmt.Sprintf("%00X%03X%02X%03X%03X", 1, 0x07A, y, z, x)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
/*RndBH genorates a semi-random atlas code
|
||||
Requires no input required and returns a string
|
||||
|
||||
This is not a true random atlas genorator. Insted this will create a Planet id of 1, Solar System Index of 0x079 and random Y, Z, X
|
||||
SSI 0x079 always has a black hole.
|
||||
|
||||
REF: https://nomanssky.fandom.com/wiki/Portal_address#Solar_System_Index https://nomanssky.fandom.com/wiki/Star_system#Classification
|
||||
*/
|
||||
func RndBH() (final string) {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
min := 0x1
|
||||
ymax := 0xFF
|
||||
xzmax := 0xFFF
|
||||
|
||||
x := rand.Intn(xzmax-min+1) + min
|
||||
z := rand.Intn(xzmax-min+1) + min
|
||||
y := rand.Intn(ymax-min+1) + min
|
||||
|
||||
final = fmt.Sprintf("%00X%03X%02X%03X%03X", 1, 0x079, y, z, x)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user