TheRock Posted June 18, 2009 Posted June 18, 2009 I am new at Scripting . Please help me #include <GUIConstants.au3> #include <String.au3> #include <array.au3> #include <inet.au3> reset() Local $sonuc Local $sonu[1] $link = InputBox("ENTER", "Enter The URL", "", "") #EndRegion ### END Koda GUI section ### While 1 If Not $link = "" Then $a = _INetGetSource($link) $s = _StringBetween($a,'flv_url=','&url_') MsgBox(0,"",$s[0]) $s2 = _StringBetween($s[0],'.com_','.flv') ;~ MsgBox(0,"",$sonu[0]) $dw = $s[0] & "&OBT_fname=sitename.com_" & $s2[0] & ".flv" MsgBox(0,"",$dw) ClipPut($dw) reset() Exit Else Exit EndIf WEnd Func reset() $a = "" $s = "" $s2 = "" $dw = "" EndFunc
Moderators Melba23 Posted June 18, 2009 Moderators Posted June 18, 2009 TheRock,First, welcome to the AutoIt forums. A good start - some code to work on and a clear question. I wish some other newcomers would do the same. :-)From what I can see, your problem arises when $s is not a variable - i.e. _StringBetween returns an error, not an array. I have modified your script to add a bit of errorchecking:expandcollapse popup#include <GUIConstants.au3> #include <String.au3> #include <array.au3> #include <inet.au3> Local $sonuc Local $sonu[1] reset() $link = InputBox("ENTER", "Enter The URL", "", "") While 1 If Not $link = "" Then $a = _INetGetSource($link) $s = _StringBetween($a, 'flv_url=', '&url_') If @error Then MsgBox(0, "", "The URL was not valid") Exit Else MsgBox(0, "", $s[0]) $s2 = _StringBetween($s[0], '.com_', '.flv') ;~ MsgBox(0,"",$sonu[0]) $dw = $s[0] & "&OBT_fname=sitename.com_" & $s2[0] & ".flv" MsgBox(0, "", $dw) ClipPut($dw) reset() GUICtrlSetData($link, "") Exit EndIf Else Exit EndIf WEnd Func reset() $a = "" $s = "" $s2 = "" $dw = "" EndFunc ;==>resetI hope that works better. You do use _StringBetween again to get $s2 - but I am sure you can add the errorcheck for that yourself now. ;-)M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now