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