This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import socket | |
| import struct | |
| import select | |
| import time | |
| import random | |
| from binascii import crc32 | |
| DSUC_VersionReq = 0x100000 | |
| DSUS_VersionRsp = 0x100000 | |
| DSUC_ListPorts = 0x100001 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Gui, Show, w640 h360 | |
| OnMessage(0x100, "WM_KEYDOWN") | |
| Return | |
| ;C::DllCall("ShowCursor", UInt,0) | |
| ;V::DllCall("ShowCursor", UInt,1) | |
| GuiClose: | |
| { | |
| ExitApp | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from math import atan2, sqrt, pow | |
| #import numpy | |
| import operator | |
| def cross(a, b): | |
| return a[0]*b[1]-a[1]*b[0] | |
| def dot(a,b): | |
| return sum(map( operator.mul, a, b)) | |
| if starting: | |
| kx = 0.0 | |
| ky = 0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //pie.framerate = screen.RefreshRate | |
| pie.framerate = 120 | |
| var.f = removeunits(pie.framerate) | |
| var.x = deadzone(joy.X,0.03) | |
| var.y = deadzone(joy.Y,0.03) | |
| var.scale = 60 | |
| var.x = ensuremaprange(var.x,-1,1,-var.scale,var.scale) | |
| var.y = ensuremaprange(var.y,-1,1,-var.scale,var.scale) | |
| var.dial = EnsureMapRange(joy.dial, -0.62, 1, -1, 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://github.com/AndersMalmgren/FreePIE/wiki/Sign | |
| def sign(val): #Returns -1 for negatives, 0 for zero and 1 for positives | |
| return (1 * (val > 0)) + (-1 * (val < 0)) | |
| # https://github.com/AndersMalmgren/FreePIE/wiki/ScaledDeadzone | |
| # (modified) | |
| def ScaledDeadzone(val, mini, maxi, dz): #Paremeters are Value, Minimum, Maximum and Deadzone Size. | |
| scaled = filters.mapRange(val,mini,maxi, -1.0,1.0) | |
| output = 0.0 | |
| if abs(scaled) > dz: |