I've been working on this macro since the double xp end, and finaly, with the aid of the old forum, i'm finally successfull to make a nice macro for this game.
Thanks to ezza and everyone for the posts about general macro coding, regexp & eval using and all the stuff
This macro must be call with : macro hugelTroy (maybe because it's the main macro who start talking to the npc )
You should type nl before to make sure that TroyNPC is number 0 otherwise it will not talk with the right npc.
Autotalkcont MUST BE OFF. The best is to have a config that do absolutly nothing, no move, no storage etc ...
What this macro do :
-Talk to Troy, and make you start playing the game
-Start with shield answer, in case troy shows 'whats going on' option, bc he'll chose bow so you win
-Log troy's last answer
-Take care about the 'whats going on' option so you win the round
-Change answer if troy win because he will answer the same if we don't change
-Count & show how many times you have play each time you start again
-Loop again and again and again untill you, you're computer, or troy are dead (note : if you are dead irl, macro will still run)
Here the code
Code: Select all
###################################################
#
# macro for hugel minigames npc
# made by rastalo
# Using OpenKore 2.0.1
# Using Macro Plugin 1.3.5a
# U CAN USE THIS MACRO ONLY IF YOU AGREE WITH THE GENERAL OPEN SOURCE DISCLAMER
#
# created : 24/06/2008
# last modified : 29/06/2008
#
########################
# auto-answer for playing the game
#answer r1 to play
automacro TroyRespGame {
console /Game rules/
call TroyRespGameB
}
macro TroyRespGameB {
# pause 1
do talk resp 1
do talk cont
}
#answer r0 to play
automacro TroyRespPay {
console /Do Not Pay/
call TroyRespPayB
}
########################
# keep track of troy's last answer
macro TroyRespPayB {
# pause 1
do talk resp 0
do talk cont
release TroyResp
do talk cont
}
automacro Troysword {
console /Troy#fes: Sword!/
call TroyswordB
}
macro TroyswordB {
$troyLast = sword
call TroyRespC
}
automacro Troyshield {
console /Troy#fes: Shield!/
call TroyshieldB
}
macro TroyshieldB {
$troyLast = shield
call TroyRespC
}
automacro Troybow {
console /Troy#fes: Bow!/
call TroybowB
}
macro TroybowB {
$troyLast = box
call TroyRespC
}
########################
# if option 'whats going on' show up,
# calculate the winnin resp
automacro WhatsG0 {
console /0\s\swhat/
call WhatsG0B
}
automacro WhatsG1 {
console /1\s\swhat/
call WhatsG1B
}
automacro WhatsG2 {
console /2\s\swhat/
call WhatsG2B
}
automacro WhatsG3 {
console /3\s\swhat/
call WhatsG3B
}
macro WhatsG0B {
#whats going on is choice 0
#move up all aswers
if ($troyLast == sword) goto T0Going1
if ($troyLast == shield) goto T0Going2
if ($troyLast == box) goto T0Going3
:T0Going1
# dernier choix sword
$switch = 3
goto T0GoingEnd
:T0Going2
# dernier choix shield
$switch = 1
goto T0GoingEnd
:T0Going3
# dernier choix box
$switch = 2
goto T0GoingEnd
:T0GoingEnd
call TroyRespB
}
macro WhatsG1B {
#whats going on is choice 1
#move up aswers till 1
if ($troyLast == sword) goto T1Going1
if ($troyLast == shield) goto T1Going2
if ($troyLast == box) goto T1Going3
:T1Going1
# dernier choix sword
$switch = 3
goto T1GoingEnd
:T1Going2
# dernier choix shield
$switch = 0
goto T1GoingEnd
:T1Going3
# dernier choix box
$switch = 2
goto T1GoingEnd
:T1GoingEnd
call TroyRespB
}
macro WhatsG2B {
#whats going on is choice 2
#move up aswers till 2
if ($troyLast == sword) goto T2Going1
if ($troyLast == shield) goto T2Going2
if ($troyLast == box) goto T2Going3
:T2Going1
# dernier choix sword
$switch = 3
goto T2GoingEnd
:T2Going2
# dernier choix shield
$switch = 0
goto T2GoingEnd
:T2Going3
# dernier choix box
$switch = 1
goto T2GoingEnd
:T2GoingEnd
call TroyRespB
}
macro WhatsG3B {
#whats going on is choice 3
# => we don't care :)
if ($troyLast == sword) goto T3Going1
if ($troyLast == shield) goto T3Going2
if ($troyLast == box) goto T3Going3
:T3Going1
# dernier choix sword
$switch = 2
goto T3GoingEnd
:T3Going2
# dernier choix shield
$switch = 0
goto T3GoingEnd
:T3Going3
# dernier choix box
$switch = 1
goto T3GoingEnd
:T3GoingEnd
call TroyRespB
}
########################
# if 'whats going on' don't show up
automacro TroyResp {
run-once 1
console /3\s\sCancel Chat/
call TroyRespNext
}
#make sure we don't answer cancel
macro TroyRespNext {
if ($switch < 3) goto TroyRespSwitch
$switch = 2
:TroyRespSwitch
call TroyRespB
}
########################
# respond to npc
macro TroyRespB {
pause 1
log switch is $switch
if ($switch == 0) goto switch0
if ($switch == 1) goto switch1
if ($switch == 2) goto switch2
if ($switch == 3) goto switch3
:switch0
do talk resp 0
call TroyRespC
:switch1
do talk resp 1
call TroyRespC
:switch2
do talk resp 2
call TroyRespC
:switch3
do talk resp 3
call TroyRespC
}
macro TroyRespC {
do talk cont
log last answer is $troyLast
do talk cont
# pause 1
release TroyResp
do talk cont
}
########################
# in case of a tie: change answer for another
automacro TroyCollision {
console /Troy#fes: A head-on collision!/
call TroyColB
}
macro TroyColB {
log COLLISION !!!!!!!!!!!
if ($switch == 0) goto switchCol0
if ($switch == 1) goto switchCol1
if ($switch == 2) goto switchCol2
if ($switch == 3) goto switchCol3
:switchCol0
$switch = @rand(0,2)
if ($switch != 0) goto switchEnd
$switch = 1
goto switchEnd
:switchCol1
$switch = @rand(0,2)
if ($switch != 1) goto switchEnd
$switch = 2
goto switchEnd
:switchCol2
$switch = @rand(0,2)
if ($switch != 2) goto switchEnd
$switch = 1
goto switchEnd
:switchCol3
$switch = @rand(0,2)
goto switchEnd
:switchEnd
log NEW Switch IS $switch
call TroyRespC
}
########################
# If troy win, we need to change answer or it keep spamm and winning
automacro TroyWin {
console /Hahaha, Troy wins!/
call TroyWinB
}
macro TroyWinB {
log TROY WIN !!!!!!!!!!!
$temp = $switch
:TroyWinR
$switch = @rand (0,2)
if ($switch == $temp) goto TroyWinR
call TroyRespC
}
########################
# THIS IS THE START MACRO
macro hugelTroy{
# pause 1
$passe++
log =============== PASSE NUM $passe ==============
release TroyResp
# default answer is shield
$switch = 1
$troyLast = box
do talk 0
# pause 1
do talk cont
do talk cont
# pause 1
# on joue
# do talk resp 1
# do talk cont
# pause 1
# on paye
# do talk resp 0
# do talk cont
# do talk cont
# pause 1
# passe 1
# do talk resp 1
# do talk cont
# do talk cont
# do talk cont
# pause 1
# passe 2
# do talk resp 1
# do talk cont
# do talk cont
# do talk cont
# pause 1
# passe 3
# do talk resp 1
# do talk cont
# do talk cont
# do talk cont
# pause 1
# passe 4
# do talk resp 1
# do talk cont
# do talk cont
# do talk cont
# pause 1
# passe 5
# do talk resp 1
# do talk cont
# do talk cont
# do talk cont
}
########################
# do it again again again again again again again again ...
# untill the comp is dead :-)
automacro TroyRestart {
console /Done talking/
call hugelTroy
}
About this code
-macro should be 348 lignes with the } of the automacro TroyRestart, if not, tell me because you are mess up
-all the pause 1 are commented out, because i use console log and XKore 1, so it's slow enough to not have to make pause.
If you encounter bugs like 'You are not talking to a npc', uncomment them, and/or and more pauses.
-All the comments parts in macro hugelTroy are a very basic macro for playing the game, who do not take care of anything else than doing resp 1 all the time
-You can improve this macro, but YOU MUST POST YOUR MODS DOWN THERE !
-I run it for 1 hour :
about 85 games
about 300 tickets
-Comments are welcome
Have fun earning tickets !