Year of the Dragon: Through April 23rd, claim the adventure pack Slice of Life for free! Speak to Xatheral in the Hall of Heroes.

Game mechanicsNewbie guideIn developmentDDO StoreSocial Media


ChallengesClassesCollectablesCraftingEnhancementsEpic DestiniesFavorFeats

GlossaryItemsMapsMonstersPlacesQuestsRacesReincarnationSkillsSpells


Please create an account or log in to build a reputation and unlock more editing privileges, and then visit DDO wiki's IRC Chat/Discord if you need any help!

User:Technical 13/SandBox/mIRC scripts/Craps

From DDO wiki
Jump to navigation Jump to search
⇑   ⇑   Back to top   ⇑   ⇑
General   Journal   Sand Box   To Do List   Characters   Quest List   Crafting   Talk  



 


;--- Craps ---
on *:TEXT:!Craps*:# {
  if (%quote.flood == $null) {
    /unset %Craps_*
    if ($2- == help) {
      /notice $nick * The version available here is based on the "Pass / Come" betting style of the game.
      /notice $nick ** If you roll a "7" or an "11" on the first roll, you win.
      /notice $nick ** If you roll a "2", "3", or "12" on the first roll, you lose.
      /notice $nick ** If you roll any other number on the first roll, that number becomes your "point" number and you roll again.
      /notice $nick ** This "point" number is the number required to roll on any subsequent rolls to win.
      /notice $nick ** If you roll a "7" on any subsequent roll, you lose.
      /notice $nick ** Rolling any number other than the "point" number or a "7" on a subsequent roll and you roll again.
    }
    else {
      /set %Craps_Dice 0
      /set %Craps_Trys 1
      /set %Craps_TRON $nick
      while (%Craps_Dice < 2) {
        /set %Craps_Die $rand(1,6)
        /set %Craps_TRON %Craps_TRON $+ $chr(44) $+ $chr(32) $+ D $+ $calc(%Craps_Dice + 1) $+ : $+ %Craps_Die
        /set %Craps_Roll $calc(%Craps_Roll + %Craps_Die)
        inc %Craps_Dice
      }
      /set %Craps_TRON %Craps_TRON $+ $chr(44) $+ $chr(32) $+ R $+ %Craps_Trys $+ : $+ %Craps_Roll
      if ((%Craps_Roll == 7) || (%Craps_Roll == 11)) {
        /msg $chan $nick rolled a %Craps_Roll (on the $ord(%Craps_Trys) try) -- YOU WIN!
        /unset %Craps_*
      }
      elseif ((%Craps_Roll == 2) || (%Craps_Roll == 3) || (%Craps_Roll == 12)) {
        /msg $chan $nick rolled a %Craps_Roll (on the $ord(%Craps_Trys) try) -- YOU LOSE!
        /unset %Craps_*
      }
      else {
        /set %Craps_Point %Craps_Roll
        /set %Craps_TRON %Craps_TRON $+ $chr(44) $+ $chr(32) $+ POINT = %Craps_Point
        /set %Craps_ReRoll TRUE
        while (%Craps_ReRoll === TRUE) {
          /unset %Craps_Dice %Craps_Roll
          /set %Craps_Dice 0
          inc %Craps_Trys
          while (%Craps_Dice < 2) {
            /set %Craps_Die $rand(1,6)
            /set %Craps_TRON %Craps_TRON $+ $chr(44) $+ $chr(32) $+ D $+ $calc(%Craps_Dice + 1) $+ : $+ %Craps_Die
            /set %Craps_Roll $calc(%Craps_Roll + %Craps_Die)
            inc %Craps_Dice
          }
          /set %Craps_TRON %Craps_TRON $+ $chr(44) $+ $chr(32) $+ R $+ %Craps_Trys $+ : $+ %Craps_Roll
          if (%Craps_Roll == %Craps_Point) {
            /msg $chan $nick rolled a %Craps_Roll (with a "point" of %Craps_Point on the $ord(%Craps_Trys) try) -- YOU WIN!
            /unset %Craps_*
          }
          elseif (%Craps_Roll == 7) {
            /msg $chan $nick rolled a %Craps_Roll (with a "point" of %Craps_Point on the $ord(%Craps_Trys) try) -- YOU LOSE!
            /unset %Craps_*
          }
          if ((%Craps_Point != %Craps_Roll) && (%Craps_Roll != 7)) {
            /set %Craps_ReRoll TRUE
          }
          else {
            /set %Craps_ReRoll FALSE
          }
        }
        /unset %Craps_*
      }
    }
  }
  set -u2 %quote.flood on
}