Help with have_equipped and equipped_item

Camber

Member
These 2 ASH functions are returning incorrect/random values for non-standard or no familiar equipment, but work fine with the default familiar equipment. and i don't know why.

The code snippet below explains the core problem i am having. I ran it with the Mosquito equipped with the ant hoe. The script first returns saying i have the hypo equipped, which is just not so! I then manually unequipped the ant hoe and ran the script again, with the same results. Earlier it said i had nothing equipped. It almost seems random, unless the default item is equipped.

Anyone have any ideas? Thanks!


Code:
void test() {
	print("Familiar= " + my_familiar() );
	item ito = equipped_item( $slot[ familiar ]);
	print("*** Initially Equipped_Item= " + ito );

	if (have_equipped(to_item("ant hoe"))) {
		cli_execute("unequip " + "ant hoe");
		ito = equipped_item( $slot[ familiar ]);
	}
	print("----Equipped_Item= " + ito );
}
void main() {
	test();
}

Results:
Code:
> call scripts\3testundress_pets.ash

Familiar= Mosquito
*** Initially Equipped_Item= hypodermic needle
----Equipped_Item= hypodermic needle
 

hippymon

Member
I see nothing wrong with the outcome of your "snippet." Seems the problem is not within KoLmafia, but within the script. Meaning: you want apples from a banana tree.

EDIT: re-read the post, it seems that maybe you should include cli_execute("refresh fam equip"); or "fam" or "equip" whichever works....
 

Camber

Member
Thank you, thank you, thank you! Frustration is at an end!

cli_execute("refresh equip"); did the trick.

Question - Is there a list of cli_execute commands anywhere?
 

hippymon

Member
Not necessarily a list of ALL command's but there is a CLI manual with multiple commands explained.
If you know how to interpret it, you may also look up the "KoLmafiaCLI.java" file with the ".tar.gz" mafia download or simply visit: here.
 

macman104

Member
In the link hippymon posted, you'll want to browse through the commands that start around line 406. Alternatively search for the string "private void executeCommand".
 

dangerpin

Member
Since I had to research this for a question elsewhere I figured I would put it in here for easier searching. This is a (possibly) incomplete collection of CLI commands.

Code:
CLI Command List

updated from [url]http://kolmafia.sourceforge.net/scripting.html[/url]
and KoLmafiaCLI.java
[url]http://kolmafia.svn.sourceforge.net/viewvc/kolmafia/src/net/sourceforge/kolmafia/KoLmafiaCLI.java?view=markup[/url]

priphea
chat
mail
event
compose
gift
option \ opt
item
gear
pvp
.php
relay \ serve
forum
wait \ pause
conditions \ objectives
conditions clear
conditions check
conditions list
update
abort
echo timestamp
echo kol-date
set
set battleaction
get
if
inv
while
relogin \ timein
login
exit \ quit \ logout
verify \ validate \	call \ run \ exec \ load \ start
repeat
moon
debug on
debug off
mirror end
mirror stop
mirror close
lookup
survival	getdata
breakfast
refresh
refresh all
refresh status
refresh effects
refresh gear
refresh equipment
refresh outfit
refersh inv
refresh storage
refresh familiar
refresh terrarium
entryway
maze	\ hedgemaze
tower	\ guardians
chamber
leaflet
leaflet nomagic
nemesis
guild
gourd
tavern
train
train base
train buffed
train turns
council
campground
campground toast
campground relax *not working?
campground rest
campground bookshelf ???
cast \	skill
uneffect \ remedy \ shrug
retrieve \ aquire
retrieve worthless item
aquire worthless item
clan
clan snapshot
clan stashlog
print \ list \ show ("<font color=black>")
eat
drink
use
zap
smash \ pulverize
create
make
bake
mix
smith
tinker
untinker
mallsell \ automall
stash
stash put
stash take
hagnk
sell \ autosell
reprice \ undercut
mind-control \ mcd
field
field plant square spore
field pick square
field harvest
field show
adventure
donate
equip \ wear \ wield
equip offhand
equp <slotname> <itemname>
unequip \ remove
unequip offhand
unequip fake hand
familiar
familiar list
closet
closet take
closet put
closet list
display
display take
display put
outfit
outfits
outfit list
outfit equip
checkpoint
buy \ mallbuy
buffbot
searchmall
searchmall with limit
pvplog
hermit
trapper
hunter
galaktik ** Not working properly
restore \ recover \ check (used with hp, mp, mana or health)
trigger
trigger clear
trigger autofill
mood
moode execute
mood clear
mood autofill
restaurant
brewery
kitchen
toast
rest
arches ** Not working properly
send \ kmail
csend
insults
dusty
!
demons
summon
call
using
counters
concert
summary [filename]
encounters [filename]
win game
gc
version
alias
unalias
basement
newdata
checkdata
checkplurals
checkmodifiers
clear \ cls
ashref
wiki \ lookup
monsters ??
second \ hold \ dualwield
up
flowers
raffle
styx
friars
mpitems
sofa \ sleep
storage
session
safe
ghost
hobo
clear counters
telescope look high 
telescope look low
epic weapon

*Epic weapon rocks!
 

smanoli

New member
Just FYI http://kolmafia.svn.sourceforge.net...ceforge/kolmafia/KoLmafiaCLI.java?view=markup is a much more recent version of the KOLmafiaCLI.java file than is linked above.

Also the galaktik command seems to be removed entirely. It's no longer in the KOLmafiaCLI.java file. Reversion 3863 removed that command.

On another note, are there plans to add back in the galaktik functionality. I'd love to have support for being able to heal a certain number of hp from the doc via CLI. There are sevral times where I've wanted to only heal 1hp but as far as I can tell there's no way to do from CLI. Something along the lines of galaktik hp x or galalktik mp x where x is the amount to heal perhaps. Looking at the code it seems like this is doable by adding something like this back into KoLmafiaCLI.java:
Code:
if ( command.startsWith( "galaktik" ) )
{
  String[] params = parameters.split( " ", 2);

  GalaktikRequest galaktik = new GalaktikRequest(params[0], Integer.parseInt(params[1]));
  galaktik.run();
}

That should give the form of galaktik {curehp | curemp} <amount to restore>. Of course my quick little bit of code has no nice checking for inputs in the correct form but that should be easy to add.
 

dangerpin

Member
Fixed, well sort of fixed, thanks for the input.

Edit* added clear counters
Edit** added Epic Weapon 7/6/08
 
Top