fairieswearboots
New member
Hi people,
Can someone please tell me what I am doing wrong in the script below? I've been unable to get this ash script to work; Mafia keeps giving me unexpected error messages when I use it.
This is the .ash script:
#yetifight.ash
void main() {
string PAGEDATA = "";
repeat {
if(have_effect($effect[On the trail])==0) {
print("Casting Transcendent Olfaction...");
PAGEDATA = use_skill(1, $skill[Olfaction]);
} else {
print("On the Trail effect still active!");
#PAGEDATA = attack();
}
} until(
# general win/loss messages
contains_text(PAGEDATA, "You win the fight!") ||
contains_text(PAGEDATA, "You lose the fight!") ||
contains_text(PAGEDATA, "You run away, like a sissy little coward")
);
}
This is the CCS I call it from:
[Knott Yeti]
1: consult yetifight.ash
I've been doing a lot of reading in the forums to try to find the solution myself, but to no avail. :-\
[edit]
sorry i forgot to mention i am using build 5715 of kolmafia
[/edit]
[another edit]
excerpt from the debug log:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
KoLmafia r5715, Linux, Java 1.6.0_04
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Please note: do not post these logs in the KoLmafia thread. If
you would like us to look at the log, please instead email logs
to holatuwol@hotmail.com using the subject "KoLmafia Debug Log"
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Timestamp: Sun Feb 10 21:09:43 CET 2008
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Unexpected error, debug log printed.
class java.lang.ArrayIndexOutOfBoundsException: -1
java.lang.ArrayIndexOutOfBoundsException: -1
at net.sourceforge.kolmafia.textui.Interpreter.requestUserParams(Interpreter.java:355)
at net.sourceforge.kolmafia.textui.Interpreter.executeScope(Interpreter.java:273)
at net.sourceforge.kolmafia.textui.Interpreter.execute(Interpreter.java:217)
at net.sourceforge.kolmafia.request.FightRequest.nextRound(FightRequest.java:306)
at net.sourceforge.kolmafia.request.FightRequest.nextRound(FightRequest.java:257)
at net.sourceforge.kolmafia.request.FightRequest.runOnce(FightRequest.java:638)
at net.sourceforge.kolmafia.request.FightRequest.run(FightRequest.java:672)
at net.sourceforge.kolmafia.LocalRelayAgent$CustomCombatThread.run(LocalRelayAgent.java:467)
[/another edit]
Can someone please tell me what I am doing wrong in the script below? I've been unable to get this ash script to work; Mafia keeps giving me unexpected error messages when I use it.
This is the .ash script:
#yetifight.ash
void main() {
string PAGEDATA = "";
repeat {
if(have_effect($effect[On the trail])==0) {
print("Casting Transcendent Olfaction...");
PAGEDATA = use_skill(1, $skill[Olfaction]);
} else {
print("On the Trail effect still active!");
#PAGEDATA = attack();
}
} until(
# general win/loss messages
contains_text(PAGEDATA, "You win the fight!") ||
contains_text(PAGEDATA, "You lose the fight!") ||
contains_text(PAGEDATA, "You run away, like a sissy little coward")
);
}
This is the CCS I call it from:
[Knott Yeti]
1: consult yetifight.ash
I've been doing a lot of reading in the forums to try to find the solution myself, but to no avail. :-\
[edit]
sorry i forgot to mention i am using build 5715 of kolmafia
[/edit]
[another edit]
excerpt from the debug log:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
KoLmafia r5715, Linux, Java 1.6.0_04
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Please note: do not post these logs in the KoLmafia thread. If
you would like us to look at the log, please instead email logs
to holatuwol@hotmail.com using the subject "KoLmafia Debug Log"
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Timestamp: Sun Feb 10 21:09:43 CET 2008
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Unexpected error, debug log printed.
class java.lang.ArrayIndexOutOfBoundsException: -1
java.lang.ArrayIndexOutOfBoundsException: -1
at net.sourceforge.kolmafia.textui.Interpreter.requestUserParams(Interpreter.java:355)
at net.sourceforge.kolmafia.textui.Interpreter.executeScope(Interpreter.java:273)
at net.sourceforge.kolmafia.textui.Interpreter.execute(Interpreter.java:217)
at net.sourceforge.kolmafia.request.FightRequest.nextRound(FightRequest.java:306)
at net.sourceforge.kolmafia.request.FightRequest.nextRound(FightRequest.java:257)
at net.sourceforge.kolmafia.request.FightRequest.runOnce(FightRequest.java:638)
at net.sourceforge.kolmafia.request.FightRequest.run(FightRequest.java:672)
at net.sourceforge.kolmafia.LocalRelayAgent$CustomCombatThread.run(LocalRelayAgent.java:467)
[/another edit]