Author Topic: LazyUno  (Read 2268 times)

Jumpkins

  • Guest
LazyUno
« on: May 18, 2009, 10:14:32 AM »
I made a script to play Uno on IRC a few years ago.  It really helps when playing Uno.

Code: [Select]
Dim LazyUnoDialog

Sub LazyUno()

    LazyUnoDialog = CreateDialog("Lazy UNO",715,125,98,261)

    AddComboBox LazyUnoDialog,5,5,80,20,90,0,"PlayComboBox"
        AddItem 90,5,"UNO"
        AddItem 90,5,"Play"
        AddItem 90,5,"Join"
        AddItem 90,5,"Count"
        AddItem 90,5,"Remove"
        AddItem 90,5,"End"
        AddItem 90,5,"Stat"
        AddItem 90,5,"Top Ten"
        AddItem 90,5,"About"
        AddItem 90,5,"Draw"
        AddItem 90,5,"Pass"

    MyValue = SetListItem(90,0,5)

    AddComboBox LazyUnoDialog,5,35,80,20,100,0,"RedComboBox"
        AddItem 100,5,"Red"
        AddItem 100,5,"0"
        AddItem 100,5,"1"
        AddItem 100,5,"2"
        AddItem 100,5,"3"
        AddItem 100,5,"4"
        AddItem 100,5,"5"
        AddItem 100,5,"6"
        AddItem 100,5,"7"
        AddItem 100,5,"8"
        AddItem 100,5,"9"
        AddItem 100,5,"Draw Two"
        AddItem 100,5,"Reverse"
        AddItem 100,5,"Skip"

    MyValue = SetListItem(100,0,5)

    AddComboBox LazyUnoDialog,5,65,80,20,110,0,"YellowComboBox"
        AddItem 110,5,"Yellow"
        AddItem 110,5,"0"
        AddItem 110,5,"1"
        AddItem 110,5,"2"
        AddItem 110,5,"3"
        AddItem 110,5,"4"
        AddItem 110,5,"5"
        AddItem 110,5,"6"
        AddItem 110,5,"7"
        AddItem 110,5,"8"
        AddItem 110,5,"9"
        AddItem 110,5,"Draw Two"
        AddItem 110,5,"Reverse"
        AddItem 110,5,"Skip"

    MyValue = SetListItem(110,0,5)

    AddComboBox LazyUnoDialog,5,95,80,20,120,0,"GreenComboBox"
        AddItem 120,5,"Green"
        AddItem 120,5,"0"
        AddItem 120,5,"1"
        AddItem 120,5,"2"
        AddItem 120,5,"3"
        AddItem 120,5,"4"
        AddItem 120,5,"5"
        AddItem 120,5,"6"
        AddItem 120,5,"7"
        AddItem 120,5,"8"
        AddItem 120,5,"9"
        AddItem 120,5,"Draw Two"
        AddItem 120,5,"Reverse"
        AddItem 120,5,"Skip"

    MyValue = SetListItem(120,0,5)

    AddComboBox LazyUnoDialog,5,125,80,20,130,0,"BlueComboBox"
        AddItem 130,5,"Blue"
        AddItem 130,5,"0"
        AddItem 130,5,"1"
        AddItem 130,5,"2"
        AddItem 130,5,"3"
        AddItem 130,5,"4"
        AddItem 130,5,"5"
        AddItem 130,5,"6"
        AddItem 130,5,"7"
        AddItem 130,5,"8"
        AddItem 130,5,"9"
        AddItem 130,5,"Draw Two"
        AddItem 130,5,"Reverse"
        AddItem 130,5,"Skip"

    MyValue = SetListItem(130,0,5)

    AddComboBox LazyUnoDialog,5,155,80,25,140,0,"WildComboBox"
        AddItem 140,5,"Wild"
        AddItem 140,5,"Wild Card"
        AddItem 140,5,"Draw Four"
        AddItem 140,5,"Red"
        AddItem 140,5,"Yellow"
        AddItem 140,5,"Green"
        AddItem 140,5,"Blue"

    MyValue = SetListItem(140,0,5)

    AddButton LazyUnoDialog,"Draw",5,185,40,24,150,0,"DrawButton"

    AddButton LazyUnoDialog,"Pass",45,185,40,24,150,0,"PassButton"

    AddButton LazyUnoDialog,"Good",5,214,40,24,150,0,"UnoGoodButton"

    AddButton LazyUnoDialog,"Bad",45,214,40,24,150,0,"UnoBadButton"

    AddButton LazyUnoDialog,"Joke",5,243,40,24,150,0,"SillyButton"

    AddButton LazyUnoDialog,"Exit",45,243,40,24,150,0,"ExitButton"

    ShowDialog LazyUnoDialog

    SendCommand "/echo 4L8A3Z12Y 8U4N3O 12has 8been 3OPENED"

End Sub

Sub PlayComboBox_Selected()

   If GetListItem(90,5) = "Play" then
        SendCommand "/say !Uno"
        SendCommand "/timer 3 1 3 /say jo"
   ElseIf GetListItem(90,5) = "Join" then
        SendCommand "/say jo"
   ElseIf GetListItem(90,5) = "Count" then
        SendCommand "/say count"
   ElseIf GetListItem(90,5) = "Remove" then
        SendCommand "/say !unoremove"
   ElseIf GetListItem(90,5) = "End" then
        SendCommand "/say !unoend"
   ElseIf GetListItem(90,5) = "Stat" then
        SendCommand "/say !unostat"
   ElseIf GetListItem(90,5) = "Top Ten" then
        SendCommand "/say !unotop10"
   ElseIf GetListItem(90,5) = "About" then
        SendCommand "/say !unoabout"
   ElseIf GetListItem(90,5) = "Draw" then
        SendCommand "/say dr"
   ElseIf GetListItem(90,5) = "Pass" then
        SendCommand "/say pa"
   end if 

    MyValue = SetListItem(90,0,5)

End Sub

Sub RedComboBox_Selected()

   If GetListItem(100,5) = "0" then
        SendCommand "/say pl r 0"
   ElseIf GetListItem(100,5) = "1" then
        SendCommand "/say pl r 1"
   ElseIf GetListItem(100,5) = "2" then
        SendCommand "/say pl r 2"
   ElseIf GetListItem(100,5) = "3" then
        SendCommand "/say pl r 3"
   ElseIf GetListItem(100,5) = "4" then
        SendCommand "/say pl r 4"
   ElseIf GetListItem(100,5) = "5" then
        SendCommand "/say pl r 5"
   ElseIf GetListItem(100,5) = "6" then
        SendCommand "/say pl r 6"
   ElseIf GetListItem(100,5) = "7" then
        SendCommand "/say pl r 7"
   ElseIf GetListItem(100,5) = "8" then
        SendCommand "/say pl r 8"
   ElseIf GetListItem(100,5) = "9" then
        SendCommand "/say pl r 9"
   ElseIf GetListItem(100,5) = "Draw Two" then
        SendCommand "/say pl r dt"
   ElseIf GetListItem(100,5) = "Reverse" then
        SendCommand "/say pl r r"
   ElseIf GetListItem(100,5) = "Skip" then
        SendCommand "/say pl r s"
   end if 

    MyValue = SetListItem(100,0,5)

End Sub

Sub YellowComboBox_Selected()

   If GetListItem(110,5) = "0" then
        SendCommand "/say pl y 0"
   ElseIf GetListItem(110,5) = "1" then
        SendCommand "/say pl y 1"
   ElseIf GetListItem(110,5) = "2" then
        SendCommand "/say pl y 2"
   ElseIf GetListItem(110,5) = "3" then
        SendCommand "/say pl y 3"
   ElseIf GetListItem(110,5) = "4" then
        SendCommand "/say pl y 4"
   ElseIf GetListItem(110,5) = "5" then
        SendCommand "/say pl y 5"
   ElseIf GetListItem(110,5) = "6" then
        SendCommand "/say pl y 6"
   ElseIf GetListItem(110,5) = "7" then
        SendCommand "/say pl y 7"
   ElseIf GetListItem(110,5) = "8" then
        SendCommand "/say pl y 8"
   ElseIf GetListItem(110,5) = "9" then
        SendCommand "/say pl y 9"
   ElseIf GetListItem(110,5) = "Draw Two" then
        SendCommand "/say pl y dt"
   ElseIf GetListItem(110,5) = "Reverse" then
        SendCommand "/say pl y r"
   ElseIf GetListItem(110,5) = "Skip" then
        SendCommand "/say pl y s"
   end if 

    MyValue = SetListItem(110,0,5)

End Sub

Sub GreenComboBox_Selected()

   If GetListItem(120,5) = "0" then
        SendCommand "/say pl g 0"
   ElseIf GetListItem(120,5) = "1" then
        SendCommand "/say pl g 1"
   ElseIf GetListItem(120,5) = "2" then
        SendCommand "/say pl g 2"
   ElseIf GetListItem(120,5) = "3" then
        SendCommand "/say pl g 3"
   ElseIf GetListItem(120,5) = "4" then
        SendCommand "/say pl g 4"
   ElseIf GetListItem(120,5) = "5" then
        SendCommand "/say pl g 5"
   ElseIf GetListItem(120,5) = "6" then
        SendCommand "/say pl g 6"
   ElseIf GetListItem(120,5) = "7" then
        SendCommand "/say pl g 7"
   ElseIf GetListItem(120,5) = "8" then
        SendCommand "/say pl g 8"
   ElseIf GetListItem(120,5) = "9" then
        SendCommand "/say pl g 9"
   ElseIf GetListItem(120,5) = "Draw Two" then
        SendCommand "/say pl g dt"
   ElseIf GetListItem(120,5) = "Reverse" then
        SendCommand "/say pl g r"
   ElseIf GetListItem(120,5) = "Skip" then
        SendCommand "/say pl g s"
   end if 

    MyValue = SetListItem(120,0,5)

End Sub

Sub BlueComboBox_Selected()

   If GetListItem(130,5) = "0" then
        SendCommand "/say pl b 0"
   ElseIf GetListItem(130,5) = "1" then
        SendCommand "/say pl b 1"
   ElseIf GetListItem(130,5) = "2" then
        SendCommand "/say pl b 2"
   ElseIf GetListItem(130,5) = "3" then
        SendCommand "/say pl b 3"
   ElseIf GetListItem(130,5) = "4" then
        SendCommand "/say pl b 4"
   ElseIf GetListItem(130,5) = "5" then
        SendCommand "/say pl b 5"
   ElseIf GetListItem(130,5) = "6" then
        SendCommand "/say pl b 6"
   ElseIf GetListItem(130,5) = "7" then
        SendCommand "/say pl b 7"
   ElseIf GetListItem(130,5) = "8" then
        SendCommand "/say pl b 8"
   ElseIf GetListItem(130,5) = "9" then
        SendCommand "/say pl b 9"
   ElseIf GetListItem(130,5) = "Draw Two" then
        SendCommand "/say pl b dt"
   ElseIf GetListItem(130,5) = "Reverse" then
        SendCommand "/say pl b r"
   ElseIf GetListItem(130,5) = "Skip" then
        SendCommand "/say pl b s"
   end if 

    MyValue = SetListItem(130,0,5)

End Sub

Sub WildComboBox_Selected()

   If GetListItem(140,5) = "Wild Card" then
        SendCommand "/say pl w"
   ElseIf GetListItem(140,5) = "Draw Four" then
        SendCommand "/say pl w d f"
   ElseIf GetListItem(140,5) = "Red" then
        SendCommand "/say co r"
   ElseIf GetListItem(140,5) = "Yellow" then
        SendCommand "/say co y"
   ElseIf GetListItem(140,5) = "Green" then
        SendCommand "/say co g"
   ElseIf GetListItem(140,5) = "Blue" then
        SendCommand "/say co b"
   end if 

    MyValue = SetListItem(140,0,5)

End Sub

Sub DrawButton_Clicked()
    SendCommand "/say dr"
End Sub

Sub PassButton_Clicked()
    SendCommand "/say pa"
End Sub

Sub UnoGoodButton_Clicked()
    SendCommand "/me $randphrase(UnoGood.txt)"
End Sub

Sub UnoBadButton_Clicked()
    SendCommand "/me $randphrase(UnoBad.txt)"
End Sub

Sub SillyButton_Clicked()
    SendCommand "/say $randphrase(SillyPhrase.txt)"
End Sub

Sub ExitButton_Clicked()

    CloseDialog LazyUnoDialog

    ClosingLazyUno

End Sub

Sub ClosingLazyUno()
    SendCommand "/echo 4L8A3Z12Y 8U4N3O 12has 8been 4CLOSED"
End Sub