regexp multiline for npc autotalking (casino slot machine)

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

Moderator: Moderators

wakoko79
Noob
Noob
Posts: 4
Joined: 06 Dec 2011, 13:29
Noob?: Yes

regexp multiline for npc autotalking (casino slot machine)

#1 Post by wakoko79 »

HI, this is my first botting experience and I'm quite excited.. I'm on dreamerRO, there is a casino there where I can gamble.
Basically I want my character to auto-gamble. There is a anti-cheat system where you have to type a string (colored in red) correctly to continue on gambling, but first things first. I also have issues with multiple line checking, can it be implemented here?

This is how I see things would go:
1. Automatically talk to npc at 187,107

Code: Select all

talknpc 187 107 c
if I'm not currently talking to it.
I imagine I will use a variable that specifies if I already talked to that npc or not
2. Continue talking to it with the correct response, in this case

Code: Select all

talk resp 0
to play the game.
Here is the console printout:
Slot Machine#slot2-7: [Slot Machine]
Slot Machine#slot2-7: '-^-. What do you want? .-^-'
Slot Machine#slot2-7: Type 'talk cont' to continue talking
----------Responses-----------
# Response
0 Play
1 View Instruction
2 Exit
3 Cancel Chat
-------------------------------
Slot Machine#slot2-7: Type 'talk resp #' to choose a response.
notes:
Clearly, this would require multiple line regexp, which I'm really not familiar with since I'm new(actually just started because of openkore) to scripting and whatnots, I have experience programming in C, but totally nada in scripting. But I think I can settle with this regexp "Type 'talk resp #' to choose a response"
Another issue with this is, as I understand, the console event triggers anything that can be seen from the console. There are times when some lines are inserted in between this multiline regexp, because of this, I really think a single line should do the trick HERE
3. It will then prompt me to input amount, I want to input "2000000". Here's the prompt after the talk resp 0 from #2:
Slot Machine#slot2-7: [Slot Machine]
Slot Machine#slot2-7: '-^-. Insert zeny to bet .-^-'
Slot Machine#slot2-7: (maximum bet: 2000000 )
Slot Machine#slot2-7: Type 'talk num <number #>' to input a number.
4. At this point(it's 5:35am here, I haven't slept yet) I really want to sleep so I'm just posting the whole thing that I want to automate. As you can see, this go on and on with the initial exception that the first command (talknpc 187 107 c) is not repeated.
talknpc 187 107 c
Talking to NPC at (187, 107) using sequence: c
Slot Machine#slot2-7: [Slot Machine]
Slot Machine#slot2-7: '-^-. What do you want? .-^-'
Slot Machine#slot2-7: Type 'talk cont' to continue talking
Player ImBringiingSexyback (2) uses Greed on himself (Lv: 1)
----------Responses-----------
# Response
0 Play
1 View Instruction
2 Exit
3 Cancel Chat
-------------------------------
Slot Machine#slot2-7: Type 'talk resp #' to choose a response.
Player ImBringiingSexyback (2) uses Greed on himself (Lv: 1)
[dist=20.6] xX Capricorn Xx (5): tah ai?
Player ImBringiingSexyback (2) uses Greed on himself (Lv: 1)
Player ImBringiingSexyback (2) uses Greed on himself (Lv: 1)

talk resp 0
Player ImBringiingSexyback (2) uses Greed on himself (Lv: 1)
Slot Machine#slot2-7: [Slot Machine]
Slot Machine#slot2-7: '-^-. Insert zeny to bet .-^-'
Slot Machine#slot2-7: (maximum bet: 2000000 )
Slot Machine#slot2-7: Type 'talk num <number #>' to input a number.
[dist=17.7] ImBringiingSexyback (2): voltei
The NPC did not respond.
Slot Machine#slot2-7: Type 'talk cont' to continue talking
talk num 2000000
[dist=20.6] xX Capricorn Xx (5): XD
You lost 2,000,000 zeny.
Slot Machine#slot2-7: [Slot Machine]
Slot Machine#slot2-7: | | | |
Slot Machine#slot2-7: | K | Q | J |
Slot Machine#slot2-7: | | | |
Slot Machine#slot2-7: Type 'talk cont' to continue talking
[dist=17.7] ImBringiingSexyback (2): bom
[dist=20.6] xX Capricorn Xx (5): *Heh*
[dist=17.7] ImBringiingSexyback (2): peguei algo?^/

talk cont
Slot Machine#slot2-7: [Slot Machine]
Slot Machine#slot2-7: '-^-. What do you want? .-^-'
Slot Machine#slot2-7: Type 'talk cont' to continue talking
[dist=20.6] xX Capricorn Xx (5): como vc fez isso
[dist=20.6] xX Capricorn Xx (5): ?

talk cont
----------Responses-----------
# Response
0 Play
1 View Instruction
2 Exit
3 Cancel Chat
-------------------------------
Slot Machine#slot2-7: Type 'talk resp #' to choose a response.t2-7: Type 'talk resp #' to choose a response.------
Slot Machine#slot2-7: Type 'talk resp #' to choose a response.
NOTES:
BLUE color is what I typed on openkore(using svn, xkore 0)
GREEN texts are the other extra lines I'm talking about, (verbose 1)
RED text is warning(or whatever) from openkore. I think openkore is auto continuing talking eventhough my config says autoTalkCont 0. I really don't know.

I'm just starting to get hold of what I have to do, here are some things I typed:
automacro gamble_0 {
console /Type 'talk resp #' to choose a response/
call {
do talk resp 0
}
}

automacro gamble_1 {
console /'-\^-\. Insert zeny to bet \.-\^-'/
call {
do talk num 2000000
}
}
I spent the night trying to understand what I can with openkore.. But I think this is my limit for this day, I really have to sleep >.<
Please help me here guys.. Thanks a lot in advance! =)
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: regexp multiline for npc autotalking (casino slot machine)

#2 Post by EternalHarvest »

"talknpc" expects a whole dialog sequence and it can handle it without additional triggers for every NPC's line (as long as the dialog stays similar). It closes dialog at the end, so either put the whole dialog sequence in it, or use "e" code to prevent closing, or use "talk @npc(187 107)" to start talking instead of "talknpc 187 107".
wakoko79
Noob
Noob
Posts: 4
Joined: 06 Dec 2011, 13:29
Noob?: Yes

Re: regexp multiline for npc autotalking (casino slot machine)

#3 Post by wakoko79 »

EternalHarvest wrote:"talknpc" expects a whole dialog sequence and it can handle it without additional triggers for every NPC's line (as long as the dialog stays similar). It closes dialog at the end, so either put the whole dialog sequence in it, or use "e" code to prevent closing, or use "talk @npc(187 107)" to start talking instead of "talknpc 187 107".
got it.. thanks =)

Now I got a new problem with extracting strings(captcha). Here's a sample console printout:
Slot Machine#slot2-7: Hello palopalopalo
Slot Machine#slot2-7: Sorry to bother but we're trying to stop people from cheating our system.
Slot Machine#slot2-7: Type 'talk cont' to continue talking
Slot Machine#slot2-7: [Slot Machine]
Slot Machine#slot2-7: Please insert what the box says!
Slot Machine#slot2-7: | g43g432f |
Slot Machine#slot2-7: Type 'talk text' (Respond to NPC)2f[/color] |
Slot Machine#slot2-7: Type 'talk text' (Respond to NPC)
What I want to do here is to extract g43g432f and to store it in a variable so that I can use it.
here is what I did, note that prior to this, a macro that I activate always locks the macro captcha_2.

Code: Select all

automacro captcha {
  priority 0
  console /[color=#0000FF]Please insert what the box says[/color]/

  release captcha_2
}

automacro captcha_2 {
  priority 0
  console /[color=#40BF00]Slot Machine#slot2-7: \|[^<>]+\|[/color]/

  $var1 = $.lastMatchN
}
The string "Slot Machine#slot2-7: | " is pretty common so I captcha_2 is initially locked.
From what I've read, $.lastMatchN returns the last regexp match (not sure about this).
But the thing is I don't know how to delete the extra characters so that the captcha will be the only thing remaining.

Please help again, thanks!!
walkhima
Noob
Noob
Posts: 1
Joined: 16 Jan 2012, 05:29
Noob?: No

Re: regexp multiline for npc autotalking (casino slot machine)

#4 Post by walkhima »

How to throw a las vegas/casino themed party? I'm planning on having a las vegas/ casino style party for my birthday. I'm on a rather tight budget so I'm looking for some creative ideas that I could do to recreate a casino, and some casino games I could have without having to buy game tables. Also what type of food/ decorations should I have?
darktaz15
Noob
Noob
Posts: 7
Joined: 13 Oct 2011, 10:19
Noob?: Yes

Re: regexp multiline for npc autotalking (casino slot machine)

#5 Post by darktaz15 »

bro i think you made this work already .. cause ive seen some characters there that are in the slots for almost 24/7 then goes to the atm to change it to money bags.. can you share the rcvpackets.txt with me.. and if possible the macro's cause i really dont have an idea how to make macro's .. second about the rcvpackets.txt i cant extract it via JCV tools and tried the other methods but it just doesnt work for me.
wakoko79
Noob
Noob
Posts: 4
Joined: 06 Dec 2011, 13:29
Noob?: Yes

Re: regexp multiline for npc autotalking (casino slot machine)

#6 Post by wakoko79 »

darktaz15 wrote:bro i think you made this work already .. cause ive seen some characters there that are in the slots for almost 24/7 then goes to the atm to change it to money bags.. can you share the rcvpackets.txt with me.. and if possible the macro's cause i really dont have an idea how to make macro's .. second about the rcvpackets.txt i cant extract it via JCV tools and tried the other methods but it just doesnt work for me.

I quit DreamerRO about 6 months ago. I quit gaming 6 months ago 'coz I needed to study. I also deleted my openkore and all the files with it so I don't have anything now, sorry dude... But I'm getting bored so I might be active again next month or so =)
zarge
Noob
Noob
Posts: 18
Joined: 14 Oct 2010, 05:08
Noob?: Yes

Re: regexp multiline for npc autotalking (casino slot machine)

#7 Post by zarge »

hello :) i cant seem to figure out this line

Code: Select all

console /[color=#40BF00]Slot Machine#slot2-7: \|[^<>]+\|[/color]/
this is all i need im all set.. please help? :) thanks in advance
FrankMarello
Noob
Noob
Posts: 1
Joined: 13 Jan 2013, 04:10
Noob?: No

Re: regexp multiline for npc autotalking (casino slot machine)

#8 Post by FrankMarello »

This is controlled by the laws in your state, however, that wording sounds as if your state makes a difference between free slot machine horse-racing and casino gambling. It SOUNDS as if you can bet on horse races but not play the slots or table games inside the casino.