Post by nathanmyersc on Feb 1, 2024 3:05:07 GMT
I created an intention repeater in c++ that searches the intention you type for a object to charge or image to charge if it finds one and you are imbuing the item with an INTENTIONS.txt
It will read each line of that intentions.txt affirming the object is charged with the intentions of each individual intention in intentions.txt
If it doesnt detect the word Charged then it presumes currently that the benificiary is me and reads each line of INTENTIONS.txt with the foreword of my name recieving the intentions i dont recall how i worded it atm.
I think its a cool take on things. not sure if any of your programs actually read the lines of the text file as affirmations to the charged object or person. its a good idea i think.
Its highly beta but here it is for anyone who has a c++ compiler.
"Satans Bane.jpg" is Charged with the intentions of "INTENTIONS.txt" is how i operate it currently.
The program will detect that Satans Bane.jpg is the object of charging. and that INTENTIONS.txt are the intentions.
It iterates overy every line of INTENTIONS.txt intending it to go charge Satans Bane.jpg in my example.
There is a iteration counter. But much slower iterations than your model as it is reading the entire INTENTIONS document of text every loop.
Im sure il find more ways to improve it ecetera.
It looks for a certain list of keywords
Charged charged imbued Imbued
will mean that the charged object preceeds it
Charging charging Imbuing imbuing imbues and Imbues
will mean that the charged object proceeds it.
Use accordingly.
AKA
"INTENTIONS.txt is charging "PERSON A" with its affirmations.
or "PERSON A" is charged with the affirmations within "INTENTIONS.txt"
QOUTATIONS are mandatory.
It will read each line of that intentions.txt affirming the object is charged with the intentions of each individual intention in intentions.txt
If it doesnt detect the word Charged then it presumes currently that the benificiary is me and reads each line of INTENTIONS.txt with the foreword of my name recieving the intentions i dont recall how i worded it atm.
I think its a cool take on things. not sure if any of your programs actually read the lines of the text file as affirmations to the charged object or person. its a good idea i think.
Its highly beta but here it is for anyone who has a c++ compiler.
"Satans Bane.jpg" is Charged with the intentions of "INTENTIONS.txt" is how i operate it currently.
The program will detect that Satans Bane.jpg is the object of charging. and that INTENTIONS.txt are the intentions.
It iterates overy every line of INTENTIONS.txt intending it to go charge Satans Bane.jpg in my example.
There is a iteration counter. But much slower iterations than your model as it is reading the entire INTENTIONS document of text every loop.
Im sure il find more ways to improve it ecetera.
It looks for a certain list of keywords
Charged charged imbued Imbued
will mean that the charged object preceeds it
Charging charging Imbuing imbuing imbues and Imbues
will mean that the charged object proceeds it.
Use accordingly.
AKA
"INTENTIONS.txt is charging "PERSON A" with its affirmations.
or "PERSON A" is charged with the affirmations within "INTENTIONS.txt"
QOUTATIONS are mandatory.
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <thread>
#include <atomic>
#include <windows.h>
#include <array>
const std::array<std::string,4> chargeWordsPastTense = { "Charged", "charged", "Imbued", "imbued"};
const std::array<std::string,6> chargeWordsFutureTense = {"Charging", "charging", "Imbuing", "imbuing","imbues","Imbues"};
// Global vector to hold intentions from text files
std::vector<std::string> intentions;
std::string chargingFile = "";
std::string chargedObject = "Nathan Douglas Myerscough";
volatile long long fileReadLoops = 0;
volatile long long maxLongLongReads = 0;
const long long maxLongLongSize = 9223372036854775806;
// Function to load text file into a vector of strings
void loadTextFile(const std::string& filename) {
std::ifstream file(filename);
std::string line;
while (std::getline(file, line)) {
intentions.push_back(line);
}
}
// Function to load image file
void loadImageFile(const std::string& filename) {
chargedObject = filename;
// Add code here to load image file
std::cout << "Loading image file: " << filename << std::endl;
}
// Function to load audio file
void loadAudioFile(const std::string& filename) {
chargedObject = filename;
// Add code here to load audio file
std::cout << "Loading audio file: " << filename << std::endl;
}
void extractChargedName(const std::string& input, const size_t startQuote, const size_t endQuote)
{
std::string fileName = input.substr(startQuote + 1, endQuote - startQuote - 1);
// Assuming the preceding file is more likely an image or audio file
std::string extension = chargingFile.substr(chargingFile.find_last_of(".") + 1);
std::cout << extension;
if (extension == "jpg" || extension == "png" || extension == "gif") {
loadImageFile(fileName);
} else if (extension == "mp3" || extension == "wav" || extension == "ogg") {
loadAudioFile(fileName);
}
else
{
chargedObject = fileName;
}
}
void backSearchForChargedObject(const std::string& input, const size_t chargedPos)
{
// Search for the file preceding the "Charged" keyword
size_t endQuote = input.rfind("\"", chargedPos);
if (endQuote != std::string::npos) {
size_t startQuote = input.rfind("\"",endQuote-1);
if (startQuote != std::string::npos) {
extractChargedName(input, startQuote,endQuote);
}
}
}
void forwardSearchForChargedObject(const std::string& input, const size_t chargedPos)
{
// Search for the file preceding the "Charged" keyword
size_t startQuote = input.find("\"", chargedPos);
if (startQuote != std::string::npos) {
size_t endQuote = input.find("\"",startQuote+1);
if (endQuote != std::string::npos) {
extractChargedName(input,startQuote,endQuote);
}
}
}
// Function to search for file names in input string
void searchAndLoadFiles(const std::string& input) {
size_t chargedPos;
for (const auto& word : chargeWordsPastTense) {
chargedPos = input.find(word);
if (chargedPos != std::string::npos) {
backSearchForChargedObject(input,chargedPos);
// Search for a text file after the "Charged" keyword
size_t pos = (chargedPos != std::string::npos ? chargedPos + 7 : 0); // Start searching after "Charged"
if((pos = input.find(".txt", pos)) != std::string::npos) {
size_t end = pos + 4;
size_t start = input.rfind("\"", pos-1) + 1;
chargingFile = input.substr(start, end - start);
loadTextFile(chargingFile);
}//ELSE its a one line affirmation figure it out somehow.
return;
}
}
if (chargedPos == std::string::npos) {
for(const auto& word: chargeWordsFutureTense){
chargedPos = input.find(word);
if (chargedPos != std::string::npos) {
forwardSearchForChargedObject(input,chargedPos);
}
}
}
size_t pos = (chargedPos != std::string::npos ? chargedPos : input.size()-1); // Start searching after "Charged"
if((pos = input.rfind(".txt", pos)) != std::string::npos) {
size_t end = pos + 4;
size_t start = input.rfind("\"", pos-1) + 1;
chargingFile = input.substr(start, end - start);
loadTextFile(chargingFile);
}
}
void iterationTimeCounter()
{
fileReadLoops += 1;
SetConsoleTitleA(std::__cxx11::to_string(fileReadLoops + (maxLongLongReads*maxLongLongSize)).c_str());
if(fileReadLoops == maxLongLongSize)
{
fileReadLoops = 0; maxLongLongReads += 1;
}
}
std::vector<std::string>* modifiedIntentions;
// Function to modify intentions when chargedFile is not empty
void modifyChargedIntentions() {
modifiedIntentions = new std::vector<std::string>();
for (const auto& intent : intentions) {
modifiedIntentions->push_back(chargedObject + " is imbued with the following intention: " + intent);
//std::cout <<modifiedIntentions.back() << std::endl;
}
delete modifiedIntentions; iterationTimeCounter();
}
// Function to modify intentions when chargedFile is empty
void modifyPersonIntentions() {
modifiedIntentions = new std::vector<std::string>();
for (const auto& intent : intentions) {
modifiedIntentions->push_back(chargedObject + " is imbued with the following intention: " + intent);
}
delete modifiedIntentions; iterationTimeCounter();
}
int main() {
std::string intention;
std::cout << "Please enter your intention: ";
std::getline(std::cin, intention);
// Search for file names and load files
searchAndLoadFiles(intention);
std:: cout << "Charged Object is: " + chargedObject << std::endl;
std::cout << "Charging File is: " + chargingFile << std::endl;
if(intentions.empty())
{
intentions.push_back (intention);
}
std::atomic<bool> exitRequested(false);
//
// //Start a thread to monitor for keyboard input
// std::thread inputThread([&exitRequested]() {
// while (!exitRequested) {
// if (std::cin.peek() == 27) { // Check if the next input is the escape key
// exitRequested = true;
// }
// }
// });
do {
if(chargedObject != "")
modifyChargedIntentions();
else
modifyPersonIntentions();
} while (!exitRequested);
// inputThread.join(); // Wait for the input thread to finish
return 0;
}