Jump to content

Join our Slack

Talk to other users and have a great time
Slack Server

Welcome to our Community

Click here to get your Exiled Bot license
Donation Store
Jarvis101

Crafting with orbs

Recommended Posts

Not sure if you started work on crafting orbs... but I got bored and threw something together.

//Code for crafting

//usage of namespace
using namespace std;

//main controllers (gui elements)
bool has_craftables;
bool craft;

int current_roll;
int max_rolls;

//Crafting settings (config elements)
bool alchemy;
bool fusing;
bool socketing;
bool chaos;
bool regal;
bool chrome;
bool exalt;

//Crafting commands (eg. in config, use [Alch] == "true"
bool alch;
bool fuse;
bool socket;
bool Croll;
bool Rroll;
bool color;
bool ex;

//function declarations
bool init();
bool load_craft();
void start_craft();


main()//The item parse
{
	if(!init())
	{
		//handle error
		if(!load_craft())
		{
			//handle error
		}
	}
	else
	{
		if(craft == true)
		{
			start_craft();
		}
	}
}

bool init()
{
	bool flag = true;
	bool loadfilecheck = true; //Place holder for the function used to load the settings

	//initializing unused variables
	has_craftables = false;
	craft = false;
	max_rolls = 0;

	//This would be where you load crafting setting
	if(!loadfilecheck)
	{
		//error message here
		flag = false;
	}

	return flag;
}

bool load_craft()
{
	//This is where you load the config file
}

void start_craft()
{
	if(has_craftables == true)
	{
		while(current_roll < max_rolls)
		{
			if(alchemy == true)
			{
				//check item against craft parameters and set the variable to true if a true match is found
				if(alch == true)
				{
					//go to stash
					//find orb
					//craft
					current_roll++;
				}
			}
			if(regal == true)
			{
				//check item against craft parameters and set the variable to true if a true match is found
				if(Rroll == true)
				{
					//go to stash
					//find orb
					//
					current_roll++;
				}
			}
			if(chaos == true)
			{
				//check item against craft parameters and set the variable to true if a true match is found
				if(Croll == true)
				{
					//go to stash
					//find orb
					//craft
					current_roll++;
				}
			}
			if(socketing == true)
			{
				//check item against craft parameters and set the variable to true if a true match is found
				if(socket == true)
				{
					//go to stash
					//find orb
					//craft
					current_roll++;
				}
			}
			if(fusing == true)
			{
				//check item against craft parameters and set the variable to true if a true match is found
				if(fuse == true)
				{
					//go to stash
					//find orb
					//craft
					current_roll++;
				}
			}
			if(chrome == true)
			{
				//check item against craft parameters and set the variable to true if a true match is found
				if(color == true)
				{
					//go to stash
					//find orb
					//craft
					current_roll++;
				}
			}
			if(exalt == true)
			{
				//check item against craft parameters and set the variable to true if a true match is found
				if(ex == true)
				{
					//go to stash
					//find orb
					//craft
					current_roll++;
				}
			}
		}
	}
}
Edited by Jarvis101

Share this post


Link to post
Share on other sites

Nice try :)

You forget to specify the Item we want to roll ^^.

Behind this, need for a hard regex handling.

Also logic handling the result of the craft to stash it or sell it or reroll it.

Share this post


Link to post
Share on other sites

I was thinking of when the bot id's the item, it checks its stats vs a crafting config. The result would be checked against a pickit.

 

example : Item gets id'd, checks if it is to be sold, if so, run through craft check. loop process until crafting tries are used up.

 

But yeah, I can see a dozen problems with this code. Wrote it last night after being up for 20 hours.

Edited by Jarvis101

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...