Randomly Select Soccer Teams

By nettocash on Apr 02, 2009

Just something I put together when bored one day for a friend who owns a soccer channel. Someone else might find this useful too so I figured I'd post it.

Step 1 - Add names to 3 files in your mirc directory called: pot1.txt, pot2.txt, and pot3.txt
Example:

  • I typed the following using mIRC
    /write pot1.txt Maple Leafs
    /write pot1.txt Flames
    /write pot2.txt The Wild Cats
    /write pot2.txt The Ant Eaters
    /write pot3.txt The Montreal Leafs
    /write pot3.txt Habs

Step 2 - Type: /msg #EPL !Pot Team_1 Team_2
INFO: This will select a random pot number. Options are 1, 2, or 3.
Example:

!pot nettocash pix I have randomly selected pot #3 for nettocash vs. pix Step 3 - Type: /msg #EPL !Team Team_1 Team_2 INFO: This will select a random name from one of the 3 filenames labelled pot[x].txt Example: !Team nettocash pix I have random selected The Montreal Leafs for nettocash from pot #3 I have random selected The Canadian Habs for pix from pot #3 By default the channel name is #EPL, but you can change it. ```mirc on *:TEXT:*:#EPL:{ if ($1 == !Pot) { if ($2 == $NULL) { msg $chan Correct Syntax: !Pot | HALT } if ($3 == $NULL) { msg $chan Correct Syntax: !Pot | HALT } else { var %pot = $rand(1,3) | set %Pot. [ $+ [ $2 ] ] $3 %pot | set %Pot. [ $+ [ $3 ] ] $2 %pot | msg $chan I Have randomly selected Pot $+ $chr(2) $chr(35) $+ %pot $+ $chr(2) for $+ $chr(2) $replace($2,_,$chr(32)) $+ $chr(2) vs. $+ $chr(2) $replace($3,_,$chr(32)) | halt } } if ($1 == !Team) { if ($2 == $NULL) { msg $chan Correct Syntax: !Team | HALT } if (%Pot. [ $+ [ $2 ] ] == $null) { msg $chan No pot selected for $+ $Chr(2) $replace($2,_,$chr(32)) $Chr(2) $+ yet! To select one, type: !Pot $2 | HALT } else { set %team $read(pot $+ $GetTok(%Pot. [ $+ [ $2 ] ],2,32) $+ .txt) set %team2 $read(pot $+ $GetTok(%Pot. [ $+ [ $2 ] ],2,32) $+ .txt) if (%team == %team2) { .remove redocockswap.txt .copy pot $+ $GetTok(%Pot. [ $+ [ $2 ] ],2,32) $+ .txt redocockswap.txt if (%team2 iswm $read(redocockswap.txt, w, * $+ %team2 $+ *)) { write -dl $readn redocockswap.txt } set %team2 $read(redocockswap.txt) msg $chan I have randomly selected Team $+ $chr(2) %team $+ $chr(2) for $+ $chr(2) $replace($2,_,$chr(32)) $+ $chr(2) from Pot $+ $chr(2) $chr(35) $+ $GetTok(%Pot. [ $+ [ $2 ] ],2,32) msg $chan I have randomly selected Team $+ $chr(2) %team2 $+ $chr(2) for $+ $chr(2) $replace($GetTok(%Pot. [ $+ [ $2 ] ],1,32),_,$chr(32)) $+ $chr(2) from Pot $+ $chr(2) $chr(35) $+ $GetTok(%Pot. [ $+ [ $2 ] ],2,32) halt } else { msg $chan I have randomly selected Team $+ $chr(2) %team $+ $chr(2) for $+ $chr(2) $replace($2,_,$chr(32)) $+ $chr(2) from Pot $+ $chr(2) $chr(35) $+ $GetTok(%Pot. [ $+ [ $2 ] ],2,32) | msg $chan I have randomly selected Team $+ $chr(2) %team2 $+ $chr(2) for $+ $chr(2) $replace($GetTok(%Pot. [ $+ [ $2 ] ],1,32),_,$chr(32)) $+ $chr(2) from Pot $+ $chr(2) $chr(35) $+ $GetTok(%Pot. [ $+ [ $2 ] ],2,32) | HALT } } } } ```

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.