Help With Ringfit Code for WoW

GPC2 script programming for Titan Two. Code examples, questions, requests.

Help With Ringfit Code for WoW

Postby andresburton » Wed Apr 28, 2021 2:07 am

Code: Select all
init {
}
 
main {
 
    if((get_val(ACCEL_2_X > -1.75) && get_val(ACCEL_2_X < 8.25)) && ((get_val(ACCEL_2_Y > -16.0) && get_val(ACCEL_2_Y < -6.0)) && (get_val(ACCEL_2_Z > -24.0) && get_val(ACCEL_2_Z < -14.0)))
    {
        set_val(KEY_1, 100.00);
    }
 
    if((get_val(ACCEL_2_X > -1.75) && get_val(ACCEL_2_X < 8.25)) && ((get_val(ACCEL_2_Y > 6.0) && get_val(ACCEL_2_Y < 16.0)) && (get_val(ACCEL_2_Z > -24.0) && get_val(ACCEL_2_Z < -14.0)))
    {
        set_val(KEY_2, 100.00);
    }
 
}


I'm new to programming for Titan 2, so this might just be a really basic error. I'm making a Ring Fit Mod for WoW that presses 1 or 2 if I tilt the Ring Fit. I've scratched my head and have no idea why these errors are coming up:

GPC error: WoW.gpc(189): Illegal operation '>'.
GPC error: WoW.gpc(189): Illegal operation 'get_val'.
GPC error: WoW.gpc(189): Illegal operation '<'.
GPC error: WoW.gpc(189): Illegal operation 'get_val'.
GPC error: WoW.gpc(189): Illegal operation '&&'.
GPC error: WoW.gpc(189): Illegal operation '>'.
GPC error: WoW.gpc(189): Illegal operation 'get_val'.
GPC error: WoW.gpc(189): Illegal operation '<'.
GPC error: WoW.gpc(189): Illegal operation 'get_val'.
GPC error: WoW.gpc(189): Illegal operation '&&'.
GPC error: WoW.gpc(189): Illegal operation '>'.
GPC error: WoW.gpc(189): Illegal operation 'get_val'.
GPC error: WoW.gpc(189): Illegal operation '<'.
GPC error: WoW.gpc(189): Illegal operation 'get_val'.
GPC error: WoW.gpc(189): Illegal operation '&&'.
GPC error: WoW.gpc(189): Illegal operation '&&'.
GPC error: WoW.gpc(190): Illegal operation '&&'.
GPC error: WoW.gpc(190): syntax error, unexpected B_S, expecting C '{'.
User avatar
andresburton
Sergeant
Sergeant
 
Posts: 9
Joined: Sat Feb 27, 2021 4:26 am

Re: Help With Ringfit Code for WoW

Postby Mad » Wed Apr 28, 2021 2:46 am

Just brackets in wrong places.

You want to use key_set instead of set_val
https://www.consoletuner.com/wiki/index ... t2:key_set
Code: Select all
#include <keyboard.gph>
main {
 
    if(get_val(ACCEL_2_X) > -1.75 && get_val(ACCEL_2_X) < 8.25 && get_val(ACCEL_2_Y) > -16.0 && get_val(ACCEL_2_Y) < -6.0 && get_val(ACCEL_2_Z) > -24.0 && get_val(ACCEL_2_Z) < -14.0)
    {
        key_set(KEY_1, 1);
    }
 
    if(get_val(ACCEL_2_X) > -1.75 && get_val(ACCEL_2_X) < 8.25 && get_val(ACCEL_2_Y) > 6.0 && get_val(ACCEL_2_Y) < 16.0 && get_val(ACCEL_2_Z) > -24.0 && get_val(ACCEL_2_Z) < -14.0)
    {
        key_set(KEY_2, 1);
    }
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord (2K / FPS)
Mad
Major General
Major General
 
Posts: 4533
Joined: Wed May 22, 2019 5:39 am


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 73 guests