Posting Code into Forum Topics
8 posts
• Page 1 of 1
Posting Code into Forum Topics
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.
-
UK_Wildcats - Brigadier General
- Posts: 2243
- Joined: Thu Jan 08, 2015 6:53 pm
Re: Posting Code into Forum Topics
Great sticky!
- bonefisher
- Lieutenant General
- Posts: 5413
- Joined: Thu Jan 29, 2015 10:49 am
Re: Posting Code into Forum Topics
Thank you. I wanted to make it easier for people to post code without losing the formating and making for long posts.
-
UK_Wildcats - Brigadier General
- Posts: 2243
- Joined: Thu Jan 08, 2015 6:53 pm
Re: Posting Code into Forum Topics
Great idea, took me a few posts to get it right. Some of them become really hard to read. Should help people out a lot.
-
The_Rabid_Taco - Major
- Posts: 1066
- Joined: Wed Mar 16, 2016 6:04 pm
- Location: Pensacola, FL
Re: Posting Code into Forum Topics
- Code: Select all
Thank you
-
Massacre - Sergeant Major
- Posts: 95
- Joined: Wed Jul 06, 2016 1:55 am
- Location: Oklahoma
Re: Posting Code into Forum Topics
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20322
- Joined: Tue Mar 18, 2014 1:39 pm
-
UK_Wildcats - Brigadier General
- Posts: 2243
- Joined: Thu Jan 08, 2015 6:53 pm
8 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 4 guests