Thank You sir, it have been great idea to worked with the responses....but still i'm stucked on if function here my new codes
Code: Select all
automacro SetPertanyaan {
console /(\d+)\s+?(Hide|Thief Bug|30)/i
run-once 1
call JawabTanya
}
macro JawabTanya {
log Response : $.lastMatch2
pause 3
if ($.lastMatch2 == "Hide") call Jawab1
pause 2
if ($.lastMatch2 == "Thief Bug") call Jawab2
pause 2
if ($.lastMatch2 == "30") call Jawab3
pause 2
release SetPertanyaan
}
macro Jawab1 {
do c A
}
macro Jawab2 {
do c B
}
macro Jawab3 {
do c C
}
and it's returned [macro] JawabTanya error: error in 2: syntax error in if statement,
i used "chat" command to checked my if function worked or not, it seems did not worked at all
coz if my if statement didn't worked all set question will have answer for my first if and it returns 50 points that will failed on rogue test except the same set question for my first set question, on my code above console /(\d+)\s+?(Hide|Thief Bug|30)/i it means Hide for set question one, Thief Bug for set question 2 and 30 for set question 3
And if i'd tried code if like this
Code: Select all
macro JawabTanya {
log Response : $.lastMatch2
pause 3
if ($.lastMatch2 == "Hide") {
do c A
}
pause 2
if ($.lastMatch2 == "Thief Bug") {
do c B
}
pause 2
if ($.lastMatch2 == "30") {
do c C
}
pause 2
release SetPertanyaan
}
it will appeared at the start turn on my bot showed error message like this
control\macros.txt: ignoring line 'if ($.lastMatch2 =~ /Thief Bug/) {' (munch,
munch, strange block)
control\macros.txt: ignoring line 'if ($.lastMatch2 =~ /30/) {' (munch, munch,
strange block)
control\macros.txt: ignoring '}' (munch, munch, strange food)
only this step i failured, i just so stucked with this if statement T-T and for the last quote if i pushed the OK then shows error message like this
[macro] JawabTanya error: error in 2: syntax error in if statement