Script is working but not

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

Script is working but not

Postby Eruklaw » Sat Mar 14, 2020 6:27 pm

Hello all,

I've adapted a script and it works ingame but my bar swap isn't working/registering.
When i press the left button it has to bar swap but it doesn't.
I've looked over the script for hours but i can't find what i did wrong.

So i've loaded the original script and that too doesn't bar swap?
So now i realy have no idea what to do.

Hopefully you all can and want to help me.

I've included my script witch i've adapted and I used buffy's converter to convert it to a titan 2 script.

===============
Code: Select all
#pragma METAINFO("eso_rot.gpc", 1, 0, "Buffy's GPC Converter v0.27r5")
#include <titanone.gph>
 
 
// GPC Online Library
//Auto press buttons for ESO rotation
/*
 
 
**/
//
//Written by: Eruklaw
//START ON BACK BAR
//Ring of Preservation
//" "
//ENDLESS HAIL
//" "
//LA
//""
//Ritual of retribution
//""
//LA
//""
//WEAPON SWAP
//""
//Power of the light
//" "
//LA
//""
//Beast trap
//""
//LA
//""
//Biting jabs
//" "
//LA
//""
//Biting jabs
//" "
//LA
//""
//Biting jabs
//" "
//LA
//""
//Power of the light
//" "
//LA
//""
//Biting jabs
//""
//LA
//""
//Biting jabs
//" "
//LA
//""
//Biting jabs
//" "
//LA
//""
//Biting jabs
//" "
//LA
//""
//Biting jabs
//" "
//LA
//""
//WEAPON SWAP
//""
//on=FALSE
 
 
#define __LAST_COMBO__ c_eso_rot
#define DISABLE_VM_ // delete underscore to disable VM mode
#ifndef DISABLE_VM
#define VM_TIME 10
#define vm_tctrl(time) ___vm_time___ = (((10+ time) < 0) ? 0 : (10+ time))
#define wait(a) wait(vm_tctrl_wait(a));
#else
#define VM_TIME 0
#endif
 
int on = FALSE;
uint8 __COMBO_RUN__[1];
int8 __io_vals__[38];
uint8 __io_val_events__[38];
uint32 __vm_run_time__ = 0;
uint8 __run_vm__ = 1, ___vm_time___ = VM_TIME, ___i____i;
 
main {
if(__run_vm__) {
if (_event_press(XB1_RIGHT)) {
on = TRUE;
}
if (on) {
combo_run(c_eso_rot);
}
}
}
 
combo c_eso_rot {
wait(400);
set_val(XB1_LB, 100);
wait(400);
set_val(XB1_LB, 0);
wait(400);
set_val(XB1_X, 100);
wait(400);
set_val(XB1_X, 0);
wait(400);
set_val(XB1_RT, 100);
wait(400);
set_val(XB1_RT, 0);
wait(400);
set_val(XB1_B, 100);
wait(400);
set_val(XB1_B, 0);
wait(400);
set_val(XB1_RT, 100);
wait(400);
set_val(XB1_RT, 0);
wait(400);
set_val(XB1_LEFT, 100);
wait(400);
set_val(XB1_LEFT, 0);
wait(400);
set_val(XB1_B, 100);
wait(400);
set_val(XB1_B, 0);
wait(400);
set_val(XB1_RT, 100);
wait(400);
set_val(XB1_RT, 0);
wait(400);
set_val(XB1_Y, 100);
wait(400);
set_val(XB1_Y, 0);
wait(400);
set_val(XB1_RT, 100);
wait(400);
set_val(XB1_RT, 0);
wait(400);
set_val(XB1_X, 100);
wait(400);
set_val(XB1_X, 0);
wait(400);
set_val(XB1_RT, 100);
wait(400);
set_val(XB1_RT, 0);
wait(400);
set_val(XB1_X, 100);
wait(400);
set_val(XB1_X, 0);
wait(400);
set_val(XB1_RT, 100);
wait(400);
set_val(XB1_RT, 0);
wait(400);
set_val(XB1_X, 100);
wait(400);
set_val(XB1_X, 0);
wait(400);
set_val(XB1_RT, 100);
wait(400);
set_val(XB1_RT, 0);
wait(400);
set_val(XB1_B, 100);
wait(400);
set_val(XB1_B, 0);
wait(400);
set_val(XB1_RT, 100);
wait(400);
set_val(XB1_RT, 0);
wait(400);
set_val(XB1_X, 100);
wait(400);
set_val(XB1_X, 0);
wait(400);
set_val(XB1_RT, 100);
wait(400);
set_val(XB1_RT, 0);
wait(400);
set_val(XB1_X, 100);
wait(400);
set_val(XB1_X, 0);
wait(400);
set_val(XB1_RT, 100);
wait(400);
set_val(XB1_RT, 0);
wait(400);
set_val(XB1_X, 100);
wait(400);
set_val(XB1_X, 0);
wait(400);
set_val(XB1_RT, 100);
wait(400);
set_val(XB1_RT, 0);
wait(400);
set_val(XB1_X, 100);
wait(400);
set_val(XB1_X, 0);
wait(400);
set_val(XB1_RT, 100);
wait(400);
set_val(XB1_RT, 0);
wait(400);
set_val(XB1_X, 100);
wait(400);
set_val(XB1_X, 0);
wait(400);
set_val(XB1_RT, 100);
wait(400);
set_val(XB1_RT, 0);
wait(400);
set_val(XB1_LEFT, 100);
wait(400);
set_val(XB1_LEFT, 0);
wait(400);
combo_restart(c_eso_rot);
}
 
 
 
main {
if(__run_vm__) {
__run_vm__ = system_time() >= (__vm_run_time__+ ___vm_time___);
if(__run_vm__) __vm_run_time__ = system_time();
else {
memset( & __io_val_events__[0], 0, 38);
for(___i____i = 0; ___i____i < 38; ++ ___i____i) {
__io_vals__[___i____i] = get_val(___i____i);
}
#ifdef __LAST_COMBO__
for(___i____i = 0; ___i____i < sizeof(__COMBO_RUN__); ++ ___i____i) {
if(__LAST_COMBO__[(___i____i * 3) + ___i____i]) {
__LAST_COMBO__[(___i____i * 3) + ___i____i] = 0;
__COMBO_RUN__[___i____i] = 1;
}
}
#endif
}
}
else {
for(___i____i = 0; ___i____i < 38; ++ ___i____i) {
set_val(___i____i, __io_vals__[___i____i]);
if(event_press(___i____i)) __io_val_events__[___i____i] = 1;
if(event_release(___i____i)) __io_val_events__[___i____i] = 3;
}
if(system_time() >= (__vm_run_time__+ ___vm_time___)) {
__run_vm__ = 1; __vm_run_time__ = system_time();
#ifdef __LAST_COMBO__
for(___i____i = 0; ___i____i < sizeof(__COMBO_RUN__); ++ ___i____i) {
if(__COMBO_RUN__[___i____i]) {
__LAST_COMBO__[(___i____i * 3) + ___i____i] = 1;
__COMBO_RUN__[___i____i] = 0;
}
}
#endif
}
}
}
 
 
int vm_tctrl_wait(int num) {
return ___vm_time___ ? ((num / ___vm_time___) + ((num % ___vm_time___) ? 1 : 0)) : num;
}
 
bool _event_press(uint8 io) {
return event_press(io) || __io_val_events__[io] == 1;
}
 
bool _event_release(uint8 io) {
return event_release(io) || __io_val_events__[io] == 3;
}
User avatar
Eruklaw
Private First Class
Private First Class
 
Posts: 3
Joined: Wed Mar 11, 2020 3:39 pm

Re: Script is working but not

Postby Mad » Sat Mar 14, 2020 8:07 pm

You could try reducing the wait times in the combo from 400ms to 100ms.

If you still run into issues you could record a macro: https://www.consoletuner.com/wiki/index ... _interface
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: Script is working but not

Postby Eruklaw » Sat Mar 14, 2020 9:38 pm

Thnx for the response Mad. I'll try that tomorrow.
User avatar
Eruklaw
Private First Class
Private First Class
 
Posts: 3
Joined: Wed Mar 11, 2020 3:39 pm

Re: Script is working but not

Postby Eruklaw » Mon Mar 16, 2020 8:59 pm

It workt MAD. Thnx. Now i only have to work on my timings. Haha
User avatar
Eruklaw
Private First Class
Private First Class
 
Posts: 3
Joined: Wed Mar 11, 2020 3:39 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 86 guests