View difference between Paste ID: daTcDNaJ and evhSiWR1
SHOW: | | - or go back to the newest paste.
1-
on *:TEXT:!roll*:#zps@: {
1+
/* This section contains the help contents for IRC Uno Commands.
2-
  if ($nick == kissofdea37) {
2+
!Uno - Use this command in an active Uno channel to start a game of IRC Uno.
3-
    mode $chan +i
3+
Join - Use this command to join a game after someone has typed !Uno
4-
    timerroll1 10 20 msg #zps@ 0,12 Roll call meet 0,4 $2 0,12 in the general store world $3 to get your voice back or get a 90 min ban!!!! 
4+
!Deal - If you started a game with !Uno you will be informed to use this command to deal the cards after 1-9 other players join.
5-
    timerroll2 1 240 mode $chan -i
5+
!Play - Use !Play <color> <card> to play standard cards, 0-9, Reverse, Skip, DrawTwo. Use !Play W <color> to play a wild and !Play WD4 to play a wild draw for. (Colors, numbers and words are accepted values. Red, r, five, 5, d2, drawtwo, etc.. are all accepted values.)
6
!Draw - Use this if none of your cards play to draw a card off of the top of the deck.
7
!Pass - If enabled use this to pass if your drawn card cannot play.
8
!UnoTop10 <Option> - Type this to see the top 10 players. Options: Average, Games, Points
9
!Score - Type !Score to see your score, type !Score <Nick> to see someone else's score.
10
!TopCard - Missed which card was on top? This command will reshow it.
11
!ShowCards - Missed your cards? This command will let you look again.
12
!UnoStop - Stops Uno, Ops and the player who started the game are allowed to stop it.
13
!Quit - Tired of the game? !Quit will remove you.
14
!Players - Who's playing Uno? Type !Players to find out.
15
!Rank - If enabled this command will tell you how you rank.
16
!Count - Tells you how many cards each player has.
17
*/
18
;----------------------------------------------------------------------
19
on *:load: {
20
  echo -a 0,1---=) 4Loaded 11{15IRC-Uno11} 9by 11{15Lost.Lion@gmail.com11} 0(=---
21
  if (!$exists(" $+ $scriptdir $+ Uno.txt $+ ")) {
22
    echo -a 0,1" $+ $scriptdir $+ Uno.txt $+ " not found, creating now.
23
    write -l1 " $+ $scriptdir $+ Uno.txt $+ " !PlayerList!
24
    write -l2 " $+ $scriptdir $+ Uno.txt $+ " !Options!.1.0.1.0.0.0.1.0.0
25
    write -l3 " $+ $scriptdir $+ Uno.txt $+ " !Channels!,#Uno
26
    write -l4 " $+ $scriptdir $+ Uno.txt $+ " 0
27
    if (!$exists(" $+ $scriptdir $+ Uno.txt $+ ")) {
28
      echo -a 0,1" $+ $scriptdir $+ Uno.txt $+ " was not sucessfully created, please make sure $scriptdir is not write-protected and reload Uno.mrc.
29
      halt
30
    }
31
    else {
32
      echo -a 0,1" $+ $scriptdir $+ Uno.txt $+ " was sucessfully created.
33
    }
34
  }
35
  echo -a 0,1Right click in any Channel or type 4/UnoOptions0 for options.
36
  unoreset
37
}
38
;----------------------------------------------------------------------
39
on *:text:!deal:%iuno.c2: {
40
  if ($network == %iuno.np) {
41
    if (%iuno.dl != 1) {
42
      if ($nick == %iuno.fp) {
43
        if ($numtok(%iuno.u,46) >= 2) {
44
          var %iuno.s 1
45
          while (%iuno.s <= 7) {
46
            var %iuno.v 2
47
            while (%iuno.v <= $numtok(%iuno.u,46)) {
48
              set %iuno.h. $+ $gettok(%iuno.u,%iuno.v,46) $instok(%iuno.h. [ $+ [ $gettok(%iuno.u,%iuno.v,46) ] ] ,$gettok(%iuno.d,1,46),-0,46)
49
              set %iuno.d $deltok(%iuno.d,1,46)
50
              inc %iuno.v
51
            }
52
            set %iuno.h. $+ %iuno.fp $instok(%iuno.h. [ $+ [ %iuno.fp ] ] ,$gettok(%iuno.d,1,46),-0,46)
53
            set %iuno.d $deltok(%iuno.d,1,46)
54
            inc %iuno.s
55
          }
56
          set %iuno.dl 1
57
          while ($pos($gettok(%iuno.d,1,46),w,0)) {
58
            set %iuno.d $instok(%iuno.d,$gettok(%iuno.d,1,46),$rand(1,$numtok(%iuno.d,46)),46)
59
            set %iuno.d $deltok(%iuno.d,1,46)
60
          }
61
          set %iuno.dp $instok(%iuno.dp,$gettok(%iuno.d,1,46),1,46)
62
          set %iuno.d $deltok(%iuno.d,1,46)
63
          set %iuno.u $instok(%iuno.u,$gettok(%iuno.u,1,46),-0,46)
64
          set %iuno.u $deltok(%iuno.u,1,46)
65
          if ($pos($gettok(%iuno.dp,1,46),S,1)) {
66
            skip $network $gettok(%iuno.u,1,46)
67
          }
68
          elseif ($pos($gettok(%iuno.dp,1,46),D2,1)) {
69
            drawtwo $network $gettok(%iuno.u,1,46)
70
          }
71
          elseif ($pos($gettok(%iuno.dp,1,46),R,1)) {
72
            reverse $network $nick
73
          }
74
          else {
75
            showtopcard $network $chan
76
            unomsg $network $chan $gettok(%iuno.u,1,46) $+ 's turn.
77
           unocards $network $gettok(%iuno.u,1,46)
78
          }
79
        }
80
        else {
81
          unomsg $network $chan Sorry but you need 2 people to play.
82
        }
83
      }
84
      else {
85
        unomsg $network $chan Sorry but %iuno.fp needs to deal.
86
      }
87
    }
88
    else {
89
      unomsg $network $chan Uno has already been delt.
90
    }
91
  }
92
}
93
;----------------------------------------------------------------------
94
on *:text:join:%iuno.c2: {
95
  if ($network == %iuno.np) {
96
    if ($numtok(%iuno.u,46) < 10) {
97
      if (%iuno.dl != 1) {
98
        set %iuno.u $addtok(%iuno.u,$nick,46)
99
        unomsg $network $chan $nick is Uno player $chr(35) $+ $findtok(%iuno.u,$nick,1,46)
100
        unomsg3 $network %iuno.fp There are now $numtok(%iuno.u,46) players for Uno, type !deal in %iuno.c2 to start the game.
101
      }
102
      else {
103
        set %iuno.u $addtok(%iuno.u,$nick,46)
104
        unomsg $network $chan Dealing $nick into current Uno game.
105
        var %iuno.jt 1
106
        while (%iuno.jt <= 7) {
107
          if (!$numtok(%iuno.d,46)) {
108
            set %iuno.ud %iuno.dp
109
            unset %iuno.dp
110
            set %iuno.dp $gettok(%iuno.ud,1,46)
111
            set %iuno.ud $deltok(%iuno.ud,1,46)
112
            unomsg $network $chan Shuffling discard pile
113
            newunodeck x
114
          }
115
          set %iuno.h. $+ $nick $instok( %iuno.h. [ $+ [ $nick ] ] ,$gettok(%iuno.d,1,46),-0,46)
116
          set %iuno.d $deltok(%iuno.d,1,46)
117
          inc %iuno.jt
118
        }
119
       unocards $network $nick
120
      }
121
    }
122
    else {
123
      unomsg $network $chan Sorry $nick but 10 users are already playing.
124
    }
125
  }
126
}
127
;----------------------------------------------------------------------
128
on *:text:!unostop:%iuno.c2: {
129
  if ($network == %iuno.np) {
130
    if ($nick == %iuno.fp || $nick isop %iuno.c2) {
131
      unomsg $network $chan $nick has stopped IRC-Uno: Type !Uno to begin anew.
132
      unoreset
133
    }
134
    else {
135
      unomsg $network $chan Only %iuno.fp may stop the current game, type !quit to leave the game.
136
    }
137
  }
138
}
139
;----------------------------------------------------------------------
140
on *:text:!uno:%iuno.c: {
141
  if ($chanvalid($chan,$network))  {
142
    set %iuno.color $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",2),2,46)
143
    set %iuno.rank $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",2),3,46)
144
    set %iuno.draw $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",2),4,46)
145
    set %iuno.comm $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",2),5,46)
146
    set %iuno.c $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",3),2-,44)
147
    unocolors
148
    if (!%iuno.fp) {
149
      set %iuno.fp $nick
150
      set %iuno.c2 $chan
151
      set %iuno.np $network
152
      set %iuno.abv m.b.g.m.y.s.d2.d2.r.0.1.2.3.4.5.6.7.8.9
153
      set %iuno.words r.Blue.Green.Red.Yellow.Skip.Draw2.DrawTwo.Reverse.Zero.One.Two.Three.Four.Five.Six.Seven.Eight.Nine
154
      newunodeck
155
      set %iuno.u $addtok(%iuno.u,$nick,46)
156
      unomsg $network $chan IRC-Uno Started: Type join to join in.
157
    }
158
    else {
159
      unomsg3 $network %iuno.fp An Uno game has already been started in %iuno.c2 $+ .
160
    }
161
    unset %iuno.t.u
162
  }
163
}
164
;----------------------------------------------------------------------
165
on *:text:!play W*D* *:%iuno.c2: {
166
  if ($network == %iuno.np) {
167
    if (($2 == WD4) || ($2 == WildDrawFour) || ($2 == WildDraw4)) {
168
      if (!$findtok(%iuno.abv,$3,46)) set %iuno.pv $gettok(%iuno.abv,$findtok(%iuno.words,$3,46),46)
169
      elseif ($3 == r) set %iuno.pv m
170
      else set %iuno.pv $3
171
      if ($nick == $gettok(%iuno.u,1,46)) {
172
        if ($pos(%iuno.h. [ $+ [ $nick ] ],zWD4,1)) {
173
          if ((%iuno.udc != 1) || ((%iuno.udc == 1) && ($pos($gettok(%iuno.h. [ $+ [ $nick ] ],$numtok(%iuno.h. [ $+ [ $nick ] ],46),46),zWD4,1)))) {
174
            if (%iuno.pv == b || %iuno.pv ==  g || %iuno.pv ==  m || %iuno.pv ==  y ) {
175
              set %iuno.dp $instok(%iuno.dp,[ %iuno.pv ] $+ $chr(42),1,46)
176
              set %iuno.h. [ $+ [ $nick ] ] $remtok(%iuno.h. [ $+ [ $nick ] ],zWD4,1,46)
177
              if ($numtok(%iuno.h. [ $+ [ $nick ] ],46) == 1) unomsg $network $chan  $+ %iuno.cr $+ U $+ %iuno.cy $+ n $+ %iuno.cb $+ o $+ %iuno.cg $+ !  $+ %iuno.fc $+ $nick has one card left!
178
              set %iuno.u $instok(%iuno.u,$gettok(%iuno.u,1,46),-0,46)
179
              set %iuno.u $deltok(%iuno.u,1,46)
180
              if (%iuno.pv == b) set %iuno.pv Blue.
181
              if (%iuno.pv == g) set %iuno.pv Green.
182
              if (%iuno.pv == m) set %iuno.pv Red.
183
              if (%iuno.pv == y) set %iuno.pv Yellow.
184
              if (%iuno.udc) unset %iuno.udc
185
              var %iuno.d4 1
186
              while (%iuno.d4 <= 4) {
187
                if (!$numtok(%iuno.d,46)) {
188
                  set %iuno.ud %iuno.dp
189
                  unset %iuno.dp
190
                  set %iuno.dp $gettok(%iuno.ud,1,46)
191
                  set %iuno.ud $deltok(%iuno.ud,1,46)
192
                  unomsg $network $chan Shuffling discard pile
193
                  newunodeck x
194
                }
195
                set [ %iuno.h. [ $+ [ $gettok(%iuno.u,1,46) ] ] ] $instok(%iuno.h. [ $+ [ $gettok(%iuno.u,1,46) ] ],$gettok(%iuno.d,1,46),-0,46)
196
                set %iuno.d $deltok(%iuno.d,1,46)
197
                inc %iuno.d4
198
              }
199
              unset %iuno.d4
200
              unomsg $network $chan $gettok(%iuno.u,1,46) draws 4 cards and is skipped!
201
              drawncards $network $gettok(%iuno.u,1,46) 4
202
              set %iuno.u $instok(%iuno.u,$gettok(%iuno.u,1,46),-0,46)
203
              set %iuno.u $deltok(%iuno.u,1,46)
204
              if (!$numtok(%iuno.h. [ $+ [ $nick ] ],46)) {
205
                score $network $nick
206
              }
207
              else {
208
                unomsg $network $chan $gettok(%iuno.u,1,46) $+ 's turn.
209
                showtopcard $network $chan
210
                unocards $network $gettok(%iuno.u,1,46)
211
              }
212
            }
213
            else {
214
              unomsg $network $chan Please specify a color $nick $+ . !play WD4 [b,g,r,y]
215
            }
216
          }
217
          else {
218
            unomsg $network $chan Sorry $nick but you must play the card you've drawn or !Pass.
219
          }
220
        }
221
        else {
222
          unomsg $network $chan You don't have that card $nick $+ .
223
        }
224
      }
225
    }
226
  }
227
}
228
;----------------------------------------------------------------------
229
on *:text:!play W*:%iuno.c2: {
230
  if ($network == %iuno.np) {
231
    if (!$findtok(%iuno.abv,$3,46)) set %iuno.pv $gettok(%iuno.abv,$findtok(%iuno.words,$3,46),46)
232
    elseif ($3 == r) set %iuno.pv m
233
    else set %iuno.pv $3
234
    if ($nick == $gettok(%iuno.u,1,46)) {
235
      if ($poscs(%iuno.h. [ $+ [ $nick ] ],ZW,1)) {
236
        if ((%iuno.udc != 1) || ((%iuno.udc == 1) && ($poscs($gettok(%iuno.h. [ $+ [ $nick ] ],$numtok(%iuno.h. [ $+ [ $nick ] ],46),46),ZW,1)))) {
237
          if (%iuno.pv == b || %iuno.pv == g || %iuno.pv == m || %iuno.pv == y ) {
238
            set %iuno.dp $instok(%iuno.dp,[ %iuno.pv ] $+ $chr(42),1,46)
239
            set %iuno.h. [ $+ [ $nick ] ] $remtok(%iuno.h. [ $+ [ $nick ] ],ZW,1,46)
240
            if ($numtok(%iuno.h. [ $+ [ $nick ] ],46) == 1) unomsg $network $chan  $+ %iuno.cr $+ U $+ %iuno.cy $+ n $+ %iuno.cb $+ o $+ %iuno.cg $+ !  $+ %iuno.fc $+ $nick has one card left!
241
            if (!$numtok(%iuno.h. [ $+ [ $nick ] ],46)) {
242
              score $network $nick
243
            }
244
            else {
245
              set %iuno.u $instok(%iuno.u,$gettok(%iuno.u,1,46),-0,46)
246
              set %iuno.u $deltok(%iuno.u,1,46)
247
              if (%iuno.udc) unset %iuno.udc
248
              if (%iuno.pv == b) set %iuno.pv Blue.
249
              if (%iuno.pv == g) set %iuno.pv Green.
250
              if (%iuno.pv == m) set %iuno.pv Red.
251
              if (%iuno.pv == y) set %iuno.pv Yellow.
252
              unomsg $network $chan $nick changed the color to %iuno.pv $gettok(%iuno.u,1,46) $+ 's turn.
253
              showtopcard $network $chan
254
             unocards $network $gettok(%iuno.u,1,46)
255
            }
256
          }
257
          else {
258
            unomsg $network $chan Please specify a color $nick $+ . !play W [b,g,r,y]
259
          }
260
        }
261
        else {
262
          unomsg $network $chan Sorry $nick but you must play the card you've drawn or !Pass.
263
        }
264
      }
265
      else {
266
        unomsg $network $chan You don't have that card $nick $+ .
267
      }
268
    }
269
  }
270
}
271
;----------------------------------------------------------------------
272
on *:text:!play *:%iuno.c2: {
273
  if ($network == %iuno.np) {
274
    if (!$findtok(%iuno.abv,$2,46)) set %iuno.pv $gettok(%iuno.abv,$findtok(%iuno.words,$2,46),46)
275
    elseif ($2 == r) set %iuno.pv m
276
    else set %iuno.pv $2
277
    if (!$findtok(%iuno.abv,$3,46)) set %iuno.px $gettok(%iuno.abv,$findtok(%iuno.words,$3,46),46)
278
    else set %iuno.px $3
279
    set %iuno.pvx %iuno.pv $+ %iuno.px
280
    if ($nick == $gettok(%iuno.u,1,46)) {
281
      if ($findtok(%iuno.h. [ $+ [ $nick ] ],%iuno.pvx,0,46)) {
282
        if (($pos($gettok(%iuno.dp,1,46),[ %iuno.pv ],1)) || (($pos($gettok(%iuno.dp,1,46),[ %iuno.px ],1)) && ($iif($pos($gettok(%iuno.dp,1,46),D2,1),$iif($pos(%iuno.pvx,D2,1),$true,$false),$true)))) {
283
          if ((%iuno.udc != 1) || ((%iuno.udc == 1) && ($pos($gettok(%iuno.h. [ $+ [ $nick ] ],$numtok(%iuno.h. [ $+ [ $nick ] ],46),46),%iuno.pvx,1)))) {
284
            set %iuno.dp $instok(%iuno.dp,$upper(%iuno.pvx),1,46)
285
            set %iuno.h. [ $+ [ $nick ] ] $remtok(%iuno.h. [ $+ [ $nick ] ],%iuno.pvx,1,46)
286
            if ($numtok(%iuno.h. [ $+ [ $nick ] ],46) == 1) unomsg $network $chan  $+ %iuno.cr $+ U $+ %iuno.cy $+ n $+ %iuno.cb $+ o $+ %iuno.cg $+ !  $+ %iuno.fc $+ $nick has one card left!
287
            set %iuno.u $instok(%iuno.u,$gettok(%iuno.u,1,46),-0,46)
288
            set %iuno.u $deltok(%iuno.u,1,46)
289
            if ($numtok(%iuno.h. [ $+ [ $nick ] ],46)) {
290
              if ($pos($gettok(%iuno.dp,1,46),S,1)) {
291
                skip $network $gettok(%iuno.u,1,46)
292
              }
293
              elseif ($pos($gettok(%iuno.dp,1,46),D2,1)) {
294
                drawtwo $network $gettok(%iuno.u,1,46)
295
              }
296
              elseif ($pos($gettok(%iuno.dp,1,46),R,1)) {
297
                reverse $network $nick
298
              }
299
              else {
300
                unomsg $network $chan $gettok(%iuno.u,1,46) $+ 's turn.
301
                showtopcard $network $chan
302
                unocards $network $gettok(%iuno.u,1,46)
303
              }
304
            }
305
            else {
306
              score $network $nick
307
            }
308
            if (!$numtok(%iuno.h. [ $+ [ $nick ] ],46)) {
309
              score $network $nick
310
            }
311
            if (%iuno.udc) unset %iuno.udc
312
          }
313
          else {
314
            unomsg $network $chan Sorry $nick but you must play the card you've drawn or !Pass.
315
          }
316
        }
317
        else {
318
          unomsg $network $chan Sorry but that card doesn't play $nick $+ .
319
        }
320
      }
321
      else {
322
        unomsg $network $chan You don't have that card $nick $+ .
323
      }
324
    }
325
  }
326
}
327
;----------------------------------------------------------------------
328
on *:text:!draw:%iuno.c2: {
329
  if ($network == %iuno.np) {
330
    if ($nick == $gettok(%iuno.u,1,46)) {
331
      if (%iuno.udc != 1) {
332
        if (!$numtok(%iuno.d,46)) {
333
          set %iuno.ud %iuno.dp
334
          unset %iuno.dp
335
          set %iuno.dp $gettok(%iuno.ud,1,46)
336
          set %iuno.ud $deltok(%iuno.ud,1,46)
337
          unomsg $network $chan Shuffling discard pile
338
          newunodeck x
339
        }
340
        set %iuno.h. $+ $nick $instok( %iuno.h. [ $+ [ $nick ] ] ,$gettok(%iuno.d,1,46),-0,46)
341
        set %iuno.d $deltok(%iuno.d,1,46)
342
        if (%iuno.draw == 1) set %iuno.udc 1
343
        drawncards $network $gettok(%iuno.u,1,46) 1
344
        unomsg $network $chan $nick draws a card.
345
      }
346
      else {
347
        unomsg $network $chan $nick you must play the card you drew or !Pass
348
      }
349
    }
350
  }
351
}
352
;----------------------------------------------------------------------
353
on *:text:!TopCard:%iuno.c2: {
354
  if ($network == %iuno.np) showtopcard $network $chan
355
}
356
;----------------------------------------------------------------------
357
on *:text:!pass:%iuno.c2: {
358
  if ($network == %iuno.np) {
359
    if ($nick == $gettok(%iuno.u,1,46)) {
360
      if (%iuno.draw == 1) {
361
        if (%iuno.udc == 1) {
362
          set %iuno.u $instok(%iuno.u,$gettok(%iuno.u,1,46),-0,46)
363
          set %iuno.u $deltok(%iuno.u,1,46)
364
          unomsg $network $chan $nick passes, $gettok(%iuno.u,1,46) $+ 's turn.
365
          showtopcard $network $chan
366
          unocards $network $gettok(%iuno.u,1,46)
367
         unset %iuno.udc
368
        }
369
        else {
370
          unomsg $network $chan $nick you must draw before you can pass.
371
        }
372
      }
373
      else {
374
        unomsg $network $chan $nick you must draw until you can play.
375
      }
376
    }
377
  }
378
}
379
;----------------------------------------------------------------------
380
on *:text:!UnoTop10*:%iuno.c: {
381
  if ($chanvalid($chan,$network))  {
382
    if (%iuno.tt == 1) {
383
      if ($2 == Points) filter -ffac " $+ $scriptdir $+ Uno.txt $+ " " $+ $scriptdir $+ UnoTop.txt $+ " unofilter2 */*
384
      elseif ($2 == Games) filter -ffac " $+ $scriptdir $+ Uno.txt $+ " " $+ $scriptdir $+ UnoTop.txt $+ " unofilter3 */*
385
      else filter -ffac " $+ $scriptdir $+ Uno.txt $+ " " $+ $scriptdir $+ UnoTop.txt $+ " unofilter */*
386
      unomsg3 $network $nick  $+ %iuno.fc $+ , $+ %iuno.bc $+ Uno Top 10 for $iif($2 == Points,Total Points,$iif($2 == Games,Games Played,Average Points Per Game $chr(40) $+ Points/Games $+ $chr(41))) is:
387
      set %iuno.ptv.n $network
388
      write -il1 " $+ $scriptdir $+ UnoTop.txt $+ " [Top10]
389
      write -il12 " $+ $scriptdir $+ UnoTop.txt $+ " [EndTop10]
390
      play -aq5m1tTop10 unomsg3 $nick " $+ $scriptdir $+ UnoTop.txt $+ " 1000
391
      write -dl1 " $+ $scriptdir $+ UnoTop.txt $+ "
392
      write -dl12 " $+ $scriptdir $+ UnoTop.txt $+ "
393
    }
394
    else {
395
      unomsg3 $network $nick Sorry but !UnoTop10 is disabled.
396
    }
397
  }
398
}
399
;----------------------------------------------------------------------
400
on *:text:!Rank:%iuno.c: {
401
  if ($chanvalid($chan,$network))  {
402
    if (%iuno.rank == 1) {
403
      filter -ffac " $+ $scriptdir $+ Uno.txt $+ " " $+ $scriptdir $+ UnoTop.txt $+ " unofilter2 */*
404
      if ($read(" $+ $scriptdir $+ UnoTop.txt $+ ", nw, $nick *)) {
405
        set %iuno.r.t $read(" $+ $scriptdir $+ UnoTop.txt $+ ", nw, $nick *)
406
        set %iuno.r.p $readn
407
        filter -ffac " $+ $scriptdir $+ Uno.txt $+ " " $+ $scriptdir $+ UnoTop.txt $+ " unofilter3 */*
408
        set %iuno.r.t $read(" $+ $scriptdir $+ UnoTop.txt $+ ", nw, $nick *)
409
        set %iuno.r.g $readn
410
        filter -ffac " $+ $scriptdir $+ Uno.txt $+ " " $+ $scriptdir $+ UnoTop.txt $+ " unofilter */*
411
        set %iuno.r.t $read(" $+ $scriptdir $+ UnoTop.txt $+ ", nw, $nick *)
412
        set %iuno.r.a $readn
413
        unomsg3 $network $nick Your IRC Uno Rankings: %iuno.r.a / %iuno.r.p / %iuno.r.g
414
        unomsg3 $network $nick (Points per Game / Total Points / Total Games)
415
      }
416
      else {
417
        unomsg3 $network $nick Sorry but you are currently unranked, play Uno to get into the rankings!
418
      }
419
    }
420
    else {
421
      unomsg3 $network $nick Sorry but individual ranks are disabled.
422
    }
423
  }
424
}
425
;----------------------------------------------------------------------
426
on *:text:!score:%iuno.c: {
427
  if ($chanvalid($chan,$network))  {
428
    if (%iuno.sco == 1) {
429
      if ($read(" $+ $scriptdir $+ Uno.txt $+ ",s,$nick)) unomsg3 $network $nick You have $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",s,$nick),1,47) total points and $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",s,$nick),2,47) games played.
430
      else unomsg3 $network $nick No score saved.
431
    }
432
    else {
433
      unomsg3 $network $nick !Score has been disabled.
434
    }
435
  }
436
}
437
;----------------------------------------------------------------------
438
on *:text:!score *:%iuno.c: {
439
  if ($chanvalid($chan,$network))  {
440
    if (%iuno.scon == 1) {
441
      if ($read(" $+ $scriptdir $+ Uno.txt $+ ",s,$2)) unomsg3 $network $nick $2 has $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",s,$2),1,47) total points and $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",s,$2),2,47) games played.
442
      else unomsg3 $network $nick No score saved for $2
443
    }
444
    else {
445
      unomsg3 $network $nick !Score <Nick> has been disabled.
446
    }
447
  }
448
}
449
;----------------------------------------------------------------------
450
on *:text:!showcards:%iuno.c2: {
451
  if ($network == %iuno.np) unocards $network $nick
452
}
453
;----------------------------------------------------------------------
454
on *:text:!quit:%iuno.c2: {
455
  if (($findtok(%iuno.u,$nick,46)) && ($network == %iuno.np)) runoplayer $network $nick
456
}
457
;----------------------------------------------------------------------
458
on *:text:!players:%iuno.c2: {
459
  if ($network == %iuno.np) {
460
    unomsg3 $network $nick  $+ %iuno.fc $+ , $+ %iuno.bc $+ Current Uno Players are:
461
    unomsg3 $network $nick  $+ %iuno.fc $+ , $+ %iuno.bc $+ $replace(%iuno.u,.,$chr(32))
462
  }
463
}
464
;----------------------------------------------------------------------
465
on *:text:!Commands:%iuno.c: {
466
  if ($chanvalid($chan,$network))  {
467
    set %iuno.cmnd !Uno, Join, !Deal, !Play <color> <card>, !Play [W/WD4] <color>, !Draw, !Pass, !UnoTop10, !Score, !Score <nick>, !TopCard, !ShowCards, !UnoStop, !Quit, !Players, !Rank, !Count
468
    unomsg3 $network $nick  $+ %iuno.fc $+ , $+ %iuno.bc $+ Commands for IRC Uno are: %iuno.cmnd
469
    unomsg3 $network $nick  $+ %iuno.fc $+ , $+ %iuno.bc $+ Type !Help <Command> for more information on a command.
470
    unset %iuno.cmnd
471
  }
472
}
473
;----------------------------------------------------------------------
474
on *:text:!Help*:%iuno.c: {
475
  if ($chanvalid($chan,$network))  {
476
    set %iuno.cmnd !Uno.Join.!Deal.!Play.!Draw.!Pass.!UnoTop10.!Score.!TopCard.!ShowCards.!UnoStop.!Quit.!Players.!Rank.!Count
477
    if (!$findtok(%iuno.cmnd,$2,1,46)) {
478
      unomsg3 $network $nick  $+ %iuno.fc $+ , $+ %iuno.bc $+ Sorry but I cannot find any help for that command.
479
    }
480
    else {
481
      set %iuno.line $findtok(%iuno.cmnd,$2,1,46) + 1
482
      unomsg3 $network $nick  $+ %iuno.fc $+ , $+ %iuno.bc $+ $Read(" $+ $scriptdir $+ Uno.mrc $+ ", %iuno.line)
483
      unset %iuno.line
484
    }
485
    unset %iuno.cmnd
486
  }
487
}
488
;----------------------------------------------------------------------
489
on *:text:!Count:%iuno.c2: {
490
  set %iuno.cnt.tmp 1
491
  set %iuno.cnt.rp Card Count:
492
  while (%iuno.cnt.tmp <= $numtok(%iuno.u,46)) {
493
    set %iuno.cnt.rp %iuno.cnt.rp $+ $chr(32) $+ $gettok(%iuno.u,%iuno.cnt.tmp,46) $numtok(%iuno.h. [ $+ [ $gettok(%iuno.u,%iuno.cnt.tmp,46) ] ],46) :
494
    inc %iuno.cnt.tmp
495
  }
496
  unomsg3 $network $nick %iuno.cnt.rp
497
  unset %iuno.cnt.*
498
}
499
;----------------------------------------------------------------------
500
on *:KICK:%iuno.c: {
501
  if (($findtok(%iuno.u,$knick,46)) && ($network == %iuno.np)) runoplayer $network $knick
502
}
503
;----------------------------------------------------------------------
504
on *:NICK: {
505
  if ($network == %iuno.np)  {
506
    if ($findtok(%iuno.u,$nick,1,46)) {
507
      set %iuno.u $reptok(%iuno.u,$nick,$newnick,1,46)
508
      if ($nick == %iuno.fp) {
509
        set %iuno.fp $newnick
510
      }
511
      set %iuno.h. [ $+ [ $newnick ] ] %iuno.h. [ $+ [ $nick ] ]
512
      unset %iuno.h. [ $+ [ $nick ] ]
513
    }
514
  }
515
}
516
;----------------------------------------------------------------------
517
on *:PART:%iuno.c2: {
518
  if (($findtok(%iuno.u,$nick,46)) && ($network == %iuno.np)) runoplayer $network $nick
519
}
520
;----------------------------------------------------------------------
521
on *:QUIT: {
522
  if (($findtok(%iuno.u,$nick,46)) && ($network == %iuno.np)) runoplayer $network $nick
523
}
524
;----------------------------------------------------------------------
525
alias chanvalid {
526
  if (%iuno.mn == 0) return $true
527
  elseif ((%iuno.mn == 1) && ($findtok(%iuno.c. [ $+ [ $2 ] ],$1,1,46))) return $true
528
  else return $false
529
}
530
;----------------------------------------------------------------------
531
alias score {
532
  unomsg $1 %iuno.c2 We have a winner! Go $2
533
  set %iuno.u $deltok(%iuno.u,$findtok(%iuno.u,$2,1,46),46)
534
  var %iuno.sc 1
535
  var %iuno.cs $numtok(%iuno.u,46)
536
  while (%iuno.sc <= %iuno.cs) {
537
    addplayerscoreb $gettok(%iuno.u,%iuno.sc,46)
538
    inc %iuno.sc
539
  }
540
  addplayerscore $2
541
  unomsg $1 %iuno.c2 $2 gains %iuno.t.u points. For a total of %iuno.t.k points, and a total of $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",s,$2),2,47) games played.
542
  unoreset
543
}
544
;----------------------------------------------------------------------
545
alias unocid {
546
  if ($isid) {
547
    var %e = return $+($chr(3),$color(info),$!unocid: Error -)
548
    if ($version < 6.0) %e multi-server capability was only added in version 6.0
549
    if (!$len($1)) %e you must specify a network, server, or wildcarded string as first parameter.
550
    if (!$regex($ticks,$2,/^-?\d+-?(?:-\d+)?$/)) %e second param should either be a number or a range.
551
    var %n = $iif($3 isnum 1-15,$3,1), %params = $1 $iif($3 !isnum,$3)
552
    set -u %result
553
    scon -at $+ %n unocid % $+ params
554
    return $gettok(%result,$2,32)
555
  }
556
  if ($1 iswm $server) || ($istok($server $network,$1,32)) {
557
    if ($2) && ($me !ison $2) return
558
    set -u %result %result $cid
559
  }
560
}
561
;----------------------------------------------------------------------
562
alias unomsg {
563
  if ($unocid($1,1,$2)) {
564
    scid $ifmatch
565
    msg $2  $+ %iuno.fc $+ , $+ %iuno.bc $+ $3-
566
    scid -r
567
  }
568
}
569
;----------------------------------------------------------------------
570
alias unomsg2 {
571
  if ($unocid($1,1,$2)) {
572
    scid $ifmatch
573
    msg $2  $+ %iuno.fc $+ , $+ %iuno.bc $+ $3-
574
    scid -r
575
  }
576
}
577
;----------------------------------------------------------------------
578
alias unomsg3 {
579
  if ($play($1).status) {
580
    set %iuno.um3n %iuno.ptv.n
581
    set %iuno.um3c $1
582
    set %iuno.um3m $2-
583
  }
584
  else {
585
    set %iuno.um3n $1
586
    set %iuno.um3c $2
587
    set %iuno.um3m $3-
588
  }
589
  if ($unocid(%iuno.um3n,1,%iuno.c2)) {
590
    scid $ifmatch
591
    if (%iuno.comm == 0) notice %iuno.um3c  $+ %iuno.fc $+ , $+ %iuno.bc $+ $iif($play(%iuno.um3c).status,$chr(35) $+ $play(%iuno.um3c).pos $+ $chr(32)) $+ %iuno.um3m
592
    if (%iuno.comm == 1) msg %iuno.um3c  $+ %iuno.fc $+ , $+ %iuno.bc $+ $iif($play(%iuno.um3c).status,$chr(35) $+ $play(%iuno.um3c).pos $+ $chr(32)) $+ %iuno.um3m
593
    scid -r
594
  }
595
}
596
;----------------------------------------------------------------------
597
alias runoplayer {
598
  if ($2 == %iuno.fp) {
599
    set %iuno.u $deltok(%iuno.u,$findtok(%iuno.u,$2,46),46)
600
    if ($numtok(%iuno.u,46) <= 1) {
601
      if ($numtok(%iuno.u,46) != 0) {
602
        addplayerscoreb $2
603
        addplayerscore $gettok(%iuno.u,1,46)
604
        unomsg $1 %iuno.c2 $gettok(%iuno.u,1,46) gains %iuno.t.u points. For a total of %iuno.t.k points, and a total of $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",s,$gettok(%iuno.u,1,46)),2,47) games played.
605
        unoreset
606
      }
607
      else {
608
        unomsg $1 %iuno.c2 No one is playing Uno t.t Type !Uno to begin anew.
609
        unoreset
610
      }
611
    }
612
    else {
613
      set %iuno.fp $gettok(%iuno.u,1,46)
614
      unomsg $1 %iuno.c2 $2 was removed from the current Uno game.
615
      unomsg $1 %iuno.c2 %iuno.fp is now in control of the current Uno game.
616
      unomsg3 $1 %iuno.fp You may now stop Uno by typing !unostop into %iuno.c2
617
      if (%iuno.dl == 1) {
618
        set %iuno.t.x 1
619
        set %iuno.t.r $numtok(%iuno.h. [ $+ [ $2 ] ],46)
620
        while (%iuno.t.r >= %iuno.t.x) {
621
          set %iuno.d $instok(%iuno.d,$gettok(%iuno.h. [ $+ [ $2 ] ],%iuno.t.x,46),$rand(1,$numtok(%iuno.d,46)),46)
622
          inc %iuno.t.x
623
        }
624
        addplayerscoreb $2
625
      }
626
    }
627
  }
628
  elseif ($findtok(%iuno.u,$2,0,46)) {
629
    set %iuno.u $deltok(%iuno.u,$findtok(%iuno.u,$2,1,46),46)
630
    if ($numtok(%iuno.u,46) <= 1) {
631
      if ($numtok(%iuno.u,46) != 0) {
632
        addplayerscoreb $2
633
        addplayerscore $gettok(%iuno.u,1,46)
634
        unomsg $1 %iuno.c2 $gettok(%iuno.u,1,46) gains %iuno.t.u points. For a total of %iuno.t.k points, and a total of $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",s,$gettok(%iuno.u,1,46)),2,47) games played.
635
        unoreset
636
      }
637
      else {
638
        unomsg $1 %iuno.c2 No one is playing Uno t.t Type !Uno to begin anew.
639
        unoreset
640
      }
641
    }
642
    else {
643
      unomsg $1 %iuno.c2 $2 was removed from the current Uno game.
644
      if (%iuno.dl == 1) {
645
        set %iuno.t.x 1
646
        set %iuno.t.r $numtok(%iuno.h. [ $+ [ $2 ] ],46)
647
        while (%iuno.t.r >= %iuno.t.x) {
648
          set %iuno.d $instok(%iuno.d,$gettok(%iuno.h. [ $+ [ $2 ] ],%iuno.t.x,46),$rand(1,$numtok(%iuno.d,46)),46)
649
          inc %iuno.t.x
650
        }
651
        addplayerscoreb $2
652
      }
653
    }
654
  }
655
}
656
;----------------------------------------------------------------------
657
alias addplayerscore {
658
  set %iuno.t.q $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",s,$1),2,47)
659
  inc %iuno.t.q
660
  write -l1 " $+ $scriptdir $+ Uno.txt $+ " $addtok($read(" $+ $scriptdir $+ Uno.txt $+ ",1),$1,46)
661
  if (!$read(" $+ $scriptdir $+ Uno.txt $+ ",s,$1)) write " $+ $scriptdir $+ Uno.txt $+ " $1 0/0
662
  set %iuno.t.r $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",s,$1),1,47)
663
  set %iuno.t.k $calc(%iuno.t.r + %iuno.t.u)
664
  $eval(write -s $+ $1 " $+ $scriptdir $+ Uno.txt $+ " $1 %iuno.t.k $+ $chr(47) $+ %iuno.t.q)
665
}
666
;----------------------------------------------------------------------
667
alias addplayerscoreb {
668
  set %iuno.h. [ $+ [ $1 ] ] $remove(%iuno.h. [ $+ [ $1 ] ],b,g,m,y,z,D4)
669
  set %iuno.t.s $replace(%iuno.h. [ $+ [ $1 ] ],.,+,S,20,D2,20,R,20,W,50)
670
  set %iuno.t.s $calc(%iuno.t.s)
671
  write -l1 " $+ $scriptdir $+ Uno.txt $+ " $addtok($read(" $+ $scriptdir $+ Uno.txt $+ ",1),$1,46)
672
  if (!$read(" $+ $scriptdir $+ Uno.txt $+ ",s,$1)) write " $+ $scriptdir $+ Uno.txt $+ " $1 0/0
673
  set %iuno.t.a $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",s,$1),2,47)
674
  inc %iuno.t.a
675
  set %iuno.t.u $calc(%iuno.t.s + %iuno.t.u)
676
  $eval(write -s $+ $1 " $+ $scriptdir $+ Uno.txt $+ " $1 $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",s,$1),1,47) $+ $chr(47) $+ %iuno.t.a)
677
}
678
;----------------------------------------------------------------------
679
alias unocards { /* Network, Nick */
680
  if (%iuno.h. [ $+ [ $2 ] ]) {
681
    set %iuno.ch. [ $+ [ $2 ] ] $sorttok(%iuno.h. [ $+ [ $2 ] ],46,a)
682
    set %iuno.ch. [ $+ [ $2 ] ] $replace(%iuno.ch. [ $+ [ $2 ] ],b,$eval($chr(3) $+ %iuno.cb $+ $chr(44) $+ %iuno.bc $+ $chr(91)))
683
    set %iuno.ch. [ $+ [ $2 ] ] $replace(%iuno.ch. [ $+ [ $2 ] ],g,$eval($chr(3) $+ %iuno.cg $+ $chr(44) $+ %iuno.bc $+ $chr(91)))
684
    set %iuno.ch. [ $+ [ $2 ] ] $replace(%iuno.ch. [ $+ [ $2 ] ],m,$eval($chr(3) $+ %iuno.cr $+ $chr(44) $+ %iuno.bc $+ $chr(91)))
685
    set %iuno.ch. [ $+ [ $2 ] ] $replace(%iuno.ch. [ $+ [ $2 ] ],y,$eval($chr(3) $+ %iuno.cy $+ $chr(44) $+ %iuno.bc $+ $chr(91)))
686
    set %iuno.ch. [ $+ [ $2 ] ] $replace(%iuno.ch. [ $+ [ $2 ] ],z,$eval($chr(3) $+ %iuno.cw $+ $chr(44) $+ %iuno.bc $+ $chr(91)))
687
    set %iuno.ch. [ $+ [ $2 ] ] $replace(%iuno.ch. [ $+ [ $2 ] ],.,$chr(93) $+ $chr(3))
688
    set %iuno.ch. [ $+ [ $2 ] ] %iuno.ch. [ $+ [ $2 ] ] $+ $chr(93)
689
    unomsg3 $1 $2 %iuno.d4.s %iuno.ch. [ $+ [ $2 ] ]
690
  }
691
  else {
692
    echo -s Uno error - User $2 does not have any cards.
693
  }
694
}
695
;----------------------------------------------------------------------
696
alias showtopcard {  /* Network, Channel */
697
  set %iuno.dc $gettok(%iuno.dp,1,46)
698
  set %iuno.dc $replace(%iuno.dc,b,$eval($chr(3) $+ %iuno.cb $+ $chr(44) $+ %iuno.bc $+ $chr(91)))
699
  set %iuno.dc $replace(%iuno.dc,g,$eval($chr(3) $+ %iuno.cg $+ $chr(44) $+ %iuno.bc $+ $chr(91)))
700
  set %iuno.dc $replace(%iuno.dc,m,$eval($chr(3) $+ %iuno.cr $+ $chr(44) $+ %iuno.bc $+ $chr(91)))
701
  set %iuno.dc $replace(%iuno.dc,y,$eval($chr(3) $+ %iuno.cy $+ $chr(44) $+ %iuno.bc $+ $chr(91)))
702
  set %iuno.dc $replace(%iuno.dc,z,$eval($chr(3) $+ %iuno.cw $+ $chr(44) $+ %iuno.bc $+ $chr(91)))
703
  set %iuno.dc $replace(%iuno.dc,.,$chr(93) $+ $chr(3))
704
  unomsg $1 $2 Top Card: %iuno.dc $+ $chr(93)
705
  var %iuno.cc 2
706
  set %iuno.cl Next:
707
  while (%iuno.cc <= $numtok(%iuno.u,46)) {
708
    set %iuno.cl %iuno.cl $chr(124) $gettok(%iuno.u,%iuno.cc,46) - $numtok(%iuno.h. [ $+ [ $gettok(%iuno.u,%iuno.cc,46) ] ],46) Cards
709
    inc %iuno.cc
710
  }
711
  unomsg3 $1 $gettok(%iuno.u,1,46)  $+ %iuno.fc $+ , $+ %iuno.bc $+ %iuno.cl
712
}
713
;----------------------------------------------------------------------
714
alias unoreset {
715
  unset %iuno.*
716
  set %iuno.color $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",2),2,46)
717
  set %iuno.rank $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",2),3,46)
718
  set %iuno.draw $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",2),4,46)
719
  set %iuno.comm $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",2),5,46)
720
  set %iuno.rwt $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",2),6,46)
721
  set %iuno.tt $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",2),7,46)
722
  set %iuno.sco $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",2),8,46)
723
  set %iuno.scon $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",2),9,46)
724
  set %iuno.mn $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",2),10,46)
725
  set %iuno.c $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",3),2-,44)
726
  set %iuno.as $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",4),1,32)
727
  if (%iuno.as > 0) {
728
    set %iuno.networks $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",4),2,32)
729
    set %iuno.as3 $gettok($read(" $+ $scriptdir $+ Uno.txt $+ ",4),3-,32)
730
  }
731
  set %iuno.as.c 1
732
  while (%iuno.as.c <= %iuno.as) {
733
    set %iuno.c. [ $+ [ $gettok(%iuno.networks,%iuno.as.c,44) ] ] $gettok(%iuno.as3,%iuno.as.c,32)
734
    inc %iuno.as.c
735
  }
736
  unocolors
737
}
738
;----------------------------------------------------------------------
739
alias newunodeck {
740
  if (!$1) set %iuno.ud b0.b1.b2.b3.b4.b5.b6.b7.b8.b9.b1.b2.b3.b4.b5.b6.b7.b8.b9.g0.g1.g2.g3.g4.g5.g6.g7.g8.g9.g1.g2.g3.g4.g5.g6.g7.g8.g9.m0.m1.m2.m3.m4.m5.m6.m7.m8.m9.m1.m2.m3.m4.m5.m6.m7.m8.m9.y0.y1.y2.y3.y4.y5.y6.y7.y8.y9.y1.y2.y3.y4.y5.y6.y7.y8.y9.bD2.bD2.gD2.gD2.mD2.mD2.yD2.yD2.bS.bS.gS.gS.yS.yS.mS.mS.bR.bR.gR.gR.yR.yR.mR.mR.ZW.ZW.ZW.ZW.zWD4.zWD4.zWD4.zWD4
741
  if ($1) {
742
    set %iuno.ud $replace(%iuno.ud,b $+ $chr(42),$chr(42),g $+ $chr(42),$chr(42),m $+ $chr(42),$chr(42),y $+ $chr(42),$chr(42))
743
    
744
    if ($findtok(%iuno.ud,$chr(42),0,46)) set %iuno.ud $reptok(%iuno.ud,$chr(42),ZW,1,46)
745
    if ($findtok(%iuno.ud,$chr(42),0,46)) set %iuno.ud $reptok(%iuno.ud,$chr(42),ZW,1,46)
746
    if ($findtok(%iuno.ud,$chr(42),0,46)) set %iuno.ud $reptok(%iuno.ud,$chr(42),ZW,1,46)
747
    if ($findtok(%iuno.ud,$chr(42),0,46)) set %iuno.ud $reptok(%iuno.ud,$chr(42),ZW,1,46)
748
    if ($findtok(%iuno.ud,$chr(42),0,46)) set %iuno.ud $reptok(%iuno.ud,$chr(42),zWD4,1,46)
749
    if ($findtok(%iuno.ud,$chr(42),0,46)) set %iuno.ud $reptok(%iuno.ud,$chr(42),zWD4,1,46)
750
    if ($findtok(%iuno.ud,$chr(42),0,46)) set %iuno.ud $reptok(%iuno.ud,$chr(42),zWD4,1,46)
751
    if ($findtok(%iuno.ud,$chr(42),0,46)) set %iuno.ud $reptok(%iuno.ud,$chr(42),zWD4,1,46)
752
  }
753
  var %iuno.it $numtok(%iuno.ud,46)
754
  unset %iuno.d
755
  var %iuno.i = 1
756
  while (%iuno.i <= %iuno.it) {
757
    var %iuno.r $rand(1,$numtok(%iuno.ud,46))
758
    set %iuno.d $instok(%iuno.d,$gettok(%iuno.ud,%iuno.r,46),-0,46)
759
    set %iuno.ud $deltok(%iuno.ud,%iuno.r,46)
760
    inc %iuno.i
761
  }
762
  unset %iuno.ud
763
}
764
;----------------------------------------------------------------------
765
alias skip {
766
  set %iuno.u $instok(%iuno.u,$gettok(%iuno.u,1,46),-0,46)
767
  set %iuno.u $deltok(%iuno.u,1,46)
768
  unomsg $1 %iuno.c2 $2 was Skipped! $gettok(%iuno.u,1,46) $+ 's turn.
769
  showtopcard $1 %iuno.c2
770
  unocards $1 $gettok(%iuno.u,1,46)
771
}
772
;----------------------------------------------------------------------
773
alias drawtwo {
774
  var %iuno.d2v 1
775
  while (%iuno.d2v <= 2) {
776
    if (!$numtok(%iuno.d,46)) {
777
      set %iuno.ud %iuno.dp
778
      unset %iuno.dp
779
      set %iuno.dp $gettok(%iuno.ud,1,46)
780
      set %iuno.ud $deltok(%iuno.ud,1,46)
781
      unomsg $1 %iuno.c2 Shuffling discard pile
782
      newunodeck x
783
    }
784
    set %iuno.h. [ $+ [ $2 ] ] $instok(%iuno.h. [ $+ [ $2 ] ],$gettok(%iuno.d,1,46),-0,46)
785
    set %iuno.d $deltok(%iuno.d,1,46)
786
    inc %iuno.d2v
787
  }
788
  set %iuno.u $instok(%iuno.u,$gettok(%iuno.u,1,46),-0,46)
789
  set %iuno.u $deltok(%iuno.u,1,46)
790
  unomsg $1 %iuno.c2 $2 Draws Two and is Skipped! $gettok(%iuno.u,1,46) $+ 's turn.
791
  showtopcard $1 %iuno.c2
792
  drawncards $network $2 2
793
  unocards $1 $gettok(%iuno.u,1,46)
794
}
795
;----------------------------------------------------------------------
796
alias unocolors {
797
  if (%iuno.color == 1) {
798
    set %iuno.cb 12
799
    set %iuno.cg 9
800
    set %iuno.cw 0
801
    set %iuno.fc 0
802
    set %iuno.bc 1
803
  }
804
  else {
805
    set %iuno.cb 2
806
    set %iuno.cg 3
807
    set %iuno.cw 1
808
    set %iuno.fc 1
809
    set %iuno.bc 0
810
  }
811
  set %iuno.cr 4
812
  set %iuno.cy 8
813
}
814
;----------------------------------------------------------------------
815
alias drawncards {
816
  set %iuno.t.m $numtok(%iuno.h. [ $+ [ $2 ] ],46)
817
  set %iuno.t.l $gettok(%iuno.h. [ $+ [ $2 ] ],%iuno.t.m,46)
818
  set %iuno.t.j $3
819
  while (%iuno.t.j > 1) {
820
    dec %iuno.t.m
821
    set %iuno.t.l %iuno.t.l $+ $chr(46) $+ $gettok(%iuno.h. [ $+ [ $2 ] ],%iuno.t.m,46)
822
    dec %iuno.t.j
823
  }
824
  set %iuno.t.l $replace(%iuno.t.l,b,$eval($chr(3) $+ %iuno.cb $+ $chr(44) $+ %iuno.bc $+ $chr(91)))
825
  set %iuno.t.l $replace(%iuno.t.l,g,$eval($chr(3) $+ %iuno.cg $+ $chr(44) $+ %iuno.bc $+ $chr(91)))
826
  set %iuno.t.l $replace(%iuno.t.l,m,$eval($chr(3) $+ %iuno.cr $+ $chr(44) $+ %iuno.bc $+ $chr(91)))
827
  set %iuno.t.l $replace(%iuno.t.l,y,$eval($chr(3) $+ %iuno.cy $+ $chr(44) $+ %iuno.bc $+ $chr(91)))
828
  set %iuno.t.l $replace(%iuno.t.l,z,$eval($chr(3) $+ %iuno.cw $+ $chr(44) $+ %iuno.bc $+ $chr(91)))
829
  set %iuno.t.l $replace(%iuno.t.l,.,$chr(93) $+ $chr(3))
830
  set %iuno.t.l %iuno.t.l $+ $chr(93)
831
  unomsg3 $1 $2  $+ %iuno.fc $+ , $+ %iuno.bc $+ Drawn Card(s): %iuno.t.l
832
}
833
;----------------------------------------------------------------------
834
alias reverse { /* Network, Nick */
835
  var %iuno.ri 2
836
  while (%iuno.ri <= $numtok(%iuno.u,46)) {
837
    set %iuno.u $instok(%iuno.u,$gettok(%iuno.u,%iuno.ri,46),1,46)
838
    inc %iuno.ri
839
    set %iuno.u $deltok(%iuno.u,%iuno.ri,46)
840
  }
841
  if ((%iuno.rwt == 1) && ($numtok(%iuno.u,46) == 2)) {
842
    set %iuno.u $instok(%iuno.u,$gettok(%iuno.u,1,46),-0,46)
843
    set %iuno.u $deltok(%iuno.u,1,46)
844
  }
845
  set %iuno.u $instok(%iuno.u,$gettok(%iuno.u,1,46),-0,46)
846
  set %iuno.u $deltok(%iuno.u,1,46)
847
  unomsg $1 %iuno.c2 $2 Reversed it! $gettok(%iuno.u,1,46) $+ 's turn.
848
  showtopcard $1 %iuno.c2
849
  unocards $1 $gettok(%iuno.u,1,46)
850
}
851
;----------------------------------------------------------------------
852
alias chanpop {
853
  did -r UnoOptions 10
854
  didtok UnoOptions 10 44 %iuno.c
855
  did -c UnoOptions 10 1
856
}
857
;----------------------------------------------------------------------
858
alias chanpop2 {
859
  did -r UnoOptions 43
860
  if (!$1) didtok UnoOptions 43 46 %iuno.c. [ $+ [ $did(53).text ] ]
861
  if ($1) didtok UnoOptions 43 46 %iuno.c. [ $+ [ $did(40).text ] ]
862
  did -c UnoOptions 43 1
863
  if (!$1) did -c UnoOptions 40 $findtok($didtok(UnoOptions,40,44),$did(53).text,1,44)
864
}
865
;----------------------------------------------------------------------
866
alias unofilter { ;Average per Game
867
  if ($calc($gettok($1,2,32)) > $calc($gettok($2,2,32))) return -1
868
  if ($calc($gettok($1,2,32)) < $calc($gettok($2,2,32))) return 1
869
  if ($calc($gettok($1,2,32)) == $calc($gettok($2,2,32))) return 0
870
}
871
;----------------------------------------------------------------------
872
alias unofilter2 { ;Total Points
873
  if ($gettok($gettok($1,2,32),1,47) > $gettok($gettok($2,2,32),1,47)) return -1
874
  if ($gettok($gettok($1,2,32),1,47) < $gettok($gettok($2,2,32),1,47)) return 1
875
  if ($gettok($gettok($1,2,32),1,47) == $gettok($gettok($2,2,32),1,47)) return 0
876
}
877
;----------------------------------------------------------------------
878
alias unofilter3 { ;Total Games
879
  if ($gettok($gettok($1,2,32),2,47) > $gettok($gettok($2,2,32),2,47)) return -1
880
  if ($gettok($gettok($1,2,32),2,47) < $gettok($gettok($2,2,32),2,47)) return 1
881
  if ($gettok($gettok($1,2,32),2,47) == $gettok($gettok($2,2,32),2,47)) return 0
882
}
883
;----------------------------------------------------------------------
884
alias UnoOptions {
885
  dialog -ma UnoOptions UnoOptions
886
}
887
;----------------------------------------------------------------------
888
alias mnunoupdate {
889
  set %iuno.networks $didtok(UnoOptions,40,44)
890
  set %iuno.tv.c 1
891
  while (%iuno.tv.c <= $numtok(%iuno.networks,44)) {
892
    set %iuno.tv2.c 1
893
    while (%iuno.tv2.c <= $numtok(%iuno.c. [ $+ [ $gettok(%iuno.networks,%iuno.tv.c,44) ] ],46)) {
894
      set %iuno.c $addtok(%iuno.c,$gettok(%iuno.c. [ $+ [ $gettok(%iuno.networks,%iuno.tv.c,44) ] ],%iuno.tv2.c,46),44)
895
      inc %iuno.tv2.c
896
    }
897
    inc %iuno.tv.c
898
  }
899
}
900
;----------------------------------------------------------------------
901
dialog -l UnoOptions {
902
  title "IRC Uno by Lost.Lion@gmail.com"
903
  size -1 -1 300 328
904
  option pixels notheme
905
  tab "Options", 6, 1 1 299 300
906
  tab "Network Options", 38
907
  tab "Variations", 27
908
  tab "About", 7
909
  button "Apply", 1, 220 300 70 25, ok
910
  button "UnLoad", 23, 7 265 70 25, tab 6
911
  button "ReLoad", 24, 78 265 70 25, tab 6
912
  button "Reset", 25, 149 265 70 25, tab 6
913
  button "Open Uno.txt", 26, 220 265 72 25, tab 6
914
  button "Remove Network", 47, 158 168 87 20, tab 38 disable
915
  button "Add Channel", 48, 7 66 87 20, tab 38 disable
916
  button "Remove Channel", 49, 158 121 87 20, tab 38 disable
917
  button "Add Channel", 39, 5 32 87 20, tab 6
918
  button "Remove Channel", 50, 145 74 87 20, tab 6
919
  button "Cancel", 46, 141 300 65 25
920
  box "Color Scheme", 8, 5 95 140 55, tab 6
921
  box "User Communications", 20, 145 95 140 55, tab 6
922
  box "Rank System", 32, 5 150 140 55, tab 6
923
  box "Score System", 34, 145 150 140 55, tab 6
924
  text "Uno Channel(s)", 9, 145 33 84 17, tab 6 center
925
  text "Uno for mIRC created by Lost.Lion@gmail.com", 11, 6 24 289 17, tab 7
926
  text "Version 1.12", 12, 6 40 100 17, tab 7
927
  text "Find me at irc.rizon.net channel #Lovely Nick KovuKun", 14, 5 83 290 17, tab 7
928
  text "Special Thanks To:", 15, 5 122 291 17, tab 7 center
929
  text "superlady of #lovely for giving me many ideas and lots of support.", 16, 5 141 291 30, tab 7 center
930
  text "All the members of #lovely for putting up with the testing and for joining in to help find the bugs.", 17, 5 172 291 30, tab 7 center
931
  text "RG for making the Dialog Editor and Script Editor that I am Using.", 18, 5 203 291 30, tab 7 center
932
  text "Networks", 41, 7 150 100 17, tab 38
933
  text "Channels", 42, 7 103 100 17, tab 38
934
  text "IRC Uno uses $findcid ($unocid) by FiberOPtics", 44, 5 253 291 17, tab 7 center
935
  link "http://www.LostLion.tk", 13, 6 56 146 17, tab 7
936
  link "http://www.mircscripts.org/users/RG", 19, 58 234 185 17, tab 7
937
  link "http://www.mirc.net/user/FiberOPtics", 45, 58 272 186 17, tab 7
938
  radio "Black Background", 4, 7 113 107 17, tab 6 group
939
  radio "White Background", 5, 7 129 107 17, tab 6
940
  radio "Notice", 21, 148 113 57 17, tab 6 group
941
  radio "Message", 22, 148 129 64 17, tab 6
942
  check "Enable !Rank", 3, 7 168 100 17, tab 6
943
  check "Reverse acts like Skip with 2 Players", 28, 5 45 196 17, tab 27
944
  check "Enable !UnoTop10", 33, 7 183 111 17, tab 6
945
  check "Enable !Score", 36, 147 168 100 17, tab 6
946
  check "Enable !Score <nick>", 37, 147 184 126 17, tab 6
947
  check "Enable Multi-Network", 35, 7 26 118 17, tab 38
948
  check "1 !Draw then !Pass", 2, 5 27 117 17, tab 27
949
  check "All Networks", 54, 145 68 100 17, tab 38 disable
950
  check "Cards Dealt Face Up", 29, 5 81 124 17, tab 27 disable
951
  check "!Play or Lose (No !Draw)", 30, 5 99 140 17, tab 27 disable
952
  check "DrawTwo/DrawFours Accumulate", 31, 5 117 185 17, tab 27 disable
953
  check "Wild Draw 4 Doesn't Skip Player", 55, 5 63 195 17, tab 27 disable
954
  combo 10, 145 51 138 70, tab 6 drop sort
955
  combo 40, 7 168 149 70, tab 38 drop sort disable
956
  combo 43, 7 121 149 70, tab 38 drop sort disable
957
  edit "#Channel", 51, 5 51 138 20, tab 6
958
  edit "#Channel", 52, 7 47 138 20, tab 38 disable
959
  edit "Network", 53, 145 47 138 20, tab 38 disable
960
}
961
;----------------------------------------------------------------------
962
on *:dialog:UnoOptions:init:0: {
963
  if (%iuno.draw == 1) did -c UnoOptions 2
964
  if (%iuno.rank == 1) did -c UnoOptions 3
965
  if (%iuno.color == 1) did -c UnoOptions 4
966
  if (%iuno.color == 2) did -c UnoOptions 5
967
  if (%iuno.comm == 0) did -c UnoOptions 21
968
  if (%iuno.comm == 1) did -c UnoOptions 22
969
  if (%iuno.rwt == 1) did -c UnoOptions 28
970
  if (%iuno.tt == 1) did -c UnoOptions 33
971
  if (%iuno.sco == 1) did -c UnoOptions 36
972
  if (%iuno.scon == 1) did -c UnoOptions 37
973
  if (%iuno.mn == 1) {
974
    did -c UnoOptions 35
975
    didtok UnoOptions 40 44 %iuno.networks
976
    didtok UnoOptions 43 46 %iuno.c. [ $+ [ $gettok(%iuno.networks,1,44) ] ]
977
    did -c UnoOptions 40 1
978
    did -c UnoOptions 43 1
979
    did -b UnoOptions 39,51,10,50
980
    did -e UnoOptions 52,53,48,54,43,49,40,47
981
  }
982
  chanpop
983
}
984
;----------------------------------------------------------------------
985
on *:dialog:UnoOptions:sclick:23: {
986
  dialog -x UnoOptions
987
  unload -rs " $+ $scriptdir $+ Uno.mrc $+ "
988
}
989
on *:dialog:UnoOptions:sclick:24: {
990
  dialog -x UnoOptions
991
  reload -rs " $+ $scriptdir $+ Uno.mrc $+ "
992
}
993
on *:dialog:UnoOptions:sclick:25: {
994
  dialog -x UnoOptions
995
  unoreset
996
}
997
on *:dialog:UnoOptions:sclick:26: {
998
  dialog -x UnoOptions
999
  run " $+ $scriptdir $+ Uno.txt $+ "
1000
}
1001
on *:dialog:UnoOptions:sclick:46: {
1002
  dialog -x UnoOptions
1003
}
1004
on *:dialog:UnoOptions:sclick:39: {
1005
  set %iuno.c $addtok(%iuno.c,$did(51).text,44)
1006
  chanpop
1007
}
1008
on *:dialog:UnoOptions:sclick:50: {
1009
  set %iuno.c $remtok(%iuno.c,$did(10,1).seltext,44)
1010
  did -d UnoOptions 10 $did(10).sel
1011
  chanpop
1012
}
1013
on *:dialog:UnoOptions:sclick:48: {
1014
  if ($did(54).state == 1) {
1015
    set %iuno.c.all $addtok(%iuno.c.all,$did(52).text,46)
1016
    did -r UnoOptions 53
1017
    did -a UnoOptions 53 All
1018
  }
1019
  else {
1020
    set %iuno.c. [ $+ [ $did(53).text ] ] $addtok(%iuno.c. [ $+ [ $did(53).text ] ],$did(52).text,46)
1021
  }
1022
  if (!$findtok($didtok(UnoOptions,40,46),$did(53).text,46)) {
1023
    did -a UnoOptions 40 $did(53).text
1024
  }
1025
  mnunoupdate
1026
  chanpop2
1027
}
1028
on *:dialog:UnoOptions:sclick:49: {
1029
  set %iuno.c. [ $+ [ $did(40).seltext ] ] $remtok(%iuno.c. [ $+ [ $did(40).seltext ] ],$did(43).seltext,46)
1030
  if ($numtok( %iuno.c. [ $+ [ $did(40).seltext ] ],46) == 0) {
1031
    unset %iuno.c. [ $+ [ $did(40).seltext ] ]
1032
    did -d UnoOptions 40 $did(40).sel
1033
  }
1034
  did -c UnoOptions 40 1
1035
  chanpop2 X
1036
}
1037
on *:dialog:UnoOptions:sclick:47: {
1038
  unset %iuno.c. [ $+ [ $did(40).seltext ] ]
1039
  did -d UnoOptions 40 $did(40).sel
1040
  set %iuno.networks $remtok(%iuno.networks,$did(40).seltext,1,44)
1041
  chanpop2
1042
}
1043
on *:dialog:UnoOptions:sclick:40: {
1044
  chanpop2 X
1045
}
1046
on *:dialog:UnoOptions:sclick:35: {
1047
  if ($did(35).state == 1) {
1048
    did -r UnoOptions 40,43
1049
    didtok UnoOptions 40 44 %iuno.networks
1050
    didtok UnoOptions 43 46 %iuno.c. [ $+ [ $gettok(%iuno.networks,1,44) ] ]
1051
    did -c UnoOptions 40 1
1052
    did -c UnoOptions 43 1
1053
    did -b UnoOptions 39,51,10,50
1054
    did -e UnoOptions 52,53,48,54,43,49,40,47
1055
  }
1056
  else {
1057
    did -e UnoOptions 39,51,10,50
1058
    did -b UnoOptions 52,53,48,54,43,49,40,47
1059
  }
1060
}
1061
;----------------------------------------------------------------------
1062
on *:dialog:UnoOptions:close:*: {
1063
  set %iuno.draw $did(2).state
1064
  set %iuno.rank $did(3).state
1065
  set %iuno.rwt $did(28).state
1066
  set %iuno.tt $did(33).state
1067
  set %iuno.sco $did(36).state
1068
  set %iuno.scon $did(37).state
1069
  set %iuno.mn $did(35).state
1070
  if ($did(4).state == 1) set %iuno.color 1
1071
  else set %iuno.color 2
1072
  if ($did(21).state == 1) set %iuno.comm 0
1073
  else set %iuno.comm 1
1074
  unocolors
1075
  write -l3 " $+ $scriptdir $+ Uno.txt $+ " !Channels! $+ $chr(44) $+ %iuno.c
1076
  write -l2 " $+ $scriptdir $+ Uno.txt $+ " !Options! $+ $chr(46) $+ %iuno.color $+ $chr(46) $+ %iuno.rank $+ $chr(46) $+ %iuno.draw $+ $chr(46) $+ %iuno.comm $+ $chr(46) $+ %iuno.rwt $+ $chr(46) $+ %iuno.tt $+ $chr(46) $+ %iuno.sco $+ $chr(46) $+ %iuno.scon $+ $chr(46) $+ %iuno.mn
1077
  unset %iuno.c
1078
  if (%iuno.mn == 0) set %iuno.c $didtok(UnoOptions,10,44)
1079
  else {
1080
    mnunoupdate
1081
  }
1082
  set %iuno.lfc 1
1083
  set %iuno.lft $numtok(%iuno.networks,44) $+ $chr(32) $+ %iuno.networks
1084
  while (%iuno.lfc <= $numtok(%iuno.networks,44)) {
1085
    set %iuno.lft $addtok(%iuno.lft,%iuno.c. [ $+ [ $gettok(%iuno.networks,%iuno.lfc,44) ] ],32)
1086
    inc %iuno.lfc
1087
  }
1088
  write -l4 " $+ $scriptdir $+ Uno.txt $+ " %iuno.lft
1089
  unset %iuno.lfc
1090
  unset %iuno.lft
1091
}
1092
;----------------------------------------------------------------------
1093
menu channel {
1094
  Uno Options: UnoOptions
1095
}
1096
;----------------------------------------------------------------------
1097
on *:unload: {
1098
  unset %iuno.*
1099
  echo -a 0,1--=) 4UnLoaded 11{15IRC-Uno11} 9by 11{15Lost.Lion@gmail.com11} 0(=--
1100
}