Need help with meat-farming script

AstroDroid

New member
I recently had the accessibility to my computer cut short, and decided that this was no reason to not make any meat on KoL. Realizing the potential of scheduling KoLmafia to run at 3am with auto login set to my seal clubber account, I learned the basics of writing scripts. So I decided to attempt to write a script, or a series of scripts, that would execute on login and take my 3 accounts through my usual meat farming process. I set KoLmafia to auto login, set login.txt (see below) to run after login, and arranged it so that my seal clubber would go first, then my disco bandit, and finally my pastamancer. It’s not working and I’m as frustrated as I am limited with my knowledge of script writing. Any help would be highly appreciated.

login.txt
Code:
if class is seal clubber call 1 scAuto.txt
if class is disco bandit call 1 dbAuto.txt
if class is pastamancer call 1 pmAuto.txt

scAuto.txt

Code:
breakfast
csend 6 meat to testudinata
csend 7 meat to testudinata
csend 8 meat to testudinata
csend 10 meat to testudinata
buy 7 white citadel burger
outfit custom: cash clothing
eat 1 toast
eat 7 white citadel burger
drink 19 ram's face lager
use 1 manual of labor
use * twinkly wad
use * hot wad
use * cold wad
use * sleaze wad
use * spooky wad
use * stench wad
use * six pack of mountain stream
use * bag of cheat-os
conditions clear
adventure * icy peak
make * ram-battering staff
pulverize * ram-battering staff
pulverize * ga-ga radio
pulverize * snow queen crown
make * twinkly wad
make * hot wad
make * cold wad
make * sleaze wad
make * spooky wad
make * stench wad
trapper hippopotamus skin
hunter hippopotamus skin
mallsell hippopotamus skin 196 0
mallsell crazy little turkish delight 100 0
mallsell insanely spicy bean burrito 100 0
mallsell white citadel burger 100 0
mallsell toast 100 0
mallsell brimstone chicken sandwich 100 0
mallsell double bacon beelzeburger 100 0
mallsell jumbo dr. lucifer 100 0
mallsell lord of the flies-sized fries 100 0
outfit custom: log out in this
drink 1 ram's face lager
login <name of disco bandit>

dbAuto.txt

Code:
breakfast
csend 6 meat to testudinata
csend 7 meat to testudinata
csend 8 meat to testudinata
csend 10 meat to testudinata
csend 11 meat to iocainebot
buy 7 white citadel burger
outfit custom: kill yeti in this
eat 1 toast
eat 7 white citadel burger
drink 19 ram's face lager
use 1 manual of dexterity
use * twinkly wad
use * hot wad
use * cold wad
use * sleaze wad
use * spooky wad
use * stench wad
use * six pack of mountain stream
use * bag of cheat-os
conditions clear
adventure * icy peak
make * ram-battering staff
trapper hippopotamus skin
hunter hippopotamus skin
mallsell hippopotamus skin 196 0
mallsell coconut shell 999,999,999 0
mallsell little paper umbrella 999,999,999 0
mallsell magical ice cubes 999,999,999 0
mallsell crazy little turkish delight 100 0
mallsell insanely spicy bean burrito 100 0
mallsell white citadel burger 100 0
mallsell toast 100 0
mallsell brimstone chicken sandwich 100 0
mallsell double bacon beelzeburger 100 0
mallsell jumbo dr. lucifer 100 0
mallsell lord of the flies-sized fries 100 0
outfit custom: log out in this
drink 1 ram's face lager
undercut
login <name of pastamancer>

pmAuto.txt
Code:
breakfast
csend 6 meat to testudinata
csend 7 meat to testudinata
csend 8 meat to testudinata
csend 10 meat to testudinata
csend 11 meat to iocainebot
cast 10 leash of linguini
buy 7 white citadel burger
outfit custom: money maker
eat 1 toast
eat 7 white citadel burger
drink 19 ram's face lager
use 1 manual of transmission
use * twinkly wad
use * hot wad
use * cold wad
use * sleaze wad
use * spooky wad
use * stench wad
use * six pack of mountain stream
use * bag of cheat-os
conditions clear
adventure * icy peak
make * ram-battering staff
trapper hippopotamus skin
hunter hippopotamus skin
mallsell hippopotamus skin 196 0
mallsell dry noodles 999,999,999 0
mallsell crazy little turkish delight 100 0
mallsell insanely spicy bean burrito 100 0
mallsell white citadel burger 100 0
mallsell toast 100 0
mallsell brimstone chicken sandwich 100 0
mallsell double bacon beelzeburger 100 0
mallsell jumbo dr. lucifer 100 0
mallsell lord of the flies-sized fries 100 0
outfit custom: adventure maximizer
drink 1 ram's face lager
undercut
update
exit


Thanks again for taking your time to look at this.
 
well first off all the login statements don't say who to login. OK maybe you took that out intentionally.

mallsell has been changed in the latest release. you should combine all the lines that contain mallsell into one in the following format:

Code:
mallsell * banana @ 0 limit 5, * cold hi mein @ 0 limit 3, 23 spring @ 100 limit 0, 0 ten leaf clover @ 3000 limit 0

It will be more server friendly, and speed up execution of your scripts. The * above indicates the quantity, the number after @ indicates price (0 for your current price or max price if none are in your store) and the number after limit is the limit per day that a person can buy. Place a comma between each item. Specify all the items you want to sell, and kolmafia will place 11 items at a time in your store till it has placed them all in there. In SCAuto this will reduce 9 actions to 1, in DBAuto it will reduce 12 actions to 2, and in PMAuto it will reduce 10 actions to 1.



actual problem:

unless this has been changed login.txt should be
Code:
if class is seal clubber 
  call 1 scAuto.txt
if class is disco bandit 
  call 1 dbAuto.txt
if class is pastamancer 
  call 1 pmAuto.txt
with the if this = that on a seperate line from the command to execute. Again that is unless changes were made to the functionality.
 

AstroDroid

New member
"No available namespace with function: 1" is the error message displayed by the execution of the newly revised login.txt. Also, could you please point me in the right direction to make it so that the script would only buy burgers if I didn't have any? Thanks for your help, I'm now past the bash-my-head-off-the-screen stage of this problem.

P.S. You were correct in your speculation that I purposely took out my user names, I tried to put a description of the user in angle brackets, <seal clubber account>, but it didn't work out within the code box.
 
I missed that:

Code:
if class is seal clubber call 1 scAuto.txt
if class is disco bandit call 1 dbAuto.txt
if class is pastamancer call 1 pmAuto.txt

should be:

Code:
if class is seal clubber 
  call scAuto.txt
if class is disco bandit 
  call dbAuto.txt
if class is pastamancer 
  call pmAuto.txt
 

AstroDroid

New member
Now it just freezes-up on me, but perhaps that is not from the script. I'll edit this later once I try a couple of things.
___________________________________________________________________________________________
Edit:
When you changed login.txt the first time, you left spaces in front of the even numbered lines. I took those out, now it seems to be working just fine. Thanks. Oh yeah, have any idea how I could make it so the script only buys burgers when I need them? It would save me some meat, but is not really important.
 
the easiest way is to turn on "buy items from the mall when needed" and "buy items from npc stores when needed" and remove the command to buy them. then if you need them kolmafia will buy them as soon as you say to eat them in a script.
 

AstroDroid

New member
Thanks, I'll do that. When I came back to my computer after running login.txt, scAuto.txt crashed on me during the bounty hunter hunter request. Will that command only work if the hunter is accepting that particular item?
 

macman104

Member
use "acquire" instead of "buy". That buys if needed, but uses if you already have some.

EDIT: I also imagine that yes, the bounty hunter might error out if it is not accepting that item today. To get around that, you might need to use some ASH scripting.
 

AstroDroid

New member
Thanks, but I know nothing of ASH scripting. Wanna point me the right way to learn how to do it?
OK, I found a command at the bottom of the basic scripting guide (http://kolmafia.sourceforge.net/scripting.html) that says:
if bounty hunter wants <itemname>

This checks to see if the bounty hunter is currently trading the given item. Partial names are accepted, but note that if ANY of the bounty hunter items contain the given substring, there will be a match.
I get the unexpected error message after I'm done with the trapper, the debug log, which I have no clue how to use, is also printed. I'm currently attaching it to an email to the email address given in the log.

I'm posting my modified scripts for convenience (I figured out where the attachment function was).
If anyone would rather me put them in the actual message, let me know and I'll edit this or make a new post to include them.
I took out the line with the bounty hunter hunter request, and the script still crashes on me. Could someone please offer me an explanation?
 

Attachments

  • login.txt
    131 bytes · Views: 52
  • scAuto.txt
    1.2 KB · Views: 59
  • dbAuto.txt
    1.2 KB · Views: 54
  • pmAuto.txt
    1.1 KB · Views: 56
Which version of kolmafia are you using? You are using the version of mallsell which was added in version 10.9, and if you are using an earlier version, then that may be the problem. Try a test run without the Mallsell command.
 

AstroDroid

New member
I'm using v10.9, this is my line of mallsell code:
Code:
mallsell * hippopotamus skin @ 196 limit 0, * crazy little turkish delight @ 100 limit 0, * insanely spicy bean burrito @ 100 limit 0, * white citadel burger @ 100 limit 0, * toast @ 100 limit 0, * brimstone chicken sandwich @ 100 limit 0, * double bacon beelzeburger @ 100 limit 0, * jumbo dr. lucifer @ 100 limit 0, * lord of the flies-sized fries @ 100 limit 0

Also, did I make proper use of the bounty hunter hunter request using the "if bounty hunter wants" condition?

I sent the portion of DEBUG.txt pertaining to this problem to holatuwol's hotmail account, any clue how long it takes for a response?

Thanks again for all the helpful tips and suggestions.
 
Well It appears that you did make proper use of the "if bounty hunter wants" unless something has changed.

For Holatuwol's response it may take 5 minutes or it may take 5 days. You have to remember he is just 1 person, and he does have other obligations. I'm sure that he will look into it as soon as it is possible for him to do so.
 

holatuwol

Developer
I don't reply to email unless a reply is specifically requested and/or implied by a question.

Assuming your debug log is the one with all the index out of bounds exceptions, I have no idea what's causing it. I've applied assorted patches to the module that's reporting bugs to handle the possibility of race conditions, which would certainly result in the visible error, but that's as far as it gets.
 
Related:
> call scripts\PulvMallDump.ash
UNEXPECTED ERROR. Debug log printed.

PulvMallDump.ash
Code:
cli_execute("mallsell " +
"* twinkly wad @ 0 limit 0, " +
"* hot wad @ 0 limit 0, " +
"* cold wad @ 0 limit 0, " +
"* stench wad @ 0 limit 0, " +
"* spooky wad @ 0 limit 0, " +
"* sleaze wad @ 0 limit 0, " +

"* twinkly nuggets @ 0 limit 0, " +
"* stench nuggets @ 0 limit 0, " +
"* spooky nuggets @ 0 limit 0, " +
"* sleaze nuggets @ 0 limit 0, " +
"* hot nuggets @ 0 limit 0, " +
"* cold nuggets @ 0 limit 0, " +

"* cold powder @ 0 limit 0, " +
"* hot powder @ 0 limit 0, " +
"* sleaze powder @ 0 limit 0, " +
"* spooky powder @ 0 limit 0, " +
"* stench powder @ 0 limit 0, " +
"* twinkly powder @ 0 limit 0, " +
"* useless powder @ 0 limit 0"
);

Did you try to remove the mallsell command?

edit:


Changing the script to:

Code:
cli_execute("mallsell " +
"* twinkly wad @ 0 limit 0");

sells my twinkly wads as expected, but the following caused a dead stop, but kolmafia stayed in green state. (Debug message/log can't be printed twice in same session?) Double Edit: 2 blank lines were added to the debug log at the very top. (there are 4 now, there was 2)

Code:
cli_execute("mallsell " +
"* twinkly wad @ 0 limit 0, " +
"* hot wad @ 0 limit 0");

and this next one sold my Hot Wads:

Code:
cli_execute("mallsell " +
//"* twinkly wad @ 0, ");
"* hot wad @ 0");
 

AstroDroid

New member
Does that only work with ASH scripting? If so, where can I learn to write ASH scripts to incorporate it?

I cut the mall request out of my scripts, I will edit this post sometime after they are done running to report the outcome.

My apologies to Holatuwol if I came across as offensive. It was an innocent inquiry; I kind of assumed that more than one person would manage the interpretation of debug logs and am impressed that he handles all of that on his own along with everything else relating to the KoLmafia project that he deals with. In the future I will keep this in mind, along with the fact that if I want an email answered I should state that.
My apologies for my poor response time, horrendous complications have arisen. The scrip was running, just processing the Ram’s Face Lager request, when my dad kicked me off the computer. Foolishly, I left KoLmafia running in an attempt to complete my task and find if the rewrite (without the mall script) was successful. He has this thing against alcohol in games and I’m not allowed to play KoL anymore (unless I can convince him otherwise… only a faint hope). I would, however, like to see this problem through, and will try to regain KoL access, or transfer it over to another player at my school and provide said player with revised scripts via email. Who knows, if these scripts get up and running, I could have the meat counter maxed out on KoL by the time my dad lets me play again (or I turn 18).

Back to the scripting problem… Although I haven’t tested it yet for the abovementioned reasons, I do not believe the mallsell command is the problem. According to the session log of my last uninterrupted test, mallsell was successfully executed, and the login request and outfit requests were the only ones not recorded. Curiously, the listing in the CLI showed the trapper’s success and then crashed, and the 20th Ram’s Face Lager request was executed before the non-existent outfit request. Ohh, there isn’t an outfit request recorded at the beginning either, so maybe they just aren’t shown in the session logs.

Thanks for all your help and patience. I will be significantly less active on the forums, so please bear with me.
 
Top