Posting Code into Forum Topics
Posted: Wed Jun 22, 2016 4:26 pm
I have recently seen a lot of people posting code directly into topics. The code is more difficult to read, follow and it loses the GPC scripting format when you copy and paste it. Below is an example of how the code looks using both methods.
Copying and pasting code using the "GPC Code" option
Copying and pasting directly into the topic.
define TURBO_BUTTON = PS4_CIRCLE;
int doubletap_stage = 0;
int doubletap_timing;
int turbo_toggle = FALSE;
main {
if(doubletap_stage == 0) {
if(get_val(TURBO_BUTTON)) doubletap_stage = 1;
} else if(doubletap_stage == 1) {
if(!get_val(TURBO_BUTTON)) { doubletap_timing = 0; doubletap_stage = 2; }
} else if(doubletap_stage == 2) {
if(get_val(TURBO_BUTTON)) { doubletap_stage = 1; turbo_toggle = !turbo_toggle; }
doubletap_timing = doubletap_timing + get_rtime();
if(doubletap_timing > 100) doubletap_stage = 0;
}
if(turbo_toggle) {
combo_run(TurboButton);
}
}
combo TurboButton {
set_val(TURBO_BUTTON, 100);
wait(40);
set_val(TURBO_BUTTON, 0);
wait(30);
set_val(TURBO_BUTTON, 0);
}
Please notice that the indentation is completely removed when you directly post in the topic.
This is Quick Reply, which is great for quick textual replies. If you want to do more, you have to use "POSTREPLY" or use "Full Editor" from the Quick Reply box.
You must use "POSTREPLY" or "Full Editor" in order to use full posting options including "GPC Code".
Here are all options available when using "POSTREPLY" or "Full Editor"
Here are the steps to post code directly into a topic using the "GPC Code" option.
1. Click "POSTREPLY" button or
1. Click "Quick Reply" button and then click "Full Editor"
2. Type in your message.
3. Place cursor where you want to paste code
4. Click "GPC Code" button
5. Paste your code
NOTE: To post code correctly, your cursor MUST be between the brackets and shown below.
Copying and pasting code using the "GPC Code" option
- Code: Select all
define TURBO_BUTTON = PS4_CIRCLE;
int doubletap_stage = 0;
int doubletap_timing;
int turbo_toggle = FALSE;
main {
if(doubletap_stage == 0) {
if(get_val(TURBO_BUTTON)) doubletap_stage = 1;
} else if(doubletap_stage == 1) {
if(!get_val(TURBO_BUTTON)) { doubletap_timing = 0; doubletap_stage = 2; }
} else if(doubletap_stage == 2) {
if(get_val(TURBO_BUTTON)) { doubletap_stage = 1; turbo_toggle = !turbo_toggle; }
doubletap_timing = doubletap_timing + get_rtime();
if(doubletap_timing > 100) doubletap_stage = 0;
}
if(turbo_toggle) {
combo_run(TurboButton);
}
}
combo TurboButton {
set_val(TURBO_BUTTON, 100);
wait(40);
set_val(TURBO_BUTTON, 0);
wait(30);
set_val(TURBO_BUTTON, 0);
}
Copying and pasting directly into the topic.
define TURBO_BUTTON = PS4_CIRCLE;
int doubletap_stage = 0;
int doubletap_timing;
int turbo_toggle = FALSE;
main {
if(doubletap_stage == 0) {
if(get_val(TURBO_BUTTON)) doubletap_stage = 1;
} else if(doubletap_stage == 1) {
if(!get_val(TURBO_BUTTON)) { doubletap_timing = 0; doubletap_stage = 2; }
} else if(doubletap_stage == 2) {
if(get_val(TURBO_BUTTON)) { doubletap_stage = 1; turbo_toggle = !turbo_toggle; }
doubletap_timing = doubletap_timing + get_rtime();
if(doubletap_timing > 100) doubletap_stage = 0;
}
if(turbo_toggle) {
combo_run(TurboButton);
}
}
combo TurboButton {
set_val(TURBO_BUTTON, 100);
wait(40);
set_val(TURBO_BUTTON, 0);
wait(30);
set_val(TURBO_BUTTON, 0);
}
Please notice that the indentation is completely removed when you directly post in the topic.
This is Quick Reply, which is great for quick textual replies. If you want to do more, you have to use "POSTREPLY" or use "Full Editor" from the Quick Reply box.
You must use "POSTREPLY" or "Full Editor" in order to use full posting options including "GPC Code".
Here are all options available when using "POSTREPLY" or "Full Editor"
Here are the steps to post code directly into a topic using the "GPC Code" option.
1. Click "POSTREPLY" button or
1. Click "Quick Reply" button and then click "Full Editor"
2. Type in your message.
3. Place cursor where you want to paste code
4. Click "GPC Code" button
5. Paste your code
NOTE: To post code correctly, your cursor MUST be between the brackets and shown below.