Slots

By Lord-Harlot on Dec 13, 2008

I was bored so I made this. Idea from http://www.hawkee.com/snippet/5464/ but its my own code apart from one part which I used to get me started since its been a while since Ive used dialogs.

You can change the odds of winning.

menu * { 
  Slots: slots 
}
alias slots { dialog -m slots slots }
dialog slots {
  title "mIRC slot game - Zanacross"
  size -1 -1 222 117
  option pixels
  box "Slot game", 3, 11 4 198 102
  button "Spin", 1, 34 72 65 25
  button "Close", 2, 115 72 65 25, cancel
  edit "", 4, 35 25 40 20, disable
  edit "", 5, 139 25 40 20, disable
  edit "", 6, 87 25 40 20, disable
  text "Give it a spin", 8, 26 45 84 17, center
  text "Credits", 7, 111 45 40 17
  text "", 13, 151 45 36 17
  menu "Menu", 9
  item "Change Odds", 10, 9
  item "Help", 11, 9
  item "Exit", 12, 9
}

dialog Odds {
  title "The odds of winning"
  size -1 -1 170 138
  option pixels
  box "Odds", 4, 21 6 122 129
  edit "", 1, 49 73 65 20
  button "Set", 2, 51 101 65 25
  text "Here you can set the chance you have of wining", 3, 27 23 109 42, center
}
dialog Help {
  title "Help"
  size -1 -1 263 161
  option pixels
  text "To use this script all you need to do is press the Spin button.", 1, 12 64 230 28, center
  text " To change the chance of wining click on the Odds Menu Item", 2, 12 34 230 31, center
  button "Ok", 3, 89 115 65 25, Cancel
  text "This script was made by Zanacross", 4, 13 91 230 17, center
  box "Help", 5, 7 8 248 140
}

on *:DIALOG:slots:*:*: {
  if ($devent == sclick) { 
    if ($did == 1) {
      var %a = $r(1,%odds), %b = $r(1,%odds), %c = $r(1,%odds)
      did -r slots 4-5,6 | did -a slots 4 %a | did -a slots 5 %b | did -a slots 6 %c
      if (%a == %b && %b == %c) { did -a slots 8 You win!! | halt }
      did -a slots 8 You Lose! 
    }
  }
  if ($devent == menu) { 
    if ($did == 10) { dialog -m Odds Odds }
    if ($did == 11) { dialog -m Help Help }
    if ($did == 12) { dialog -c slots slots }
  }
  if ($devent == init) {
    set %odds 10
  }
}
on *:DIALOG:Odds:sclick:2: {
  if ($did(1) !isnum) { echo -a This needs to be a number | halt } 
  if ($did(1) >= 10000) { echo -a Please make sure the number is lower then 10000 | halt }
  if ($did(1) <= 1) { echo -a Please make sure the number is greater then 1 | halt }
set %odds $did(1) | dialog -c odds odds 
}

Comments

Sign in to comment.
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.