I need help on macro console condition

All about the macro plugin can be found in this forum. This forum is intended for the macro plugin only.

Moderator: Moderators

ronron14
Noob
Noob
Posts: 4
Joined: 04 Jul 2011, 02:45
Noob?: No

I need help on macro console condition

#1 Post by ronron14 »

hi can somebody help me, I've been trying to make a macros.txt file and I can't seem to trigger the if statement for this example:

Code: Select all

----------Responses-----------
#  Response
0  No, never would I leave a quest!
1  Yah I'm pathetic... Pay 50000000z
2  Cancel Chat
-------------------------------
the code that i've used is this

Code: Select all

if (console =~ /1.+Yah.+I'm.+pathetic\.\.\..+Pay.+50000000z.+/) call giveup
is there something wrong with my code?
or do I need an extra plugin for my bot to recognize the npc Response list and be able to check it through console?
thanks in advanced..
ever_boy_
Developers
Developers
Posts: 308
Joined: 06 Jul 2012, 13:44
Noob?: No

Re: I need help on macro console condition

#2 Post by ever_boy_ »

yeah, your code is quite messed up.
so, you keep talking to the same npc till this "yah i'm pathetic" thing doesn't show up?
if so, show me what's the text when it doesn't show up.
ronron14
Noob
Noob
Posts: 4
Joined: 04 Jul 2011, 02:45
Noob?: No

Re: I need help on macro console condition

#3 Post by ronron14 »

the thing is the console condition in some way doesn't recognize the condition if it's under the response list of an npc **as show in the code above.. I was thinking of using eval() but I don't have the knowledge about that.. it doesn't trigger even if the console shows the text that is suppose to trigger the macro.. it doesn't really matter what the text is, it does not trigger right then and there.. I think it should use the eval() but the thing is I don't fully understand it..
ever_boy_
Developers
Developers
Posts: 308
Joined: 06 Jul 2012, 13:44
Noob?: No

Re: I need help on macro console condition

#4 Post by ever_boy_ »

ever_boy_ wrote:show me what's the text when it doesn't show up.
GotMilk25
Noob
Noob
Posts: 7
Joined: 04 Dec 2012, 17:47
Noob?: No

Re: I need help on macro console condition

#5 Post by GotMilk25 »

ronron14 wrote:hi can somebody help me, I've been trying to make a macros.txt file and I can't seem to trigger the if statement for this example:

Code: Select all

----------Responses-----------
#  Response
0  No, never would I leave a quest!
1  Yah I'm pathetic... Pay 50000000z
2  Cancel Chat
-------------------------------
the code that i've used is this

Code: Select all

if (console =~ /1.+Yah.+I'm.+pathetic\.\.\..+Pay.+50000000z.+/) call giveup
is there something wrong with my code?
or do I need an extra plugin for my bot to recognize the npc Response list and be able to check it through console?
thanks in advanced..
Can't you just use this? or you really need it to be in the if statement

Code: Select all

automacro test {
     console /Yah I'm pathetic\.\.\. Pay 50000000z/i
     call {
     ....
     stop
}
}