stuck on something agian
9 posts
• Page 1 of 1
stuck on something agian
Hey Im stuck on trying to end a switch multuple ways, if i dont add that line script works
Any idea how to fix that, thanks
- Code: Select all
#pragma METAINFO("<author_name>", 1, 0, "")
#include <keyboard.gph>
#define R_BUMPER BUTTON_4
#define FIRE_BUTTON BUTTON_5
#define RS_TAP BUTTON_6
#define L_BUMPER BUTTON_7
#define ADS_BUTTON BUTTON_8
#define SPRINT_BUTTON BUTTON_9
#define DUP BUTTON_10
#define DDOWN BUTTON_11
#define DLEFT BUTTON_12
#define DRIGHT BUTTON_13
#define SWITCH_BUTTON BUTTON_14
#define B_BUTTON BUTTON_15
#define JUMP_BUTTON BUTTON_16
#define RELOAD_BUTTON BUTTON_17
#define L_STICK_X STICK_2_X
#define L_STICK_Y STICK_2_Y
#define R_STICK_X STICK_1_X
#define R_STICK_Y STICK_1_Y
#define or ||
bool SHOTIES;
bool bumper_switch;
main {
//LS JUMPS
if(event_active(DLEFT) && time_release(DLEFT) < 300) {
SHOTIES = !SHOTIES;
}
if(SHOTIES) {
if(event_release(FIRE_BUTTON)) {
bumper_switch = !bumper_switch;
}
}
if(bumper_switch && event_release(FIRE_BUTTON)) {
combo_run(right_bumper);
}
if(!bumper_switch && event_release(FIRE_BUTTON)) {
combo_run(left_bumper);
}
if(event_active(Y_BUTTON) or event_active(B_BUTTON) or event_active(R_BUMPER) or event_active(L_BUMPER)){ //<<--this is giving me an error why
SHOTIES = FALSE;
}
}
combo right_bumper
{
// wait(40);
set_val(L_BUMPER, 100.0);
wait(30);
}
combo left_bumper
{
// wait(40);
set_val(R_BUMPER, 100.0);
wait(30);
}
combo EasyJump {
set_val(BUTTON_16, 100.0);
wait(120);
set_val(BUTTON_16, 0.0);
wait(420);
}
Any idea how to fix that, thanks
-
alencroat - Lieutenant
- Posts: 320
- Joined: Sun Oct 15, 2017 5:58 pm
Re: stuck on something agian
- Code: Select all
#pragma METAINFO("<author_name>", 1, 0, "")
#include <keyboard.gph>
#define R_BUMPER BUTTON_4
#define FIRE_BUTTON BUTTON_5
#define RS_TAP BUTTON_6
#define L_BUMPER BUTTON_7
#define ADS_BUTTON BUTTON_8
#define SPRINT_BUTTON BUTTON_9
#define DUP BUTTON_10
#define DDOWN BUTTON_11
#define DLEFT BUTTON_12
#define DRIGHT BUTTON_13
#define Y_BUTTON BUTTON_14
#define B_BUTTON BUTTON_15
#define JUMP_BUTTON BUTTON_16
#define RELOAD_BUTTON BUTTON_17
#define L_STICK_X STICK_2_X
#define L_STICK_Y STICK_2_Y
#define R_STICK_X STICK_1_X
#define R_STICK_Y STICK_1_Y
#define or ||
bool SHOTIES;
bool bumper_switch;
main {
//LS JUMPS
if(event_active(DLEFT) && time_release(DLEFT) < 300) {
SHOTIES = !SHOTIES;
}
if(SHOTIES) {
if(event_release(FIRE_BUTTON)) {
bumper_switch = !bumper_switch;
}
}
if(bumper_switch && event_release(FIRE_BUTTON)) {
combo_run(right_bumper);
}
if(!bumper_switch && event_release(FIRE_BUTTON)) {
combo_run(left_bumper);
}
if(event_active(Y_BUTTON) || event_active(B_BUTTON) || event_active(R_BUMPER) ||
event_active(L_BUMPER)){
SHOTIES = FALSE;
}
}
combo right_bumper
{
// wait(40);
set_val(L_BUMPER, 100.0);
wait(30);
}
combo left_bumper
{
// wait(40);
set_val(R_BUMPER, 100.0);
wait(30);
}
combo EasyJump {
set_val(BUTTON_16, 100.0);
wait(120);
set_val(BUTTON_16, 0.0);
wait(420);
}
- bonefisher
- Lieutenant General
- Posts: 5413
- Joined: Thu Jan 29, 2015 10:49 am
Re: stuck on something agian
Y_BUTTON is not defined, add to your code:
- Code: Select all
#define Y_BUTTON BUTTON_14
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
Re: stuck on something agian
heheh oh wow, ty ty
-
alencroat - Lieutenant
- Posts: 320
- Joined: Sun Oct 15, 2017 5:58 pm
Re: stuck on something agian
hmm I just cant get to have this to work J2KBr, Im working on like version 5 or 6 on building like a pro script, so this script you gave me once for shotguns is pretty close to what I need I'll post example here:
So what I need is a script that when I press : if(event_active(DLEFT) && time_release(DLEFT) < 300) {
It will activate a swith the switch will do the following:
when I hit RT and (after I release) RT it goes to combo 1, press LB once
when I hit RT and (after I release) RT then goes to combo 2 which is RB
And end the switch in multiple ways by hitting buttons Y or B pr LB or RB.
Im gona keep searching online, as if I have had seen or have heped on something very similar to what I'm looking for.
Please ask me if Im confusing I can explain the best I can
- Code: Select all
#pragma METAINFO("<author_name>", 1, 0, "")
#pragma METAINFO("<author_name>", 1, 0, "")
#define R_BUMPER BUTTON_4
#define FIRE_BUTTON BUTTON_5
#define RS_TAP BUTTON_6
#define L_BUMPER BUTTON_7
#define ADS_BUTTON BUTTON_8
#define SPRINT_BUTTON BUTTON_9
#define DUP BUTTON_10
#define DDOWN BUTTON_11
#define DLEFT BUTTON_12
#define DRIGHT BUTTON_13
#define SWITCH_BUTTON BUTTON_14
#define CROUCH_BUTTON BUTTON_15
#define JUMP_BUTTON BUTTON_16
#define RELOAD_BUTTON BUTTON_17
#define L_STICK_X STICK_2_X
#define L_STICK_Y STICK_2_Y
#define R_STICK_X STICK_1_X
#define R_STICK_Y STICK_1_Y
bool SHOTIES;
bool runauto = TRUE;
bool bumper_switch;
bool run_flag;
bool norapidfire;
bool toggle;
bool event_flag;
main {
//on release RT the combos switch
if(event_active(RELOAD_BUTTON) && time_release(RELOAD_BUTTON) < 150) {
SHOTIES = !SHOTIES;
}
if(SHOTIES) {
set_val(FIRE_BUTTON, 0.0);
if(get_actual(FIRE_BUTTON) && time_active(FIRE_BUTTON) < 400) {
combo_run(rapid_fire);
}
if(event_active(FIRE_BUTTON)) {
bumper_switch = !bumper_switch;
}
if(bumper_switch && event_active(FIRE_BUTTON)) {
combo_run(right_bumper);
}
if(!bumper_switch && event_active(FIRE_BUTTON)) {
combo_run(left_bumper);
}
}
}
combo rapid_fire //no need to worry about rapid fire here
{
set_val(BUTTON_5, 100.0);
wait(40);
set_val(BUTTON_5, 0.0);
wait(40);
set_val(BUTTON_5, 0.0);
}
combo right_bumper
{
wait(550);
set_val(BUTTON_4, 100.0);
wait(200);
}
combo left_bumper
{
wait(550);
set_val(BUTTON_7, 100.0);
wait(200);
}
So what I need is a script that when I press : if(event_active(DLEFT) && time_release(DLEFT) < 300) {
It will activate a swith the switch will do the following:
when I hit RT and (after I release) RT it goes to combo 1, press LB once
when I hit RT and (after I release) RT then goes to combo 2 which is RB
And end the switch in multiple ways by hitting buttons Y or B pr LB or RB.
Im gona keep searching online, as if I have had seen or have heped on something very similar to what I'm looking for.
Please ask me if Im confusing I can explain the best I can
-
alencroat - Lieutenant
- Posts: 320
- Joined: Sun Oct 15, 2017 5:58 pm
Re: stuck on something agian
EDIT: OK its close to this:
So just with this one the switch is always on,
this one also does what its supoosed to but its always on and i cant adjsut the wait times for button 4 and 7 to be pressed
- Code: Select all
bool bumper_switch = FALSE;
main {
// set_val(BUTTON_5, 0.0);
if(event_active(DLEFT) && time_release(DLEFT) < 300) {
bumper_switch = !bumper_switch;
}
if(bumper_switch && event_release(BUTTON_5)) {
combo_run(right_bumper);
}
//these 2 combos have to keep changing, everytime I relase RT(button5)
if(!bumper_switch && event_release(BUTTON_5)) {
combo_run(left_bumper);
}
}
combo right_bumper
{
wait(40);
set_val(BUTTON_4, 100.0);
wait(30);
}
combo left_bumper
{
wait(40);
set_val(BUTTON_7, 100.0);
wait(30);
}
So just with this one the switch is always on,
this one also does what its supoosed to but its always on and i cant adjsut the wait times for button 4 and 7 to be pressed
-
alencroat - Lieutenant
- Posts: 320
- Joined: Sun Oct 15, 2017 5:58 pm
Re: stuck on something agian
Ok so after hours of trying to figure out just what the hells going on lol, stumbled on this and it works as i need it to be, but i wonder if its stressing the code or if the code is wayyy bigger then its supposed to be. Take a look please and let me know.
- Code: Select all
#pragma METAINFO("<author_name>", 1, 0, "")
#define R_BUMPER BUTTON_4
#define FIRE_BUTTON BUTTON_5
#define RS_TAP BUTTON_6
#define L_BUMPER BUTTON_7
#define ADS_BUTTON BUTTON_8
#define SPRINT_BUTTON BUTTON_9
#define DUP BUTTON_10
#define DDOWN BUTTON_11
#define DLEFT BUTTON_12
#define DRIGHT BUTTON_13
#define Y_BUTTON BUTTON_14
#define B_BUTTON BUTTON_15
#define JUMP_BUTTON BUTTON_16
#define RELOAD_BUTTON BUTTON_17
#define L_STICK_X STICK_2_X
#define L_STICK_Y STICK_2_Y
#define R_STICK_X STICK_1_X
#define R_STICK_Y STICK_1_Y
#define or ||
bool SHOTIES = FALSE;
bool bumper_switch = TRUE;
main {
if(event_active(DLEFT) && time_release(DLEFT) < 300) {
SHOTIES = !SHOTIES;
}
if(SHOTIES) {
if(event_release(FIRE_BUTTON)) {
bumper_switch = !bumper_switch;
}
}
if(SHOTIES && bumper_switch && event_release(FIRE_BUTTON)) {
combo_run(left_bumper);
}
if(SHOTIES && !bumper_switch && event_release(FIRE_BUTTON)) {
combo_run(right_bumper);
}
if(event_active(Y_BUTTON) || event_active(B_BUTTON) || event_active(R_BUMPER) ||
event_active(L_BUMPER)){
SHOTIES = FALSE;
}
}
combo right_bumper
{
// wait(40);
set_val(L_BUMPER, 100.0);
wait(30);
}
combo left_bumper
{
// wait(40);
set_val(R_BUMPER, 100.0);
wait(30);
}
-
alencroat - Lieutenant
- Posts: 320
- Joined: Sun Oct 15, 2017 5:58 pm
Re: stuck on something agian
Hope this still works:
- Code: Select all
//#pragma METAINFO("<author_name>", 1, 0, "") // <<<<-------- wrong way around !
#pragma METAINFO("script name", 1, 0, "author_name") // <<<<-------- this is correct
#define R_BUMPER BUTTON_4
#define FIRE_BUTTON BUTTON_5
#define RS_TAP BUTTON_6
#define L_BUMPER BUTTON_7
#define ADS_BUTTON BUTTON_8
#define SPRINT_BUTTON BUTTON_9
#define DUP BUTTON_10
#define DDOWN BUTTON_11
#define DLEFT BUTTON_12
#define DRIGHT BUTTON_13
#define Y_BUTTON BUTTON_14
#define B_BUTTON BUTTON_15
#define JUMP_BUTTON BUTTON_16
#define RELOAD_BUTTON BUTTON_17
#define L_STICK_X STICK_2_X
#define L_STICK_Y STICK_2_Y
#define R_STICK_X STICK_1_X
#define R_STICK_Y STICK_1_Y
#define or ||
bool SHOTIES = FALSE;
bool bumper_switch = TRUE;
main {
if(event_active(DLEFT) && time_release(DLEFT) < 300) {
SHOTIES = !SHOTIES;
}
if(SHOTIES) {
if(event_release(FIRE_BUTTON)) {
bumper_switch = !bumper_switch;
if(bumper_switch) {
combo_run(left_bumper);
} else {
combo_run(right_bumper);
}
}
if(event_active(Y_BUTTON) || event_active(B_BUTTON) || event_active(R_BUMPER) ||
event_active(L_BUMPER)){
SHOTIES = FALSE;
}
} // end of SHOTIES TRUE
}
combo right_bumper
{
// wait(40);
set_val(L_BUMPER, 100.0);
wait(30);
}
combo left_bumper
{
// wait(40);
set_val(R_BUMPER, 100.0);
wait(30);
}
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
Re: stuck on something agian
ty about to test it hehe staying up later tonight, got allot of projects in mind I wana try
ty works very good, I gonna save it too
ty works very good, I gonna save it too
-
alencroat - Lieutenant
- Posts: 320
- Joined: Sun Oct 15, 2017 5:58 pm
9 posts
• Page 1 of 1
Return to GPC2 Script Programming
Who is online
Users browsing this forum: No registered users and 74 guests