t2:gpc_scripting:examples_1

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
t2:gpc_scripting:examples_1 [2020/06/23 15:54]
scachi [Double Tap]
t2:gpc_scripting:examples_1 [2020/09/08 06:59]
scachi [GPC Script Examples]
Line 15: Line 15:
 ^ On button hold press it repetitive | [[t2:​gpc_scripting:​examples_1#​aim_assist_abuse|Aim Assist Abuse]] | ^ On button hold press it repetitive | [[t2:​gpc_scripting:​examples_1#​aim_assist_abuse|Aim Assist Abuse]] |
 ^ On button hold press it repetitive | [[t2:​gpc_scripting:​examples_1#​bunny_hop|Bunny Hop]] | ^ On button hold press it repetitive | [[t2:​gpc_scripting:​examples_1#​bunny_hop|Bunny Hop]] |
 +^ On button hold press it repetitive | [[t2:​gpc_scripting:​examples_1#​simple_rapid_fire|Rapid Fire]] |
 ^ On button double tap| [[t2:​gpc_scripting:​examples_1#​double_tap|Double Tap]] &  [[t2:​gpc_scripting:​examples_1#​double_tap|Toggle]] | ^ On button double tap| [[t2:​gpc_scripting:​examples_1#​double_tap|Double Tap]] &  [[t2:​gpc_scripting:​examples_1#​double_tap|Toggle]] |
 ^  \\ |  | ^  \\ |  |
Line 350: Line 351:
 ===== Rapid Fire ===== ===== Rapid Fire =====
 Rapid Fire does press and release the fire button while you are holding down the fire button. Rapid Fire does press and release the fire button while you are holding down the fire button.
 +
 +=== Simple Rapid Fire ===
 +When you hold down the fire button the script will press and release the button fast.
 +<code gpc2>
 +// Simple Rapid Fire
 +main {
 +  // run rapid fire only when press BUTTON_5
 +  if (is_active(BUTTON_5)) combo_run(cRapidFire);​
 +  // stop when releasing button
 +  if (event_release(BUTTON_5)) combo_stop(cRapidFire);​
 +}
 +
 +combo cRapidFire {
 +  set_val(BUTTON_5,​100);​ // press button 5
 +  wait(40); ​             // (press) for 40ms
 +  set_val(BUTTON_5,​0); ​  // release button 5
 +  wait(40); ​             // (release) for 40ms
 +}
 +</​code>​
 +
 === Toggle Rapid Fire === === Toggle Rapid Fire ===
 While holding BUTTON_8 press BUTTON_10 to toggle Rapid Fire usage on/off. While holding BUTTON_8 press BUTTON_10 to toggle Rapid Fire usage on/off.
t2/gpc_scripting/examples_1.txt · Last modified: 2021/03/09 17:38 by scachi