Jump to content

z0mgItsJohn

Active Members
  • Posts

    285
  • Joined

  • Last visited

  • Days Won

    1

z0mgItsJohn last won the day on March 25 2013

z0mgItsJohn had the most liked content!

About z0mgItsJohn

  • Birthday 04/26/1995

Profile Information

  • Location
    USA

Recent Profile Visitors

862 profile views

z0mgItsJohn's Achievements

Universalist

Universalist (6/7)

3

Reputation

  1. Some games or software might disable the ability to simulate key strokes / mouse movements in order to prevent automation / botting.
  2. No problem bro, I actually just happened to check this forum and noticed your post in the help section and wanted to see if I could help, glad I could help .
  3. Wouldn't it be : _Query("SELECT * FROM patients WHERE patient_id = '0" & $QSID & "0'")?
  4. Just a suggestion, but maybe you could use Facebook's API and create a simple app, and then use a free web host to host the app code, and then use autoit to rip the firends list from your site. If you're interested in trying it, here's a link to get you started : http://developers.facebook.com/docs/reference/api/FriendList/ Peace.
  5. I fixed a few bugs, and added a tray tool tip to tell you when a URL is loading, the window will also minimize when you open a URL.
  6. The code has been updated, and I finished the "Notifier" option. If you happen to download it, and try it out, please leave feedback. Edit : I just noticed a bug that opens a live channel twice, I fixed it, and updated the code / download link.
  7. If you happen to watch live streams on Justin.tv and want a easy to way to keep track of the channels your following, this is the tool for you! Current version : 1.1 Features : - Channels with a blue text color are live. - Click a channel once to view information (Title, Status, Category, Sub-category), or double click to view it. - Hide or Show the window : This feature can be accessed via the tray menu. - Notifier : Allows you to set specific channels to be notified about when they go live. Known Problems : - If you are following over 100 people, only 100 of them will show up, this is due to JTV's API only allowing up to 100 at a time, I'm pretty sure you could work around it, if you really wanted to. Screen Shots : Your JTV.au3 : ; Includes. #Include <GUIConstantsEx.au3> #Include <GUIListBox.au3> #Include <GUITreeView.au3> #Include <WindowsConstants.au3> #Include <Misc.au3> #Include <_XMLDomWrapper.au3> #Include <File.au3> #Include <Array.au3> #Include <INet.au3> #Include <Date.au3> ; Username check. If IniRead ('settings.ini','Settings','Username','') == '' Then $Input = InputBox ('JTV Username?','What is your JTV username?','','', 200, 125) If @Error Then Exit If $Input = '' Then Do $Input = InputBox ('JTV Username?','What is your JTV username?','','', 200, 125) If @Error Then Exit Until $Input <> '' ElseIf @Error Then Exit EndIf IniWrite ('settings.ini','Settings','Username', $Input) EndIf ; Options. Opt ('GUIOnEventMode', 1) Opt ('TrayMenuMode', 1) Opt ('TrayOnEventMode', 1) ; Tray menu. $Tray_Toggle = TrayCreateItem ('Hide') TrayItemSetOnEvent (-1, '_Toggle') TrayCreateItem ('') TrayCreateItem ('Exit') TrayItemSetOnEvent (-1, '_Exit') ; Live vars. Global $Live_Nodes, $Live_sTitles, $Live_Titles, $Live_URLs, $Live_Status, $Live_C, $Live_SC ; Last Live var. Global $Last_Live_URLs = 0 ; All vars. Global $All_Nodes, $All_sTitles, $All_Titles, $All_URLs, $All_Status, $All_C, $All_SC ; Other vars. Global $Toggle = 0, $Toggle_Hide = 1 ; Main GUI. $GUI = GUICreate ('Your JTV v1.1', 230, 310) GUISetOnEvent ($GUI_EVENT_CLOSE, '_Exit') GUICtrlCreateTab (0, 0, 232, 313) GUICtrlCreateTabItem ('Channels') $Channel_Tree = GUICtrlCreateTreeView (5, 25, 220, 255) GUICtrlCreateButton ('Refresh', 5, 285, 55, 20) GUICtrlSetOnEvent (-1, '_Refresh') GUICtrlSetTip (-1, 'Refresh the list of channels.') GUICtrlCreateButton ('Open JTV', 64, 285, 65, 20) GUICtrlSetOnEvent (-1, '_Open_JTV') GUICtrlCreateButton ('Exit', 133, 285, 40, 20) GUICtrlSetOnEvent (-1, '_Exit') GUICtrlCreateTabItem ('Settings') GUICtrlCreateGroup ('', 5, 20, 220, 40) $Username = GUICtrlCreateInput (IniRead ('settings.ini','Settings','Username',''), 11, 32, 153, 20) GUICtrlSetTip (-1, 'Your JTV username.') GUICtrlCreateButton ('Update', 168, 31, 52, 21) GUICtrlSetOnEvent (-1, '_Update') GUICtrlSetTip (-1, 'Update your JTV username.') GUICtrlCreateGroup ('Notifier', 5, 61, 220, 245) $Notifier = GUICtrlCreateCombo ('', 11, 78, 65) GUICtrlSetOnEvent (-1, '_Save_Settings') GUICtrlSetData (-1, 'Enabled|Disabled', IniRead ('settings.ini','Settings','Notifier','Disabled')) GUICtrlSetTip (-1, 'The status of the notifier.') $Delay = GUICtrlCreateInput (IniRead ('settings.ini','Settings','Delay', 10), 81, 78, 43, 21, 1) GUICtrlSetOnEvent (-1, '_Save_Settings') GUICtrlSetTip (-1, 'The delay between how often the notifier checks for live channels. (In minutes.)') GUICtrlCreateUpdown (-1) $Add = GUICtrlCreateButton ('Add', 128, 78, 34, 21) GUICtrlSetOnEvent (-1, '_Toggle_Hide') GUICtrlSetTip (-1, 'Add a channel to the notifier list.') $Remove = GUICtrlCreateButton ('Remove', 165, 78, 55, 21) GUICtrlSetOnEvent (-1, '_Remove') GUICtrlSetTip (-1, 'Remove the selected channel from the notifier list.') $Notifier_List = GUICtrlCreateList ('', 11, 104, 208, 200) GUISetState (@SW_SHOW, $GUI) WinSetOnTop ($GUI, '', 1) ; Add GUI $Add_GUI = GUICreate ('Add', 220, 213, -1, -1, -1, 128) GUISetOnEvent ($GUI_EVENT_CLOSE, '_Toggle_Hide') $Add_List = GUICtrlCreateList ('', 0, 0, 220, 200) GUICtrlCreateButton ('Add', 0, 191, 35, 20) GUICtrlSetOnEvent (-1, '_Add') GUICtrlSetTip (-1, 'Add the selected channel to the notifier list.') GUICtrlCreateButton ('Add All', 37, 191, 45, 20) GUICtrlSetOnEvent (-1, '_Add_All') GUICtrlSetTip (-1, 'Add all of your channels to the notifier list.') GUISetState (@SW_SHOW, $Add_GUI) WinSetState ($Add_GUI, '', @SW_HIDE) WinSetOnTop ($Add_GUI, '', 1) ; Notifier If GUICtrlRead ($Notifier) == 'Enabled' Then _Notifier_List () AdlibRegister ('_Refresh', (GUICtrlRead ($Delay) * (1000 * 60))) Else GUICtrlSetState ($Delay, $GUI_DISABLE) GUICtrlSetState ($Add, $GUI_DISABLE) GUICtrlSetState ($Remove, $GUI_DISABLE) GUICtrlSetState ($Notifier_List, $GUI_DISABLE) EndIf _Refresh () ; Main Loop While 1 Sleep (150) WEnd ; Custom Functions Func _Refresh () Local $rUsername = GUICtrlRead ($Username) If $rUsername == '' Then Return ; Disable TreeView. GUICtrlSetState ($Channel_Tree, $GUI_DISABLE) ; Reset TreeView. _GUICtrlTreeView_DeleteAll ($Channel_Tree) ; Local vars. Local $Live_URL = 'http://api.justin.tv/api/user/favorites/' & $rUsername & '.xml?limit=100&offset=0&live=true' Local $All_URL = 'http://api.justin.tv/api/user/favorites/' & $rUsername & '.xml?limit=100&offset=0' Local $Live_XML = @TempDir & '\live.xml' Local $All_XML = @TempDir & '\all.xml' Local $Nodes, $A, $Title, $Len ; Check for any old XML files. If FileExists ($Live_XML) Then FileDelete ($Live_XML) If FileExists ($All_XML) Then FileDelete ($All_XML) ; Load live channels. INetGet ($Live_URL, $Live_XML) _XMLFileOpen ($Live_XML) $Nodes = _XMLGetNodeCount ('/channels/channel') Global $Live_Nodes = $Nodes If $Nodes > 0 Then Global $Live_sTitles[$Nodes + 1], $Live_Titles[$Nodes + 1], $Live_URLs[$Nodes + 1], $Live_Status[$Nodes + 1], $Live_C[$Nodes + 1], $Live_SC[$Nodes + 1] For $A = 1 To $Nodes $Title = _XMLGetFirstValue ('/channels/channel[' & $A & ']/title') ; Make sure the title isn't too long. If StringLen ($Title) > 25 Then $Title = StringLeft ($Title, 25) & '...' $Live_sTitles[$A] = $Title $Live_Titles[$A] = _XMLGetFirstValue ('/channels/channel[' & $A & ']/title') $Live_URLs[$A] = _XMLGetFirstValue ('/channels/channel[' & $A & ']/channel_url') ; Notifier If GUICtrlRead ($Notifier) == 'Enabled' Then If $Last_Live_URLs == 0 And _Check ($Live_URLs[$A]) == 1 Or _ArraySearch ($Last_Live_URLs, $Live_URLs[$A]) < 0 And _Check ($Live_URLs[$A]) == 1 Then WinSetOnTop ($GUI, '', 0) $Msg = MsgBox (BitOr (4, 32), 'Live Channel Notice', $Title & ' is live, would you like to view this stream?') WinSetOnTop ($GUI, '', 1) GUICtrlSetState ($Channel_Tree, $GUI_DISABLE) If $Msg == 6 Then _URL ($Live_URLs[$A]) GUICtrlSetState ($Channel_Tree, $GUI_ENABLE) EndIf EndIf $Live_Status[$A] = _XMLGetFirstValue ('/channels/channel[' & $A & ']/status') ; Make sure the status isn't too long. $Len = StringLen ($Live_Status[$A]) If $Len > 74 Then If $Len > 148 Then $Live_Status[$A] = StringLeft ($Live_Status[$A], 74) & @CRLF & StringMid ($Live_Status[$A], 75, 74) & @CRLF & StringRight ($Live_Status[$A], $Len - 148) ElseIf $Len = 148 Then $Live_Status[$A] = StringLeft ($Live_Status[$A], 74) & @CRLF & StringRight ($Live_Status[$A], 74) Else $Live_Status[$A] = StringLeft ($Live_Status[$A], 74) & @CRLF & StringRight ($Live_Status[$A], $Len - 74) EndIf EndIf If $Live_Status[$A] == '' Then $Live_Status[$A] = 'Status not set.' $Live_C[$A] = _XMLGetFirstValue ('/channels/channel[' & $A & ']/category_title') If $Live_C[$A] == '' Then $Live_C[$A] = 'Not Set' $Live_SC[$A] = _XMLGetFirstValue ('/channels/channel[' & $A & ']/subcategory_title') If $Live_SC[$A] == '' Then $Live_SC[$A] = 'Not Set' GUICtrlCreateTreeViewItem ($Title, $Channel_Tree) GUICtrlSetOnEvent (-1, '_Process') GUICtrlSetColor (-1, 0x0000FF) Next ; Add the current URLs to the last live URLs. If GUICtrlRead ($Notifier) == 'Enabled' Then Global $Last_Live_URLs[$Nodes + 1] For $A = 1 To $Nodes $Last_Live_URLs[$A] = $Live_URLs[$A] Next EndIf EndIf FileDelete ($Live_XML) ; Load all channels. INetGet ($All_URL, $All_XML) _XMLFileOpen ($All_XML) $Nodes = _XMLGetNodeCount ('/channels/channel') Global $All_Nodes = $Nodes If $Nodes > 0 Then Global $All_sTitles[$Nodes + 1], $All_Titles[$Nodes + 1], $All_URLs[$Nodes + 1], $All_Status[$Nodes + 1], $All_C[$Nodes + 1], $All_SC[$Nodes + 1] For $A = 1 To $Nodes $Title = _XMLGetFirstValue ('/channels/channel[' & $A & ']/title') ; Make sure the title isn't too long. If StringLen ($Title) > 25 Then $Title = StringLeft ($Title, 25) & '...' $All_sTitles[$A] = $Title $All_Titles[$A] = _XMLGetFirstValue ('/channels/channel[' & $A & ']/title') $All_URLs[$A] = _XMLGetFirstValue ('/channels/channel[' & $A & ']/channel_url') $All_Status[$A] = _XMLGetFirstValue ('/channels/channel[' & $A & ']/status') ; Make sure the status isn't too long. $Len = StringLen ($All_Status[$A]) If $Len > 74 Then If $Len > 148 Then $All_Status[$A] = StringLeft ($All_Status[$A], 74) & @CRLF & StringMid ($All_Status[$A], 75, 74) & @CRLF & StringRight ($All_Status[$A], $Len - 148) ElseIf $Len = 148 Then $All_Status[$A] = StringLeft ($All_Status[$A], 74) & @CRLF & StringRight ($All_Status[$A], 74) Else $All_Status[$A] = StringLeft ($All_Status[$A], 74) & @CRLF & StringRight ($All_Status[$A], $Len - 74) EndIf EndIf If $All_Status[$A] == '' Then $All_Status[$A] = 'Status not set.' $All_C[$A] = _XMLGetFirstValue ('/channels/channel[' & $A & ']/category_title') If $All_C[$A] == '' Then $All_C[$A] = 'Not Set' $All_SC[$A] = _XMLGetFirstValue ('/channels/channel[' & $A & ']/subcategory_title') If $All_SC[$A] == '' Then $All_SC[$A] = 'Not Set' If _ArraySearch ($Live_Titles, $Title) == -1 Then GUICtrlCreateTreeViewItem ($Title, $Channel_Tree) GUICtrlSetOnEvent (-1, '_Process') EndIf Next EndIf FileDelete ($All_XML) ; Enable TreeView. GUICtrlSetState ($Channel_Tree, $GUI_ENABLE) EndFunc Func _Process () If ControlGetFocus ($GUI) <> 'SysTreeView321' Or WinGetTitle ('[ACTIVE]') <> WinGetTitle ($GUI) Then Return ; Declare vars. Local $Live_Index, $All_Index, $Text = _GUICtrlTreeView_GetText ($Channel_Tree, GUICtrlRead ($Channel_Tree)), $Timer, $Rect ; Search for index. $Live_Index = _ArraySearch ($Live_sTitles, $Text) $All_Index = _ArraySearch ($All_sTitles, $Text) ; Check for double click. Do Sleep (15) Until _IsPressed (01) = False $Timer = TimerInit () Do Sleep (15) Until _IsPressed (01) Or TimerDiff ($Timer) >= 150 ; Process single click or double click. If TimerDiff ($Timer) >= 150 Then If $Live_Index <> -1 Then _ToolTip ($Live_Titles[$Live_Index], $Live_Status[$Live_Index], $Live_C[$Live_Index], $Live_SC[$Live_Index]) If $All_Index <> -1 Then _ToolTip ($All_Titles[$All_Index], $All_Status[$All_Index], $All_C[$All_Index], $All_SC[$All_Index]) Else If $Live_Index <> -1 Then _URL ($Live_URLs[$Live_Index]) If $All_Index <> -1 And $Live_Index = -1 Then _URL ($All_URLs[$All_Index]) EndIf EndFunc Func _URL ($aURL) TrayTip ('','Loading URL : ' & $aURL, 2000, 1) WinSetState ($GUI, '', @SW_MINIMIZE) WinSetState ($GUI, '', @SW_DISABLE) ShellExecuteWait ($aURL) WinSetState ($GUI, '', @SW_ENABLE) EndFunc Func _Update () Local $rUsername = GUICtrlRead ($Username) Local $URL = 'http://www.justin.tv/' & $rUsername If _INetGetSource ($URL) = '' Then GUICtrlSetData ($Username, 'Username does not exist.') Else IniWrite ('settings.ini','Settings','Username', GUICtrlRead ($Username)) _Refresh () EndIf EndFunc Func _Add () If GUICtrlRead ($Add_List) == '' Then Return Local $List = @ScriptDir & '\notifier_list.txt', $Index = _ArraySearch ($Last_Live_URLs, $All_URLs[_ArraySearch ($All_sTitles, GUICtrlRead ($Add_List))]) If $Index > 0 Then _ArrayDelete ($Last_Live_URLs, $Index) FileWriteLine ($List, $All_URLs[_ArraySearch ($All_sTitles, GUICtrlRead ($Add_List))]) _Notifier_List () _Toggle_Hide () EndFunc Func _Add_All () Local $List = @ScriptDir & '\notifier_list.txt', $A Global $Last_Live_URLs = 0 FileDelete ($List) For $A = 1 To $All_Nodes FileWriteLine ($List, $All_URLs[$A]) Next _Notifier_List () _Toggle_Hide () EndFunc Func _Toggle_Hide () Local $A If $Toggle_Hide == 0 Then WinSetState ($Add_GUI, '', @SW_HIDE) $Toggle_Hide = 1 Else GUICtrlSetData ($Add_List, '') For $A = 1 To $All_Nodes GUICtrlSetData ($Add_List, $All_sTitles[$A]) Next WinSetState ($Add_GUI, '', @SW_SHOW) $Toggle_Hide = 0 EndIf EndFunc Func _Check ($aURL) Local $List = @ScriptDir & '\notifier_list.txt', $A, $Count = _FileCountLines ($List) For $A = 1 To $Count If FileReadLine ($List, $A) = $aURL Then Return 1 Next Return 0 EndFunc Func _Remove () Local $List = @ScriptDir & '\notifier_list.txt', $A, $Count = _FileCountLines ($List), $Line, $Selected = GUICtrlRead ($Notifier_List), $Temp = @ScriptDir & '\Temp_List.txt' If FileExists ($List) == 0 Or GUICtrlRead ($Notifier_List) == 'Disabled' Or $Selected == '' Then Return If $Count == 1 And FileReadLine ($List, 1) == $Selected Then GUICtrlSetData ($Notifier_List, '') GUICtrlSetData ($Notifier_List, 'No channels currently added.') FileDelete ($List) Return EndIf For $A = 1 To $Count $Line = FileReadLine ($List, $A) If $Selected <> $Line Then FileWriteLine ($Temp, $Line) Next FileCopy ($Temp, $List, 1) FileDelete ($Temp) _Notifier_List () EndFunc Func _Notifier_List () Local $List = @ScriptDir & '\notifier_list.txt', $Count = _FileCountLines ($List) If $Count == 0 Then GUICtrlSetData ($Notifier_List, 'No channels currently added.') Return EndIf GUICtrlSetData ($Notifier_List, '') For $A = 1 To $Count GUICtrlSetData ($Notifier_List, FileReadLine ($List, $A)) Next EndFunc Func _Save_Settings () Local $Control = ControlGetFocus ($GUI), $Saved, $Current ; Determine which control was clicked. If $Control == 'Edit2' Then $Saved = IniRead ('settings.ini','Settings','Notifier','Disabled') $Current = GUICtrlRead ($Notifier) If $Saved <> $Current Then IniWrite ('settings.ini','Settings','Notifier', $Current) If $Saved <> 'Enabled' And $Current == 'Enabled' Then _Notifier_List () AdlibRegister ('_Refresh', (GUICtrlRead ($Delay) * (1000 * 60))) GUICtrlSetState ($Delay, $GUI_ENABLE) GUICtrlSetState ($Add, $GUI_ENABLE) GUICtrlSetState ($Remove, $GUI_ENABLE) GUICtrlSetState ($Notifier_List, $GUI_ENABLE) ElseIf $Current == 'Disabled' Then AdlibUnRegister ('_Refresh') GUICtrlSetState ($Delay, $GUI_DISABLE) GUICtrlSetState ($Add, $GUI_DISABLE) GUICtrlSetState ($Remove, $GUI_DISABLE) GUICtrlSetState ($Notifier_List, $GUI_DISABLE) EndIf ElseIf $Control == 'Edit3' Then If GUICtrlRead ($Notifier) <> 'Enabled' Then Return $Saved = IniRead ('settings.ini','Settings','Delay', 10) $Current = GUICtrlRead ($Delay) If $Saved <> $Current Then IniWrite ('settings.ini','Settings','Delay', $Current) AdlibUnRegister ('_Refresh') AdlibRegister ('_Refresh', (GUICtrlRead ($Delay) * (1000 * 60))) EndIf EndFunc Func _Toggle () If $Toggle = 0 Then WinSetState ($GUI, '', @SW_HIDE) TrayItemSetText ($Tray_Toggle, 'Show') $Toggle = 1 Else WiNSetState ($GUI, '', @SW_SHOW) TrayItemSetText ($Tray_Toggle, 'Hide') $Toggle = 0 EndIf EndFunc Func _Open_JTV () _URL ('http://www.justin.tv') EndFunc Func _XMLGetFirstValue ($Node) Local $rVal $rVal = _XMLGetValue ($Node) If IsArray ($rVal) Then Return ($rVal[1]) Else Return SetError (1, 3, 0) EndIf EndFunc Func _ToolTip ($Title, $Status, $C, $SC, $Delay = 3500) Local $Pos = MouseGetPos (), $Timer, $Pos2 ToolTip ($Status & @CRLF & $C & ' -> ' & $SC, $Pos[0] + 13, $Pos[1], $Title) $Timer = TimerInit () Do Sleep (10) $Pos2 = MouseGetPos () Until $Pos[0] <> $Pos2[0] Or $Pos[1] <> $Pos2[1] Or TimerDiff ($Timer) >= $Delay ToolTip ('') EndFunc Func _Exit () Exit EndFunc Settings.ini : [Settings] Username= Notifier=Disabled Delay=10 Download link (Source code and complied versions 64 and 32 bit) : http://www.mediafire.com/?yb3ew2on1fa121z If you have any problems or suggestions, feel free to post them below ! Enjoy, - John
  8. I'm pretty sure this is what you're looking for : #Include <File.au3> $File = '' For $A = 1 To _FileCountLines ($File) $Line = FileReadLine ($File, $A) If StringInStr ($Line, 'Type = Mark') Then FileWriteLine ('Export.txt', FileReadLine ($File, $A + 6)) Next Hope this helps, - John
  9. @ChrisL Thanks, the script works perfectly. @Jos Sorry, I be more patient next time. =3
  10. Sorry for the bump but someone tripled posted, and there where like 7 posts in front of mine, and I didn't want it to go unseen, I'll test the script later, thanks.
  11. How would I go about getting using _XMLDomWrapper.au3 to get an array containing the channel URL for each of the channels in the XML file? I've never used XML before so I have no clue what I'm doing, any help would be greatly appreciated. XML File: <?xml version="1.0" encoding="UTF-8"?> <channels> <channel> <category>gaming</category> <id>4870636</id> <login>total_cereal</login> <subcategory>wii</subcategory> <title>Total Cereal's Box</title> <status>Donkey Kong Country Returns</status> <tags>0 1 2 3 4 5 6 7 8 9 and box brawl cereal cereals cerealsgameboy galaxy gamecube gba gcn kart majoras mario mask metroid nintendo ocarina of pokemon the time total wii zelda</tags> <producer>true</producer> <category_title>Gaming</category_title> <subcategory_title>Wii</subcategory_title> <producer>true</producer> <language>en</language> <timezone>US/Eastern</timezone> <channel_url>http://www.justin.tv/total_cereal</channel_url> <mature nil="true"></mature> <image_url_huge>http://static-cdn.jtvnw.net/jtv_user_pictures/total_cereal-profile_image-8f140eab3c7dc386-600x600.jpeg</image_url_huge> <image_url_large>http://static-cdn.jtvnw.net/jtv_user_pictures/total_cereal-profile_image-8f140eab3c7dc386-300x300.jpeg</image_url_large> <image_url_medium>http://static-cdn.jtvnw.net/jtv_user_pictures/total_cereal-profile_image-8f140eab3c7dc386-150x150.jpeg</image_url_medium> <image_url_small>http://static-cdn.jtvnw.net/jtv_user_pictures/total_cereal-profile_image-8f140eab3c7dc386-70x70.jpeg</image_url_small> <image_url_tiny>http://static-cdn.jtvnw.net/jtv_user_pictures/total_cereal-profile_image-8f140eab3c7dc386-50x50.jpeg</image_url_tiny> <screen_cap_url_huge>http://static-cdn.jtvnw.net/previews/live_user_total_cereal-630x473.jpg</screen_cap_url_huge> <screen_cap_url_large>http://static-cdn.jtvnw.net/previews/live_user_total_cereal-320x240.jpg</screen_cap_url_large> <screen_cap_url_medium>http://static-cdn.jtvnw.net/previews/live_user_total_cereal-150x113.jpg</screen_cap_url_medium> <screen_cap_url_small>http://static-cdn.jtvnw.net/previews/live_user_total_cereal-70x53.jpg</screen_cap_url_small> <embed_enabled>true</embed_enabled> <embed_code> &lt;object type=&quot;application/x-shockwave-flash&quot; height=&quot;295&quot; width=&quot;353&quot; id=&quot;live_embed_player_flash&quot; data=&quot;http://www.justin.tv/widgets/live_embed_player.swf?channel=total_cereal&quot; bgcolor=&quot;#000000&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot; /&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.justin.tv/widgets/live_embed_player.swf&quot; /&gt;&lt;param name=&quot;flashvars&quot; value=&quot;start_volume=25&amp;watermark_position=top_right&amp;channel=total_cereal&amp;auto_play=false&quot; /&gt;&lt;/object&gt; </embed_code> <views_count>#&lt;TwiceNumber:0xbab3988&gt;</views_count> </channel> <channel> <category>gaming</category> <id>5037326</id> <login>blackhawk88</login> <subcategory>xbox</subcategory> <title>CC Blackhawk's Underground Station </title> <status> Black Ops w/ Blackhawk</status> <tags>0 1 10 100 2 3 360 4 5 6 7 8 88 9 a amazing arcade b ball band bass best black blackhawk borderlands box burst c call cc ccblack ccblackhawk combo cry d dbz dirt dirt2 dragon drifting drum drums duty e expert f far fc full fullcombo funny g gh gh5 ghm ghwt god good guitar h halen halo hawk hero high i j k l limit live m metallica modern music n o oblivion of ox p pa philadelphia philly pro q quality r s sexy t tour u v van vh vocals vs w warfare</tags> <producer>true</producer> <category_title>Gaming</category_title> <subcategory_title>Xbox</subcategory_title> <producer>true</producer> <language>en</language> <timezone>America/New_York</timezone> <channel_url>http://www.justin.tv/blackhawk88</channel_url> <mature>true</mature> <image_url_huge>http://static-cdn.jtvnw.net/jtv_user_pictures/blackhawk88-profile_image-3c6202c409f9421f-600x600.jpeg</image_url_huge> <image_url_large>http://static-cdn.jtvnw.net/jtv_user_pictures/blackhawk88-profile_image-3c6202c409f9421f-300x300.jpeg</image_url_large> <image_url_medium>http://static-cdn.jtvnw.net/jtv_user_pictures/blackhawk88-profile_image-3c6202c409f9421f-150x150.jpeg</image_url_medium> <image_url_small>http://static-cdn.jtvnw.net/jtv_user_pictures/blackhawk88-profile_image-3c6202c409f9421f-70x70.jpeg</image_url_small> <image_url_tiny>http://static-cdn.jtvnw.net/jtv_user_pictures/blackhawk88-profile_image-3c6202c409f9421f-50x50.jpeg</image_url_tiny> <screen_cap_url_huge>http://static-cdn.jtvnw.net/previews/live_user_blackhawk88-630x473.jpg</screen_cap_url_huge> <screen_cap_url_large>http://static-cdn.jtvnw.net/previews/live_user_blackhawk88-320x240.jpg</screen_cap_url_large> <screen_cap_url_medium>http://static-cdn.jtvnw.net/previews/live_user_blackhawk88-150x113.jpg</screen_cap_url_medium> <screen_cap_url_small>http://static-cdn.jtvnw.net/previews/live_user_blackhawk88-70x53.jpg</screen_cap_url_small> <embed_enabled>true</embed_enabled> <embed_code> &lt;object type=&quot;application/x-shockwave-flash&quot; height=&quot;295&quot; width=&quot;353&quot; id=&quot;live_embed_player_flash&quot; data=&quot;http://www.justin.tv/widgets/live_embed_player.swf?channel=blackhawk88&quot; bgcolor=&quot;#000000&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot; /&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.justin.tv/widgets/live_embed_player.swf&quot; /&gt;&lt;param name=&quot;flashvars&quot; value=&quot;start_volume=25&amp;watermark_position=top_right&amp;channel=blackhawk88&amp;auto_play=false&quot; /&gt;&lt;/object&gt; </embed_code> <views_count>#&lt;TwiceNumber:0xb9b06d0&gt;</views_count> </channel> <channel> <category>gaming</category> <id>8221220</id> <login>jaieazy</login> <subcategory>shooters</subcategory> <title>The People's Station</title> <status>MW2 Replay</status> <tags>2 bad barber battlefield bfbc call company deathmatch domination duty gears headquarters hq modern mw2 of radio shop show sports sportstalk talk team television war warfare</tags> <producer>true</producer> <category_title>Gaming</category_title> <subcategory_title>Shooters</subcategory_title> <producer>true</producer> <language>en</language> <timezone>America/Los_Angeles</timezone> <channel_url>http://www.justin.tv/jaieazy</channel_url> <mature>true</mature> <image_url_huge>http://static-cdn.jtvnw.net/jtv_user_pictures/jaieazy-profile_image-3d635bc78483f42c-600x600.jpeg</image_url_huge> <image_url_large>http://static-cdn.jtvnw.net/jtv_user_pictures/jaieazy-profile_image-3d635bc78483f42c-300x300.jpeg</image_url_large> <image_url_medium>http://static-cdn.jtvnw.net/jtv_user_pictures/jaieazy-profile_image-3d635bc78483f42c-150x150.jpeg</image_url_medium> <image_url_small>http://static-cdn.jtvnw.net/jtv_user_pictures/jaieazy-profile_image-3d635bc78483f42c-70x70.jpeg</image_url_small> <image_url_tiny>http://static-cdn.jtvnw.net/jtv_user_pictures/jaieazy-profile_image-3d635bc78483f42c-50x50.jpeg</image_url_tiny> <screen_cap_url_huge>http://static-cdn.jtvnw.net/previews/live_user_jaieazy-630x473.jpg</screen_cap_url_huge> <screen_cap_url_large>http://static-cdn.jtvnw.net/previews/live_user_jaieazy-320x240.jpg</screen_cap_url_large> <screen_cap_url_medium>http://static-cdn.jtvnw.net/previews/live_user_jaieazy-150x113.jpg</screen_cap_url_medium> <screen_cap_url_small>http://static-cdn.jtvnw.net/previews/live_user_jaieazy-70x53.jpg</screen_cap_url_small> <embed_enabled>true</embed_enabled> <embed_code> &lt;object type=&quot;application/x-shockwave-flash&quot; height=&quot;295&quot; width=&quot;353&quot; id=&quot;live_embed_player_flash&quot; data=&quot;http://www.justin.tv/widgets/live_embed_player.swf?channel=jaieazy&quot; bgcolor=&quot;#000000&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot; /&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.justin.tv/widgets/live_embed_player.swf&quot; /&gt;&lt;param name=&quot;flashvars&quot; value=&quot;start_volume=25&amp;watermark_position=top_right&amp;channel=jaieazy&amp;auto_play=false&quot; /&gt;&lt;/object&gt; </embed_code> <views_count>#&lt;TwiceNumber:0xb979158&gt;</views_count> </channel> <channel> <category>gaming</category> <id>9378736</id> <login>deathhand2277</login> <subcategory>other_gaming</subcategory> <title>Gaming with Death</title> <status>Dead Space &quot;Impossible mode&quot; with No Upgrades/No suit upgrades with Commentary! Let's bring out some rage &lt;o.o&lt;</status> <tags></tags> <producer>true</producer> <category_title>Gaming</category_title> <subcategory_title>Other Gaming</subcategory_title> <producer>true</producer> <language>en</language> <timezone>America/New_York</timezone> <channel_url>http://www.justin.tv/deathhand2277</channel_url> <mature>true</mature> <image_url_huge>http://static-cdn.jtvnw.net/jtv_user_pictures/deathhand2277-profile_image-6989ac05d234f0a5-600x600.jpeg</image_url_huge> <image_url_large>http://static-cdn.jtvnw.net/jtv_user_pictures/deathhand2277-profile_image-6989ac05d234f0a5-300x300.jpeg</image_url_large> <image_url_medium>http://static-cdn.jtvnw.net/jtv_user_pictures/deathhand2277-profile_image-6989ac05d234f0a5-150x150.jpeg</image_url_medium> <image_url_small>http://static-cdn.jtvnw.net/jtv_user_pictures/deathhand2277-profile_image-6989ac05d234f0a5-70x70.jpeg</image_url_small> <image_url_tiny>http://static-cdn.jtvnw.net/jtv_user_pictures/deathhand2277-profile_image-6989ac05d234f0a5-50x50.jpeg</image_url_tiny> <screen_cap_url_huge>http://static-cdn.jtvnw.net/previews/live_user_deathhand2277-630x473.jpg</screen_cap_url_huge> <screen_cap_url_large>http://static-cdn.jtvnw.net/previews/live_user_deathhand2277-320x240.jpg</screen_cap_url_large> <screen_cap_url_medium>http://static-cdn.jtvnw.net/previews/live_user_deathhand2277-150x113.jpg</screen_cap_url_medium> <screen_cap_url_small>http://static-cdn.jtvnw.net/previews/live_user_deathhand2277-70x53.jpg</screen_cap_url_small> <embed_enabled>true</embed_enabled> <embed_code> &lt;object type=&quot;application/x-shockwave-flash&quot; height=&quot;295&quot; width=&quot;353&quot; id=&quot;live_embed_player_flash&quot; data=&quot;http://www.justin.tv/widgets/live_embed_player.swf?channel=deathhand2277&quot; bgcolor=&quot;#000000&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot; /&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.justin.tv/widgets/live_embed_player.swf&quot; /&gt;&lt;param name=&quot;flashvars&quot; value=&quot;start_volume=25&amp;watermark_position=top_right&amp;channel=deathhand2277&amp;auto_play=false&quot; /&gt;&lt;/object&gt; </embed_code> <views_count>#&lt;TwiceNumber:0xb959a88&gt;</views_count> </channel> <channel> <category>gaming</category> <id>10092428</id> <login>360icons</login> <subcategory>xbox</subcategory> <title>IcoNs Live</title> <status>EU 2v2 Tournament 2PMest/6PMgmt www.360icons.com [FREE Entry]</status> <tags>callofduty games modernwarfare2 tournaments videogames xbox</tags> <producer>true</producer> <category_title>Gaming</category_title> <subcategory_title>Xbox</subcategory_title> <producer>true</producer> <language>en</language> <timezone>US/Eastern</timezone> <channel_url>http://www.justin.tv/360icons</channel_url> <mature>true</mature> <image_url_huge>http://static-cdn.jtvnw.net/jtv_user_pictures/360icons-profile_image-7c6ee8165140ae1e-600x600.jpeg</image_url_huge> <image_url_large>http://static-cdn.jtvnw.net/jtv_user_pictures/360icons-profile_image-7c6ee8165140ae1e-300x300.jpeg</image_url_large> <image_url_medium>http://static-cdn.jtvnw.net/jtv_user_pictures/360icons-profile_image-7c6ee8165140ae1e-150x150.jpeg</image_url_medium> <image_url_small>http://static-cdn.jtvnw.net/jtv_user_pictures/360icons-profile_image-7c6ee8165140ae1e-70x70.jpeg</image_url_small> <image_url_tiny>http://static-cdn.jtvnw.net/jtv_user_pictures/360icons-profile_image-7c6ee8165140ae1e-50x50.jpeg</image_url_tiny> <screen_cap_url_huge>http://static-cdn.jtvnw.net/previews/live_user_360icons-630x473.jpg</screen_cap_url_huge> <screen_cap_url_large>http://static-cdn.jtvnw.net/previews/live_user_360icons-320x240.jpg</screen_cap_url_large> <screen_cap_url_medium>http://static-cdn.jtvnw.net/previews/live_user_360icons-150x113.jpg</screen_cap_url_medium> <screen_cap_url_small>http://static-cdn.jtvnw.net/previews/live_user_360icons-70x53.jpg</screen_cap_url_small> <embed_enabled>true</embed_enabled> <embed_code> &lt;object type=&quot;application/x-shockwave-flash&quot; height=&quot;295&quot; width=&quot;353&quot; id=&quot;live_embed_player_flash&quot; data=&quot;http://www.justin.tv/widgets/live_embed_player.swf?channel=360icons&quot; bgcolor=&quot;#000000&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot; /&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.justin.tv/widgets/live_embed_player.swf&quot; /&gt;&lt;param name=&quot;flashvars&quot; value=&quot;start_volume=25&amp;watermark_position=top_right&amp;channel=360icons&amp;auto_play=false&quot; /&gt;&lt;/object&gt; </embed_code> <views_count>#&lt;TwiceNumber:0xb8d0ff8&gt;</views_count> </channel> </channels> In the above XML file there are five channels <channel></channel> between the <channels></channels> tags, and I need to get the value between <channel_url></channel_url> tags for each of the channels. I hope I explained my problem clear enough, and again, any help will be greatly appreciated. Thanks, - John
  12. Here's another thought: Maybe, instead of blocking Task Manager, you could just check to see if it's running, and give the student a warning message telling them that if the program is closed via Task Manager, then the student will lose the ability to use Task Manager. Peace.
  13. Thanks! Also, you're pro. I've played against my self like 50 times and lost all of them...
  14. As the title says, I've wrote a nice little online Rock, Paper, Scissors game. Server.au3: #Include <GUIConstantsEx.Au3> #Include <WindowsConstants.Au3> #Include <Misc.Au3> #Include <GUIEdit.Au3> #Include <INet.Au3> #NoTrayIcon Opt ('GUIOnEventMode', 1) Global $STS = 0, $Client = -1, $Server = -1, $cToggle = 0, $Weapon = 0, $cWeapon = 0 Global $Server_Wins = 0, $Client_Wins = 0 $Main = GUICreate ('Rock, Paper, Scissors - Player #1', 300, 225) GUISetOnEvent ($GUI_EVENT_CLOSE, '_Exit') GUISetBkColor (0x000000) GUICtrlCreateGroup ('Settings', 5, 1, 173, 68) GUICtrlSetColor (-1, 0xFFFFFF) $ConStr = GUICtrlCreateInput (@IpAddress1 & ':1234', 12, 18, 125, 20, 1) $sToggle = GUICtrlCreateButton ('Start', 142, 18, 30, 21) GUICtrlSetOnEvent ($sToggle, '_sToggle') $sMatch = GUICtrlCreateButton ('Start Match', 12, 43, 75, 20) GUICtrlCreateGroup ('Game Console', 5, 70, 290, 150) GUICtrlSetColor (-1, 0xFFFFFF) GUICtrlSetOnEvent ($sMatch, '_sMatch') GUICtrlSetState ($sMatch, $GUI_DISABLE) $Console = GUICtrlCreateEdit ('', 12, 88, 276, 125, 2103360) GUICtrlSetFont ($Console, 9, '','','Lucida Sans Unicode') GUISetState (@SW_SHOW) _Log ('Online Rock, Paper, Scissors v2.0') _Log ('Made by : John O.') $Child = GUICreate ('Rock, Paper, or Scissors?', 247, 66, -1, -1, -1, 128) GUISetOnEvent ($GUI_EVENT_CLOSE, '_cToggle') GUISetBkColor (0x000000) GUICtrlCreateButton ('', 5, 5, 76, 56, 32896) GUICtrlSetImage (-1, '1.bmp') GUICtrlSetOnEvent (-1, '_1') GUICtrlCreateButton ('', 85, 5, 76, 56, 32896) GUICtrlSetImage (-1, '2.bmp') GUICtrlSetOnEvent (-1, '_2') GUICtrlCreateButton ('', 166, 5, 76, 56, 32896) GUICtrlSetImage (-1, '3.bmp') GUICtrlSetOnEvent (-1, '_3') GUISetState (@SW_HIDE, $Child) While 1 If $STS = 1 Then If $Client = -1 Then Do $Client = TcpAccept ($Server) Until $Client <> -1 _Log ('Client has connected.') GUICtrlSetState ($sMatch, $GUI_ENABLE) Else $Recv = TcpRecv ($Client, 1000) If @Error Then TcpCloseSocket ($Client) $Client = -1 $Server_Wins = 0 $Client_Wins = 0 $Weapon = 0 $cWeapon = 0 _Log ('Client has disconnected.') GUICtrlSetState ($sMatch, $GUI_DISABLE) ElseIf StringInStr ($Recv, 'cWeapon:') Then $cWeapon = StringReplace ($Recv, 'cWeapon:','') If $Weapon == 'Rock' Or $Weapon == 'Paper' Or $Weapon == 'Scissors' Then _Process () EndIf EndIf EndIf Sleep (25) WEnd Func _Process () If $cWeapon == 'Rock' And $Weapon == 'Rock' Then $Result = 'Rock = Rock, there is a tie!' EndIf If $cWeapon == 'Rock' And $Weapon == 'Paper' Then $Result = 'Paper beats Rock, player #1 wins!' $Server_Wins = $Server_Wins + 1 EndIf If $cWeapon == 'Rock' And $Weapon == 'Scissors' Then $Result = 'Rock beats Scissors, player #2 wins!' $Client_Wins = $Client_Wins + 1 EndIf If $cWeapon == 'Paper' And $Weapon == 'Rock' Then $Result = 'Paper beats Rock, player #2 wins!' $Client_Wins = $Client_Wins + 1 EndIf If $cWeapon == 'Paper' And $Weapon == 'Paper' Then $Result = 'Paper = Paper, there is a tie!' EndIf If $cWeapon == 'Paper' And $Weapon == 'Scissors' Then $Result = 'Scissors beats Paper, player #1 wins!' $Server_Wins = $Server_Wins + 1 EndIf If $cWeapon == 'Scissors' And $Weapon == 'Rock' Then $Result = 'Rock beats Scissors, player #1 wins!' $Server_Wins = $Server_Wins + 1 EndIf If $cWeapon == 'Scissors' And $Weapon == 'Paper' Then $Result = 'Scissors beats Paper, player #2 wins!' $Client_Wins = $Client_Wins + 1 EndIf If $cWeapon == 'Scissors' And $Weapon == 'Scissors' Then $Result = 'Scissors = Scissors, there is a tie!' EndIf _Log ($Result & @CRLF & 'The match has ended.' & @CRLF & "Player #1's wins : " & $Server_Wins & ", Player #2's wins : " & $Client_Wins) TcpSend ($Client, 'Result:' & $Result & @CRLF & 'The match has ended.' & @CRLF & "Player #1's wins : " & $Server_Wins & ", Player #2's wins : " & $Client_Wins) $Weapon = 0 $cWeapon = 0 GUICtrlSetState ($sMatch, $GUI_ENABLE) EndFunc Func _1 () $Weapon = 'Rock' _Log ('You have selected : ' & $Weapon) _Log ('Waiting for results...') _cToggle () If $cWeapon == 'Rock' Or $cWeapon == 'Paper' Or $cWeapon == 'Scissors' Then _Process () EndFunc Func _2 () $Weapon = 'Paper' _Log ('You have selected : ' & $Weapon) _Log ('Waiting for results...') _cToggle () If $cWeapon == 'Rock' Or $cWeapon == 'Paper' Or $cWeapon == 'Scissors' Then _Process () EndFunc Func _3 () $Weapon = 'Scissors' _Log ('You have selected : ' & $Weapon) _Log ('Waiting for results...') _cToggle () If $cWeapon == 'Rock' Or $cWeapon == 'Paper' Or $cWeapon == 'Scissors' Then _Process () EndFunc Func _sMatch () _Log ('The match has started.' & @CRLF & 'Choose your weapon.') TcpSend ($Client, 'sMatch') _cToggle () GUICtrlSetState ($sMatch, $GUI_DISABLE) EndFunc Func _cToggle () If $cToggle = 0 Then GUISetState (@SW_SHOW, $Child) $cToggle = 1 Else GUISetState (@SW_HIDE, $Child) $cToggle = 0 EndIf EndFunc Func _sToggle () If $STS = 0 Then TcpStartUp () $rConStr = GUICtrlRead ($ConStr) $rConStr = StringSplit ($rConStr, ':') If $rConStr[0] = 2 Then $Server = TcpListen ($rConStr[1], $rConStr[2]) If @Error Or $Server = -1 Then TcpShutdown () _Log ('Error : Cannot start the server.') $Server = -1 Return @Error EndIf Else TcpShutdown () _Log ('Error : Cannot start the server.') Return @Error EndIf _Log ('Global Server -> ' & _GetIP () & ':' & $rConStr[2]) _Log ('Waiting for client...') GUICtrlSetState ($ConStr, $GUI_DISABLE) GUICtrlSetData ($sToggle, 'Stop') $STS = 1 Else TcpCloseSocket ($Server) TcpCloseSocket ($Client) TcpShutdown () _Log ('The server has stopped.') GUICtrlSetState ($ConStr, $GUI_ENABLE) GUICtrlSetState ($sMatch, $GUI_DISABLE) GUICtrlSetData ($sToggle, 'Start') $Server = -1 $Client = -1 $STS = 0 $Server_Wins = 0 $Client_Wins = 0 EndIf EndFunc Func _Log ($Data) GUICtrlSetData ($Console, GUICtrlRead ($Console) & $Data & @CRLF) _GUICtrlEdit_LineScroll ($Console, 0, _GUICtrlEdit_GetLineCount ($Console) - 1) EndFunc Func _Exit () Exit EndFunc Client.au3: #Include <GUIConstantsEx.Au3> #Include <WindowsConstants.Au3> #Include <Misc.Au3> #Include <GUIEdit.Au3> #NoTrayIcon Opt ('GUIOnEventMode', 1) Global $_sToggle = 0, $cToggle = 0, $Server = -1 $Main = GUICreate ('Rock, Paper, Scissors - Player #2', 300, 202) GUISetOnEvent ($GUI_EVENT_CLOSE, '_Exit') GUISetBkColor (0x000000) GUICtrlCreateGroup ('Settings', 5, 1, 208, 45) GUICtrlSetColor (-1, 0xFFFFFF) $ConStr = GUICtrlCreateInput (@IpAddress1 & ':1234', 12, 18, 125, 20, 1) $sToggle = GUICtrlCreateButton ('Connect', 142, 18, 65, 21) GUICtrlSetOnEvent ($sToggle, '_sToggle') GUICtrlCreateGroup ('Game Console', 5, 46, 290, 150) GUICtrlSetColor (-1, 0xFFFFFF) $Console = GUICtrlCreateEdit ('', 12, 63, 276, 125, 2103360) GUICtrlSetFont ($Console, 9, '','','Lucida Sans Unicode') GUISetState (@SW_SHOW) _Log ('Online Rock, Paper, Scissors v2.0') _Log ('Made by : John O.') $Child = GUICreate ('Rock, Paper, or Scissors?', 247, 66, -1, -1, -1, 128) GUISetOnEvent ($GUI_EVENT_CLOSE, '_cToggle') GUISetBkColor (0x000000) GUICtrlCreateButton ('', 5, 5, 76, 56, 32896) GUICtrlSetImage (-1, '1.bmp') GUICtrlSetOnEvent (-1, '_1') GUICtrlCreateButton ('', 85, 5, 76, 56, 32896) GUICtrlSetImage (-1, '2.bmp') GUICtrlSetOnEvent (-1, '_2') GUICtrlCreateButton ('', 166, 5, 76, 56, 32896) GUICtrlSetImage (-1, '3.bmp') GUICtrlSetOnEvent (-1, '_3') GUISetState (@SW_HIDE, $Child) While 1 If $_sToggle = 1 Then $Recv = TcpRecv ($Server, 1000) If @Error Then _Log ('Disconnected from the server.') _sToggle () ElseIf $Recv <> '' Then If $Recv = 'sMatch' Then _Log ('The match has started.' & @CRLF & 'Choose your weapon.') _cToggle () ElseIf StringInStr ($Recv, 'Result:') Then $Recv = StringReplace ($Recv, 'Result:','') _Log ($Recv) EndIf EndIf EndIf Sleep (25) WEnd Func _cToggle () If $cToggle = 0 Then GUISetState (@SW_SHOW, $Child) $cToggle = 1 Else GUISetState (@SW_HIDE, $Child) $cToggle = 0 EndIf EndFunc Func _sToggle () If $_sToggle = 0 Then TcpStartUp () $rConStr = GUICtrlRead ($ConStr) $rConStr = StringSplit ($rConStr, ':') If $rConStr[0] = 2 Then $Server = TcpConnect ($rConStr[1], $rConStr[2]) If @Error Or $Server = -1 Then TcpShutdown () _Log ('Error : Cannot connect to the server.') $Server = -1 Return @Error EndIf Else TcpShutdown () _Log ('Error : Cannot connect to the server.') Return @Error EndIf _Log ('You have connected to the server.') GUICtrlSetState ($ConStr, $GUI_DISABLE) GUICtrlSetData ($sToggle, 'Disconnect') $_sToggle = 1 Else TcpCloseSocket ($Server) TcpShutdown () GUICtrlSetState ($ConStr, $GUI_ENABLE) GUICtrlSetData ($sToggle, 'Connect') $Server = -1 $_sToggle = 0 EndIf EndFunc Func _1 () $Weapon = 'Rock' _Log ('You have selected : ' & $Weapon) _Log ('Waiting for results...') _cToggle () TcpSend ($Server, 'cWeapon:' & $Weapon) EndFunc Func _2 () $Weapon = 'Paper' _Log ('You have selected : ' & $Weapon) _Log ('Waiting for results...') _cToggle () TcpSend ($Server, 'cWeapon:' & $Weapon) EndFunc Func _3 () $Weapon = 'Scissors' _Log ('You have selected : ' & $Weapon) _Log ('Waiting for results...') _cToggle () TcpSend ($Server, 'cWeapon:' & $Weapon) EndFunc Func _Log ($Data) GUICtrlSetData ($Console, GUICtrlRead ($Console) & $Data & @CRLF) _GUICtrlEdit_LineScroll ($Console, 0, _GUICtrlEdit_GetLineCount ($Console) - 1) EndFunc Func _Exit () Exit EndFunc You'll need the images : http://www.mediafire.com/download.php?qm765d0cecw9u3b Or if you want to download source files, complied version, and images : http://www.mediafire.com/download.php?7cc2q8kb8ufb8lt Hope you guys enjoy! - John
×
×
  • Create New...