Openkore.com
http://forums.openkore.com/

[DarkRO] Blackjack Dealer Bot
http://forums.openkore.com/viewtopic.php?f=33&t=210083
Page 1 of 1

Author:  coarse [ 04 May 2015, 06:52 ]
Post subject:  [DarkRO] Blackjack Dealer Bot

You have to change #indexOfNPC to the index of the blackjack dealer when you type 'nl'
Other than that, it's good to go

You can change the strategy at the do automacro
dealer hand value is $dhvalue while player hand value is $phvalue

$phvalue will always be the soft value, if possible
Code:
macro startbj {
   do talk #indexOfNPC
   pause 1
   do talk cont
   do talk resp 1
   $start = 1
   $count = 0
}

macro stopbj {
   $start = 0
   $count = 0
}

automacro counter {
   var start == 1
   priority 10
   call {
      $count++
   }
   timeout 2
}

automacro botfilter {
   var count >= 3
   call {
      $count = 0
      do talk cont
   }
   timeout 8
}

automacro dhvalue {
   console /The DEALER has: (\d+)/
   call {
      $dhvalue = @eval($.lastMatch1)
      $count = 0
   }
}

automacro phvalue {
   priority 2
   console /YOU have: (\d+)/
   call {
      pause 1
      $count = 0
      $phvalue = @eval($.lastMatch1)
      do talk cont
   }
}

automacro phvalues {
   console /You have: (\d+)/
   call {
      pause 1
      $count = 0
      $phvalue = @eval($.lastMatch1)
      do talk cont
   }
}

3-14, double down
15 to 16, stay if dealer's hand is 16 and below; else hit
17-21, stay

automacro do {
   console /Stay/
   call {
      pause 1
      $count = 0
      if ($phvalue >= 17) {
         do talk resp 1
      } elsif ($phvalue <= 16 && $phvalue >= 15) {
         if ($dhvalue <= 16) {
            do talk resp 1
         } else {
            do talk resp 0
         }
      } else {
         do talk resp 2
      }
   }
}

automacro dealer {
   console /The Dealer is/
   call {
      $count = 0
      do talk cont
   }
}

automacro dealer stay {
   console /The Dealer stays/
   call {
      $count = 0
      do talk cont
   }
}

automacro deal {
   console /the cards are being dealt/
   call {
      $count = 0
      do talk cont
   }
}

automacro prebet {
   console /Please place your bets.../
   call {
      $count = 0
      do talk cont
   }
}

automacro bet {
   console /1,000,000z/
   call {
      pause 1
      $count = 0
      do talk resp 5
   }
}

automacro ddown {
   console /chosen to Double Down/
   call {
      $count = 0
      do talk cont
   }
}

automacro notenuf {
   console /You must pull/
   call {
      $count = 0
      do talk cont
   }
}

automacro lose {
   console /sorry but/
   call {
      $count = 0
      $dhvalue = 0
      $phvalue = 0
      do talk cont
   }
}

automacro win {
   console /you've won/
   call {
      $count = 0
      $dhvalue = 0
      $phvalue = 0
      do talk cont
   }
}

automacro push {
   console /You tied with/
   call {
      $count = 0
      $dhvalue = 0
      $phvalue = 0
      do talk cont
   }
}

Author:  Jenjuro [ 04 May 2015, 15:42 ]
Post subject:  Re: [DarkRO] Blackjack Dealer Bot

Sir Pahingi naman po ng mismong bot sa dark ung server.text po sana or kung pwede buong bot napo maraming salamat po godbless

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/