How can I monitor if switch is on
3 posts
• Page 1 of 1
How can I monitor if switch is on
I have got this code in and I would like to monitor my switch if its (ON/OFF) in the Device monitor. kinda like tracking anything for example buton 5/RT.. Im guessing the combo would be assigned to new buttons I think button 18? I seen something like that before but still no idea what im doing. Thanks!
- Code: Select all
bool preciseAR= FALSE;
main {
//PRECISE AR SHOOTING
if(event_release(DDOWN)) {
preciseAR = !preciseAR;
}
if(preciseAR == TRUE) {
if(is_active(ADS_BUTTON)){
set_val(ADS_BUTTON, 0.0);
combo_run(preciseAR2);
}
if (event_active(Y_BUTTON)){
preciseAR = FALSE;
}
}
if(get_val(DDOWN)) {
set_val(DDOWN, 0.0); // <<-- Also i didnt know where to add that above ^^
}
combo preciseAR2 {
set_val(ADS_BUTTON, 100);
wait(240);
BUTTON, 100);
set_val(ADS_BUTTON, 100);
set_val(FIRE_BUTTON, 100);
wait(30);
wait(200);
}
-
alencroat - Lieutenant
- Posts: 320
- Joined: Sun Oct 15, 2017 5:58 pm
Re: How can I monitor if switch is on
- Code: Select all
#define DDOWN BUTTON_11
#define Y_BUTTON BUTTON_14
#define ADS_BUTTON BUTTON_8
#define FIRE_BUTTON BUTTON_5
bool preciseAR;
main {
set_val(DDOWN, 0);
//----
if(event_release(DDOWN)) { preciseAR = !preciseAR; }
//----
if(preciseAR == TRUE) {
if(is_active(ADS_BUTTON)) { combo_run(preciseAR2); set_val(ADS_BUTTON, 0); }
if(event_active(Y_BUTTON)) preciseAR = FALSE;
}
//----
}
combo preciseAR2 {
set_val(ADS_BUTTON, 100); wait(240);
//----
set_val(ADS_BUTTON, 100); set_val(FIRE_BUTTON, 100); wait(30);
//----
wait(200);
//----
}
main {
//-- This is your toggle monitor
set_val(BUTTON_18, preciseAR);
//-- BUTTON_18 will turn green only when preciseAR is active.
}
-
Sillyasskid - Captain
- Posts: 574
- Joined: Sat May 14, 2016 3:07 am
Re: How can I monitor if switch is on
nice ty ty
-
alencroat - Lieutenant
- Posts: 320
- Joined: Sun Oct 15, 2017 5:58 pm
3 posts
• Page 1 of 1
Return to GPC2 Script Programming
Who is online
Users browsing this forum: midg3t2 and 209 guests