Do we have any Scripting experts? (Freepie?)

rtmoose

Captain
May 28, 2014
86
23
185
RSI Handle
rtmoose
hey dudes..

i am trying to write a freePIE script to use the trackIR to emulate the moueswheel.

basically i want to lean in and make the wheel scroll up, lean out and the wheel goes down.. pretty simple, but im a plebe.

here is a script written for the hydra that achieves the same thing, but by spinning the thumbstick in a circle..

can anyone modify it for my purposes?

global scrollSensitivity

global scrolling

global scrollPrevPos

global scrollDiff

global scrollDiffMagnitude



L = 0

R = 1



def applyHydraSide():

global L, R

if(hydra[0].side == "L"):

L = 0

R = 1

if(hydra[0].side == "R"):

L = 1

R = 0




def updateScrollPrevPos():

global scrollPrevPos

scrollPrevPos = hydra[R].roll




def startScrolling():

global scrolling

updateScrollPrevPos()

scrolling = True



def stopScrolling():

global scrolling

scrolling = False


def scroll():

global scrollDiff, scrollDiffMagnitude, scrollSensitivity

scrollDiff = hydra[R].roll - scrollPrevPos

scrollDiffMagnitude = scrollDiff * scrollSensitivity

if (scrollDiffMagnitude > 1.0 or scrollDiffMagnitude < -1.0):

mouse.wheel = scrollDiffMagnitude

updateScrollPrevPos()



def update():

global scrollSensitivity, scrolling

applyHydraSide()



if scrolling:

if hydra[R].one:

scroll()

else:

stopScrolling()

else:

if hydra[R].one:

startScrolling()


if starting:

applyHydraSide()

scrollSensitivity = 5

scrolling = False

scrollPrevPos = 0.0

scrollDiff = 0.0

scrollDiffMagnitude = 0.0




update()
 

Statix

Commander
Dec 25, 2014
66
47
150
RSI Handle
Statix
Do you want this to function outside of Star Citizen or just in game?
 

rtmoose

Captain
May 28, 2014
86
23
185
RSI Handle
rtmoose
yea i was all over that thread back in the day, but no, nothing of use in there.

the script i put in the OP is just an example, it doesnt have to be that complicated, as long as leaning forward causes the wheel to scroll up, and back scrolls back.. should be ennough
 
Forgot your password?