Creating my first Breakfast Script

hurdarr

New member
Greetings. :D

I'm having a little of trouble running some of the popular scripts (EatDrink for example), so I'm gonna try to learn to write my own script.

I did some research but didn't found useful information, pretty much only threads with users that had problems with their scripts.

My multi (who only plays on sc, while my main is on hc) is low on meat (half million), never ascended and doesn't own a single IotM.

This what I had in mind, a script when I logged in, would automatically:
buy 1 milk of magnesium
buys 3 of the cheapest Hi mein (what do you think?)
buy 15 twinkly wads
buy 5 salty dogs (Boozerbear's shop sells them 130 meat each, seems a good deal, gives 15 spleen out of 20)


use 1 milk of magnesium
eat 3 Hi-Mein's
use 15 twinkly wads
drink 5 salty dogs

cast skills, tomes, librams (just in cae i buy them in a near future)

get clovers from hermit
get meat from clan and the produce stand
buy raffle ticket

I noticed the General > Preferences > Breakfast tab, but I don't now how to write a file, so I can't upload it.

Also, is there an easy to calculate my optimal diet?
 
Last edited:

Bale

Minion
Greetings. :D

I'm having a little of trouble running some of the popular scripts (EatDrink for example), so I'm gonna try to learn to write my own script.

I did some research but didn't found useful information, pretty much only threads with users that had problems with their scripts.

My multi (who only plays on sc, while my main is on hc) is low on meat (half million), never ascended and doesn't own a single IotM.

This what I had in mind, a script when I logged in, would automatically:


I noticed the General > Preferences > Breakfast tab, but I don't now how to write a file, so I can't upload it.
Well, some scripts are tricky, but others are easy to write. I'd suggest you start with CLI which is a lot simpler than ASH, although there are things you can do in ASH that CLI cannot replicate. I'll show you a few examples. In black is what you want to do. In blue is CLI command to do that. In green is the ASH commands to do the same thing:

Code:
buy 1 milk of magnesium
[COLOR="Blue"]buy 1 milk of magnesium[/COLOR]
[COLOR="Green"]buy(1, $item[milk of magnesium]);[/COLOR]

buys 3 of the cheapest Hi mein (what do you think?)
[COLOR="Blue"]cheapest +hi mein; buy 3 it[/COLOR]
[COLOR="Green"]int [item] himein;
himein[$item[cold hi mein]] = mall_price($item[cold hi mein]);
himein[$item[hot hi mein]] = mall_price($item[hot hi mein]);
himein[$item[sleazy hi mein]] = mall_price($item[sleazy hi mein]);
himein[$item[spooky hi mein]] = mall_price($item[spooky hi mein]);
himein[$item[stinky hi mein]] = mall_price($item[stinky hi mein]);
item cheapest;
int price = 9999999;
foreach key in himein
     if(himein[key] < price) {
          cheapest = key;
          price = himein[key];
     }
buy(3, cheapest);[/COLOR]

buy 15 twinkly wads
[COLOR="Blue"]buy 15 twinkly wad[/COLOR]
[COLOR="Green"]buy(15, $item[twinkly wad]);[/COLOR]

use 1 milk of magnesium
[COLOR="Blue"]use 1 milk of magnesium[/COLOR]
[COLOR="Green"]use(1, $item[milk of magnesium]);[/COLOR]

eat 3 Hi-Mein's
[COLOR="Blue"]eat 3 either cold hi mein, hot hi mein, sleazy hi mein, spooky hi mein, stinky hi mein[/COLOR]
[COLOR="Green"]eat(3, cheapest);[/COLOR]
That should be enough to give you the basic idea. You can see why CLI is recommended for a beginner. It requires less knowledge of programing and in many cases the command is exactly as you would think.

Also, is there an easy to calculate my optimal diet?
There is no easy way to calculate your optimal diet. Someone already wrote a script to do that. If you want to see how it is done, take a look at EatDrink. The script won't bite so feel free to read it with notepad.
 
Last edited:

dj_d

Member
Well, make sure to set "bite=false".

Nice work, Bale, that was good of you to help. As the author of eatdrink.ash, feel free to ask any questions or post in the thread if you're having trouble getting it to work for you.
 

ki77bot

Member
You can use this for the Clan stuff:

Code:
void clan () {

	print ("");
	print ("Processing Clan Rumpus stuff...", "blue");
	print ("");

	print ("");
	print ("...accessing Potted Meat Tree...", "green");
	visit_url("clan_rumpus.php?action=click&spot=9&furni=3");

	print ("");
	print ("...accessing Mr. Klaw Skill Crane Game...", "green");
	visit_url("clan_rumpus.php?action=click&spot=3&furni=3");
	visit_url("clan_rumpus.php?action=click&spot=3&furni=3");
	visit_url("clan_rumpus.php?action=click&spot=3&furni=3");

	print ("");
	print ("...accessing Deluxe Mr. Klaw Skill Crane Game...", "green");
	visit_url("clan_viplounge.php?action=klaw");
	visit_url("clan_viplounge.php?action=klaw");
	visit_url("clan_viplounge.php?action=klaw");
}

and this for the Hippy Store:

Code:
void misc () {	

	print ("");
	print ("...visiting the Hippy Store...", "green");
	visit_url("store.php?whichstore=h");

}

In both cases you also need a void main:

Code:
void main() {
	clan ();
	misc();
}

Robbing the hermit...

Code:
// --- H E R M I T --- //

int shice_items = item_amount( $item[worthless gewgaw] ) + item_amount( $item[worthless trinket] ) + item_amount( $item[worthless knick-knack] );

if ((shice_items) >= 5){
      cli_execute("hermit * ten-leaf clover");
	  cli_execute("use * ten-leaf clover");
	} else {
		print("Not enough worthless items!", "red");
	} 

if ((shice_items) > 0){
	print("You still have "+shice_items+" worthless items left.", "green");
	} else {
		print("Better get more worthless items!", "red");
	}

Well, you didn't ask for this one, but you still might like it ;) :

Code:
// --- F R I A R   B L E S S I N G --- //
	
if (contains_text(visit_url("questlog.php?which=2"),"cleansed the taint"))
   visit_url("friars.php?action=buffs&bro=3&pwd=");

// bro=1 : Brother Flying Burrito	(+food drops)
// bro=2 : Brother Corsican			(+fam. exp)
// bro=3 : Brother Smothers			(+booze drops)

Cheers,
ki77bot.
 

hurdarr

New member
Code:
buy(1, $item[milk of magnesium]);

int [item] himein;
himein[$item[cold hi mein]] = mall_price($item[cold hi mein]);
himein[$item[hot hi mein]] = mall_price($item[hot hi mein]);
himein[$item[sleazy hi mein]] = mall_price($item[sleazy hi mein]);
himein[$item[spooky hi mein]] = mall_price($item[spooky hi mein]);
himein[$item[stinky hi mein]] = mall_price($item[stinky hi mein]);
item cheapest;
int price = 9999999;
foreach key in himein
     if(himein[key] < price) {
          cheapest = key;
          price = himein[key];
     }
buy(3, cheapest);


buy(15, $item[twinkly wad]);
buy(5, $item[salty dog]);

use(1, $item[milk of magnesium]);
eat(3, cheapest);
use(15, $item[twinkly wad]);
drink(5, $item[salty dog]);

This is what I have an works great.

Just quick questions: what about visiting the clan room to get meat and from the hippy stand?

Do I need to use the code above, or is there a simple command line? And what about using skills (tomes, librams and pastamastery, etc.)»

Thank you so much guys, I don't know how I managed to live without these handy scripts. So many hours wasted multi-tasking and being bored to death.
 
Last edited:

ki77bot

Member
If you want to keep it short just use the visit_url...lines and you'll be OK.

Code:
	visit_url("clan_rumpus.php?action=click&spot=9&furni=3");

	visit_url("clan_rumpus.php?action=click&spot=3&furni=3");
	visit_url("clan_rumpus.php?action=click&spot=3&furni=3");
	visit_url("clan_rumpus.php?action=click&spot=3&furni=3");

	visit_url("store.php?whichstore=h");

assuming that your clan does have a Mr. Klaw...

Skills are used like this:

Code:
	use_skill(5, $skill["Advanced Saucecrafting"]);
	use_skill(5, $skill["Pastamastery"]);
	use_skill(5, $skill["Advanced Cocktailcrafting"]);

So, if you want to add other skills, then simply put in the name of the skill and how many times you want it to be cast...

Cheers,
ki77bot
 
Last edited:

Rinn

Developer
autosell not autsell. And since you're working in ash you would need to do cli_execute("autosell * Angry Farmer Candy");
 

hurdarr

New member
I may be wrong, but I believe I did a typo in the post. Will have to wait for tomorrow to confirm.

Just wondering, of all the items you get from the Gian'ts Castle, which ones shouldn't I autosell? I was thinking of pulverizing Giant Needles, Furry Fur, Wolf mask and using Warm Subject gift certificates.

Do you folks do the same?
 
Last edited:

Bale

Minion
Just wondering, of all the items you get from the Gian'ts Castle, which ones shouldn't I autosell? I was thinking of pulverizing Giant Needles, Furry Fur, Wolf mask and using Warm Subject gift certificates.
Now you're asking for farming advice. There are several threads on the KoL gameplay discussion forum for that topic. Read them and post your questions there.
 

hurdarr

New member
I added the following to my script.

Code:
autosell * Angry Farmer Candy
autosell * awful poetry journal 
autosell * chaos butterfly 
autosell * disturbing fanfic 
autosell * furry fur 
autosell * heavy d
autosell * original g 
autosell * plot hole 
autosell * probability potion
autosell * procrastination potion 
autosell * thin black candle 
autosell * Mick's IcyVapohotness Rub

But I still get following error:

Code:
Unknown variable: 'autosell' (myBreakfast.ash, line 32)

What am I doing wrong?

Thanks.
 

ki77bot

Member
You are not getting the difference of CLI (what you are using above) and ASH commands...

So, if you want to put this into your other ASH-Script you could do it like this:

Code:
cli_execute("autosell * Angry Farmer Candy");

and so on...

I am almost sure, there is a better way in ash, but I don't know it.

Cheers,
ki77bot.

PS: Hey, I just noticed Rinn already posted that...maybe you should read here first:

Basic KoL Scripting

Advanced KoL Scripting
 
Last edited:

hurdarr

New member
Thanks.

I read those but I still had many questions, that's why I created a thread.

By the way, how do you use the gift certificate? I already spent my turns today.

is it something like:

use * Warm Subject gift certificate;

or

cli_execute("use * Warm Subject gift certificate");
 
Last edited:

ki77bot

Member
Well, obviously reading is not understanding. :D

They are BOTH correct.

The first line can be put in a CLI file (file extension *.txt) and the second one is the syntax for an ASH file (file extension *.ash). As the rest of your breakfast script is already in ASH you should use the second one.

Cheers,
ki77bot.
 

Bale

Minion
I'll explain. You cannot mix CLI with ASH. The two need to be kept separate. Despite that, it is possible to add lines of CLI into ASH or use some ASH in CLI.

To use a CLI command in an ASH script you can use the command: cli_execute("CLI command here");

If it was a CLI script, the cli_execute() would not have been necessary.
 

marth1992

New member
I'm also trying to make my own breakfast script, but through the scripts I've seen in ASH, I am very confused
All I want to do is consume with a consumption plan much like the OP, do lucre, and farm castle

so to start, I want to create a consumption plan
First, to fill spleen it's simply (in ASH)
buy( 15, $item[twinkly wad])
use( 15, $item[twinkly wad])

then for stomach I think it's (to buy cheapest wonton, revised from hi mein script)
int [item] wonton;
wonton[$item[sausage wonton]] = mall_price($item[sausage wonton]);
wonton[$item[tofu wonton]] = mall_price($item[tofu wonton]);
item cheapest;
int price = 9999999
foreach key in wonton
if(wonton[key] < price) {
cheapest = key,
price = wonton[key];
}
buy(5, cheapest);
use(5, cheapest);

I changed the item to wonton, and added a line at the eat to eat the 5 cheapest wontons in the mall

Lastly, I need to figure out how to get drinking to work, I have liver of steel, and I want to create 5 SHC drinks, because I have advanced and superhuman cocktailcrafting, and access to still. I want to drink 4 SHC drinks, the 2 drunkeness dusty wine, and a fine wine for my 1 drunkeness wine, but so far, the only progress I have on this is to start with
boolean use_skill( 5, $skill["Advanced Cocktailcrafting"])

and my problem is counting all the coconut shells, ice cubes, and paper umbrellas so it makes that many SHC drinks, for example, I use Advanced cocktailcrafting 5 times, and get 3 ice cubes, a coconut shell, and a paper umbrella, I want mafia to automatically make 3 moxie only substat drinks (don't remember names), a mox/mus with the coconut shell, and a pure myst with the paper umbrella, and to buy the dusty wine, and automatically make the fine wine, then consume any 4 SHC drinks, and the dusty and fine wines, then do bounty and X number of turns of farming, then night cap with a SHC

anyway any help will be appreciated =D

edit: there should be spaces in the quotes, but I don't know how to do that in the forum, besides hitting the spacebar a few times, I went 5 spaces for one tab, and 10 for two tabs, but they wont register
 
Last edited:
Top