SleepingBagExploitFix

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com

.phase

Member
Member
Jul 29, 2014
58
12
8
Southern California
Why not just run it as is, in the Magma module?

@mikec has made it so that the two modules can run side-by-side in the latest build. And if you didn't want to run it as Magma, you can quickly update it to be ran under Fougerite's new Jint.

No need to reinvent the wheel, is there? Not sure what porting this into C# module would gain you. (But, I also haven't looked at the code, so... xD)
 

mikec

Master Of All That I Survey
Retired Staff
Trusted Member
Jul 12, 2014
296
152
28
Los Angeles, California, USA
That's some quality code. I showed Sleepy how to ask a structure's Bounds if a point was inside it or within a certain distance.

JintPlugin's LookUp class makes this drop-dead easy:

Code:
var near = LookUp.Filter(Structures.All, Player, 5.0);
var mine = LookUp.Filter(near, Player);
if (near.length >= 1) {
   PlayerMessage("You're within 5 meters of at least one structure");
   Player.Message(mine.length + " of them belong to you.");
}
 
  • Informative
Reactions: .phase

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
Why not just run it as is, in the Magma module?

@mikec has made it so that the two modules can run side-by-side in the latest build. And if you didn't want to run it as Magma, you can quickly update it to be ran under Fougerite's new Jint.

No need to reinvent the wheel, is there? Not sure what porting this into C# module would gain you. (But, I also haven't looked at the code, so... xD)
Since C# is the main language it is faster than any interpreter will come out. Check out Jint and IronPython performance in google. For example the entity find at location or the door is just the same method as the javascript i made it for. Difference is when i used it in Js it took 10sec to find the first teo entities and then my srv crashed. With csharp module it found them in 2sec.

Sent from my Samsung Galaxy S4