This recreated thread into a post is about using
Notepad++, which is a free and mature source code editor that supports several languages out of the box. In addition, it also supports User Defined Languages, which is the feature I used to define the syntax highlighting specific to the custom coding language that Egor and Mad Scientist have come up with.
There are several other features that Notepad++ has that make it a superior tool to Notepad for writing code, but in the interest of keeping this post from becoming too long I’ll refer you to the Notepad++ site to discover those. You won't be disappointed.
Bottom line, if you’ll just be writing short code snippets here and there, Notepad++ is probably overkill. But, if you’re writing long profiles and/or are a programmer, Notepad++ is a great way to go. And with post-flop coding on the horizon, folks will probably be generating more, not less, code.
If you’ve read this far and are still with me, you may think that syntax highlighting and Notepad++ are the greatest things since sliced bread (or at least the greatest thing since Shanky’s Hold ‘em Poker Bot ) … so let’s get this party started.
To use Notepad++ you need to go out, download a copy and install it. As I mentioned before, it’s free to use. The Notepad++ homepage is located at
http://notepad-plus.sourceforge.net/uk/site.htm.
If you’re a programmer you might be interested in downloading the binary and/or the source files. For most folks, though, all you really need is the file that's in “executable installer format”, which is called
npp.5.1.4.Installer.exe, and can be downloaded from
http://sourceforge.net/project/showfiles.php?group_id=95717&package_id=102072.
After you’ve installed Notepad++ you now have a tool that’s waaaay better than Notepad for writing code. Still, out of the box it doesn’t know about the PokerBot, so you need a way to tell Notepad++ how to recognize the syntax of the PokerBot’s language. You can always create your own user-defined language if you choose, of course … or you’re welcome to use the files I’ve already created.
Back to top
« Last Edit: Feb 5th, 2009 at 3:30pm by Bender »
Posts: 211 Syntax Highlighting with Notepad++
Reply #3 - Feb 5th, 2009 at 3:19am
I’ve created three files and uploaded them to the Internet for you to download …
1) userDefineLang.xmlThis is the first of two files you’ll need to copy to your copy of Notepad++.
The file can be downloaded from:
http://www.2shared.com/file/4802755/91af479d/userDefineLang.htmlThe password is
shanky.
2) stylers.xmlThis is the second of two files you’ll need to copy to your copy of Notepad++.
The file can be downloaded from:
http://www.2shared.com/file/4802760/cae8e0d1/stylers.htmlAgain, the password is
shanky.
Once you’ve downloaded the first two files, you’ll need to replace the copies of the files that are already on your PC with the copies you’ve just downloaded. But first, you need to run Notepad++ at least once to create these files. So, open Notepad++ and then close it, and then you can proceed to the next step.
The
userDefineLang.xml and stylers.xml files are located in the “Application Data” subfolder in your user's Documents and Settings folder. To locate this file open a command window
(START > Run) and key in …
%APPDATA%\Notepad++
… then hit ENTER. A window will open containing several files. Replace the original
userDefineLang.xml and
stylers.xml files with the copies you just downloaded. (Note that the
userDefineLang.xml file may not exist if you haven’t used that feature in Notepad++ yet.)
3) Example of a Complete Preflop Limit Profile.txtThis is a copy of the sample code that Egor has written for the Pokerbot Customizing Guide documentation on pages 28-33. If you already have your own code then you don’t really need this file. I included it here so you don’t have to write some new code from scratch.
The file can be downloaded from:
http://www.2shared.com/file/4802765/ba82145e/Example_of_a_Complete_Preflop_Limit...
The password is (you guessed it)
shanky.
[Warning: Once you open this file in Notepad++ you may never go back to plain old Notepad again. ]
Back to top
« Last Edit: Feb 5th, 2009 at 5:39am by Bender »
Posts: 211 Syntax Highlighting with Notepad++
Reply #4 - Feb 5th, 2009 at 3:20am
You can now open this file in Notepad++ and voilà!
The code should look like the code at the top of this thread. This is all configurable, so you can tailor it to your own preferences if you don’t like my style.
• In my case I chose to take the “structural” keywords (custom, preflop, flop, turn, river) and color them
orange.
• I colored the
When statement keyword as well as the
Operators (and, or, not)
blue.
•
Comments are
green.
• Keywords that have to do with
Conditions (hand, suited, in, bigblind, smallblind, button) and
Variables (folds, checks, calls, bets, raises, opponents, opponentsleft, opponentsattable, stilltoact, betsize, folds, checks, calls, bets, raises, opponents, opponentsleft, opponentsattable, stilltoact, betsize, potsize, botslastaction, stacksize, potsize, botslastaction, stacksize) are colored
black.
•
Action keywords (beep, call, play, raise, raisemin, raisehalfpot, raisepot, raisemax, fold, bet, betmin, bethalfpot, betpot, betmax, force) are colored magenta.
•
Comparators (=, <, >, <=, >=, %) are
black.
• One feature I added that helps me, and I think you might find useful, is that any code that is enclosed in parenthesis is highlighted with a
yellow background. It helps me make sure that parethesis are used in pairs correctly.
I hope you enjoy using Notepad++ and I especially hope that you find my syntax highlighting helpful. Again, you don’t have to use my style … if you have ideas of your own you can certainly configure Notepad++ to your liking. I’ll provide some links below, including links to the Notepad++ documentation.
Back to top
« Last Edit: Feb 5th, 2009 at 3:37pm by Bender »
Posts: 211 Syntax Highlighting with Notepad++
Reply #5 - Feb 5th, 2009 at 3:20am
Here are some links that you might find helpful …
Notepad++ home pagehttp://notepad-plus.sourceforge.net/uk/site.htmNotepad++ User Manualhttp://notepad-plus.sourceforge.net/commun/helpFiles/Notepad++.UserManual.pdf.zipNotepad++ User Language Define System Manualhttp://notepad-plus.sourceforge.net/uk/UserLangDefineManual.pdfSome tips about defining your own language in Notepad++ http://notepad-plus.wiki.sourceforge.net/Customise+languagesExcel file for calculation of Random Variable
Aug 2nd, 2010 at 12:49pm
Since now and then, people are confused about the random variable and there are lots of questions about it,
I have made a small excel file to calculate the correct random variable for up to 6 actions with customizable percentages.
Just fill out the second column and you will get the appropriate numbers and an example codeblock for you to use.
EDIT: added a reverse calculation to go from the random numbers to the actual percentages as requested (only included in the download)
I made the download a .rar file, because the xlsx extension did not work properly on my computer.
http://www.mediafire.com/file/zh5yl8rk7g45hdq/random.rarBack to top
« Last Edit: Aug 31st, 2010 at 2:14pm by Transporter »
________________________________________
calculate random variables: http://bonusbots.com/supportforum/YaBB.pl?num=1280749784
Posts: 1108 Re: Excel file for calculation of Random Variable
Reply #1 - Aug 8th, 2010 at 1:29am
I had also made something similar in excell at work when I got bored. I wonder if there is someone out there that could make something like this that does not require excell. I dont really feel like loading excell on my laptop.
Posts: 1108 Re: Excel file for calculation of Random Variable
Reply #2 - Aug 8th, 2010 at 7:05am
I got the file converted to the older format on the net. This is just what I needed to get the desired reults with layered variable code.
Posts: 229
Switzerland Re: Excel file for calculation of Random Variable
Reply #3 - Aug 9th, 2010 at 6:14pm
Transporter! Thank you very much for this contribution. Helped me much !
Posts: 36 Re: Excel file for calculation of Random Variable
Reply #4 - Aug 20th, 2010 at 5:41am
I copied the Random Variable calculator to Google Docs so anyone without Exel can use it. No sign in needed. Please drop me a PM if someone jacks it up and I'll copy the original back to it.
https://spreadsheets.google.com/ccc?key=0ArNYywcAEczZdDJuLTNMSy1weEc4eUxpUmxlMy1nMEE&hl=en&authkey=CLiIgcwD#gid=0