Cannot get kmail/csend/send to operate in script; help would be a kindness!

Gallowglass

New member
Salutations!

First post, brand-spankin-new to KoLmafia, 7~8 year absence in KoL, new to both KoL Forums & KoLmafia Forums.

Alrighty, with that outta the way, the second thing: Thanks for reading! Time is meat, after all, and I'm plum outta the former. That, and pressing exams/deadlines, have driven me to cease searching forums to attempt comprehension & simply ask (trust, this is simple asking for me... I'm wordy(ish)):

...just realized: If this post in any way (and it's practically guaranteed) should be somewhere else, I'm sorry & please lob it over that-a-way? If I could have found a quite right, alive thread I likely wouldn't be asking. ~_~;
I cannot, for the life of me, get kmail/csend/send to work in a script, no matter what.

I'm using Dev C++ and the following code:

outfit("bugbear");
retrieve_item(5, $item[Gnollish pie tin]);
retrieve_item(5, $item[Wad of dough]);
retrieve_item(2, $item[Peach]);
retrieve_item(1, $item[Pear]);
retrieve_item(2, $item[Plum]);
retrieve_item(2, $item[Milk of magnesium]);
retrieve_item(20, $item[Knob Goblin eyedrops]);
retrieve_item(9, $item[dusty bottle of great]);
retrieve_item(1, $item[melted Jell-o shot]);
//retrieve_item(1, $item[tankard of ale]);
retrieve_item(1, $item[Supernova Champagne]);
outfit("Item");
use(1, $item[Milk of magnesium]);
use(1, $item[Milk of magnesium]);
eat(2, $item[Peach pie]);
eat(1, $item[Pear tart]);
eat(2, $item[Crimbo Pie]);
drink(9, $item[dusty bottle of great]);
drink(1, $item[melted jell]);
//drink(1, $item[tankard of ale]);
use(20, $item[Knob Goblin eyedrops]);
adventure(my_adventures(), $location[Cobb's Knob Treasury]);
{
cli_execute("kmail to "" [||""]");
}
drink(1, $item[Supernova Champagne]);
outfit("RO");

I've also tried:

csend to ''" || "";

batch_open();
kmail to "" || "";
batch_close();

kmail ("", "", 0);

and multiple variations there within.

I'm not 100% new to programming, so I can follow logic statements & (after T&E) work my way through a program. The above is my testdat.ash for getting a feel of the waters, and I'm sinking. That's the last part of "basic" concept I wanted to get, yet while I've seen multiple things in the forums, I can't find where my error is.

Should not the last one work, as it's a zlib function?

Why does cli_execute not work, also why would it work?

batch_open & batch_close: While informing the prog that there is incoming repetitious items for group/stack, does it access the primary cli interface level? I've seen examples of code that held the same style/nomenclature and, yet, mine continues to fail. Is it syntax?

There's more, but I simply must away(ish). Nicotine & Fourier Series demand my attention.

Thanks again(!) and, please, be gentle?

_G
 

lostcalpolydude

Developer
Staff member
You want something like
cli_execute( "kmail pear to testudinata || hello" );

All of the attempted commands you listed are missing a recipient name and either a mention of meat or the item(s) being sent, so it's hard to list exactly what you want it to be. You can test the kmail part on its own, none of the stuff around it is causing it to fail.
 

Gallowglass

New member
It worked!

Enjoy the pear. ^_^

Given that syntax, meat goes after hello, ja?

so

cli_execute( "kmail pear to lostcalpolydude || Thanks 1000 meat" );

would send you a pear and 1k meat?

The first "" in syntax for the given commands tried was username, the second "" was the message.
 

lostcalpolydude

Developer
Staff member
It would actually be
cli_execute( "kmail pear, 1000 meat to bmaher || Thanks" );

If you want to send a message without any items or meat,
cli_execute( "kmail to gallowglass || hello" );
will work.
 

Gallowglass

New member
Ahh... gotcha!

I has no contacts, and didn't think of sending a message to myself. ^_^;

Thank you so very, very much. This has been stumping me for far longer than I want to admit. It was the last part in my water testing, which sublimely satisfies my obsessive urge to not be thwarted by inanimate objects (and programs!). I really do appreciate your assistance.
 
Top