Difference between revisions of "Lua:setXBox360ControllerVibration"

From Cheat Engine
Jump to navigation Jump to search
(Created page with 'Category:Lua '''function''' setXBox360ControllerVibration(''ControllerID'', ''leftMotor'', ''rightMotor'') Sets the speed of the left and right vibrating motor inside the co…')
 
 
Line 1: Line 1:
 
[[Category:Lua]]
 
[[Category:Lua]]
'''function''' setXBox360ControllerVibration(''ControllerID'', ''leftMotor'', ''rightMotor'')
+
{{CodeBox|'''function''' setXBox360ControllerVibration(''ControllerID'', ''leftMotor'', ''rightMotor'') ''':''' void}}
  
Sets the speed of the left and right vibrating motor inside the controller. Range (0 to 65535 where 0 is off)
+
Sets the vibration speed of the left and right motors inside the Xbox 360 controller.
  
=== Function Parameters ===
+
The motor values range from 0 to 65535, where 0 disables the motor.
  
{|width="85%" cellpadding="10%" cellpadding="5%" cellspacing="0" border="0"
+
===Function Parameters===
 +
{|width="85%" cellpadding="10%" cellspacing="0" border="0"
 
!align="left"|Parameter
 
!align="left"|Parameter
 
!align="left"|Type
 
!align="left"|Type
Line 12: Line 13:
 
|-
 
|-
 
|ControllerID
 
|ControllerID
|integer
+
|Integer
|the id of the controller (between 0 and 3)
+
|The ID of the controller to set the vibration for. Valid values range from 0 to 3.
 
|-
 
|-
 
|leftMotor
 
|leftMotor
|integer (0 to 65535)
+
|Integer
|speed of the left motor
+
|The vibration speed of the left motor. The value ranges from 0 to 65535, where 0 is off.
 
|-
 
|-
 
|rightMotor
 
|rightMotor
|integer (0 to 65535)
+
|Integer
|speed of the right motor
+
|The vibration speed of the right motor. The value ranges from 0 to 65535, where 0 is off.
 
|}
 
|}
  
 +
===Returns===
 +
void — This function does not return any value.
  
== See also ==
+
===Examples===
* [[Lua]]
+
<pre>
* [[Help_File:Script engine|Script engine]]
+
-- Set both vibration motors to full speed
 +
setXBox360ControllerVibration(0, 65535, 65535)
  
=== Related Functions ===
+
-- Stop both vibration motors
* [[Lua:getXBox360ControllerState|getXBox360ControllerState]]
+
setXBox360ControllerVibration(0, 0, 0)
 +
</pre>
 +
 
 +
{{LuaSeeAlso}}

Latest revision as of 04:01, 21 June 2026

<> Function

function setXBox360ControllerVibration(ControllerID, leftMotor, rightMotor) : void

Sets the vibration speed of the left and right motors inside the Xbox 360 controller.

The motor values range from 0 to 65535, where 0 disables the motor.

Function Parameters[edit]

Parameter Type Description
ControllerID Integer The ID of the controller to set the vibration for. Valid values range from 0 to 3.
leftMotor Integer The vibration speed of the left motor. The value ranges from 0 to 65535, where 0 is off.
rightMotor Integer The vibration speed of the right motor. The value ranges from 0 to 65535, where 0 is off.

Returns[edit]

void — This function does not return any value.

Examples[edit]

-- Set both vibration motors to full speed
setXBox360ControllerVibration(0, 65535, 65535)

-- Stop both vibration motors
setXBox360ControllerVibration(0, 0, 0)

See also[edit]

Lua
Script Engine