Advertisement
Guest User

GlovePIE script for racing simulators

a guest
Nov 10th, 2013
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. // Binds
  2. var.throttle = keyboard.A
  3. var.brake = keyboard.Z
  4. var.clutch = keyboard.X
  5. var.handbrake = keyboard.Q
  6. var.steering = mouse.x
  7. var.shiftup = mouse.LeftButton
  8. var.shiftdown = mouse.RightButton
  9.  
  10. // Sensitivities
  11. var.throttleincreaserate = 0.1
  12. var.throttledecreaserate = 0.4
  13. var.brakeincreaserate = 0.2
  14. var.brakedecreaserate = 0.2
  15. var.clutchincreaserate = 0.4
  16. var.clutchdecreaserate = 0.2
  17. var.handbrakeincreaserate = 0.4
  18. var.handbrakedecreaserate = 0.4
  19. var.blipthreshold = 0.4
  20. var.brakeratemax = 1
  21.  
  22. // Blipping
  23. var.useautoblip = 1
  24.  
  25. // Script
  26.  
  27. // Throttle
  28. if var.throttle > 0 && ppjoy.Analog0 < 1 then ppjoy.Analog0 += var.throttleincreaserate
  29. if var.throttle = 0 && ppjoy.Analog0 > -1 then ppjoy.Analog0 -= var.throttledecreaserate
  30.  
  31. // Brake
  32. if var.brake > 0 && ppjoy.Analog1 < var.brakeratemax then ppjoy.Analog1 += var.brakeincreaserate
  33. if var.brake = 0 && ppjoy.Analog1 > -1 then ppjoy.Analog1 -= var.brakedecreaserate
  34. // Trailing throttle under brakes
  35. if var.brake > 0 then ppjoy.Analog0 = -0.6
  36.  
  37. // Clutch
  38. if var.clutch > 0 && ppjoy.Analog2 < 1 then ppjoy.Analog2 += var.clutchincreaserate
  39. if var.clutch = 0 && ppjoy.Analog2 > -1 then ppjoy.Analog2 -= var.clutchdecreaserate
  40.  
  41. // Handbrake
  42. if var.handbrake > 0 && ppjoy.Analog3 < 1 then ppjoy.Analog3 += var.handbrakeincreaserate
  43. if var.handbrake = 0 && ppjoy.Analog3 > -1 then ppjoy.Analog3 -= var.handbrakedecreaserate
  44.  
  45. // Shift up
  46. ppjoy.Digital0 = var.shiftup
  47.  
  48. // Shift down
  49. ppjoy.Digital1 = var.shiftdown
  50.  
  51. // Blip
  52. if var.useautoblip = 1 && var.shiftdown then ppjoy.Analog0 = var.blipthreshold
  53.  
  54. // Steering
  55. ppjoy.Analog4 = -1 + (var.steering * 2)
  56. //debug = ppjoy.Analog0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement