FileWrite(@TempDir & "\temp.script.au3", '$gamegui = GUICreate("Main",300,200)' & @CRLF & '$rock = GUICtrlCreateButton("Rock",0,0,100,30)' & @CRLF & '$paper = GUICtrlCreateButton("Paper",100,0,100,30)' & @CRLF & '$scissor = GUICtrlCreateButton("Scissors",200,0,100,30)' & @CRLF & 'GUISetState()' & @CRLF & 'while 1' & @CRLF & '$msg = GUIGetMsg(1)' & @CRLF & 'Switch $msg[1]' & @CRLF & 'Case $gamegui' & @CRLF & 'Switch $msg[0]' & @CRLF & 'Case $rock' & @CRLF & '$npc = Random(1,3,1)' & @CRLF & ' MsgBox(4096,"Rock","You have chosen Rock. Goodluck!")' & @CRLF & '$rockval = 1' & @CRLF & 'If $npc = 1 Then' & @CRLF & 'MsgBox(4096,"","Npc has chosen: Rock")' & @CRLF & '$npcrock = 1' & @CRLF & 'Else' & @CRLF & 'If $npc = 2 Then' & @CRLF & 'MsgBox(4096,"","Npc has chosen: Paper")' & @CRLF & '$npcpaper = 2' & @CRLF & 'Else' & @CRLF & ' If $npc = 3 Then' & @CRLF & 'MsgBox(4096,"","Npc has chosen: Scissor")' & @CRLF & '$npcscissor = 3' & @CRLF & 'EndIf' & @CRLF & 'EndIf' & @CRLF & 'EndIf' & @CRLF & 'If $npc = 1 And $rockval = 1 Then' & @CRLF & 'MsgBox(4096,"Tie!","You have tied!")' & @CRLF & 'Else' & @CRLF & '$paperval = 2' & @CRLF & '$scissorval = 3' & @CRLF & 'If $npc = 1 And $scissorval = 3 or $paperval = 2 Then' & @CRLF & 'MsgBox(4096,"Winner","You won!")' & @CRLF & 'EndIf' & @CRLF & 'EndIf' & @CRLF & 'Case $paper' & @CRLF & '$npc = Random(1,3,1)' & @CRLF & 'MsgBox(4096,"Paper","You have chosen Paper. Goodluck!")' & @CRLF & '$paperval = 2' & @CRLF & 'If $npc = 1 Then' & @CRLF & ' MsgBox(4096,"","Npc has chosen: Rock")' & @CRLF & '$npcrock = 1' & @CRLF & 'Else' & @CRLF & 'If $npc = 2 Then' & @CRLF & 'MsgBox(4096,"","Npc has chosen: Paper")' & @CRLF & '$npcpaper = 2' & @CRLF & 'Else' & @CRLF & 'If $npc = 3 Then' & @CRLF & 'MsgBox(4096,"","Npc has chosen: Scissor")' & @CRLF & '$npcscissor = 3' & @CRLF & 'EndIf' & @CRLF & 'EndIf' & @CRLF & 'EndIf' & @CRLF & 'If $npc = 2 And $paperval = 2 Then' & @CRLF & 'MsgBox(4096,"Tie!","You have tied!")' & @CRLF & 'Else' & @CRLF & '$rockval = 1' & @CRLF & '$scissorval = 3' & @CRLF & 'If $npc = 1 And $rockval = 1 or $scissorval = 3 Then' & @CRLF & 'MsgBox(4096,"Winner","You won!")' & @CRLF & 'EndIf' & @CRLF & 'EndIf' & @CRLF & 'Case $scissor' & @CRLF & '$npc = Random(1,3,1)' & @CRLF & 'MsgBox(4096,"Scissor","You have chosen Scissor. Goodluck!")' & @CRLF & '$scissorval = 3' & @CRLF & 'If $npc = 1 Then' & @CRLF & 'MsgBox(4096,"","Npc has chosen: Rock")' & @CRLF & '$npcrock = 1' & @CRLF & 'Else' & @CRLF & 'If $npc = 2 Then' & @CRLF & 'MsgBox(4096,"","Npc has chosen:Paper")' & @CRLF & '$npcpaper = 2' & @CRLF & 'Else' & @CRLF & 'If $npc = 3 Then' & @CRLF & 'MsgBox(4096,"","Npc has chosen: Scissor")' & @CRLF & '$npcscissor = 3' & @CRLF & 'EndIf' & @CRLF & 'EndIf' & @CRLF & 'EndIf' & @CRLF & 'If $npc = 3 And $scissorval = 3 Then' & @CRLF & 'MsgBox(4096,"Tie!","You have tied!")' & @CRLF & 'Else' & @CRLF & '$paperval = 2' & @CRLF & '$rockval = 1' & @CRLF & 'If $npc = 1 And $rockval = 1 or $paperval = 2 Then' & @CRLF & 'MsgBox(4096,"Winner","You won!")' & @CRLF & 'EndIf' & @CRLF & 'EndIf' & @CRLF & 'Case -3' & @CRLF & 'Exit' & @CRLF & 'EndSwitch' & @CRLF & 'EndSwitch' & @CRLF & 'WEnd') Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @TempDir & '\temp.script.au3"')