Noah
Noah
CC#
Created by xxsupahbakedxx on 2/12/2023 in #help
❔ Need some help fixing this simple if statement
foreach (var entry in randomized)
{
var theblock = entry.FatBlock;
var blockname = "NULL";
var displayname = "NULL";

blockname = StatusAndLogDisplay.BlockName(entry);
try
{
// code to get the display name of the block
}
catch
{
}

if (blockname.Contains("Armory") || blockname.Contains("Proficient") || blockname.Contains("Enhanced") || blockname.Contains("Exotic") || blockname.Contains("Elite") || blockname.Contains("Nanovirus") || blockname.Contains("Lockers") || blockname.Contains("Freight"))
{
// Blocks to grind if GrindTech is on
if (GrindTech == "Y")
{
lastground = displayname; // Store the name of the block that was successfully ground
_Program.Echo("Grind: " + displayname);
groupData.RepairSystems.CurrentPickedGrindTarget = entry;
break;
}
}
else if (blockname.Contains("Beacon"))
{
// Blocks to be ground if GrindBeacon is on
if (GrindBeacon == "Y")
{
lastground = displayname; // Store the name of the block that was successfully ground
_Program.Echo("Grind: " + displayname);
groupData.RepairSystems.CurrentPickedGrindTarget = entry;
break;
}
}
else if ((blockname.Contains("Glowing") || blockname.Contains("Tritanium") || !blockname.Contains("Armor")))
{
// Blocks to be ground if GrindAll is on
if (GrindAll=="Y")
{
lastground = displayname; // Store the name of the block that was successfully ground
_Program.Echo("Grind: " + displayname);
groupData.RepairSystems.CurrentPickedGrindTarget = entry;
break;
}
}
else if ((blockname.Contains("AQD") || blockname.Contains("CubeBlock")))
{
// Blocks to be ignored if GrindAll is on
if (GrindAll=="Y")
{
continue;
}
}
}

_Program.Echo("");
_Program.Echo("Grind Ignored: " + count.ToString() + " Blocks");
_Program.Echo("");
_Program.Echo("Last Ground: " + lastground); // Echo the name of the last ground block
foreach (var entry in randomized)
{
var theblock = entry.FatBlock;
var blockname = "NULL";
var displayname = "NULL";

blockname = StatusAndLogDisplay.BlockName(entry);
try
{
// code to get the display name of the block
}
catch
{
}

if (blockname.Contains("Armory") || blockname.Contains("Proficient") || blockname.Contains("Enhanced") || blockname.Contains("Exotic") || blockname.Contains("Elite") || blockname.Contains("Nanovirus") || blockname.Contains("Lockers") || blockname.Contains("Freight"))
{
// Blocks to grind if GrindTech is on
if (GrindTech == "Y")
{
lastground = displayname; // Store the name of the block that was successfully ground
_Program.Echo("Grind: " + displayname);
groupData.RepairSystems.CurrentPickedGrindTarget = entry;
break;
}
}
else if (blockname.Contains("Beacon"))
{
// Blocks to be ground if GrindBeacon is on
if (GrindBeacon == "Y")
{
lastground = displayname; // Store the name of the block that was successfully ground
_Program.Echo("Grind: " + displayname);
groupData.RepairSystems.CurrentPickedGrindTarget = entry;
break;
}
}
else if ((blockname.Contains("Glowing") || blockname.Contains("Tritanium") || !blockname.Contains("Armor")))
{
// Blocks to be ground if GrindAll is on
if (GrindAll=="Y")
{
lastground = displayname; // Store the name of the block that was successfully ground
_Program.Echo("Grind: " + displayname);
groupData.RepairSystems.CurrentPickedGrindTarget = entry;
break;
}
}
else if ((blockname.Contains("AQD") || blockname.Contains("CubeBlock")))
{
// Blocks to be ignored if GrindAll is on
if (GrindAll=="Y")
{
continue;
}
}
}

_Program.Echo("");
_Program.Echo("Grind Ignored: " + count.ToString() + " Blocks");
_Program.Echo("");
_Program.Echo("Last Ground: " + lastground); // Echo the name of the last ground block
12 replies
CC#
Created by xxsupahbakedxx on 2/12/2023 in #help
❔ Need some help fixing this simple if statement
@Connolly assign the displayname variable to lastground after the successful grind. Then, Echo the lastground variable to display the name of the last ground block.
12 replies
CC#
Created by Kerruan on 2/12/2023 in #help
❔ impressC910 shifting position in output tray
@Kerruan
int pageCount = 0;
int pagesPerOffset = 5;
float jogOffset = 0.125f;

PrintDocument document = new PrintDocument();
document.PrintController = new StandardPrintController();
document.PrintPage += (sender, args) => {
// Draw the content for this page
pageCount++;
if (pageCount % pagesPerOffset == 0) {
string offsetCommand = string.Format("\x1B[{0:F2}in", jogOffset);
SendStringToPrinter(document.PrinterSettings.PrinterName, offsetCommand, 1);
}
args.HasMorePages = pageCount < 20; // set to false when done printing
};

document.Print();
int pageCount = 0;
int pagesPerOffset = 5;
float jogOffset = 0.125f;

PrintDocument document = new PrintDocument();
document.PrintController = new StandardPrintController();
document.PrintPage += (sender, args) => {
// Draw the content for this page
pageCount++;
if (pageCount % pagesPerOffset == 0) {
string offsetCommand = string.Format("\x1B[{0:F2}in", jogOffset);
SendStringToPrinter(document.PrinterSettings.PrinterName, offsetCommand, 1);
}
args.HasMorePages = pageCount < 20; // set to false when done printing
};

document.Print();
3 replies
CC#
Created by Daniela ♡ on 2/12/2023 in #help
❔ c# basics
DM me i'm trying to help. Going to sleep soon
34 replies
CC#
Created by Daniela ♡ on 2/12/2023 in #help
❔ c# basics
@♡ Daniela ♡ what exactly do you want to know
34 replies
CC#
Created by cgxlm on 2/12/2023 in #help
❔ Error Provider Windows Forms
Could you give more details about the issue you're experiencing?
14 replies
CC#
Created by cgxlm on 2/12/2023 in #help
❔ Error Provider Windows Forms
U allready do
14 replies
CC#
Created by cgxlm on 2/12/2023 in #help
❔ Error Provider Windows Forms
Wait
14 replies
CC#
Created by cgxlm on 2/12/2023 in #help
❔ Error Provider Windows Forms
errorPassword.SetError(txtPassword, "Password is incorrect");
errorPassword.SetError(txtPassword, "Password is incorrect");
14 replies
CC#
Created by cgxlm on 2/12/2023 in #help
❔ Error Provider Windows Forms
@cgxlm Your code looks mostly correct, but you need to set the error message to an empty string when the password is correct.
14 replies
CC#
Created by postReality on 2/12/2023 in #help
❔ Help with Dictionary<string,string>
@chowder Use a for loop to iterate over each character in the input string. For each character, use the dictionary's get() method to retrieve the corresponding value, and then use the remove() and insert() methods to replace the character with the value. Finally, print the modified string.
5 replies
CC#
Created by Oli on 12/25/2022 in #help
❔ Need some help with logic
No?🤔
49 replies
CC#
Created by Oli on 12/25/2022 in #help
❔ Need some help with logic
<a:CH_ShiroPat:970610996425142342>
49 replies
CC#
Created by Oli on 12/25/2022 in #help
❔ Need some help with logic
Here are a few things you could try to make the total attack and defence statistics equal to 35:
1: Instead of generating random attack and defence scores for each player, you could try setting the attack and defence scores manually. For example, you could divide the 35 points evenly among the 6 players, giving each player 5 attack points and 5 defence points. This would ensure that the total attack and defence scores are always equal to 35.

2:
If you want to keep the random element in the game, you could try changing the way you generate the random attack and defence scores. Currently, you are using the "Random" class to generate random numbers between 0 and 10 for attack and between 0 and 7 for defence. You could try adjusting the range of the random numbers to make it more likely that the total attack and defence scores will be equal to 35.

3:
You could also try using a different approach to ensure that the total attack and defence scores are equal to 35. For example, you could generate random attack and defence scores for each player as you are doing currently, but then keep track of the total attack and defence scores. If the total attack and defence scores are not equal to 35, you could adjust the scores for one or more players until the total is equal to 35.
1: Instead of generating random attack and defence scores for each player, you could try setting the attack and defence scores manually. For example, you could divide the 35 points evenly among the 6 players, giving each player 5 attack points and 5 defence points. This would ensure that the total attack and defence scores are always equal to 35.

2:
If you want to keep the random element in the game, you could try changing the way you generate the random attack and defence scores. Currently, you are using the "Random" class to generate random numbers between 0 and 10 for attack and between 0 and 7 for defence. You could try adjusting the range of the random numbers to make it more likely that the total attack and defence scores will be equal to 35.

3:
You could also try using a different approach to ensure that the total attack and defence scores are equal to 35. For example, you could generate random attack and defence scores for each player as you are doing currently, but then keep track of the total attack and defence scores. If the total attack and defence scores are not equal to 35, you could adjust the scores for one or more players until the total is equal to 35.
49 replies
CC#
Created by Oli on 12/25/2022 in #help
❔ Need some help with logic
Okay what exactly do you want to do
49 replies
CC#
Created by Oli on 12/25/2022 in #help
❔ Need some help with logic
@haakonseni don't see any code when i open the link
49 replies
CC#
Created by AtomicLiquid on 12/25/2022 in #help
✅ Dapper InsertAsync fails on Postgres with relation does not exist
Good luck with your project!
20 replies
CC#
Created by AtomicLiquid on 12/25/2022 in #help
✅ Dapper InsertAsync fails on Postgres with relation does not exist
<a:CH_ShiroPat:970610996425142342>
20 replies
CC#
Created by AtomicLiquid on 12/25/2022 in #help
✅ Dapper InsertAsync fails on Postgres with relation does not exist
There are a few different ways you could implement a configuration option to allow users to specify the case sensitivity of their database. Here are a couple of options:
1:
Use a configuration file: You can create a configuration file that users can edit to specify the case sensitivity of their database. For example, you could create an appsettings.json file that contains a setting for the case sensitivity of the database. Users could then edit the file to specify whether the database is case-sensitive or case-insensitive.

2:
Use a command-line argument: You can also allow users to specify the case sensitivity of their database using a command-line argument when starting your tool. For example, you could use the following syntax:
1:
Use a configuration file: You can create a configuration file that users can edit to specify the case sensitivity of their database. For example, you could create an appsettings.json file that contains a setting for the case sensitivity of the database. Users could then edit the file to specify whether the database is case-sensitive or case-insensitive.

2:
Use a command-line argument: You can also allow users to specify the case sensitivity of their database using a command-line argument when starting your tool. For example, you could use the following syntax:
mytool.exe --case-sensitive
mytool.exe --case-sensitive
3:
Use a configuration API: If your tool is a .NET application, you can also use the .NET Configuration API to allow users to specify the case sensitivity of their database. This API provides a flexible way to read and write configuration data from various sources, such as configuration files, environment variables, and command-line arguments.
3:
Use a configuration API: If your tool is a .NET application, you can also use the .NET Configuration API to allow users to specify the case sensitivity of their database. This API provides a flexible way to read and write configuration data from various sources, such as configuration files, environment variables, and command-line arguments.
Regardless of the approach you choose, you will need to update your code to use the case sensitivity setting when generating Dapper queries. You can use the [Table] and [Column] attributes to specify the exact case of your database objects based on the case sensitivity setting.
20 replies
CC#
Created by AtomicLiquid on 12/25/2022 in #help
✅ Dapper InsertAsync fails on Postgres with relation does not exist
You're welcome! I'm glad that I could help. Using the [Column] attribute to specify the exact case of your database objects is generally the recommended approach when working with Dapper. This will help to ensure that your queries are executed correctly and that the results are mapped to the correct properties in your .NET objects, regardless of the underlying database engine. Using a consistent naming convention, such as camelCase, can also make your code easier to read and maintain. However, keep in mind that you may still need to consider the case sensitivity of your database objects when switching between different database engines. Some database engines, such as MySQL, are case-insensitive by default, while others, such as PostgreSQL, are case-sensitive. If you do decide to use camelCase for your database objects, you may want to consider adding a configuration option to your tool that allows users to specify the case sensitivity of their database. This will give users the flexibility to choose the naming convention that works best for them and their database environment.
20 replies