Guest User

Untitled

a guest
May 26th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. 1
  2. on *:text:!dd *:#: {
  3. 2
  4. ; You can remove the first two IF lines if you don't care about checking if the nicks are on the channel.
  5. 4
  6. if ($2 !ison $chan) { msg $chan $2 is not a valid nick. | halt }
  7. 5
  8. if ($3 !ison $chan) { msg $chan $3 is not a valid nick. | halt }
  9. 6
  10. if (!$4) { msg $chan Invalid format. Use: !dd nick1 nick2 %p | halt }
  11. 7
  12. set %dd $2 $3 $4
  13. 8
  14. msg $chan 7[Dice Duel]10 $2 1VS.10 $3 1Pot:3 $4 %p 1-10 Type !roll.
  15. 9
  16.  .timerDD 1 500 EndDD
  17. 10
  18. }
  19. 11
  20. on *:text:!roll:#: {
  21. 12
  22. if (!%dd) { notice $nick No duel in progress. | halt }
  23. 13
  24. if (!$istok(%dd,$nick,32)) { notice $nick You are not one of the duelists. | halt }
  25. 14
  26. if ($($+(%,ddr.,$nick),2)) { notice $nick You have already rolled. | halt }
  27. 15
  28. var %r = $rand(2,12), %d1 = $gettok(%dd,1,32), %d2 = $gettok(%dd,2,32), %p = $gettok(%dd,3,32)
  29. 16
  30. set %ddr. $+ $nick %r
  31. 17
  32. msg $chan 7[Dice Duel]10 $nick 1rolled two six sided dice totalling7 %r $+ .
  33. 18
  34. var %r1 = $($+(%,ddr.,$gettok(%dd,1,32)),2), %r2 = $($+(%,ddr.,$gettok(%dd,2,32)),2)
  35. 19
  36. if (%r1 && %r2) {
  37. 20
  38. if (%r1 > %r2) { msg $chan 7[Dice Duel]10 %d1 1won the3 %p 1pot. Score:7 %r1 $+ - $+ %r2 $+ . }
  39. 21
  40. if (%r2 > %r1) { msg $chan 7[Dice Duel]10 %d2 1won the3 %p 1pot. Score:7 %r2 $+ - $+ %r1 $+ . }
  41. 22
  42. if (%r1 = %r2) { msg $chan 7[Dice Duel]10 %d1 1and10 %d2 1tied. Score7 %r1 $+ - $+ %r2 $+ . }
  43. 23
  44. unset %dd
  45. 24
  46. unset %ddr.*
  47. 25
  48. .timerDD off
  49. 26
  50. }
  51. 27
  52. }
  53. 28
  54. alias EndDD {
  55. 29
  56. msg $chan The duel ran out of time and has been ended.
  57. 30
  58. unset %dd
  59. 31
  60. unset %ddr.*
  61. 32
  62. }
Add Comment
Please, Sign In to add comment