My CLI/ASH Question Post

Wolfie

New member
Basically im making this thread so i dont have to use a new thread everytime ive got a question since im still learning ill probably have several.

now im curious right now i feed my char one of each chow mein instead of 3 pertaining to the class and im wondering if in my script i can do
Code:
cli_execute("eat 3 chow mein")
and as long as i only have 1 of each chow mein type in inventory if it will eat all 3
so that i can eliminate have 1 line of code for each chow mein type.
is this possible?
 

macman104

Member
umm, this may work, you would have to make sure you only had 1 of each though. An easier solution would be to put the following:
Code:
cli_execute("eat 1 knob sausage chow mein; eat 1 bat wing chow mein; eat 1 rat appendix chow mein");

EDIT: Also, if you are just using standard scripting and not ASH, you don't have to include the cli_execute.
 

Tirian

Member
It's easy enough for you to check yourself, but I doubt that it will work. My suspicion is that CLI will parse "chow mein" to a specific item , and then be upset that you don't have three of that item.

I don't even think the following would work:
Code:
cli_execute("eat chow mein") 
cli_execute("eat chow mein") 
cli_execute("eat chow mein")

because the parser would probably turn each of the "chow mein" into "Knob sausage chow mein" before it even gets around to looking at your inventory.
 

Wolfie

New member
Makes sense Tirian i was kinda thinking that but didnt wanna waste chow meins figuring it out lol

and macman thanks for the tip i didnt know i could seperate the commands into 1 line like that do most/all commands work like that or just a few select ones
 

Wolfie

New member
is there a way to make a script for the new custom adventures choices in haunted forest? or is there a kolmafia update that solves this with the preset custom adventure choices?
 

Tirian

Member
[quote author=Wolfie link=topic=111.msg485#msg485 date=1145996804]
is there a way to make a script for the new custom adventures choices in haunted forest? or is there a kolmafia update that solves this with the preset custom adventure choices?
[/quote]

KolMafia 7.2 will have these features, and a bunch more really nice things. It is in beta test mode right now, and it's hard to predict when it will clear. Choice adventures are hard-coded, so there's no way to trick 7.1 into playing nice with the new content.

You could download the source and compile it if you wanted, but that'll open up a whole new set of issues. I'm bouncing back and forth, because the Spooky Forest doesn't work in 7.1 but complex scripts can mess up 7.2.
 

Wolfie

New member
cool how do i grab and compile the source if ya dont mind explaining :) right now im doin alot of adventuring in spooky forest so having a client able to process the new custom setting for there would be great.
 

Tirian

Member
I'm the wrong person to ask about that. I'm actually a little surprised that I managed to get it to work for me, much less walking someone else through it. Sorry. ???
 
To download and compile the source you will need at least three pieces of software:

The current Java Development Kit (JDK), available from http://java.sun.com/ ; there are a bunch of confusing options there, but what you need is the J2SE JDK which means the Java 2 Standard Edition Java Development Kit. You'll have to install this according to the instructions provided by Sun for your operating system.

ANT, which is a build system. It comes built-in to MacOS X, but maybe only if you have the developer tools (XCode) packages installed. If you don't have it or for other operating systems, you can get it at http://ant.apache.org/ ; like Java you will need to install this according to the appropriate instructions for your OS.

Finally you will need SubVersion, which is the version control system currently being used to track the changes to KoLmafia. You can download SubVersion from http://subversion.tigris.org/ and, just like the other two, install it on your system according to the instructions provided.

Once you have all of these, you can go to the KoLmafia sourceforge project at http://sourceforge.net/projects/kolmafia and click on the subversion link, which will take you to a page that has the instructions for how to use subversion to accesss the repository. The short form of those instructions is to open up a terminal or command line window (a DOS prompt I guess on Windows) and type this:
Code:
svn co [url]https://svn.sourceforge.net/svnroot/kolmafia[/url] kolmafia

If you installed subversion correctly, it should then obtain a copy of the most recent alpha test potentially unstable version of the source code. Once that's done, you should go into the kolmafia directory (cd kolmafia) and run ant to build the project. All you do is just type 'ant' and press enter.

If all goes well, it should say something about the build being successful and you can open up the new 'dist' folder that it created inside the kolmafia folder, and double-click on the KoLmafia.jar file that it created.

As you can see, there are a lot of steps. But most of them are pretty simple, as long as you are just building the code and not trying to change it at all. It's almost certain that you will run into one or two minor problems while setting this all up because my instructions here are not very detailed; just let us know any trouble you encounter and we'll help. It would be good to know what OS you use, if you do have any questions on this stuff.
 

Wolfie

New member
ok i got subversion working it pulled the source etc i am however having probs with ant and j2se jdk they dont seem to wanna recognize eachother i did check my path statement it seems ant isnt finding tools.jar in the java folder. if ya have any ideas on it lemme know
wolfie
p.s im using win xp pro sp2
 
[quote author=Wolfie link=topic=111.msg575#msg575 date=1146446036]
ok i got subversion working it pulled the source etc i am however having probs with ant and j2se jdk they dont seem to wanna recognize eachother i did check my path statement it seems ant isnt finding tools.jar in the java folder.  if ya have any ideas on it lemme know
wolfie
p.s im using win xp pro sp2
[/quote]

I had the same problem. I fixed it by copying the file from the folder:
C:\Program Files\Java\jdk1.5.0_06\lib
to the folder:
C:\Program Files\Java\jre1.5.0_06\lib
where ant was expecting it to be. This solution works, but why is ant looking there for it anyway? I have triple checked my settings, and they all seem right.
I'm using WinXP Corporate SP2 with all available updates.
 
[quote author=efilnikufecin link=topic=111.msg582#msg582 date=1146462997]
This solution works, but why is ant looking there for it anyway? I have triple checked my settings, and they all seem right.
I'm using WinXP Corporate SP2 with all available updates.
[/quote]
Thanks for posting this solution! I hope it works for Wolfie as well.

I think an alternate solution would be to adjust your CLASSPATH environment variable; I suck enough at windows (I'm a unix guy, and recently I'm starting to learn MacOSX) that I won't try to walk you through how to do it, but if you can find the right place to set your environment variables and add the jdk/lib folder to the CLASSPATH, then it might not need to be copied/moved. You would probably have to log out and log back into windows for this kind of change to take effect.

It occurs to me that instructions for changing environment variables are probably included in the jdk install docs somewhere. Or at least I would hope so. :)
 

Wolfie

New member
the fix efilnikufecin posted worked it had to do with the tools.jar file not being found now i compiled it with ant and it said all was successfull but upon login through kolm theres errors should i post the error log info somewhere?
 
[quote author=Wolfie link=topic=111.msg595#msg595 date=1146531033]upon login through kolm theres errors should  i post the error log info somewhere?[/quote]

Sure, go ahead and send the error log to me in a PM and I'll take a look at it for you.
 
Top