openppl - the manual - documentation.help · what is openppl ppl is an acronym for poker...

124

Upload: duongnhan

Post on 17-Aug-2019

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots
Page 2: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

ThankYou!Abig“thankyou!”goestoeverybody,whohelpedustocreateOpenPPLandthisdocument:

AmstadBob4567CakeWalkChuckNeverMuckCoolBotMe123CrumbleSundayChuckstaDr.KaktuzEfuFn101GeckoJConnerJohnnyJokeDokeKaeKruseKyoLavezziMariano268MerzkiyTiponMorelloMrRuderNarfalNik0NPNGPastorPokerPoker_DogPostenjakQwertyRambamRelhbyR2D2

Page 3: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

SalemSatanikutStangelnatorSteveG1963StriklesSuperBlakTheHighFishThemAndMeTrishWant2LearnZolp

andtoeverybodywehaveforgotten.Withoutyourhelpitwouldnothavebeenpossibletocreatethismanual.Pleasecontactusatwww.maxinmontreal.com/forums,ifyoumissyournameonthelist.

Page 4: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

WhatIsOpenPPLPPLisanacronymforPokerProgrammingLanguage,alanguagetoprogrampokerbots.ItwasinventedbyShankyBonusBotstoeasethecustomizationoftheirproprietarybot-logic.Onedayanunnamedherodecidedtogiveawayhis“80%workingtranslator”totheOpenHoldemcommunity.SoOpenPPLwasbornandafteralongperiodofdevelopmentOpenPPLfinallygotcompletelyintegratedintoOpenHoldem.WhereasthefirstversionofOpenPPLneededtobetranslatedtoOH-script,OpenHoldemdoesnownativelysupportplain-textOpenPPLwithoutanytranslationsteps.SoOpenPPLnowcombinesthebestofbothworldsevenbetter:easinessofprogrammingandmightypotentialatthetables.

Page 5: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

TheAdvantageOfOpenPPL

OfcourseOpenPPLsupportsthemainfeaturesofPPL,especially:

aneasyEnglish-likeprogramminglanguage,thatcanbelearnedinnotime.alibraryofseveralhundredready-to-usefunctionsforaneasystart.

BesidesthatOpenHoldem&OpenPPLprovidesomeadditionalcoolfunctionalitythatyoumighthavemissedifyouhaveusedotherbotsinthepast:

knowingthestacksizeofeverysingleplayer.theabilitytoplayatanycasinoyouwant,providedyoucreateatablemapforit.theabilitytodevelopanddebugyourbotwithtoolslikeManualMode,PokerAcademyandPokerTH.DidyoueverwanttosimulateA2oatthebuttonoraflushdrawoutofpositionseveraldozentimesuntilyouaresatisfied?anauto-connector,thathandlesupto25tablesatoncewithlessthan1%CPU-overhead.Allyouhavetodo:openatableandsit-down.OpenHoldemconnectsautomatically(oneinstancepertable)andstartstoplay.abilitytousePokerTrackerstatsdirectlyinyourOpenPPL-code.

Butifyouareanexpertyoumightwanttomakeuseofsomeadvancedfeatures:

buildingsymbolsonyourown.accessingOpenholdem’snativesymbolsanddoinghand-rangecalculationsonthefly.

Andthebestofall:

youcancontributetotheprojecttomakeitevenbetter.it’sallforfree.Well—nearlyfree;ofcourseitrequiresabitoflearningandsomeworktobecomeamaster.

Welcometotheworldofopensource!

DocumentgeneratedbyeLyXer1.2.5(2013-03-10)on2015-09-

Page 6: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

29T21:35:37.750000

Page 7: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

GNUGENERALPUBLICLICENSE

Version3,29June2007

Copyright©2007FreeSoftwareFoundation,Inc.<http://fsf.org/>

Everyoneispermittedtocopyanddistributeverbatimcopiesofthislicensedocument,butchangingitisnotallowed.

Preamble

TheGNUGeneralPublicLicenseisafree,copyleftlicenseforsoftwareandotherkindsofworks.

Thelicensesformostsoftwareandotherpracticalworksaredesignedtotakeawayyourfreedomtoshareandchangetheworks.Bycontrast,theGNUGeneralPublicLicenseisintendedtoguaranteeyourfreedomtoshareandchangeallversionsofaprogram--tomakesureitremainsfreesoftwareforallitsusers.We,theFreeSoftwareFoundation,usetheGNUGeneralPublicLicenseformostofoursoftware;itappliesalsotoanyotherworkreleasedthiswaybyitsauthors.Youcanapplyittoyourprograms,too.

Whenwespeakoffreesoftware,wearereferringtofreedom,notprice.OurGeneralPublicLicensesaredesignedtomakesurethatyouhavethefreedomtodistributecopiesoffreesoftware(andchargeforthemifyouwish),thatyoureceivesourcecodeorcangetitifyouwantit,thatyoucanchangethesoftwareorusepiecesofitinnewfreeprograms,andthatyouknowyoucandothesethings.

Toprotectyourrights,weneedtopreventothersfromdenyingyoutheserightsoraskingyoutosurrendertherights.Therefore,youhavecertainresponsibilitiesifyoudistributecopiesofthesoftware,orifyoumodifyit:responsibilitiestorespectthefreedomofothers.

Forexample,ifyoudistributecopiesofsuchaprogram,whethergratisorforafee,youmustpassontotherecipientsthesamefreedomsthatyoureceived.Youmustmakesurethatthey,too,receiveorcangetthesourcecode.Andyoumustshowthemthesetermssotheyknowtheirrights.

Page 8: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

DevelopersthatusetheGNUGPLprotectyourrightswithtwosteps:(1)assertcopyrightonthesoftware,and(2)offeryouthisLicensegivingyoulegalpermissiontocopy,distributeand/ormodifyit.

Forthedevelopers'andauthors'protection,theGPLclearlyexplainsthatthereisnowarrantyforthisfreesoftware.Forbothusers'andauthors'sake,theGPLrequiresthatmodifiedversionsbemarkedaschanged,sothattheirproblemswillnotbeattributederroneouslytoauthorsofpreviousversions.

Somedevicesaredesignedtodenyusersaccesstoinstallorrunmodifiedversionsofthesoftwareinsidethem,althoughthemanufacturercandoso.Thisisfundamentallyincompatiblewiththeaimofprotectingusers'freedomtochangethesoftware.Thesystematicpatternofsuchabuseoccursintheareaofproductsforindividualstouse,whichispreciselywhereitismostunacceptable.Therefore,wehavedesignedthisversionoftheGPLtoprohibitthepracticeforthoseproducts.Ifsuchproblemsarisesubstantiallyinotherdomains,westandreadytoextendthisprovisiontothosedomainsinfutureversionsoftheGPL,asneededtoprotectthefreedomofusers.

Finally,everyprogramisthreatenedconstantlybysoftwarepatents.Statesshouldnotallowpatentstorestrictdevelopmentanduseofsoftwareongeneral-purposecomputers,butinthosethatdo,wewishtoavoidthespecialdangerthatpatentsappliedtoafreeprogramcouldmakeiteffectivelyproprietary.Topreventthis,theGPLassuresthatpatentscannotbeusedtorendertheprogramnon-free.

Theprecisetermsandconditionsforcopying,distributionandmodificationfollow.

TERMSANDCONDITIONS

0.Definitions.

“ThisLicense”referstoversion3oftheGNUGeneralPublicLicense.

“Copyright”alsomeanscopyright-likelawsthatapplytootherkindsofworks,suchassemiconductormasks.

“TheProgram”referstoanycopyrightableworklicensedunderthisLicense.

Page 9: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

Eachlicenseeisaddressedas“you”.“Licensees”and“recipients”maybeindividualsororganizations.

To“modify”aworkmeanstocopyfromoradaptallorpartoftheworkinafashionrequiringcopyrightpermission,otherthanthemakingofanexactcopy.Theresultingworkiscalleda“modifiedversion”oftheearlierworkorawork“basedon”theearlierwork.

A“coveredwork”meanseithertheunmodifiedProgramoraworkbasedontheProgram.

To“propagate”aworkmeanstodoanythingwithitthat,withoutpermission,wouldmakeyoudirectlyorsecondarilyliableforinfringementunderapplicablecopyrightlaw,exceptexecutingitonacomputerormodifyingaprivatecopy.Propagationincludescopying,distribution(withorwithoutmodification),makingavailabletothepublic,andinsomecountriesotheractivitiesaswell.

To“convey”aworkmeansanykindofpropagationthatenablesotherpartiestomakeorreceivecopies.Mereinteractionwithauserthroughacomputernetwork,withnotransferofacopy,isnotconveying.

Aninteractiveuserinterfacedisplays“AppropriateLegalNotices”totheextentthatitincludesaconvenientandprominentlyvisiblefeaturethat(1)displaysanappropriatecopyrightnotice,and(2)tellstheuserthatthereisnowarrantyforthework(excepttotheextentthatwarrantiesareprovided),thatlicenseesmayconveytheworkunderthisLicense,andhowtoviewacopyofthisLicense.Iftheinterfacepresentsalistofusercommandsoroptions,suchasamenu,aprominentiteminthelistmeetsthiscriterion.

1.SourceCode.

The“sourcecode”foraworkmeansthepreferredformoftheworkformakingmodificationstoit.“Objectcode”meansanynon-sourceformofawork.

A“StandardInterface”meansaninterfacethateitherisanofficialstandarddefinedbyarecognizedstandardsbody,or,inthecaseofinterfacesspecifiedforaparticularprogramminglanguage,onethatiswidelyusedamongdevelopersworkinginthatlanguage.

Page 10: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

The“SystemLibraries”ofanexecutableworkincludeanything,otherthantheworkasawhole,that(a)isincludedinthenormalformofpackagingaMajorComponent,butwhichisnotpartofthatMajorComponent,and(b)servesonlytoenableuseoftheworkwiththatMajorComponent,ortoimplementaStandardInterfaceforwhichanimplementationisavailabletothepublicinsourcecodeform.A“MajorComponent”,inthiscontext,meansamajoressentialcomponent(kernel,windowsystem,andsoon)ofthespecificoperatingsystem(ifany)onwhichtheexecutableworkruns,oracompilerusedtoproducethework,oranobjectcodeinterpreterusedtorunit.

The“CorrespondingSource”foraworkinobjectcodeformmeansallthesourcecodeneededtogenerate,install,and(foranexecutablework)runtheobjectcodeandtomodifythework,includingscriptstocontrolthoseactivities.However,itdoesnotincludethework'sSystemLibraries,orgeneral-purposetoolsorgenerallyavailablefreeprogramswhichareusedunmodifiedinperformingthoseactivitiesbutwhicharenotpartofthework.Forexample,CorrespondingSourceincludesinterfacedefinitionfilesassociatedwithsourcefilesforthework,andthesourcecodeforsharedlibrariesanddynamicallylinkedsubprogramsthattheworkisspecificallydesignedtorequire,suchasbyintimatedatacommunicationorcontrolflowbetweenthosesubprogramsandotherpartsofthework.

TheCorrespondingSourceneednotincludeanythingthatuserscanregenerateautomaticallyfromotherpartsoftheCorrespondingSource.

TheCorrespondingSourceforaworkinsourcecodeformisthatsamework.

2.BasicPermissions.

AllrightsgrantedunderthisLicensearegrantedforthetermofcopyrightontheProgram,andareirrevocableprovidedthestatedconditionsaremet.ThisLicenseexplicitlyaffirmsyourunlimitedpermissiontoruntheunmodifiedProgram.TheoutputfromrunningacoveredworkiscoveredbythisLicenseonlyiftheoutput,givenitscontent,constitutesacoveredwork.ThisLicenseacknowledgesyourrightsoffairuseorotherequivalent,asprovidedbycopyrightlaw.

Youmaymake,runandpropagatecoveredworksthatyoudonotconvey,withoutconditionssolongasyourlicenseotherwiseremainsinforce.Youmay

Page 11: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

conveycoveredworkstoothersforthesolepurposeofhavingthemmakemodificationsexclusivelyforyou,orprovideyouwithfacilitiesforrunningthoseworks,providedthatyoucomplywiththetermsofthisLicenseinconveyingallmaterialforwhichyoudonotcontrolcopyright.Thosethusmakingorrunningthecoveredworksforyoumustdosoexclusivelyonyourbehalf,underyourdirectionandcontrol,ontermsthatprohibitthemfrommakinganycopiesofyourcopyrightedmaterialoutsidetheirrelationshipwithyou.

Conveyingunderanyothercircumstancesispermittedsolelyundertheconditionsstatedbelow.Sublicensingisnotallowed;section10makesitunnecessary.

3.ProtectingUsers'LegalRightsFromAnti-CircumventionLaw.

Nocoveredworkshallbedeemedpartofaneffectivetechnologicalmeasureunderanyapplicablelawfulfillingobligationsunderarticle11oftheWIPOcopyrighttreatyadoptedon20December1996,orsimilarlawsprohibitingorrestrictingcircumventionofsuchmeasures.

Whenyouconveyacoveredwork,youwaiveanylegalpowertoforbidcircumventionoftechnologicalmeasurestotheextentsuchcircumventioniseffectedbyexercisingrightsunderthisLicensewithrespecttothecoveredwork,andyoudisclaimanyintentiontolimitoperationormodificationoftheworkasameansofenforcing,againstthework'susers,yourorthirdparties'legalrightstoforbidcircumventionoftechnologicalmeasures.

4.ConveyingVerbatimCopies.

YoumayconveyverbatimcopiesoftheProgram'ssourcecodeasyoureceiveit,inanymedium,providedthatyouconspicuouslyandappropriatelypublishoneachcopyanappropriatecopyrightnotice;keepintactallnoticesstatingthatthisLicenseandanynon-permissivetermsaddedinaccordwithsection7applytothecode;keepintactallnoticesoftheabsenceofanywarranty;andgiveallrecipientsacopyofthisLicensealongwiththeProgram.

Youmaychargeanypriceornopriceforeachcopythatyouconvey,andyoumayoffersupportorwarrantyprotectionforafee.

Page 12: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

5.ConveyingModifiedSourceVersions.

YoumayconveyaworkbasedontheProgram,orthemodificationstoproduceitfromtheProgram,intheformofsourcecodeunderthetermsofsection4,providedthatyoualsomeetalloftheseconditions:

a)Theworkmustcarryprominentnoticesstatingthatyoumodifiedit,andgivingarelevantdate.b)TheworkmustcarryprominentnoticesstatingthatitisreleasedunderthisLicenseandanyconditionsaddedundersection7.Thisrequirementmodifiestherequirementinsection4to“keepintactallnotices”.c)Youmustlicensetheentirework,asawhole,underthisLicensetoanyonewhocomesintopossessionofacopy.ThisLicensewillthereforeapply,alongwithanyapplicablesection7additionalterms,tothewholeofthework,andallitsparts,regardlessofhowtheyarepackaged.ThisLicensegivesnopermissiontolicensetheworkinanyotherway,butitdoesnotinvalidatesuchpermissionifyouhaveseparatelyreceivedit.d)Iftheworkhasinteractiveuserinterfaces,eachmustdisplayAppropriateLegalNotices;however,iftheProgramhasinteractiveinterfacesthatdonotdisplayAppropriateLegalNotices,yourworkneednotmakethemdoso.

Acompilationofacoveredworkwithotherseparateandindependentworks,whicharenotbytheirnatureextensionsofthecoveredwork,andwhicharenotcombinedwithitsuchastoformalargerprogram,inoronavolumeofastorageordistributionmedium,iscalledan“aggregate”ifthecompilationanditsresultingcopyrightarenotusedtolimittheaccessorlegalrightsofthecompilation'susersbeyondwhattheindividualworkspermit.InclusionofacoveredworkinanaggregatedoesnotcausethisLicensetoapplytotheotherpartsoftheaggregate.

6.ConveyingNon-SourceForms.

Youmayconveyacoveredworkinobjectcodeformunderthetermsofsections4and5,providedthatyoualsoconveythemachine-readableCorrespondingSourceunderthetermsofthisLicense,inoneoftheseways:

a)Conveytheobjectcodein,orembodiedin,aphysicalproduct(includingaphysicaldistributionmedium),accompaniedbytheCorrespondingSourcefixedonadurablephysicalmediumcustomarilyusedforsoftware

Page 13: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

interchange.b)Conveytheobjectcodein,orembodiedin,aphysicalproduct(includingaphysicaldistributionmedium),accompaniedbyawrittenoffer,validforatleastthreeyearsandvalidforaslongasyouoffersparepartsorcustomersupportforthatproductmodel,togiveanyonewhopossessestheobjectcodeeither(1)acopyoftheCorrespondingSourceforallthesoftwareintheproductthatiscoveredbythisLicense,onadurablephysicalmediumcustomarilyusedforsoftwareinterchange,forapricenomorethanyourreasonablecostofphysicallyperformingthisconveyingofsource,or(2)accesstocopytheCorrespondingSourcefromanetworkserveratnocharge.c)ConveyindividualcopiesoftheobjectcodewithacopyofthewrittenoffertoprovidetheCorrespondingSource.Thisalternativeisallowedonlyoccasionallyandnoncommercially,andonlyifyoureceivedtheobjectcodewithsuchanoffer,inaccordwithsubsection6b.d)Conveytheobjectcodebyofferingaccessfromadesignatedplace(gratisorforacharge),andofferequivalentaccesstotheCorrespondingSourceinthesamewaythroughthesameplaceatnofurthercharge.YouneednotrequirerecipientstocopytheCorrespondingSourcealongwiththeobjectcode.Iftheplacetocopytheobjectcodeisanetworkserver,theCorrespondingSourcemaybeonadifferentserver(operatedbyyouorathirdparty)thatsupportsequivalentcopyingfacilities,providedyoumaintaincleardirectionsnexttotheobjectcodesayingwheretofindtheCorrespondingSource.RegardlessofwhatserverhoststheCorrespondingSource,youremainobligatedtoensurethatitisavailableforaslongasneededtosatisfytheserequirements.e)Conveytheobjectcodeusingpeer-to-peertransmission,providedyouinformotherpeerswheretheobjectcodeandCorrespondingSourceoftheworkarebeingofferedtothegeneralpublicatnochargeundersubsection6d.

Aseparableportionoftheobjectcode,whosesourcecodeisexcludedfromtheCorrespondingSourceasaSystemLibrary,neednotbeincludedinconveyingtheobjectcodework.

A“UserProduct”iseither(1)a“consumerproduct”,whichmeansanytangiblepersonalpropertywhichisnormallyusedforpersonal,family,orhouseholdpurposes,or(2)anythingdesignedorsoldforincorporationintoadwelling.Indeterminingwhetheraproductisaconsumerproduct,doubtfulcasesshallbe

Page 14: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

resolvedinfavorofcoverage.Foraparticularproductreceivedbyaparticularuser,“normallyused”referstoatypicalorcommonuseofthatclassofproduct,regardlessofthestatusoftheparticularuserorofthewayinwhichtheparticularuseractuallyuses,orexpectsorisexpectedtouse,theproduct.Aproductisaconsumerproductregardlessofwhethertheproducthassubstantialcommercial,industrialornon-consumeruses,unlesssuchusesrepresenttheonlysignificantmodeofuseoftheproduct.

“InstallationInformation”foraUserProductmeansanymethods,procedures,authorizationkeys,orotherinformationrequiredtoinstallandexecutemodifiedversionsofacoveredworkinthatUserProductfromamodifiedversionofitsCorrespondingSource.Theinformationmustsufficetoensurethatthecontinuedfunctioningofthemodifiedobjectcodeisinnocasepreventedorinterferedwithsolelybecausemodificationhasbeenmade.

Ifyouconveyanobjectcodeworkunderthissectionin,orwith,orspecificallyforusein,aUserProduct,andtheconveyingoccursaspartofatransactioninwhichtherightofpossessionanduseoftheUserProductistransferredtotherecipientinperpetuityorforafixedterm(regardlessofhowthetransactionischaracterized),theCorrespondingSourceconveyedunderthissectionmustbeaccompaniedbytheInstallationInformation.ButthisrequirementdoesnotapplyifneitheryounoranythirdpartyretainstheabilitytoinstallmodifiedobjectcodeontheUserProduct(forexample,theworkhasbeeninstalledinROM).

TherequirementtoprovideInstallationInformationdoesnotincludearequirementtocontinuetoprovidesupportservice,warranty,orupdatesforaworkthathasbeenmodifiedorinstalledbytherecipient,orfortheUserProductinwhichithasbeenmodifiedorinstalled.Accesstoanetworkmaybedeniedwhenthemodificationitselfmateriallyandadverselyaffectstheoperationofthenetworkorviolatestherulesandprotocolsforcommunicationacrossthenetwork.

CorrespondingSourceconveyed,andInstallationInformationprovided,inaccordwiththissectionmustbeinaformatthatispubliclydocumented(andwithanimplementationavailabletothepublicinsourcecodeform),andmustrequirenospecialpasswordorkeyforunpacking,readingorcopying.

7.AdditionalTerms.

Page 15: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

“Additionalpermissions”aretermsthatsupplementthetermsofthisLicensebymakingexceptionsfromoneormoreofitsconditions.AdditionalpermissionsthatareapplicabletotheentireProgramshallbetreatedasthoughtheywereincludedinthisLicense,totheextentthattheyarevalidunderapplicablelaw.IfadditionalpermissionsapplyonlytopartoftheProgram,thatpartmaybeusedseparatelyunderthosepermissions,buttheentireProgramremainsgovernedbythisLicensewithoutregardtotheadditionalpermissions.

Whenyouconveyacopyofacoveredwork,youmayatyouroptionremoveanyadditionalpermissionsfromthatcopy,orfromanypartofit.(Additionalpermissionsmaybewrittentorequiretheirownremovalincertaincaseswhenyoumodifythework.)Youmayplaceadditionalpermissionsonmaterial,addedbyyoutoacoveredwork,forwhichyouhaveorcangiveappropriatecopyrightpermission.

NotwithstandinganyotherprovisionofthisLicense,formaterialyouaddtoacoveredwork,youmay(ifauthorizedbythecopyrightholdersofthatmaterial)supplementthetermsofthisLicensewithterms:

a)Disclaimingwarrantyorlimitingliabilitydifferentlyfromthetermsofsections15and16ofthisLicense;orb)RequiringpreservationofspecifiedreasonablelegalnoticesorauthorattributionsinthatmaterialorintheAppropriateLegalNoticesdisplayedbyworkscontainingit;orc)Prohibitingmisrepresentationoftheoriginofthatmaterial,orrequiringthatmodifiedversionsofsuchmaterialbemarkedinreasonablewaysasdifferentfromtheoriginalversion;ord)Limitingtheuseforpublicitypurposesofnamesoflicensorsorauthorsofthematerial;ore)Decliningtograntrightsundertrademarklawforuseofsometradenames,trademarks,orservicemarks;orf)Requiringindemnificationoflicensorsandauthorsofthatmaterialbyanyonewhoconveysthematerial(ormodifiedversionsofit)withcontractualassumptionsofliabilitytotherecipient,foranyliabilitythatthesecontractualassumptionsdirectlyimposeonthoselicensorsandauthors.

Allothernon-permissiveadditionaltermsareconsidered“furtherrestrictions”withinthemeaningofsection10.IftheProgramasyoureceivedit,oranypart

Page 16: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

ofit,containsanoticestatingthatitisgovernedbythisLicensealongwithatermthatisafurtherrestriction,youmayremovethatterm.IfalicensedocumentcontainsafurtherrestrictionbutpermitsrelicensingorconveyingunderthisLicense,youmayaddtoacoveredworkmaterialgovernedbythetermsofthatlicensedocument,providedthatthefurtherrestrictiondoesnotsurvivesuchrelicensingorconveying.

Ifyouaddtermstoacoveredworkinaccordwiththissection,youmustplace,intherelevantsourcefiles,astatementoftheadditionaltermsthatapplytothosefiles,oranoticeindicatingwheretofindtheapplicableterms.

Additionalterms,permissiveornon-permissive,maybestatedintheformofaseparatelywrittenlicense,orstatedasexceptions;theaboverequirementsapplyeitherway.

8.Termination.

YoumaynotpropagateormodifyacoveredworkexceptasexpresslyprovidedunderthisLicense.Anyattemptotherwisetopropagateormodifyitisvoid,andwillautomaticallyterminateyourrightsunderthisLicense(includinganypatentlicensesgrantedunderthethirdparagraphofsection11).

However,ifyouceaseallviolationofthisLicense,thenyourlicensefromaparticularcopyrightholderisreinstated(a)provisionally,unlessanduntilthecopyrightholderexplicitlyandfinallyterminatesyourlicense,and(b)permanently,ifthecopyrightholderfailstonotifyyouoftheviolationbysomereasonablemeanspriorto60daysafterthecessation.

Moreover,yourlicensefromaparticularcopyrightholderisreinstatedpermanentlyifthecopyrightholdernotifiesyouoftheviolationbysomereasonablemeans,thisisthefirsttimeyouhavereceivednoticeofviolationofthisLicense(foranywork)fromthatcopyrightholder,andyoucuretheviolationpriorto30daysafteryourreceiptofthenotice.

TerminationofyourrightsunderthissectiondoesnotterminatethelicensesofpartieswhohavereceivedcopiesorrightsfromyouunderthisLicense.Ifyourrightshavebeenterminatedandnotpermanentlyreinstated,youdonotqualifytoreceivenewlicensesforthesamematerialundersection10.

Page 17: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

9.AcceptanceNotRequiredforHavingCopies.

YouarenotrequiredtoacceptthisLicenseinordertoreceiveorrunacopyoftheProgram.Ancillarypropagationofacoveredworkoccurringsolelyasaconsequenceofusingpeer-to-peertransmissiontoreceiveacopylikewisedoesnotrequireacceptance.However,nothingotherthanthisLicensegrantsyoupermissiontopropagateormodifyanycoveredwork.TheseactionsinfringecopyrightifyoudonotacceptthisLicense.Therefore,bymodifyingorpropagatingacoveredwork,youindicateyouracceptanceofthisLicensetodoso.

10.AutomaticLicensingofDownstreamRecipients.

Eachtimeyouconveyacoveredwork,therecipientautomaticallyreceivesalicensefromtheoriginallicensors,torun,modifyandpropagatethatwork,subjecttothisLicense.YouarenotresponsibleforenforcingcompliancebythirdpartieswiththisLicense.

An“entitytransaction”isatransactiontransferringcontrolofanorganization,orsubstantiallyallassetsofone,orsubdividinganorganization,ormergingorganizations.Ifpropagationofacoveredworkresultsfromanentitytransaction,eachpartytothattransactionwhoreceivesacopyoftheworkalsoreceiveswhateverlicensestotheworktheparty'spredecessorininteresthadorcouldgiveunderthepreviousparagraph,plusarighttopossessionoftheCorrespondingSourceoftheworkfromthepredecessorininterest,ifthepredecessorhasitorcangetitwithreasonableefforts.

YoumaynotimposeanyfurtherrestrictionsontheexerciseoftherightsgrantedoraffirmedunderthisLicense.Forexample,youmaynotimposealicensefee,royalty,orotherchargeforexerciseofrightsgrantedunderthisLicense,andyoumaynotinitiatelitigation(includingacross-claimorcounterclaiminalawsuit)allegingthatanypatentclaimisinfringedbymaking,using,selling,offeringforsale,orimportingtheProgramoranyportionofit.

11.Patents.

A“contributor”isacopyrightholderwhoauthorizesuseunderthisLicenseoftheProgramoraworkonwhichtheProgramisbased.Theworkthuslicensedis

Page 18: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

calledthecontributor's“contributorversion”.

Acontributor's“essentialpatentclaims”areallpatentclaimsownedorcontrolledbythecontributor,whetheralreadyacquiredorhereafteracquired,thatwouldbeinfringedbysomemanner,permittedbythisLicense,ofmaking,using,orsellingitscontributorversion,butdonotincludeclaimsthatwouldbeinfringedonlyasaconsequenceoffurthermodificationofthecontributorversion.Forpurposesofthisdefinition,“control”includestherighttograntpatentsublicensesinamannerconsistentwiththerequirementsofthisLicense.

Eachcontributorgrantsyouanon-exclusive,worldwide,royalty-freepatentlicenseunderthecontributor'sessentialpatentclaims,tomake,use,sell,offerforsale,importandotherwiserun,modifyandpropagatethecontentsofitscontributorversion.

Inthefollowingthreeparagraphs,a“patentlicense”isanyexpressagreementorcommitment,howeverdenominated,nottoenforceapatent(suchasanexpresspermissiontopracticeapatentorcovenantnottosueforpatentinfringement).To“grant”suchapatentlicensetoapartymeanstomakesuchanagreementorcommitmentnottoenforceapatentagainsttheparty.

Ifyouconveyacoveredwork,knowinglyrelyingonapatentlicense,andtheCorrespondingSourceoftheworkisnotavailableforanyonetocopy,freeofchargeandunderthetermsofthisLicense,throughapubliclyavailablenetworkserverorotherreadilyaccessiblemeans,thenyoumusteither(1)causetheCorrespondingSourcetobesoavailable,or(2)arrangetodepriveyourselfofthebenefitofthepatentlicenseforthisparticularwork,or(3)arrange,inamannerconsistentwiththerequirementsofthisLicense,toextendthepatentlicensetodownstreamrecipients.“Knowinglyrelying”meansyouhaveactualknowledgethat,butforthepatentlicense,yourconveyingthecoveredworkinacountry,oryourrecipient'suseofthecoveredworkinacountry,wouldinfringeoneormoreidentifiablepatentsinthatcountrythatyouhavereasontobelievearevalid.

If,pursuanttoorinconnectionwithasingletransactionorarrangement,youconvey,orpropagatebyprocuringconveyanceof,acoveredwork,andgrantapatentlicensetosomeofthepartiesreceivingthecoveredworkauthorizingthemtouse,propagate,modifyorconveyaspecificcopyofthecoveredwork,thenthepatentlicenseyougrantisautomaticallyextendedtoallrecipientsofthe

Page 19: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

coveredworkandworksbasedonit.

Apatentlicenseis“discriminatory”ifitdoesnotincludewithinthescopeofitscoverage,prohibitstheexerciseof,orisconditionedonthenon-exerciseofoneormoreoftherightsthatarespecificallygrantedunderthisLicense.Youmaynotconveyacoveredworkifyouareapartytoanarrangementwithathirdpartythatisinthebusinessofdistributingsoftware,underwhichyoumakepaymenttothethirdpartybasedontheextentofyouractivityofconveyingthework,andunderwhichthethirdpartygrants,toanyofthepartieswhowouldreceivethecoveredworkfromyou,adiscriminatorypatentlicense(a)inconnectionwithcopiesofthecoveredworkconveyedbyyou(orcopiesmadefromthosecopies),or(b)primarilyforandinconnectionwithspecificproductsorcompilationsthatcontainthecoveredwork,unlessyouenteredintothatarrangement,orthatpatentlicensewasgranted,priorto28March2007.

NothinginthisLicenseshallbeconstruedasexcludingorlimitinganyimpliedlicenseorotherdefensestoinfringementthatmayotherwisebeavailabletoyouunderapplicablepatentlaw.

12.NoSurrenderofOthers'Freedom.

Ifconditionsareimposedonyou(whetherbycourtorder,agreementorotherwise)thatcontradicttheconditionsofthisLicense,theydonotexcuseyoufromtheconditionsofthisLicense.IfyoucannotconveyacoveredworksoastosatisfysimultaneouslyyourobligationsunderthisLicenseandanyotherpertinentobligations,thenasaconsequenceyoumaynotconveyitatall.Forexample,ifyouagreetotermsthatobligateyoutocollectaroyaltyforfurtherconveyingfromthosetowhomyouconveytheProgram,theonlywayyoucouldsatisfyboththosetermsandthisLicensewouldbetorefrainentirelyfromconveyingtheProgram.

13.UsewiththeGNUAfferoGeneralPublicLicense.

NotwithstandinganyotherprovisionofthisLicense,youhavepermissiontolinkorcombineanycoveredworkwithaworklicensedunderversion3oftheGNUAfferoGeneralPublicLicenseintoasinglecombinedwork,andtoconveytheresultingwork.ThetermsofthisLicensewillcontinuetoapplytothepartwhichisthecoveredwork,butthespecialrequirementsoftheGNUAfferoGeneral

Page 20: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

PublicLicense,section13,concerninginteractionthroughanetworkwillapplytothecombinationassuch.

14.RevisedVersionsofthisLicense.

TheFreeSoftwareFoundationmaypublishrevisedand/ornewversionsoftheGNUGeneralPublicLicensefromtimetotime.Suchnewversionswillbesimilarinspirittothepresentversion,butmaydifferindetailtoaddressnewproblemsorconcerns.

Eachversionisgivenadistinguishingversionnumber.IftheProgramspecifiesthatacertainnumberedversionoftheGNUGeneralPublicLicense“oranylaterversion”appliestoit,youhavetheoptionoffollowingthetermsandconditionseitherofthatnumberedversionorofanylaterversionpublishedbytheFreeSoftwareFoundation.IftheProgramdoesnotspecifyaversionnumberoftheGNUGeneralPublicLicense,youmaychooseanyversioneverpublishedbytheFreeSoftwareFoundation.

IftheProgramspecifiesthataproxycandecidewhichfutureversionsoftheGNUGeneralPublicLicensecanbeused,thatproxy'spublicstatementofacceptanceofaversionpermanentlyauthorizesyoutochoosethatversionfortheProgram.

Laterlicenseversionsmaygiveyouadditionalordifferentpermissions.However,noadditionalobligationsareimposedonanyauthororcopyrightholderasaresultofyourchoosingtofollowalaterversion.

15.DisclaimerofWarranty.

THEREISNOWARRANTYFORTHEPROGRAM,TOTHEEXTENTPERMITTEDBYAPPLICABLELAW.EXCEPTWHENOTHERWISESTATEDINWRITINGTHECOPYRIGHTHOLDERSAND/OROTHERPARTIESPROVIDETHEPROGRAM“ASIS”WITHOUTWARRANTYOFANYKIND,EITHEREXPRESSEDORIMPLIED,INCLUDING,BUTNOTLIMITEDTO,THEIMPLIEDWARRANTIESOFMERCHANTABILITYANDFITNESSFORAPARTICULARPURPOSE.THEENTIRERISKASTOTHEQUALITYANDPERFORMANCEOFTHEPROGRAMISWITHYOU.SHOULDTHEPROGRAMPROVEDEFECTIVE,YOUASSUMETHE

Page 21: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

COSTOFALLNECESSARYSERVICING,REPAIRORCORRECTION.

16.LimitationofLiability.

INNOEVENTUNLESSREQUIREDBYAPPLICABLELAWORAGREEDTOINWRITINGWILLANYCOPYRIGHTHOLDER,ORANYOTHERPARTYWHOMODIFIESAND/ORCONVEYSTHEPROGRAMASPERMITTEDABOVE,BELIABLETOYOUFORDAMAGES,INCLUDINGANYGENERAL,SPECIAL,INCIDENTALORCONSEQUENTIALDAMAGESARISINGOUTOFTHEUSEORINABILITYTOUSETHEPROGRAM(INCLUDINGBUTNOTLIMITEDTOLOSSOFDATAORDATABEINGRENDEREDINACCURATEORLOSSESSUSTAINEDBYYOUORTHIRDPARTIESORAFAILUREOFTHEPROGRAMTOOPERATEWITHANYOTHERPROGRAMS),EVENIFSUCHHOLDEROROTHERPARTYHASBEENADVISEDOFTHEPOSSIBILITYOFSUCHDAMAGES.

17.InterpretationofSections15and16.

Ifthedisclaimerofwarrantyandlimitationofliabilityprovidedabovecannotbegivenlocallegaleffectaccordingtotheirterms,reviewingcourtsshallapplylocallawthatmostcloselyapproximatesanabsolutewaiverofallcivilliabilityinconnectionwiththeProgram,unlessawarrantyorassumptionofliabilityaccompaniesacopyofthePrograminreturnforafee.

ENDOFTERMSANDCONDITIONS

HowtoApplyTheseTermstoYourNewPrograms

Ifyoudevelopanewprogram,andyouwantittobeofthegreatestpossibleusetothepublic,thebestwaytoachievethisistomakeitfreesoftwarewhicheveryonecanredistributeandchangeundertheseterms.

Todoso,attachthefollowingnoticestotheprogram.Itissafesttoattachthemtothestartofeachsourcefiletomosteffectivelystatetheexclusionofwarranty;andeachfileshouldhaveatleastthe“copyright”lineandapointertowherethefullnoticeisfound.

Page 22: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

<onelinetogivetheprogram'snameandabriefideaofwhatitdoes.>

Copyright(C)<year><nameofauthor>

Thisprogramisfreesoftware:youcanredistributeitand/ormodify

itunderthetermsoftheGNUGeneralPublicLicenseaspublishedby

theFreeSoftwareFoundation,eitherversion3oftheLicense,or

(atyouroption)anylaterversion.

Thisprogramisdistributedinthehopethatitwillbeuseful,

butWITHOUTANYWARRANTY;withouteventheimpliedwarrantyof

MERCHANTABILITYorFITNESSFORAPARTICULARPURPOSE.Seethe

GNUGeneralPublicLicenseformoredetails.

YoushouldhavereceivedacopyoftheGNUGeneralPublicLicense

alongwiththisprogram.Ifnot,see<http://www.gnu.org/licenses/>.

Alsoaddinformationonhowtocontactyoubyelectronicandpapermail.

Iftheprogramdoesterminalinteraction,makeitoutputashortnoticelikethiswhenitstartsinaninteractivemode:

<program>Copyright(C)<year><nameofauthor>

ThisprogramcomeswithABSOLUTELYNOWARRANTY;fordetailstype`showw'.

Thisisfreesoftware,andyouarewelcometoredistributeit

undercertainconditions;type`showc'fordetails.

Thehypotheticalcommands`showw'and`showc'shouldshowtheappropriatepartsoftheGeneralPublicLicense.Ofcourse,yourprogram'scommandsmightbedifferent;foraGUIinterface,youwouldusean“aboutbox”.

Youshouldalsogetyouremployer(ifyouworkasaprogrammer)orschool,ifany,tosigna“copyrightdisclaimer”fortheprogram,ifnecessary.Formoreinformationonthis,andhowtoapplyandfollowtheGNUGPL,see<http://www.gnu.org/licenses/>.

TheGNUGeneralPublicLicensedoesnotpermitincorporatingyourprogramintoproprietaryprograms.Ifyourprogramisasubroutinelibrary,youmayconsideritmoreusefultopermitlinkingproprietaryapplicationswiththelibrary.Ifthisiswhatyouwanttodo,usetheGNULesserGeneralPublicLicenseinsteadofthisLicense.Butfirst,pleaseread<http://www.gnu.org/philosophy/why-not-lgpl.html>.

Page 23: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

StructureOfAPPL-FileIfyouhaveusedOpenHoldeminthepastyouwillknowthatyouhavetoanswerseveralquestions:ShallIgoallin?ShallIraise?ShallIcall?AndifyouanswerallquestionswithnothenOpenHoldemwillfold.Thatisoneapproachanditclearlyhassomepros.Butmostpoker-playingpeopleandnon-programerswillfindadifferentapproachmoreeasy:WhatshallIdointhissituation?Andthat’sexactlyhowOpenPPLworks.

Page 24: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

SimpleWhenConditionsWithActions

Themostsimplewaytocodeabotconsistsofaseriesofconditionsfollowedbyactionstobechosen.

WHENHaveFlushDrawANDAmountToCall<1/3PotSizeCallFORCE

Theseconditionsarealwaysevaluatedtop-down.Oncethefirstconditionistrue,theappropriateactionwillbetaken.Always!-sotheorderofprogrammingmatters.Let’sassume,thatyouwanttocallyourflushdraws,butraiseto10bbyournut-flushdraws(expert-strategy2012).Thenyouwillhavetowriteyourcommandsinthefollowingorder:

WHENHaveNutFlushDrawRaiseTo10FORCE

WHENHaveFlushDrawCallFORCE

Doittheotherwayandyournut-flush-drawwouldtriggertherulefornormalflush-draws.Acallwouldbetheresult.Asaconsequenceofthistop-down-evaluationwerecommendyoudealwith:

stronghandsfirst,specialcasesfirstweakhandslast,generalcaseslast

Thebotsimplydoesnotknowifoneruleis“morespecial”or“moreimportant”—youhavetotellitbyyourcodingorder.Ifyouwonderaboutthekeywordforce:itwasinheritedfromShanky-PPLandmeans,thatitoverwritesthedefaultbot(withoutForce).Thoughwedon’tprovideadefaultbotanddon’tthink,thatuser-definedactionsshouldbeignorediftheylacktheFORCE,wekeptthiskeywordtostaycompatibleandbecauseitisnicetoread(syntacticalsugar).

Page 25: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

Open-EndedWhenConditions

Programmingyourbotwithwhen-conditionsalonewill—inprinciple---dothejob,buttherewillbelotsofsituationsthatareverysimilar.

WHENhand$ATANDStillToAct=2ANDRaises=1ANDAmountToCall<=4RaisePotFORCE

WHENhand$ATANDStillToAct=2ANDRaises=1ANDAmountToCall>4FoldFORCE

WHENhand$ATANDStillToAct=2ANDRaises=2...

Hereonepartoftheconditiongetsrepeated:

WHENhand$ATANDStillToAct=2

Formoresophisticatedprofilesthiswouldbelotsofcodetowrite,lotsofcodetoevaluateandatruenightmaretochangeonceyouwanttoimproveit.SoOpenPPLprovidestwokindsofconditions:top-levelconditionswithoutactions(called“open-endedwhen-conditions”)andsimple“whenconditionswithactions”likeexplainedabove.Oncethefirstopen-ended-when-conditionislocatedallfollowing“normal”when-conditionsareboundtothatconditionandonlyevaluatedwhentheopen-endedwhen-conditionistrue.Soyoucouldrewritetheexampleabovelikethat:

WHENhand$ATANDStillToAct=2

WHENRaises=1ANDAmountToCall<=4RaisePotFORCE

WHENRaises=1ANDAmountToCall>4FoldFORCE

WHENRaises=2...

WHENhand$A9ANDStillToAct=2

...

Eachopen-endedwhen-conditionisactiveuntilthenextopen-endedwhen-conditionisfound.Intheexampleabove:

WHENhand$A9ANDStillToAct=2

Toterminateallyouropen-endedwhen-conditionsjustwrite:

WhenOthers

...

WhenOthersFoldForce

Codingthiswaymakesyourcodesmaller,moreeasytoreadandmoreeasytochange.However:somepeoplewouldliketotakecode-structuringtoextremesandusemultiplenestedopen-endedwhen-conditionslikebelow:

Page 26: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

WHENhand$AT

WHENStillToAct=2

WHENRaises=1

WHEN(AmountToCall<=4)RaisePotFORCE

WHEN(AmountToCall>4)FoldFORCE

WHENRaises=2

WHEN...

Inprinciplethisisagoodidea,butitdoesnotwork.Simplybecausethereisnowaytotell,whereoneopen-endedwhen-conditionendsandwherethenextonestarts.Sothesemanticswouldbecompletelyundefined(itisinfactnot,butitisforsurenotwhatyouwant).Sureyoucouldargueaboutindentation,butspaceshavenomeaninginmostprogramminglanguages(exceptgoodoldFortran77)andeverybodydoesitdifferently.Solet’srestate:Thereisatmostonelevelofopen-endedwhen-conditions(withoutaction),eachoneboundtoasequenceofwhen-conditionswithactions.Ifyouwanttostructureyourcodeevenmore(averygoodidea!)thenwerecommendtolookatthechapter“BuildingSymbolsOnYourOwn”.

Page 27: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

ControlflowofOpen-EndedWhen-Conditions

Page 28: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

StructureOfAPPL-File

Onceyouunderstandhowwhen-conditionswork,programmingyourfirstbotbecomeseasyandstraightforward:youjusthavetoprovideasequenceofwhen-conditionsforPreflop,Flop,TurnandRiver.These4maincode-sectionsarenamedf$preflop..f$river,becausethat’showuser-definedOpenHoldemsymbolsgetnamedandfromatechnicalpointofviewthesecode-sectionsarefunctions.

##f$preflop##

//Thisisacomment

//Yourcodebelongshere.

WHENhand$AARaiseMaxFORCE

WHENhand$KK...

...

WHENOthersFoldFORCE

##f$flop##

##f$turn##

##f$river##

Page 29: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

UnspecifiedReturnValues

Peoplewhocreatecompleteprofilesusuallyadd

WHENOthers

WHENOthersFoldFORCE

totheendofeverycode-section.Butitdoesnothurtifyoudon’tso.IfnoconditionmatchesthesituationOpenHoldemwillautomaticallycontinuetoevaluatethebuilt-indefault-not(Gecko).Ifnodefault-botispresent(youmaysafelydeleteit)thenOpenHoldemwillevaluatefunctionswithoutareturn-valuetozero,whichisalsotheencodingforfalse,andalsoforcheck/fold.

Page 30: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

MoreAdvancedCoding

Codingsequencesofwhen-conditionsisveryeasyandintuitive,howeverthereisonebigdisadvantage:pokerisasomewhatcomplexgameandtherearecountlesssituationstoconsider.Sothesecode-blockscanbecomeratherlarge—toolargeforasanehumanmind.Butofcoursethereisasolution:OpenPPLsupportsstructuredcoding,namely:

user-definedhand-listsuser-definedsymbols,i.e.namedfunctions,thatgetdefinedonceandcanbeusedatmultipleplaces.

Bothofthemareveryuseful,butalittlebit“advanced”andnotstandardShanky-PPL.Sowediscusstheminlaterchaptersofthismanual.

Page 31: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

HandAndBoardExpressionsHandexpressions

Oneofthemostimportantdecisionsofthegamehappenspreflop:shallIplaythishandandhow?Thisdecisioncanbecodedwiththeself-explanatoryhand-expression,likeintheexamplebelow:

WHENhand$AARaiseMaxFORCE

WHENhand$AQSuitedORhand$AJSuitedRaiseTo3FORCE

WHENhand$22ORhand$33ORhand$44...CallFORCE

AKdoesincludebothAKsandAKo.Soifyouwanttoplaysuitedhandsdifferentlyyoushouldcodethemfirst,asOpenPPLgetsevaluatedtopdown.Itwillstopatthefirstconditionthatmatches(evaluatestotrue).Soalwaysremember:stronghandsfirst,exceptionsfirst,badhandslater.

Page 32: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

CodingForSpecificSuits

Ifyouwantyoucanalsocodeforspecificsuits,likeanaceofdiamondsinyourhand.Thisisrarelynecessary,butwasusedinthepast(beforerealrandomizationwasintroducedtoStandardPPL)torandomizeactions.

WHENhand$AcQdOrhand$JhTs...

//RandomizeyourAction,theoldway

WHENhand$AdTRaiseTo10FORCE

WHENhand$ATCallFORCE

Butbecarefulwiththecodebelow:

WHENhand$AKs...

Itmeans:anyaceandkingofspades,butnotAKsuited

Page 33: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

BoardExpressions

Alotofthegamealsodependsontheboardcards.Therearesymbolslike“HaveStraightDraw”or“FlushPossibleOnTurn“,butforsomecasesmightnotbeconcreteenough.Thereforeitispossibletospecifyboard-statessimilartotheabove:

//Calling,ifanyaceisontheboard

WHENboard$ACallFORCE

//Raising,ifthereisalowpaironboard

WHENboard$22ORboard$33ORboard$44...RaiseTo10FORCE

//Raising,ifthereareAandTofthesamesuit

WHENboard$ATSUITEDRaisePotFORCE

Yousee,thisisprettystraightforward,butsometimeslotsofcodetowrite.Ifyouwanttocreatecodethatiseasytounderstand,easytoreuseandeasytomaintain,thenyoushouldencapsulateexpressionslikethesecondoneinfunctions(placeitwithinitsownfunction):

##f$LowPairOnBoard##

WHENboard$22ORboard$33ORboard$44...RETURNTRUE

User-definedvariableswouldalsobepossible,buttheyarenotnearlyasgoodasfunctions.

DocumentgeneratedbyeLyXer1.2.5(2013-03-10)on2015-01-04T12:29:51.515000

Page 34: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

ActionsThemaincodesectionsofOpen-PPLconsistofwhen-conditionswithactions.Theylooke.g.likethis:

##f$preflop##

//Openraisingonthebutton

WHEN(Raises=0andCalls=0andStillToAct=2)

//Normalopenraises

WHEN((Hand$AA)or(Hand$KK)...)RaiseTo3FORCE

//PushingaccordingtoSklanky

WHEN(StackSize<20and((Hand$...)OR...))RaiseMaxFORCE

OpenPPLprovides3kindsofactions:

Page 35: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

FixedActions

Exampleslooklike

BetMaxFORCE

RaiseMaxFORCE

AllinFORCE//synonymforBetMaxandRaiseMax,butnostandardPPL

BetPotFORCE

RaisePotFORCE

BetThreeFourthPotFORCE

RaiseThreeFourthPotFORCE

BetTwoThirdPotFORCE

RaiseTwoThirdPotFORCE

BetHalfPotFORCE

RaiseHalfPotFORCE

BetThirdPotFORCE

RaiseThirdPotFORCE

BetFourthPotFORCE

RaiseFourthPotFORCE

BetFORCE//min-bet(fixedlimit)

RaiseFORCE//min-raise(fixedlimit)

BetMinFORCE

RaiseMinFORCE

CallFORCE

CheckFORCE

FoldFORCE

BeepFORCE//beep,butdon’tact

ContrarytostandardPPLOpenPPLdoesnotdistinguishbetsandraises.OpenHoldemtreatsthemexactlythesameway.Pleasenote:SitOutisnolongerasupportedaction.Inouropinionitisbeneficialtoseparateplayinglogicandhopperlogic.ThereforeOpenHoldemprovidessomehopper-functionality,especiallythefunctionsf$sitin,f$sitout,f$leaveandf$close.Pleasealsonote:fixedactionsarefunctionsfromatechnicalpointofview,thereforetheyarecase-sensitive.

Page 36: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

ActionsWithFixedBetsize

Exampleslooklike

RaiseTo3.5FORCE

or

RaiseBy2.5FORCE

RaiseTospecifiesyourfinalbetsize,RaiseByspecifiestheamountyouwanttoaddtotheaggressorsbet-amount.

Page 37: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

ActionsWithRelativeBetsize

Exampleslooklike

RaiseBy70%FORCE

Herethebetsizegetsmeasuredasacertainpercentageofthepot(pot=commonpot+allplayersbets+theamounttocall).PotsizedbetsarealwaysRaiseBy.

Page 38: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

UsingExpressionsForTheBet-Amount

Let’sassumeyouwanttoraiseto3bbinanunraisedpot,plus1bbforeachcaller.WithstandardPPLthiswouldresultinclumsycode.ButwithOpenPPLyoucansimplywrite:

WHEN(Raises=0)RaiseTo(3+Calls)FORCE

Ifyouwantyoucouldtakethistoextremesandwritegoodcodelikethefollowing:

##f$MyFavouriteBetsizeForDryBoards##

...

WHEN(...)RaiseTof$MyFavouriteBetsizeForDryBoardsFORCE

Page 39: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

Beingstrict:using“FORCE”

EveryactioninOpenPPLhastobeterminatedbythekeyword“FORCE”.ForstandardPPLthiskeywordwasoptional.Ifyouleftitout,itmeant,thatthebotcontinuedtoevaluateandfinallyfellbacktothedefaultlogic.Wedeviatedfromthatbehaviour,as:

inouropinionitdoesnotmakeanysensetospecifyactionsthathavenoeffect.OpenPPLdoesnotprovideadefaultbot.

Page 40: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

Quickfoldingbadhands

Mostpoker-sitesprovidepre-action-buttonstoactbeforeitisyourturn.Especiallyusefulistheprefold-buttonthatmakesitpossibletoclickbadhandsawayandforgetaboutthem.Beingabletoclickthisbuttonwithyourbothasatleasttwopositiveeffects:morehuman-likebehaviourandplayingmorehandsperhourduetofasteractions.Nothingcouldbemoreeasy:

##f$prefold##

WHENAmountToCall>0AND(hand$32ORhand$43OR...)ReturnTrueFORCE

Beawareofpotentiallyunstablegame-states!

Pleasenote:

prefoldgetsevaluatedwhenitisnotyourturn.ThereforeitmighthappenthatOpenHoldemtakesascreenshot,evaluatesandactswhilethecasinoupdatesitstable-displayandthegame-stateisunstable.“Garbagein—garbageout”willhappen.Nowlet’sassumeyouhavesomesuper-nittybot:

##f$prefold##

WHEN(NOT((Hand$AA)OR(Hand$KK)))FoldFORCE

”FoldwhenIdon’thaveagoodhand”.Buthereyourgoodhandcannotgetrecognizedbecauseyouracesgetonlydisplayedpartially.Yourbotwouldfoldpocketaces!Toavoidproblemslikethatitisrecommendtocodemorefail-safelikeinthefirstexample:“FoldwhenIhaveabadhand”.Itwon’thurtthatmuchifthatcommandfailedandworkedonlyonthenextheart-beat-cycle.Thereareevenmoreconsequencesofpotentiallyunstableframes:OpenPPLdoesitsmaincalculationswhenitisyourturn.Especiallysome

Page 41: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

morecomplexsymbolswhichdependonthehistoryofthegamegetupdatedonlywhenwehavestableframestoguaranteetheircorrectness—RaisesSinceLastPlayorLastCallerPositionareexamples.Asaconsequencethesesymbolswillsimplybeundefinedbeforeyourfirstactionpreflop.ThereforeitisrecommendedtobeextracarefulabouttheGIGO-principleandsticktothemostbasicsymbolsonly.Butthisisnottoohardforprefold,isit?

Page 42: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

Backupactions

Itmayhappen,thatacertainactionisnotavailable,e.g.youmightwanttoraisebyhalfthepot,butthisiscurrentlynotpossible,e.g.becauseyouropponentmadealargeraiseandhalf-potwouldbelessthantheminimum.InsuchsituationsOpenPPLbehavesinthefollowingways:

betsizeinvalid(toolessortoomuch(PotLimitormorethanyourbalance)):betsizegetsautomaticallyadapted.ThishappensalsotoactionslikeRaisePotandRaiseHalfPot,thatgetexecutedwiththef$betsize-function.actioncan’tbeexecuted,becauseitisnotpossible,e.g.theremightbenoraise-button,becauseyoucanonlycall(allin)orfold.HereOpenPPLbehavesinthefollowingway:

RaisePotifRaiseMaxisnotpossibleRaise(Min)ifRaisePotorRaiseHalfPotisnotpossibleCallifnoRaiseispossibleCheckifnoCallispossibleFoldifnoCheckispossible(defaultbehaviourofOpenHoldem).

ThisdeviatesfromstandardPPLagain.Howeverwehavethefollowingreasons:

OpenHoldemevaluatesitstechnicalfunctionsintheorderabove(fordetailspleaserefertotheOpenHoldemManual).webelieve,itisbettertobehaveinamoreconservativewayifanerroroccurs.Mostprobablyyoudon’twanttopushallinifyouspecifyRaiseHalfPotasyourdesiredaction.Withamin-raiseyouareprobablymorehappy(orlessunhappy).

DocumentgeneratedbyeLyXer1.2.5(2013-03-10)on2015-12-07T18:31:26.437000

Page 43: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

HandlistsOpenHoldemsupportspreflophandliststosimplifypreflopcoding.Youcannamehandlistswhatyoulike,buthandlistnamesneedtostartwiththeword“list”.

##list007##

//Allin-rangeagainstcrazymaniacs

AAKKQQJJTT99//Pairs

AKsAQsAJsATsKQs//Suitedhands

AKoAQoAJo//Offsuitedhands

##list0fTr4sh1w4ntT0C4ll##

72o32o

Afterthatyoucanuseyourcustomhandlistsymbollikethis:

WHEN(Opponents=1ANDuserManiacFourBetsMeANDlist007RaiseMaxFORCE

Thereisnolimittothenumberoflistsyoucandefineandyoucanuseanynameyouwant.Indeeditisrecommendedthatyouchooseverbosenamesthatspeekforthemselves.

DocumentgeneratedbyeLyXer1.2.5(2013-03-10)on2014-12-12T08:54:20.061000

Page 44: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

MathematicalExpressionsOfcourseOpenPPLsupportsarbitarycomplexmathematicalexpressions.Asanexampleletusconsideroddsandouts.

//Callingaccordingtooddsandouts

WHENAmountToCall/(AmountToCall+PotSize)>Outs/CardsLeftCallFORCE

Offcoursethisexampleisabitsimplistic.Itdoesnotconsiderotherplayersinthepot,impliedoddsonfuturestreets,thechancetosemi-bluff,etc.ButIthinkyougetthepoint.Thefollowingoperatorsaresupported:

Page 45: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

EqualityOperators

Operator Meaning Example Exampleexplained= equal StillToAct=2 true,ifyouareonthebutton!= notequal Position!=First true,ifyouarenotoutof

position< smaller AmountToCall<5 true,iftherearelessthan5big

blindstocall> larger PotSize>20 true,ifthepotislargerthan20

bigblinds<= smalleror

equalAmountToCall<=5 true,iftherearelessthanor

equalto5bigblindstocall>= largeror

equalPotSize>=20 true,ifthepotcontains20or

morebigblinds

Page 46: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

LogicalOperators

Thelogicaloperators“and”,“or”,and“not”shouldbeprettyself-explanatory.Operator ExampleNot WHEN(HaveNothingANDOpponentsLeft>=2ANDNOT

BotIsLastRaiser)CheckFORCEAnd WHEN(BotIsLastRaiserANDOpponentsLeft=1ANDBets=0

And...BetHalfPotFORCE)XOr Meaning:eitheror,whichistrue,ifexactlyoneoftheoperandsis

true,butnotbothOr WHEN(hand$AAORhand$KK)RaiseMaxFORCENegation(Not)hashighestpriorityofalloperators,thereafterfollowAnd,XOrandORindecreasingorder.Soifyouwanttowriteanexpressionlike

WHENAmountToCall<=4AND(hand$22ORhand$33...))

youhavetothrowinsomeextrabrackets,otherwisethebotwillcallwith33anybetandthatisprobablynotwhatyouwant.Morecomplicatedexpressionssometimesleadtoconfusion.Ifyouhaveaproblemwiththatyoumightwanttorevisitthebasicsofmathematicallogicandthe“LawsofDeMorgan”.

Page 47: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

ArithmeticalOperators

OpenPPLalsosupportsbasicarithmetic.Theusualrulesapplyofcourse.Thepercentage-operatorhasthesameprioritylikemultiplicationanddivision,whichishigherthanaddition,subtraction.Operator Meaning Example+ addition- subtraction* multiplication/ division% Percentage-

operatorWHEN(AmountToCall<=50%PotSize)CallFORCE

Mod Modulus-operator

Page 48: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

BitwiseOperators(forExperts)

FurthermoreOpenPPLsupportsbitwiseoperationsthatworkonallsinglebitsofbit-vectorsorbinarynumberssimultaneously.Theyareusefulforverylow-level-stufflikedetectingwhichchairsareseatedwithOpenHoldem’sbitwisesymbols(playersseatedbits,playersdealtbits,etc.).Mostplayerswon’teverneedthesesymbols,sowewillonlygiveyoualinktoagoodexplanationhere:http://en.wikipedia.org/wiki/Bitwise_operationOperatorBitAndBitCountBitNotBitOrBitXOr

Page 49: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

User-DefinedVariablesMostprobablyyouneedsomegame-historytotakeyourdecision;thenyouwillfindsymbolslikeNoBettingOnFlopandOpenHoldem’shistorysymbolsandtheywillbeusefulforagoodportionosuse-cases,butidentifyingveryspecialsituationsafterwardsonlywiththebuilt-insymbolsmightbehardorevenimpossible.Sowouldn’titbehelpfulifyoucouldrememberwhathappenedinthegame?Ofcourseyoucan-withuser-definedvariables.Let’stakeasmallexample.User-definedvariablesneedtobeprefixedwiththeword“user”,andthewordSetwhenyougivethemavalue.

WHENFirstCallerPosition=9Setuser_UTG_Was_Limping

Asyousee,there’stheSetcommandandafteritthereisauser-definedvariableinsteadofanactionafteracondition,butnokeywordforce.WheneverOpenPPL/OpenHoldemseessuchaconstructitevaluatesthewhen-condition.Iftheconditionistrue,OpenHoldemsetstheuser-variabletotrueandcontinueswiththeevaluation,untilitfindsatrueconditionwithanaction.Alluser-definedvariablesstartwithfalse(0).Onceyousetthemtheybecometrue(or1,whichistechnicallythesame).User-definedvariableskeeptheirvalueforthecurrenthandandcan’tberesetbackbytheuser.Butwhenthehandisovertheygetresetautomatically.Naming:everyuser-definedvariablestartswiththeprefix“user”,followedbyasequenceofcharacters[a-zA-Z],digits[0-9]andunderscores[_].Queryingthevalueofavariableissimple:youcanuseitjustlikeanyothersymbolaspartofanexpression:

##f$preflop##

WHENHand$AARaiseMaxFORCE

WHENHand$KKSetuserDoesNotKnowWhatToDo

WHENHand$QQSetuserStartsToCry

WHENuserDoesNotKnowWhatToDoCallFORCE

WHENuserStartsToCrySitOutFORCE

WHENOthersFoldFORCE

Page 50: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

ExpertTricks(MemorySymbols)

Doyouneedvariablesthatcanbesettoanyarbitraryvalue?Doyouneedvariablesthatcanberesetback?Doyouneedvariablesthatdon’tresetautomatically,butkeeptheirvaluestillthenexthandorevenforthecompletesession?Thereisasolutionforit(ofcourse).InsteadofPPL-likeuser-variablesitisalsopossibletouseOpenHoldem’smemory-store-command(followingexamplestorethedecimalnumber3,14..):

WHEN(...)Setme_st_MySecretVariable_3_141592653

andthenuseitlaterwithOpenHoldem’smemory-recall-command:

WHEN(...me_re_MySecretVariable...)...

Thisconstructisalittlebitmoremighty,butalsocontainssomepossiblepitfallsandrequiresextracarebytheuser.

OpenHoldem’suser-definedvariablesarecasesensitive.me_st_x_1issomethingdifferentthanme_st_X_1.Nounderscoresallowedinthenameofthevariable.Underscoresareusedtoseparatenameandvalue.(Ifyouwonder,whyunderscoresareallowedinsimpleuser-variables:becausethetranslatorremovesthem).Noautomaticreset.Ifyouneedsuchareset,youcoulddoite.g.beforeyourfirstactionpreflop:

##f$preflop##

WHEN(BotsActionsOnThisRound=0)

WHENOthersSetme_st_MySecretVariable_0

...

Tableocclusionresetthememoryvariables.

Maytheforcebewithyou!

DocumentgeneratedbyeLyXer1.2.5(2013-03-10)on2015-09-29T22:00:19.015000

Page 51: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

BuildingSymbolsOnYourOwnThephilosophyof(standard)PPLis:providepoker-logicalsymbols,thatcanbeusedbyanypoker-playingperson,nomatterhowmuch(orless)programmingexperiencetheyhave.Examplesaree.g.MaxOpponentStackSize,StartingStackSizeHoweverthisapproachhassomedrawbacks:itshiftsallworktothedevelopersandlimitstheusers,whomightneedadditionalsymbolsfortheirbot-logic.Stayingwiththeexampleabove,theymightneed:SmallBlindStacksize,BigBlindStacksize,UTGStacksize,...,ButtonStacksize,OpenRaiserStacksize,LimpRaiserStacksize,ThreeBetterStacksize,FlopCheckRaiserStacksize,TurnDonkerStacksize,etc.Nomatterhowbusythedevelopmentteamis,theywillneverbeabletosatisfyallneeds.ThereforeOpenHoldem’s(andpartiallyOpenPPLs)philosophyisslightlydifferent:providetechnicalsymbolslikebalance0..balance9(thestacksizesforchair0..chair9)andlettheuserfigureouttherest.Thiswaytheend-userisfarmoreflexible;howeveratthecostofabitmorework.AsanexamplewedevelopasymbolBigBlindStackSize.Asafirststepweneedtoknowthechairofthebigblind.Thenasasecondstepwewillbeabletoreturnthestacksizeforthischair.TosolvethefirstproblemweusetheOpenHoldemsymbolac_dealposXwhichreturnsthedeal-positionofchairX.Thebigblindis(withtheveryrareexceptionofamissingsmallblind)alwaysthesecondplayertobedealt,sowesearchforathechair,thatgotdealtassecondplayer.

##f$BigBlindChair##

WHENac_dealpos0=2RETURN0FORCE

WHENac_dealpos1=2RETURN1FORCE

WHENac_dealpos2=2RETURN2FORCE

WHENac_dealpos3=2RETURN3FORCE

WHENac_dealpos4=2RETURN4FORCE

WHENac_dealpos5=2RETURN5FORCE

WHENac_dealpos6=2RETURN6FORCE

WHENac_dealpos7=2RETURN7FORCE

WHENac_dealpos8=2RETURN8FORCE

WHENac_dealpos9=2RETURN9FORCE

//Othercasesshouldnothappen

WHENOthersRETURN-1FORCE

Page 52: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

Havingthisinformationwecancontinuewiththesecondstep(thedullpart).Wereturnthestacksizeforthechairofthebigblind,makinguseofOpenHoldem’sstacksizesymbolsbalance0..balance9.AsyoucanseeitispossibletouseOpenHoldemSymbolsinyourOpenPPLcode.Ofcourse-wenearlyforgottomentionit.

##f$BigBlindStacksize##

WHEN(f$BigBlindChair=0)RETURNbalance0FORCE

WHEN(f$BigBlindChair=1)RETURNbalance1FORCE

WHEN(f$BigBlindChair=2)RETURNbalance2FORCE

WHEN(f$BigBlindChair=3)RETURNbalance3FORCE

WHEN(f$BigBlindChair=4)RETURNbalance4FORCE

WHEN(f$BigBlindChair=5)RETURNbalance5FORCE

WHEN(f$BigBlindChair=6)RETURNbalance6FORCE

WHEN(f$BigBlindChair=7)RETURNbalance7FORCE

WHEN(f$BigBlindChair=8)RETURNbalance8FORCE

WHEN(f$BigBlindChair=9)RETURNbalance9FORCE

//Othercasesshouldnothappen.

//Butifyouforgetabout"WHENOthers"

//therealwaysisanimplicit"RETURN0FORCE".

WHENOthersRETURN0FORCE

Yousee:itisnotthatdifficulttoextendOpenPPLonyourown.Thepossibilitesarenearlyendless.Forthemomentweskippedsomedetails,butcreatingnewsymbolsisself-explaining:eachnewsymbolstartswithafunctionheader,thatdefinesitsname.Thenameofuser-definedsymbolstraditionallybegineswithf$.Forexample##f$BigBlindStacksize##.Thereafterfollowsthefunction’scode,whichusuallyisinasequenceof(optionallyopen-ended)when-conditions.Thesewhen-conditionsusuallydefineactions(inthecaseoff$preflop...f$river)ortheycontainreturn-statementslikeintheexampleabove.That’sall.OpenPPLiseasy.

Page 53: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

AdvantagesofSymbols

Inourearlyversionsofthemanualwedidn’ttalkabouttheadvantagesofstructuredcode(especiallyfunctionsAKAsymbols),becausetheyweretooobviousforus.Thiscausedsomeconfusionsfornewbies.Symbolsaregreat:

togetunderstandableandself-documentingcode(goodnaming;http://en.wikipedia.org/wiki/Information_hiding)togetreusabelcode(namedcode-snippets)togetsmallcode(nocodeclones)togetmaintainablecode(changeandfixonelocationonly)togetfastcode(becauseofOpenHoldem’ssymbol-caching:evaluatesonlyonce,usethevalueoften)togetreadablelog-files(becauseyouseeallthesymbol-namesandtheirvalues)...

Sohowoftenshouldyoumakeuseofsymbols?Allday.Everywhere.Asmuchaspossible.Enjoythem!

Page 54: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

OpenPPLSymbolsBelowyoufindalistofOpenPPLsymbols.TheyarepartoftheOpenPPLfunction-library,whichgetsloadedautomaticallywhenyouloadOpenHoldem.MostofthesesymbolsworkexactlythesamewayastheirPPLcounterparts.Onlyveryfewdiffer,mostlyfortechnicalreasons,butsomeofthembecausewethinkitisbetterthatway.Thesedifferencesaredocumentedofcourse.Youwillalsofindsomenewsymbols,thatarenotpartofstandardPPL;somePokerTrackerandstacksizesymbolsforexample.However:wedidn’timplementeverythingthatispossibleanddesireable.Moreextensionsaresubjectofthenextchapter:“BuildingSymbolsOnYourOwn”.Whoknows:ifyoucomeupwithsomegoodcode,reasonablenamingandagooddescriptionyournewsymbolsmightbecomepartofafutureOpenPPL-release.PleasenotethatalloPPLsymbolsarecasesensitive

DocumentgeneratedbyeLyXer1.2.5(2013-03-10)on2014-09-23T13:50:40.366000

Page 55: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

BettingActionSymbolsName MeaningAllOpponentsLeftSittingOut True,ifallremainingopponentsare

sittingout.Thissymbolisespeciallymeantforuseintournaments

Bets Thenumberofbetsmadebyopponentsthisbettinground,canonlybe0or1sincethe2ndbetisaraise

BigBlindSittingOut True,ifthebigblindissittingout.Thissymbolisespeciallymeantforuseintournaments

BotCalledBeforeFlop TrueifwecalledpreflopBotCalledOnFlop TrueifwecalledontheflopBotCalledOnTurn TrueifwecalledontheturnBotCalledOnRiver TrueifwecalledontheriverBotIsLastRaiser Trueifwehavethebetting/raising

initiative,i.ewewerethelastraiseronthepreviousround

BotRaisedBeforeFlop Trueifweraisedpreflop,canalsobeusedpreflop

BotRaisedOnFlop Trueifwebetorraisedontheflop,canalsobeusedontheflop

BotRaisedOnTurn Trueifwebetorraisedontheturn,canalsobeusedontheturn

BotsActionsOnFlop NumberofactionswhereweputmoneyinthepotontheFlop

BotsActionsOnThisRound Numberofactionsthisbettingroundwhereweputmoneyinthepot

BotsActionsOnThisRoundIncludingChecks Numberofchecks+numberofactionswhereweputmoneyinthe

Page 56: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

potBotsActionsPreflop Numberofactionswhereweput

moneyinthepotpreflop,all-insarenotcountedasthegamewouldthenbeover

BotCheckedPreflop TrueifbotcheckedpreflopBotCheckedOnFlop TrueifbotcheckedontheflopBotCheckedOnTurn TrueifbotcheckedontheturnBotCheckedOnRiver TrueifbotcheckedontheriverBotsLastAction Bot’slastaction,canbeoneofthe

following:None,Beep,Raise,Bet,Call,orCheck

BotsLastPreflopAction Bot’slastpreflopaction,canbeoneofthefollowing:None,Beep,Raise,Bet,Call,orCheck

BotsLastFlopAction Bot’slastflopaction,canbeoneofthefollowing:None,Beep,Raise,Bet,Call,orCheck

BotsLastTurnAction Bot’slastturnaction,canbeoneofthefollowing:None,Beep,Raise,Bet,Call,orCheck

Calls Thenumberofcallsbyopponentsonthisbettinground

CallsSinceLastRaise Thenumberofcallsbyallopponentssincethelastraisebyanopponentonthecurrentbettinground

Checks Thenumberofchecksmadebyopponentsthisbettinground

Folds Thenumberoffoldsthisbettinground

MissingSmallBlind True,ifthereisnosmallblindinthishand,e.g.theplayerwhowouldhavebeenSBdidbustintheprevioushand.

NoBettingOnFlop Trueifnobets/raisesweremadeon

Page 57: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

theFlop,mayalsobeusedontheFlop.Betsbyheroarealsocounted

NoBettingOnTurn Trueifnobets/raisesweremadeontheTurn,mayalsobeusedontheTurn,p.Betsbyheroarealsocounted

NoVillainBetOrRaisedOnFlop NovillanbetorraisedonFlop.Betsbyheroarenotcounted

NoVillainBetOrRaisedOnTurn NovillanbetorraisedonTurn.p.Betsbyheroarenotcounted

NumberOfOpponentsAllin Numberofopponentswhoraisedorcalledallin.Range:0..9.IftheamounttocallisequaltoourstacksizeandweareheadsUpweconsiderthevillanasbeingallin.

NumberOfRaisesBeforeFlop ThenumberofraisesbeforetheFlopmadebyopponents

NumberOfRaisesOnFlop ThenumberofraisesontheFlopmadebyopponents.Betsdon’tcount

NumberOfRaisesOnTurn ThenumberofraisesontheTurnmadebyopponents.Betsdon’tcount.

OpponentCalledOnFlop AnopponentcalledonFlop,anddidnotraiseorbet

OpponentCalledOnTurn AnopponentcalledonTurn,anddidnotraiseorbet

OpponentIsAllin Anopponentisallin,theremaystillbeotherplayersinthehand.IftheamounttocallisequaltoourstacksizeandweareheadsUpweconsiderthevillanasbeingallin.

Raises Thenumberofraisesmadebyopponentsthisbettinground.Betsdon’tcount.

RaisesBeforeFlop Trueifanyopponentraisedbefore

Page 58: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

theflopRaisesOnFlop Trueifanyopponentraisedonthe

flop.Betsdon’tcount.RaisesOnTurn Trueifanyopponentraisedonthe

turn.Betsdon’tcount.RaisesSinceLastPlay Thenumberofraisessinceourlast

action.Betsdon’tcountSmallBlindSittingOut True,ifthebigsmallissittingout.

Thissymbolisespeciallymeantforuseintournaments

Pleasenote:OpenPPLhistorycounterslikeRaisesandCallsneedtogetupdatedexactlyonceperorbitwhenweseestableinput(i.e.outturn).Thisupdategetsexecutedafterautoplayer-actions.Thereforethesecountersneedanactiveautoplayertoworkproperlyformultipleorbits.

Page 59: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

BetsizesAndStacksizesStandardPPLisabitrestrictive:betsizes,stacksizesandpotsizesmayappearonlyontheleftorontherightsideofcomparisonoperators---pleasedon’taskusabouttheexactrules,weforgotthem.InOpenPPLyoucanputthemanywhereyoulike.

WHEN(AmountToCall<Pi*R*R)DANCEFORCE

It’suptoyou,whatandhowyoucode.Name Meaning LimitationsAmountToCall Theamounttocall,

countedinbigblindsNone

BetSize Thenumberofbigblindsbetbythelastaggressor

None

BigBlindSize Thesizeofthebigblind,usuallyindollars

None

MaxStacksizeOfActiveOpponents Thebiggeststacksize(expressedinbblindandnotdollars)ofallopponentscurrentlyplayingthehand.

Couldbebiggerthanyourbalance.UseEffectiveMaxStacksizeOfActiveOpponentstoknowexactlythebalanceatrisk.

EffectiveMaxStacksizeOfActiveOpponents Thebiggesteffectivestacksize(expressedinbblindandnotdollars)ofallopponentscurrentlyplayingthehand.

Yousomeopponentshavemorechips/moneythanyouthesymbolwillreturntheamoutofyourbalancetoreflecthowmuchbotisriskinginaspecifiedhand.

MaxOpponentStackSize Thebiggeststackofallopponents(playingandnotplaying).measuredinbigblindsatthebeginningofthehand

NoneDependsongame-history(game-stateonyourfirstaction)

MaxStillToActStackSize Thenumberofbigblindsinthestackoftheopponentwiththelargeststackwhohasnotacted

Firstactionprefloponly

Page 60: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

yetMinOpponentStackSize Thesmalleststackofall

opponents.(playingandnotplaying)measuredinbigblindsatthebeginningofthehand

NoneDependsongame-history(game-stateonyourfirstaction)

MinStillToActStackSize Thebiggeststackoftheopponentsbehindyou(includingSBandBB),measuredinbigblinds

Firstactionprefloponly

OpponentStacksizeHeadsUp Stacksizeofopponentwhenheadsup.PleasereadLimitations

OpponentStacksizeHeadsUpreturn-1whennotvalid.Whenusingthissymbolyouhavetocheckiftheresultis>-1andthenmakeyourcomparison.

PotSize Thecurrentpot,includingallplayersbets,countedinbigblinds.PotSizereturnseffectivepotsizeyouareparticipatingin.

None

StackSize Ourcurrentbalance,countedinbigblinds

None

StackSizeAtBeginningOfCurrentRound OurStackSizeatthebeginningofcurrentbettinground(StackSize+TotalInvestedThisRound)

Validoneverybettinground

StackUnknown Returnstrueiftheuserchairisunknown,falseotherwise.IntroducedforcompatibilitywithShanky-PPL

StartingChips Ourbalanceatthestartofasession,countedin“dollars”Thissymbolisespeciallymeantfor

None.

Page 61: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

MTTs.StartingStackSize Ourbalanceatthestart

ofasession,countedinbigblinds

NoneDependsongame-history(game-stateonyourfirstaction)

TotalInvested Themoneyputintothepotinthishand,countedinbigblinds

None

TotalInvestedThisRound AmountInvestedincurrentbettinground

None

Page 62: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

BoardSymbolsIfasetisonboard,“PairOnBoard”isalsotrue;fullhousesdoalsocountassetsandpairs,madeflushesasflushdraws,etc.Oneofmanyreasonswhyyoushouldcodestronghandsfirst.Name MeaningSecondTopFlopCardPairedOnRiver Synonymfor

SecondTopFlopCardPairedOnRiverSecondTopFlopCardPairedOnTurn Synonymfor

SecondTopFlopCardPairedOnTurnAcePresentOnFlop AnaceispresentonFlopFlushOnBoard TheentireboardarethesamesuitFlushPossible Aflushispossibleonthecurrentboard

(3ormoreof1suit)FlushPossibleOnFlop TheentireFlopisonesuitFlushPossibleOnTurn AflushispossibleontheTurnFourCardsToWheelOnBoard Trueifawheelcanbemadebyusing

onlyoneholecard,i.e.if4cardsofA2345areontheboard

FourOfOneSuitOnTurn Trueifonly1suitis/waspresentontheboardontheTurn

FullHouseOnBoard ThereisafullhouseontheboardHighCardOfCommonStraigh Returnsthevalueofthehighestcardofa

sharedstraight.Especiallymeanttodecideifwehavethesharednuts(Ace)orifwecanbeattheboard

KingPresentOnFlop True,ifatleastoneoftheFlop-cardsisaking

LowCardsOnBoard Thenumberofcardswiththerankof8orlower(aceiscountedaslow).Duplicatesofonerankarenotcounted

MoreThanOneStraightPossibleOnFlop MorethanonestraightispossibleontheFlop

Page 63: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

MoreThanOneStraightPossibleOnTurn Thereis/wasmorethanonewaytomakeastraightontheTurn

NutsOnBoard Trueifthebestpossiblehandisontheonboard

OneCardFlushPossible Theboardcontains4or5cardsofthesamecolour

OneCardStraightFlushPossible Onlyoneholecardisneededtomakeastraightflush

OneCardStraightPossible Onlyoneholecardisneededtomakeastraight

OneCardStraightPossibleOnTurn Aonecardstraightis/waspossibleontheTurn

Only1OneCardStraightPossible onlyonestraightcanbemadeusingonlyoneholecardwiththecurrentboardcards

OnlyOneStraightPossible OnlyonestraightpossibleOvercardsOnBoard Thenumberofcommoncardsthatare

higherthanthehighestcardinourhandPairOnBoard Thereareatleast2cardsofthesame

rankontheboardPairOnFlop ApairispresentontheFlopPairOnTurn TheboardhasapairontheTurnoron

theFlop)QuadsOnBoard TherearequadsontheboardQueenPresentOnFlop AqueenispresentontheFlopRiverCardIsOvercardToBoard TheRivercardisthehighestranked

commoncardRunnerRunnerFlushPossibleAtRiver TrueifaRunnerRunnerFlushis

possibleattheRiverSecondTopFlopCardPairedOnRiver True,ifthe2ndhighestFlopcardpaired

ontheRiver.IftheFlopispaireditwillbethelowestcard.IfallranksareequalquadsattheRiverwillmakethisfunctiontrue.

SecondTopFlopCardPairedOnTurn True,ifthe2ndhighestFlopcardpairedontheTurn.IftheFlopispaireditwill

Page 64: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

bethelowestcard.IfallranksareequalquadsattheTurnwillmakethisfunctiontrue.

StraightFlushOnBoard StraightflushisonboardStraightFlushPossible StraightflushispossibleStraightFlushPossibleByOthers Astraightflushcanbemadebyan

opponentwithregardstoourcardsStraightOnBoard TheboardcontainsastraightStraightPossible StraightispossibleStraightPossibleOnFlop AstrightispossibleontheFlopStraightPossibleOnTurn AstrightispossibleontheTurnSuitsOnBoard Thenumberofdifferentsuitsonboard.

Always0Preflop.SuitsOnFlop Thenumberofdifferentsuitsonthe

Flop.Always0Preflop.SuitsOnRiver Thenumberofdifferentsuitsonthe

River.Always0Preflop,attheFlopandtheTurn.

SuitsOnTurn ThenumberofdifferentsuitsontheTurn.Always0PreflopandattheFlop.

ThreeCardStraightOnBoard Thereareatleastthreeconnectedcardsontheboard

TopFlopCardPairedOnRiver ThecardwiththehighestrankontheFloppairedontheRiver

TopFlopCardPairedOnTurn ThecardwiththehighestrankontheFloppairedontheTurn

TripsOnBoard Atleastthreecardsofthesamerankarepresentontheboard

TripsOnBoardOnTurn AtleastthreecardsofthesamerankispresentontheTurn

TurnCardIsOvercardToBoard TheTurncardisthehighestrankedcommoncard

TurnCardPaired ThecardthatwasdealtontheTurnpairedontheRiver

TwoOfOneSuitPresentOnFlop True,iftheFlophas/hadatleast2

Page 65: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

cardsofthesamesuit.TwoPairOnBoard True,iftheboardcontainstwopairsTwoPairOnBoardOnTurn True,iftheboardcontainedtwopairson

TurnUncoordinatedFlop True,iftheFlopcontains/containedno

paironboard,nopossibleflush,threedifferentsuits,nopossiblestraightandnoopponentcouldhave7ormoreoutstoastraight

WheelPossible True,ifastraightwithA2345ispossible

Page 66: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

HandStrengthSymbolsIfasetisonboard,“PairOnBoard”isalsotrue;fullhousesdoalsocountassetsandpairs,madeflushesasflushdraws,etc.Thereforeitisastronglyrecommendedtocodemadehandsfirst(andstrongmadehandsattheverybeginning),thenweakerholdingwithpositivepotentialandweakerdrawsattheverylast.Name MeaningHadOverpairOnFlop Ourpocketpairis/wasofhigherrankthan

thehighestrankedflopcardHadOverPairOnTurn Ourpocketpairis/wasofhigherrankthan

thehighestrankedturncardHadPairOnFlop WehadapairontheflopHadPairOnTurn WehadapairontheturnHadSetOnFlop WehadaSetonflopHadSetOnTurn WehadaSetonturnHadTopPairOnFlop Have/hadtoppaironflopHadTopPairOnTurn Have/hadtoppaironturnHadTwoPairOnFlop WehadtwopairontheflopHadSecondOverPairOnFlop Wehad2ndoverpaironflopHadSecondOverPairOnTurn Wehad2ndoverpaironflopHadSecondTopPairOnFlop Wehad2ndtoppaironflopHaveSecondBestKicker Thereisonlyonecardthatisbetterthan

ourcurrentkickerHaveSecondBestKickerOrBetter WehavethebestorsecondbestkickerHaveSecondBestOverPairOrBetter Wehavethesecondbestoverpair(KK)or

astrongerhandHaveSecondNutFlush WehavethesecondbestflushpossibleHaveSecondNutFlushDraw WehavethesecondbestflushdrawHaveSecondNutStraight WehavethesecondbeststraightpossibleHaveSecondOverPair Wehaveaholepairwhichisbetweenthe

highestboardcardandthe2ndhighestcardrankonboard

Page 67: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

HaveSecondTopPair WehavethesecondhighestpairHaveSecondTopSet WehavethesecondbestsetHaveThirdBestKicker WehavethethirdbestkickerHaveThirdBestKickerOrBetter WehavethethirdbestkickerorbetterHaveThirdBestOverPairOrBetter Wehavethethirdbestoverpair(QQ)ora

betterhandHaveThirdNutFlush WehavetheThirdbestflushHaveThirdNutFlushDraw WehavetheThirdbestflushdrawHaveThirdOverPair Wehaveaholepairwhichisbetweenthe

2ndhighestboardcardandthe3rdhighestcardrankonboard

HaveThirdTopPair wehavetheThirdhighestpairHaveThirdTopSet WehavetheThirdhighestsetHaveFourthNutFlush WehavetheFourthhighestflushHaveFourthNutFlushDraw WehavetheFourthhighestflushdrawHaveFourthOverPair Wehaveaholepairwhichisbetweenthe

3rdhighestboardcardandthe4tfhighestcardrankonboard

HaveFourthTopPair WehavetheFourthhighestpairHaveFourthTopSet WeHavetheFourthhighestsetHaveFifthNutFlush WehavetheFifthhighestflushHaveFifthNutFlushDraw WehavetheFifthhighestflushdrawHaveFifthOverPair Wehaveaholepairwhichisbetweenthe

4thhighestboardcardandthe5thhighestcardrankonboard

HaveFifthTopPair WehavetheFifthpairHaveBackdoorSecondNutFlushDrawWehavethe2ndhighestbackdoornut

flushdrawHaveBackdoorThirdNutFlushDraw WehavetheThirdhighestbackdoornut

flushdrawHaveBackdoorFlushDraw Wehaveaflush,flushdraworabackdoor

flushdraw.HaveBackdoorFlushdrawisonlytrue,if

wecontribute2cards

Page 68: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

orwecontribute1cardtothenutsorwecontribute1cardtothe2ndnuts

HaveBackdoorNutFlushDraw WehaveabackdoornutflushdrawHaveBackdoorStraightDraw True,ifweneed2cardstocompletea

straightHaveBestKicker WehavethebestkickerHaveBestKickerOrBetter WehavethebestkickeBestOvrorabetter

handHaveBestOverPairOrBetter Havethebestoverpair(AA)orabetter

handHaveBottomPair Wehaveaholecardthatispairedwiththe

lowestcardonboardHaveBottomSet WehaveasetwiththelowestboardcardHaveBottomTrips WehaveatripswiththelowestboardcardHaveBottomTwoPair WehavebottomtwopairHaveDoubleGutshotDraw WehaveadoublegutshotdrawHaveFlush WehaveaflushHaveFlushDraw WehaveaflushdrawHaveFullHouse WehaveafullhouseHaveInsideNutStraightDraw Trueifthebothasaninsidenutstraight

draw.Aninsidenutstraightdrawisdefinedasahandwithatleast4‘outs’toanutstraight.UnlikeNutStraightDraw,outsthatmakeaflushpossiblearenotexcluded

HaveInsideStraightDraw WehaveaninsidestraightdrawHaveNothing Wehavenothing(nopair,overcards,

flushdraworstraightdraw)HaveNutFlush WehavethenutflushHaveNutFlushCard WehavethenutflushcardHaveNutFlushDraw WehavethenutflushdrawHaveNuts Wehavethebesthandpossibleatthis

time

Page 69: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

HaveNutStraight WehavethebestpossiblestraightHaveNutStraightDraw True,ifwehaveadrawtothebest

straight;thismeans:ifwehit,nobetterstraightispossible.E.g.87ataboardof653.Anutstraightdrawrequires“atleast7outs”accordingtoShankysdefinition.Thereforestraightdrawsgetdiscountedifthereisaflushdrawpossible.UseHaveUnDiscountedNutStraightDrawifyoudon’tworryaboutpossibleflushes.

HaveNutStraightFlush WehavethenutstraightflushHaveOpenEndedStraightDraw WehaveanopenendedstraightdrawHaveOverPair Wehaveapocketpairhigherthananycard

ontheboardHavePair Wehaveapair,apairedboarddoesen’t

countHavePocketPair Wehaveapocket-pairlikeAAor55HaveQuads WehavequadsHaveRunnerRunnerFlushAtRiver WehaveFlushandwemadeitwithTurn

andRivercardHaveSet Wehaveaset,i.e.threeofakindwitha

pairinthehandHaveStraight WehaveastraightHaveStraightDraw WehaveastraightdrawHaveStraightFlush WehaveastraightflushHaveTopNonBoardPairedPair Oneofourholecardsisthesamevalueas

thehighestnon-pairedcardonboardHaveTopPair Oneofourholecardsispairedwiththe

highestrankedcardontheboardHaveTopSet True,ifwehaveasetwiththehighest

boardcardHaveTopTwoPair Thetwohighestcardsontheboardare

pairedwithourholecardsHaveTopTrips TrueifwehavethebestpossibletripsHaveTrips Wehavetrips,i.e.threeofakindwitha

Page 70: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

pairontheboardHaveTwoPair Wehavetwopair,paironboarddoesnot

countHaveUnderPair Wehaveapocketpairlowerthanthe

lowestrankedcardonboardHaveUnderStraight WehavethelowerpartofastraightHaveWeakBackdoorStraightDraw Thesesymbolsdescribehandsthatareso

weakthatwedon’tconsiderthemasregularholdings,e.g.thesingle-cardidiot-endofastraightorasharedflush-drawattheboard.

HaveWeakDoubleGutshotDrawHaveWeakFlushHaveWeakFlushDrawHaveWeakInsideStraightDrawHaveWeakStraightHaveWeakStraightDrawKingPresentOnFlop AkingispresentontheflopNutFullHouseOrFourOfAKind Thissymbolevaluatesthestrengthof

quadsandfullhouses.Topquadsarealwaysratedas1,bottomquadsorbest-fullhouseas2,nextbesthandas3andsoon.Thissymboldoesnottakestraightflushesintoaccount.Soitcouldreturn1evenifourhandcanbebeatenbyastraightflush.StandardPPLreturns0ifwedon’thaveanyquads/FHatall.Howeverwethinkthisiscounterintuitiveandcausesproblems,asasmallernumbermeansabetterhand.OpenPPLreturns999forthatcase.

Overcards Thenumberofholecardsthatareovercardstotheboard

PairInHand True,ifwehaveapocketpairSuitsInHand Thenumberifuniquesuitsinourhand

Page 71: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

TopPairRank RankoftheholecardgivingyouTopPair(2-14where14isAce)

SecondTopPairRank RankofoursecondTopPairThirdTopPairRank RankofourthirdTopPairForthTopPairRank RankofourforthTopPairFifthTopPairRank RankofourfifthTopPairTopPairKickerRank Rankoftheholekickercardwhenyou

haveTopPair(2-14where14isAce)TripsRank RankofourTripsTripsKickerRank RankofthekickerofourTrips

Page 72: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

OtherSymbols

Name Meaning LimitationsIsFinalTable Weareatthefinaltableof

atournamentWorksonlywithOpenHoldem2.2.0.+andatcasinoswherethefinaltableandnormaltablescanbevisuallydistinguised.Seethetablemap-symbols$isfinaltable.

Others Alwaystrue-mainlyusedfor

WhenOthersFoldForce

None

Random Returnsarandomnumberintherange[0..100]

Getsevaluatedneweachtimeitgetsused.Sobecarefulifyoucodesequencesofrandomactions.IfyouneedarandomfunctionthatstaysconstantforsometimeyoucouldusetheOpenHoldemsymbols

randomheartbeatrandomroundrandomround1..randomround4randomhand

Butbecareful:OpenHoldemsrandomsymbolsareintherange[0..1]

Page 73: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

Player-andOpponentSymbolsName Meaning LimitationsHandIsHeadsup Trueiftwopeople

competeforthispot.thehandmighthavebeenmore-handedbefore.

None

LastAggressorActsAfterUs True(returns1)ifthelastaggressoractsafterus

None

Opponents Thenumberofopponentsthatarecurrentlyinthehand.Doesalsocountplayersthatareallin(contrarytoShankywhocountplayersthatwentallininthisbettinground,butnotplayersallinfrompreviousrounds).

REMARK.ToknowthenumberofOpponentswithbalanceabovezeroyoushouldusetheformula“Opponents-NumberOfOpponentsAllin”

OpponentsAtTable Thenumberofopponentsthatweredealtcardsthishand

None

OpponentsLeft SamemeaningasOpponentsbutbetternaming.

None

OpponentsOnFlop ThenumberofopponentsthatsawtheFlop

None

OpponentsWithHigherStack Thenumberofopponentsthatareseatedandhavehigherbalancethanyourself

None

Page 74: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

OpponentsWithLowerStack Thenumberofopponentsthatareseatedandhavelessbalancethanyourself

None

TableIsHeadsup Trueifonlytwopeoplehavebeendealt(cash-game)andonlytwopeopleareseated(tournaments,whereplayerswhositoutalsogetdealt).Thissymbolisespeciallymeanttodetectthelateststageofatournament,contrarytoHandIsHeadsupforcash-games.

None

Page 75: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

PokerTrackersymbols(Version3)Assumingalltheprerequisitesasdescribedintheconfigurationmanualaremet,thefollowingnativeOpenHoldemsymbolswillbeavailabletoyourbotforuseinitslogicprocessing.Theappropriateuseofthesesymbolsinopponentmodelingisbeyondthescopeofthisdocument,butplentyofreferencescanbefoundontheInternetwithaGooglesearch.Allthesymbolsbelowareavailablebothforcashgamesandfortournaments(SNG,MTT).OpenHoldemwillautomaticallyadaptthedatabase-queriesforyourgame-typeandprovidetherightstats.Allstatscanbeaccessedin3differentways:

forthechairoftheaggressor,e.g.pt_icon_raischair.ThissituationisoneofthemostcommonneedsforPokerTrackerstats.forasingleopponentheadsup,e.g.pt_icon_headsuptoidentifycertainplayersbytheirpreflop-positionusethepostfixessmallblind,bigblind,dealer,cutoff,user.besidesofthatyoucanusefirstcaller,lastcallerandfirstraiser.Theyworkforthecurrentorbitonly.bychairnumber,e.gpt_icon0..pt_icon9:thisismorecomplexandlessconvenientthanbothmethodsabove,butyougettheabilitytobuildanyadvancedstatonyourownaslongasyouareabletoidentifythechairofyourvillain.

Summary:Youneedtousetheprefix“pt_”.Thenaddthesymbolname.Finallyaddoneofthosepostfix:

_raischair_headsup_smallblind_bigblind_dealer_cutoff_firstcaller_lastcaller_firstraiser_dealer_user

Page 76: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

thechairnumberbetween0and9

Generalstats

SymbolMeaningiconPokerTrackerauto-rateiconcodehandsPokerTrackernumberofhandsthatareinthedatabasevpipPokerTrackerVP$IPpfrPokerTrackerpre-flopraisewtsdPokerTrackerwenttoshowdownwssdPokerTrackerwon$atshowdownaggr_factorPokerTrackertotalaggressionaggr_factor_without_preflopPokerTrackertotalaggressionexcludingpreflopfold_to_3betPokerTrackerfoldedwhilefacing3bettotal4betPokerTrackerOverall4B

Preflopstats

SymbolMeaningpreflop_aggr_factorPokerTrackerpreflopaggressionfactorpreflop_rfiPokerTrackerpre-flopraisefirstinpreflop_3betPokerTracker3betprefloppreflop_fold_to_3betPokerTrackerfoldedwhilefacing3betpreflop

Page 77: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

preflop_called_raisePokerTrackerpre-flopcalledraisepreflop_attempt_stealPokerTrackerattempttostealblindsbigblind_fold_to_stealPokerTrackerfoldedbigblindtostealsmallblind_fold_to_stealPokerTrackerfoldedsmallblindtostealpreflop_3bet_vs_stealPokerTracker3betvs.stealbigblind_3bet_vs_stealPokerTrackerBB3betvs.stealsmallblind_3bet_vs_stealPokerTrackerSB3betvs.stealpreflop_4betPokerTrackerPreflop4Bpreflop_fold_to_4betPokerTrackerPreflopfoldto4B

Flopstats

SymbolMeaningflop_seenPokerTrackersawflopflop_aggr_factorPokerTrackerflopaggressionfactorflop_cbetPokerTrackerflopcbetflop_fold_to_cbetPokerTrackerfoldedwhilefacingcbetflopflop_raise_cbetPokerTrackerraiseflopcbetflop_fold_to_3betPokerTrackerfoldedwhilefacing3betflopflop_checkraisePokerTrackerflopcheck-raiseflop_donkbetPokerTrackerdonkbetflop

Page 78: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

Turnstats

SymbolMeaningturn_seenPokerTrackersawturnturn_aggr_factorPokerTrackerturnaggressionfactorturn_cbetPokerTrackerturncbetturn_fold_to_cbetPokerTrackerfoldedwhilefacingcbetturnturn_fold_to_3betPokerTrackerfoldedwhilefacing3betturnturn_checkraisePokerTrackerturnCheck-Raiseturn_checkcallPokerTrackerturnCheck-Call

Riverstats

SymbolMeaningriver_seenPokerTrackersawriverriver_aggr_factorPokerTrackerriveraggressionfactorriver_fold_to_3betPokerTrackerfoldedwhilefacing3betriverriver_fold_to_cbetPokerTrackerfoldedwhilefacingcbetriverriver_betPokerTrackerriverbet

Page 79: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

PositionSymbolsGoodnews:contrarytoStandard-PPLmostpositionsymbolsarenotrestrictedtofirstorbitprefloponly.Youcanusetheminlaterorbitstooandalsopostflop.PositionsarealwaysBU—CO—MP3—MP2—MP1—EP3—EP2---EP1—BB—SB.Iftherearelessthan10playersatthetable,thensomeoftheearlypositionswillbemissing(EP1—EP2,etc.).Symbolslike“InButton”canbespelledintwodifferentways:“InButton”orjust“Button”.

Name Meaning LimitationsFirstCallerPosition Thepositionofthefirstcaller

(bigblind=0(althoughthiscannothappen),smallblind=1,thencounter-clockwisetill

Firstorbitprefloponly

Page 80: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

UTG=9)FirstRaiserPosition Thepositionofthefirstraiser

(bigblind=0,smallblind=1,thencounter-clockwisetillUTG=9)

Firstorbitprefloponly

InBigBlind True,ifyouarebigblind.OpenPPLissmartenpughtodetectamissingsmallblind(e.g.hebustedinatournament).Inthiscasetheplayertotheleftofthedealerwillbebigblind.

None

InButton Trueifyouarebutton(lasttoactpostflop)

None

InCutOff True,ifyouareCutOff(righttothebutton;thispositionexistsonly,ifthegameisatleast4-handed,otherwisethesymbolwillalwaysbefalse)

None

InEarlyPosition True,ifyouareinoneoftheearlypositions

None

InEarlyPosition1 True,ifyouareinEP1(lefttothebigblind,righttoEP2;thispositionexistsonly,ifthegameisatleast10-handed,otherwisethesymbolwillalwaysbefalse)

None

InEarlyPosition2 True,ifyouareinEP2(thispositionexistsonly,ifthegameisatleast9-handed,otherwisethesymbolwillalwaysbefalse)

None

InEarlyPosition3 True,ifyouareinEP3(thispositionexistsonly,ifthegameisatleast8-handed,otherwisethesymbolwillalwaysbefalse)

None

Page 81: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

InLatePosition True,ifyouareeitherCutOfforButton

None

InMiddlePosition True,ifyouareinoneofthemiddlepositions

None

InMiddlePosition1 True,ifyouareinMP1(thispositionexistsonly,ifthegameisatleast7-handed,otherwisethesymbolwillalwaysbefalse)

None

InMiddlePosition2 True,ifyouareinMP2(thispositionexistsonly,ifthegameisatleast6-handed,otherwisethesymbolwillalwaysbefalse)

None

InMiddlePosition3 True,ifyouareinMP3(thispositionexistsonly,ifthegameisatleast5-handed,otherwisethesymbolwillalwaysbefalse)

None

InSmallBlind True,ifyouaresmallblind NoneInTheBlinds True,ifyouareeithersmall

blindorbigblindNone

InUTG True,ifyouareunderthegun(lefttothebigblind),independentofthenumberofplayersatthetable.Thissymbolsisescpeciallyusefultositoutafterthelasthandofasession(beforethenextblind),butshouldnotbeusedforpositionalplay.BetterusesymbolslikeInEarlyPosition1forselectionofyourstartinghands.

None

LastCallerPosition Thepositionofthelastcaller(bigblind=0,smallblind=1,

Firstorbitprefloponly

Page 82: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

thencounter-clockwisetillUTG=9)

LastRaiserPosition Thepositionofthelastraiser(bigblind=0,smallblind=1,thencounter-clockwisetillUTG=9)

Firstorbitprefloponly

Position Ourpositionrelativetotheotherplayer,meantespeciallyforpostflopplay.Thereare3positionsatthetable:

Position=First

Position=Middle

Position=Last

Middleiseverything,thatisneitherfirstnorlast.

None

StillToAct Thenumberofopponentsthathavenotyetactedinthehandwhenitisyourturn,i.e.theplayersbehind,includingtheblinds.TheShanky-waytodetermineyourpreflop-position,buttherearebettersymbols,e.g.InButton,etc.,whichcanalsobeusedinlaterorbitsandinanybetting-round.

Firstorbitonly,bothPreflopandpostFlop

DocumentgeneratedbyeLyXer1.2.5(2013-03-10)on2015-12-01T12:34:24.625000

Page 83: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

TechnicalSymbolsWhilebuildingtheOpenPPLlibrarythedevelopershadtocreatelotsofinternalsupportingfunctions.Mostofthemaresotechnicalthattheyareofnousefortheend-user.HoweversomeofthemmightbehelpfulforpeoplewhowanttoextenttheOpenPPLlibrarywiththeirownsymbols.AfunctionlikeSmallBlindChairmightforexamplebeusefulforthedevelopmentofPokerTrackersymbolslikePT_SmallBlind_VPIP.Symbol Explanation RemarksChair0StartingStackSize...Chair9StartingStackSize

StartingstacksizeofChairNatthebeginningofthehand(balance+currentbet).Measuredinbets,notindollars.

Mainlyforpreflop.Inotherbettingroundsitreturnsthestartingstackatthebeginningofthatround.

BigBlindCurrentBet,SmallBlindCurrentBet Currentbetsoftheblindposters,measuredindollars

Mainlyusedtodetect,iftheblindsaretruelyraisingoriftheyare“blindraisers”.

ConstCardTwo...ConstCardAce Namedcardconstantstoimprovereadabilityandmaintenability.UsefulifyouwanttoaccessOpenHoldem’scardsymbols$$pr0,

None

Page 84: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

$$pr1,$$cr0...$$cr4.ConstBetRoundPreflop,ConstBetRoundFlop,ConstBetRoundTurn,ConstBetRoundRiver

Namedconstantsforthefourbettingrounds.TobeusedwithOpenHoldem’s“betround”symbol

None

CommonCard0Paired...CommonCard4Paired

True,iftherankofcommoncardNisequaltotherankofanothercommoncard.

Postfloponly

MaximumPossibleBetsizeIndollars MaximumPossiblebetsizeindollarsconsideringourcurrentbetandbalance

None

PT_LastCaller_Chair LastCallerChairnumber

None

RankOfSetOnBoard Rankofthesetonboard

Validonly,ifthereare3or4cardsofthesamerank,undefinedotherwise

\strikeoutoff\uulineoff\uwaveoffRankOfSpareCardWhenTwoPairOnBoard

\strikeoutoff\uulineoff\uwaveoffreturnsrankofthesparecardwhentwopaironboardontheriver

Riveronly

RankOfTopPairOnBoard returnsrankofthehighestpaironboard(truealsoifsetortwopairorfullhouseonboard)

Postfloponly

SidePot Potsize(innumberofblinds)wearenot

None

Page 85: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

participatinginduetoopponent’sbetbeingbiggerthanthesumofourbalancepluscurrentbet.PotSizereturnseffectivepotsizebecauseSidePotamountissubtractedfromit.

SidePotInDollars Potsize(indollars)wearenotpartecipatinginduetoopponent’sbetbeingbiggerthanthesumofourbalancepluscurrentbet

None

EarlyPosition1Chair...MiddlePosition3Chair,CutOffChair,ButtonChair,SmallBlindChair,BigBlindChair

Chairnumbersofthespecificplayers.Couldbeusede.g.forsymbolslikePT_SmallBlind_VPIP

None

AggressorChair Samemeaningasac_aggressor,butmorereliable.ac_aggressoraloneissomewhatunreliable,asitgetsscraped(bybets).Butifweraiseandtherearesuper-fastcallsbehindus(e.g.atPokerAcademy),thenwedon’thavestableframesandsoonwewillswitchtothenextbettinground,soOpenHoldemmightmisstheaggressor.Thissymbolalsoconsidersourlast

None

Page 86: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

actionandtheamounttocalltoovercomethisproblem.

SmallBlindRaising...ButtonRaising True,ifthechairinquestionisbettingorraising.ContrarytoOpenHoldem’sconventions“blindraisers”arenotcountedpreflop;onlyiftheytruelyraise.

Meantforpreflop,alsoworkingpostflop,thoughitcountsbetterstoo.

DocumentgeneratedbyeLyXer1.2.5(2013-03-10)on2014-12-12T11:48:15.587000

Page 87: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

DifferencesToShankyAndOld-Style-PPLIfyouareabotterwhousedShanky-PPLinthepasttherearesomedifferencesyoushouldknowabout:

Page 88: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

PlainTextOnly

ThedecipheringofencyptedPPLisabusiness-secretofShankyBonusBots.Wedon’tknowandwillneversupportthisdata-format.Ouraimistobuildanopen-sourcebotting-toolandnotamarketing-platformforshadysalesmen.ThereforeOpenPPLisplaintextonly—forprofilesyouownlegally,orevenbetter:forprofilesyoubuildonyourown.

Page 89: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

NoOptionSettings

StandardShanky-PPLsupportsoptionsettingstoconfiguretheirbuilt-in-defaultbot;atleastthatwastheoldwaytodoso,butnowadaysmostofthesesettingsgetoverwrittenbytheprofileandhavenoeffectatall.OpenHoldemsbuilt-inGecko-botdoesnotsupportanyShanky-opttions;theyhavenoeffectandsimplygetignored.

MakePotSizedPreFlopRaisesWhen=6

FoldToPre-FlopRaisesForAQAJsKQ=OFF

FoldPost-FlopBelowTopPairToAnyBetOrRaise=OFF

FoldToPost-FlopRaisesWithUnpairedBoardsFor=2

...

custom

preflop

...

Page 90: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

NoKeywordCustom

Asnobuilt-indefaultbotexiststhewholebot-logicis“custom”.Sure,wecouldignorethatsuperfluouskeyword,howeveritisanindicationofold-styleorShanky-style(Open)PPL.Therewillbemorethings“wrong”forsure,soweprefertoshowyouawarningasearlyaspossible.

Page 91: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

Preflop,Flop,TurnandRiverSections

Thefourmaincode-sectionsarefunctions(technicallyspeaking),thereforetheyhaveOH-script-stylefunction-header-syntax:

##f$preflop##

WHEN...RaiseMaxFORCE

...

##f$flop##

##f$turn##

##f$river##

Atleastthef$preflop-sectionmustbepresentforOpenHoldemtoswitchtoOpenPPL-mode.

Page 92: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

FloatingPointNumbers

TherearesomedifferencesbetweenStandardPPLandOpenPPLyoushouldcareabout—luckilyonlyveryfew:

StandardPPLusesintegerseverywhere,whereasOpenPPLusesfloatingpointnumbers.Anexample:inStandardPPLyoucouldwritecodelike:

WHENStacksize=1AND...RaiseBy1FORCE

WHENStacksize=2AND

oreven

WHENAmountToCall=70%Stacksize

whichwillcausetroubleswithOpenHoldem,becauseOpenHoldenusesrealnumberslike31.41.Thereforeitisrecommendedtouseinequality-operators,forexamplelikebelow:

WHENStacksize<1.5AND...RaiseBy1FORCE

WHENStacksize<2.5AND

Oryoucouldevenusethenewapproximately-equal-operator:

WHENStacksize~~3RaiseMaxFORCE

StandardPPL’ssymbolNutFullHouseOrFourOfAKinduseslowernumbersforbetterfullhousesorquads,but0fornofullhouseatall.ThisissomewhatinconsistentandOpenPPLusesahighnumber(999)forthatcase.

Page 93: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

HandAndBoardExpressions

OpenHoldem’sformulaengineusesfloating-point-numbersinternallyandthereisnoeasywaytorepresentaboardofcardsasasinglefloating-point-number.Therecouldevenbevariousdifferentboard-expressionsattherightsideofanequalitycomparatorthatarealltrue.

WHENBoard=AT...

WHENBoard=ATSuited...

Thereforewedon’tsupportnativeShanky-syntaxherebutuseparameterizedsymbols

WHENboard$AT...

WHENboard$ATSuited...

Page 94: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

CasesMatter(Partially)

OpenHoldemiscase-sensitive—contrarytostandardPPL.Thereforethecaseused(upperand/orlower)matters.TherulesforyourOpenPPLcodearemoreuser-friendlyandlessrigid.Threeareaswherecasematters:

Keywordslike“WHEN”,FORCEandoperatorslikeORetc.Forkeywords,threedifferentformatsareallowed:allupper-case,alllower-case,orareasonablemix.

WHEN(Hand$AA)RaiseMaxFORCE

When(Hand$AA)RaiseMaxForce

when(Hand$AA)RaiseMaxforce

Forbetterreadabilitywerecommendtouseonlyupper-caseforkeywords.OpenHoldemsymbols.NativeOpenHoldemsymbolsarecase-sensitiveandalwayslower-case.

WHEN(pt_vpip0<0.10)FoldFORCE

WHEN(balance0<50)RaiseMaxFORCE

However:youwillprobablyusethesesymbolsveryrarelyinyourcode.Probablyonlytocreatepoker-logicalsymbolslikePT_OpenRaiser_VPIPandBigBlindStackSize.OpenPPL-symbolsthatarepartofthelibrary.Theyarecase-sensitiveOH-script-functionswithmixedupperandlowercaseletters.

WHEN(StillToAct<2)RAISETO3FORCE

Thenamingisprettyintuitive,butthefunctionthatgenerateserror-messagesissmartenoughtolookforsimilarnamedsymbolsandwillshowyouahelpfulwarningifsomethingiswrong.

Page 95: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

FalseFriends

Again:case-sensitivitymatters.Therearesome(onlythree)symbolswiththe“same”namethathaveadifferentmeaningforOH-scriptandOpenPPL.Symbol Meaningbet Theminimumbetforthecurrentbet-round,measured

indollarsBet Theactionmin-bet(equivalenttomin-raise)call Theamountyouneedtocall,measuredindollarsCall Theaction“Call”.random Generatesnumbersintherange[0..1)Random Generatesintegernumbersintherange[0..99]Youprobablywon’tneedtheOH-scriptsymbols,butatleastthelibraryofOpenPPL-functionsusestheminternally,sotheyhavetobethere.ForthefirsttwocasesOpenHoldem’sparsercandetectifyoutookanidentifierinsteadofanactionandwillwarnyouaboutthat.Butatthemomentyouneedtotakecareaboutthelattercase.

Page 96: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

Keyword“Set”ForUser-DefinedVariables

Longstoryshort:Shanky-PPLisaneasy,English-likelanguagethatisintuitivetouse,butitcontainssometechnicalflaws.Forexample,itcan’tbeparsedwithaone-token-look-aheadlikeallothermodernprogramminglanguages.Thiscomplicatestheparserandespeciallythegenerationofgood,helpfulerror-messages.Thereforewehadtodeviateatsomepointsaliitlebit.Themostconspicuouspointisthenewkeyword“Set”beforeauser-variable:

WHEN...Setuser_utg_limp_raised_preflop

Page 97: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

NoShanky-StyleDelaypreflop

WHEN...RaiseBy3Delay5FORCE

Auser-defineddelayafteranactionsimplydoesnotfittheconceptoffunctions,thattraditionallyreturnonlyasinglevalue.Besidesthat:webelievethatitisveryclumsytohavethousandsoflineswithafixeddelay.OpenHoldemnativelysupportsasolutionthatiswaybettersuitedforthisuse-case:af$delay-functions.Itrequiresonlysome(orsomedozen)linesofcodeforperfectrandomizeddelays,dependinge.g.onboard-texture,betting-actions,etc.

##f$delay##

WHENUncoordinatedFlopANDRandom<10RETURN2500FORCE

WHEN...

Page 98: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

f$sitoutFunction

ForsimilarreasonsOpenPPLdoesnolongersupportaSitOut-command.Weprefertoseparatetheplayinglogicfromhopper-logic.ThereforeOpenHoldemhasaf$sitout-function.FurthermoreOpenHoldemsupportsf$sitin,f$autopost,f$leave,f$closeandsomemore.

##f$InUTG##

WHEN(dealposition=3)RETURNTrueFORCE

##f$sitout##

//issittingin,handsplayedandfloppctareOpenHoldemsymbols

//thatcanbeusedlikeanyotherOpenPPLsymbol.

//Wewaituntiltheorbitisfinishedandsitout

//beforewehavetopostthebigblindagain.

WHEN(issittingin

ANDhandsplayed>15

ANDfloppct<0.20

ANDHaveNoCards

ANDInUTG)

RETURNTrueForce

Page 99: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

RaiseByAndRaiseToActions

Let’sassumethefollowingsituation:yousitinthebigblindandhadtopay$10.Everybodyfoldstothebuttonwhoraisesto$30.Nowitisyourturnagainandyoudecidetoenter“90”intotheraise-box.Whatdoesthismean?Well,itdependsonthecasino.

atsomecasinos$90willbeyourfinalbetsize(RaiseTo,betsizeinterpretationmethod=3)othercasinoswilladd$90tothe$10youalreadyposted,sothefinalbetsizewillbe$100(betsizeinterpretationmethod=2).andfinallysomeothercasinoswilladdthese$90tothe$30ofthelastraiser,sothefinalbetsizewillbe$120(RaiseBy,betsizeinterpretationmethod=1)

HowdoesShankyhandlethisBabylonianconfusion?

Inonecasethesmallblindiscountedaspartofthepotandintheotheritisnot.Thiscanvarybetweenpokerroomsaswell.Youjusthavetoexperimenttogetitwhereyoulikeandsaveeachprofilethewayyouwantit.

(Egorathttp://bonusbots.com/support/index.php/topic,7934.msg79372.html#msg79372

Howeverwedon’tlikeundefinedbehaviourandwedon’twanttokeepmultipleversionsofourbotsfordifferentcasinoseither.Thereforeweintroduced2newcommands:RaiseToandRaiseBy.Thiswayyoucanclearlyspecifywhatbehaviouryouwant.YouonlyhavetospecifythecorrectbetsizeinterpretationmethodinyourtablemaptotellOpenHoldemhowyourcasinobehavesandOpenHoldemwillcareaboutalltherest.automatically.That’showitshouldbe.

Page 100: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

Gecko,OurDefaultBotTheGeckostory

Weoncehadanold-school-membercalledGeckofromtheNetherlands.GeckohadnoexperienceintheIT-business,buthewasareallydedicatedguy;ahardworkerandfastlearner.Geckoworkedroundtheclock,contributed500postspermonthtotheforum,reportedbugsSundaymorning4am.Overthecourseofthenextthreeyearsherewrotehisbotatleast20timesfromscratch,eachtimestructuringitabitbetterandmakingitstronger.HardworkpaysoffandsoGeckofinallygotawinningbotthatmadehimalittlefortune.Geckotradedhiswell-earnedbotting-moneyforsixrenovatedteeths,atwelf-maninternet-advertising-companyinPakistanandfreedomfromtheDutchpolice.OnedayGeckodecidedtovisithisemployeesinPakistan.Hetookhis$200-car(boughtfromallthemoneytheDutchpolicelefthim),foundthewaythroughthesnowymountainsofAustriaandsunnyGreece,missedPakistanbysomemilesbutdiscoveredThailandwherehenowlivesinhappiness.Geckofinallyquitbotting;butasatruegentlemanhegenerouslydonatedhispokerbottotheOpenHoldemcommunity.

Page 101: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

Itsplayingstyle

LotsofpeopleusedtheGecko-botasabasefortheirownpoker-logic.Everybodypraiseditscoding-styleanditsgoodplay.Geckoplaysno-limitbig-stackinatight-aggressive(ormaybesemi-loose-aggressive)way.ItusesPokerTrackertoadapttoitsopponents,stealingmoreagainsttightblind-posters,value-bettingharderagainstcalling-stations,beingmorecautiousifapassiveplayergivesactionandmore.ForexampleGeckoispreparedtoplayforfullstackswithmid-pairagainsthyper-maniacs.TheGecko-botisbyfarthebestbotavailabletothepublicwehaveeverseen(demo-bots)orheardof(commercials).Ittriestosqueezetheslightestedgeinanaggressivemanner;sobepreparedforsomefunnyswings,hopefullymoreoftenintherightdirection.

Page 102: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

DoesGeckoplaytournaments?

Tobehonest:notreally.Geckoisdesignedtoplaymanlybigstackandsqueezetheslightestedgeinanaggressivemanner.Butintournamentschip-EVandmoney-EVusuallydiffer(exceptforwinner-takes-it-all);tournamentsusuallygetplayedforsurvivalandtheyoftenendwithashortstackedpush-fold-phase.NothingGeckoisreallydesignedfor.TheGecko-botprobablyneedsalittletweakontopofitthattempersitsaggressionhereandtherealittlebitandcaresaboutICM.

Page 103: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

UsingtheGecko-bot

TheGecko-botisnowfullyintegratedandOpenHoldemsdefault-bot.Itsitsinthebackgroundandwaitsforsituationswhereyourbot-logicdoesnotspecifyanaction.ThenGeckostepsin.YoucanuseGeckoinseveralways:

playpureGecko.Wheneveryourbot-logicisemptyornotloadedoryouclick“New”thenGeckowillcareabouteverythingandplayallgamesfromthebeginningtotheend.Inotherwords:forgettoloadyourbot-logicandincreaseyourwinnings.tweakGecko.IfGeckosatisfiesyouonly99%orifyouwanttoadaptittoothergame-typesliketournaments,thenyoucaneasilytweakit.Don’tworry:youdon’thavetochangeanythinginGeckoscodeandpossiblyruinit.Allyouhavetodo:createanewfilewiththeexceptionalsituationsthatyouwanttoplaydifferentlyandleavetherestunspecified.ThenOpenHoldemwillplayyourbot-logicandGeckowillcareaboutalltherest.Wecallthistypeofbot-logicaGecko-tweak.useGeckoasastarting-point.foryourowncompletebot.EvenifyouwanttocreateabotcompletelyfromscratchGeckowillbeuseful.Youcanstartyourbot-logicasaGecko-tweakandaslongasyourlogicisincompleteGeckowillcareabouttheforgottensituations.Soyoucanforexampletestyourhalf-madebotasifitwasalreadyfinished.don’tuseGeckoatall.Ifyouareoneofthefortunateold-school-memberswhoalreadyhaveacompleteandbetterbot,thenyoudon’thavetoworrythatGeckoruinsanything.YoucansafelydeletetheGecko-filefromthebotlogicfolderorjustterminateallevaluationswith

WHENOthers

WHENOthersFoldFORCE

Page 104: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

DebuggingYourCodeWhydebugging?Ifyoucodeyourbotorifyouwatchitplayyouwillforsurefindsituationswheretheplaydoesn’tmatchyourexpectations.Sometimesyouknowimmediatellywhatyoudidwrongoratwhatplaceofthecodeyouhavetolookforyourerror.Butsometimesyoudon’tknoworitmightevenseem,thateverythinglooksokonyourside.Soyoumightwanttolookalittlebitdeeper-atyourcodeandmaybeevenatthesymbollibrary.Hereinthischapterwewillshowyousometechniquestolocatetheproblem:

Page 105: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

Workingwiththedebug-tab

OpenHoldemprovidesacoolfeaturecalledthedebug-tab.Justopentheformula-editor(forOH-script),switchtothef$debug-sectionandthenyoucanenteryourexpressions.Forexample:

=userchair

=HaveTopPair

HereuserchairisanativeOpenHoldemsymbolandHaveTopPairisanOpenPPL-symbol.Soonceyouhaveenteredthesymbolsinquestionclick“Apply”toconfirmyourinputand“Auto”toturntheevaluatoron.OpenHoldemwillevaluateyourexpressionsandshowyoutheirvalues.Anythingwrongwiththem?

Page 106: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

Everythingiscorrectwiththisscreenshot.Butifsomethingiswrong,theremightbeseveralreasons:

incorrectinput.HavealookatOpenHoldem’stabledisplay:everythingok?aproblemwithyourcode(orwiththesymbollibrary):asymbollikeforexampleStillToActdependsonothersymbolslikedealpositionandnchairsdealtleft.SoifStillToActwaswrongyoumightputthesesymbolsintothedebug-tabtoevaluatefurtheruntilyoufindtheproblem.

Page 107: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

Simulatingpositions

Thedebug-tabisawonderfultool—but:theproblemhappenedatalive-table—whatcanyoudo?Therearetwothingsyoucouldtry:OpenholdemprovidesatoolcalledManualMode.Hereyoucansetupsomesituationstosimulateyourbot-logic.Theotherpossibility:youcouldshootso-calledreplay-frames,i.e.screenshotsofthecasino-tablethatgetsavedtothereplay-directoryinyourbot-folder.OncethesessionisoveryoucanloadtheseframeswithOHReplay.exeandconnectOpenHoldemtoOHReplaylikeanormalcasino-table.Andthenyoucanworkwiththedebug-tabasdescribedabove.PleaserefertoOpenHoldem’smanualforamoredetaileddescriptionofthesetools.

Page 108: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

Investigatinglog-files

Notsatisfiedwiththeplay?Youmightalsolookattheautoplayer-log.Itisstoredinyourbot-folderandnamede.g.oh_0.log.OpenHoldemusesthisfiletonotonlystoretheactionittook,butalsothecompleteevaluationprocess.Firstlocateyourhand(youcanidentifyite.g.bythetime,yourcards,thehand-number,etc.).Atfirstthelogmightlooklikeacompletemess,butactuallyitiswellstructured:functionnamesontheveryleftarehigher-levelfunctions;symbolsthataremoreindentedgotcalledbythesehigher-levelfunctions.Sowhatyouseebelowisactuallyanevaluation-tree:

f$flop=-1000001.000[Line3/3]

HaveStraightDraw=0.000[Line2/2740]

HaveOpenEndedStraightDraw=0.000[Line10/2685]

HaveStraight=0.000[Line1/2735]

nstraightfill=3.000

rankbits=24770.000

HaveDoubleGutshotDraw=0.000[Line15/2286]

HaveQuads=0.000[Line1/2679]

isfourofakind=0.000

BotsLastAction=-1000008.000[Line20/549]

betround=2.000

ConstBetRoundPreflop=1.000[Line1/194]

me_re_MemBotsLastAction=0.000

Fold=-1000001.000[Line1/77]

PrevActionWasAllin=0.000[Line2/492]

prevaction=3.000

PrevActionWasAllin=0.000[cached]

Raise=-1000008.000[Line1/134]

Raise=-1000008.000[cached]

Fold=-1000001.000[cached]

Longstoryshort:

AttheverytopyouseeanOpenPPLmain-function,heref$flopBelowyouseefunctionsthatgetcalledbyf$flopeitherdirectlyorindirectlyFunctionsthatareindentedoncearedirectlycalledbyf$flop.E.gHaveStraightDraw,HaveQuads,BotsLastActionFunctionsthatareindentedoneleveldeeperarecalledbythefunctionabovethemthatwasindentedonelevelless,E.g.HaveStraightDrawcalls

Page 109: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

HaveOpenEndedStraightDrawandHaveDoubleGutshotDraw.Afterthe=youseetheresultofthefunctionevaluation[Line10/2685]means:thefunctionreturnedtheresultatitstenthline,whichisline2685inthefile.[cached]meansthattheresultalreadygotcalculatedandthecachedvaluegetsreused.symbolswithoutlineinformationarebuilt-inOpenHoldemsymbols.

That’sit,basically.Wewereabitinahurrywhenwewrotethisparagraph.Anybetterexplanationisverywelcome.

Page 110: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

ThingsToWatchOutFor

Incorrecthand-reset:Mostsymbolsdependonlyonthestateofthetable(cards,players,etc.)andarequitereliable.Howevertherearesomesymbols,thatdependonpreviousgame-states,likeBettingAction-symbols;thesesymbolsresetwheneveranewhandstarts.Alsouser-definedvariableswilllosetheirvalueifahand-resetoccurs.Thesehand-resetscanbetriggeredbycertainevents,likeachangingdealer-chairordisappearingcommunitycards,dependingonyourhand-reset-methoddefinedinthetablemap.Dependingonyoursettingsitmightbethatanocclusionofthetablewillcauseahand-resetforOpenHoldem.Sowatchoutformessageslikebelowinyourlog-file.

2012-01-2119:50:17-

*************************************************************

HANDRESET(num:dealer:0cards:KhKd):PartyPokerTable######-NLHold’em$1/$2

*************************************************************

2012-01-2119:50:17-ROUND1

Iftheyappearinthemiddleofahand,thenyoushouldrevisityourhand-reset-method.Misreadinformation:Mostproblems(andmostreported“bugs”)areofthefrom“garbagein-garbageout”.IfOpenHoldemgetsincorrectdatafromthescraper-engine(e.g.noseatedplayers)thenallfurthercalculationsbythesymbol-engineandtheevaluatorwillreturnbogusvalues.Thereasonisusuallysimple:abeginnerwithincorrectsystemsettingsorincorrectcasinosettings.Letusemphasize:Win2000classicthemeandallanimationsturnedoffarerecommended,butnotnecessary.Inproncipleyoucanscrapewhateverconfigurationyoulike.However:ifyouusesomebodyelse’stablemap,thenyouhavetouseexactlythesamesettingsastheprofilecreator.Sobeforeyougocrazyinvestigatinglog-files:havealookatbasicOpenHoldemsymbols:aretheyreasonableorplainwrong?Andbeforeyousitatareal-money-tableobserveyourbotandOpenHoldem’stable-displayforsometime:doesOpenHoldemrecognizeeverygame-statecorrectly?Don’tgetfrightened:screenscrapingisaneasyandveryflexibleapproach,thatworksgreat.Butitrequiressomecarefromyourside!

Page 111: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

UsingFlags

OpenHoldemprovidesausefulsetofbuttonswithanumberonit,from0to19calledflags.WhenanOHflagbuttonispressedthencorrespondingsymbol(f0..f19)willbetrue.Forexampleourcodecouldlooklikethefollowing:

WHENbetround=2AND(BotRaisedBeforeFlopORf0)Raise50%FORCE

TheabovelineistrueifthebotraisedbeforetheFloportheflag0buttonhasbeenpressed.ThiswayyoucouldsimulatecostomconditionsinManualMode.

DocumentgeneratedbyeLyXer1.2.5(2013-03-10)on2014-12-12T07:42:07.449000

Page 112: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

OpenPPLInPracticeIfyouhavereadthismanualuptothispointyouhavesomebasicunderstandingofOpenPPL:syntacticalrules,symbols,etc.Butthemainthing—turningyourpoker-knowledgeintobot-logic---maylooklikeadifferentkindofbeast,ifyouhavenoprogrammingexperienceatall.SoletustakesomesmallexamplesandseehowOpenPPLisusedinpractice.

Page 113: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

FoldingTrash##list_of_biggest_trash##

//Trashyhands.

//Nevertobeplayed,exceptweareintheblinds

K8sK7sK6sK5sK4sK3sK2sQ7s...

K8o...32o

##f$preflop##

//Makelifeeasyandgetridofthegreatesttrash

WHENNOTInBigBlindANDlist_of_biggest_trashFoldFORCE

Page 114: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

Open-RaisingOnTheButtonWHENStillToAct=2ANDCalls=0ANDRaises=0

WHENhand$AAORHand$KKOR...RaiseTo3FORCE

Page 115: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

ThreebettingASteal-Raiser//LastRaiserPosition<=3means:CO,BUorSB

WHENCalls=0ANDRaises=1ANDLastRaiserPosition<=3

WHENAmountToCall<=3ANDlist...RaiseTo9FORCE

Page 116: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

Contibetting##f$flop##

WHENBets=0ANDBotIsLastRaiser

WHENOpponents=1ANDRandom<80BetHalfPotFORCE

WHENOpponents=2ANDPosition=LastRaiseBy66%FORCE

Page 117: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

EffectiveStackSize##f$EffectiveStacksize##

//Firstorbitprefloponly,asitusesMaxStillToActStackSize

WHENStackSize>MaxStillToActStackSizeRETURNMaxStillToActStackSizeFORCE

WHENOthersRETURNStackSizeFORCE

Page 118: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

Push/FoldingInASNG//Goingintopush-fold-modewhenstacksizesaresmall

//Butbecareful!

//Wedon’twanttopushlooselyifsomethingiswrongwiththestacksize,

//e.g.becausethetablewasoccluded,sowecheck,ifitisnon-zero.

WHENEffectiveStacksize>0ANDEffectiveStacksize<=13

WHENCalls=0ANDRaises=0AND(Hand$...RaiseMaxFORCE

Page 119: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

DetectingALimp-Raise//Firstactionpreflop

WHENBotsActionsOnThisRound=0ANDCalls>=1ANDRaises=0

//FirstCallerPositionislimitedtofirstorbitprefloponly,

//sowerememberit,makinguseofadvancedmemorysymbols

WHENOthersme_st_MemFirstCallerPosition_FirstCallerPosition

//Thencontinuewithnormalbot-logic

....

//Afterthatwecandetectalimp-raiselikethat

//(assuming,therearenootherraisersinthepot)

WHENLastRaiserPosition=me_re_MemFirstCallerPosition...

Page 120: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

CountingOuts##f$MySimpleOutsCounter##

WHEN(HaveNutFlushDrawANDHaveNutStraightDraw)

//Wealreadyhave9+8-2duplicates

//Plusupto6undiscountedoutsforOvercards

//butsomemaybealreadycountedfortheflush

//(ifwewanttomakeitextragood,weshouldcheckthecolours

//ofourholecardswithOpenHoldemssymbols$$ps0and$$ps1)

//Theothersshouldbediscountedabit

WHEN(Overcards=2)RETURN18FORCE

WHEN(Overcards=1)RETURN16.5FORCE

WHEN(Overcards=0)RETURN15FORCE

WHEN(HaveNutFlushDraw)//ANDNOTHaveNutStraightDraw

WHEN(HaveInsideStraightDrawANDOvercards=2)...

...

Page 121: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

CallingAccordingToOddsAndOuts##f$CardsLeft##

WHENbetround=2RETURN47FORCE

WHENbetround=3RETURN46FORCE

//Drawingatotherbetroundsdoesn’tmakemuchsense

WHENOthersRETURN-1FORCE

WHENAmountToCall/(AmountToCall+PotSize)>f$Outs/f$CardsLeftCallFORCE

Page 122: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

PlayingFit-Or-FoldMultiway##f$HaveStrongDraw##

WHENHaveStraightDrawORHaveFlushDrawRETURNTrueFORCE

WHENHaveInsideStraightDrawANDOvercards=2RETURNTrueFORCE

##f$HaveTopPairOrBetter##

WHENHaveTopPairRETURNTrueFORCE

WHENHaveOverPairRETURNTrueFORCE

WHENHaveBestOverpairOrBetterRETURNTrueFORCE

##f$flop##

WHENOpponents>=3ANDNOT(f$HaveTopPairOrBetterORf$HaveStrongDraw)

WHENAmountToCall=0CheckFORCE

Page 123: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

ClosingTheTables##f$leave##

WHENissittingout

ANDelapsedauto>300//5minuteswithoutaction

ANDnopponentsseated<4

RETURNTrueFORCE

Nowit’suptoyou.Letthefunbegin!

DocumentgeneratedbyeLyXer1.2.5(2013-03-10)on2015-09-29T21:48:00.750000

Page 124: OpenPPL - The Manual - documentation.help · What Is OpenPPL PPL is an acronym for Poker Programming Language, a language to program poker bots. It was invented by Shanky BonusBots

Ifyouwanttobuy......wedon’tsellanything.Howeverifyoureallyneed“more”thanyougethere,especiallybuilt-insupportforsomepokersites,awinningbotforthelowestmicrostakes(NL2—yes,thatareblindsof$0.01/$0.02)andprofessionalhand-holding,thenyoumightwanttoconsiderbuyingtheoriginalShanky-botatwww.bonusbots.com.Toourbestknowledgetheyofferanadvertisement-dealof$30or$50orsomethingforeverycustomerwhogetsreferred.However:wedoneitherwanttonorneedtomakeanymoneyadvertisingsuchfunnythingslike“winningpoker-bots”,butwedon’twanttowastethatmoneyeither.Soifyoureallybuytheirbot,pleaseregistertotheirforum,sendgreetingstoeverybodyandaskEgortosendthatmoneytoDoctorswithoutBorders.3337thAvenue,2ndFloorNewYork,NY10001-5004Phone:212-679-6800Fax:212-679-7016https://www.doctorswithoutborders.org/donate/Thankyouverymuchforyourhelpandcooperation!

DocumentgeneratedbyeLyXer1.2.5(2013-03-10)on2015-10-07T21:50:29.196000