Jump to content

Is this correct?


Recommended Posts

$read1 = FileRead("C:\RF Online\NetLog\rfclient.log")
$read2 = FileRead("C:\Program Files\Level Up Games\RF online\NetLog\rfclient.log")
$read5 = FileRead("C:\Program Files (x86)\Level Up Games\RF online\NetLog\rfclient.log")
$read3 = FileRead("D:\RF Online\NetLog\rfclient.log")
$read4 = FileRead("D:\Program Files\Level Up Games\RF online\NetLog\rfclient.log")
$read6 = FileRead("D:\Program Files (x86)\Level Up Games\RF online\NetLog\rfclient.log")
$read7 = FileRead("C:\Program Files\RF\RF online\NetLog\rfclient.log")
$read8 = FileRead("D:\Program Files\RF\RF online\NetLog\rfclient.log")
$username1 = _StringBetween($read1, "SetAccountID", "^^", -1)
$username2 = _StringBetween($read2, "SetAccountID", "^^", -1)
$username3 = _StringBetween($read3, "SetAccountID", "^^", -1)
$username4 = _StringBetween($read4, "SetAccountID", "^^", -1)
$username5 = _StringBetween($read5, "SetAccountID", "^^", -1)
$username6 = _StringBetween($read6, "SetAccountID", "^^", -1)
$username7 = _StringBetween($read7, "SetAccountID", "^^", -1)
$username8 = _StringBetween($read8, "SetAccountID", "^^", -1)
$size1 = UBound($username1)
$size2 = UBound($username2)
$size3 = UBound($username3)
$size4 = UBound($username4)
$size5 = UBound($username5)
$size6 = UBound($username6)
$size7 = UBound($username7)
$size8 = UBound($username8)

can it be simplified to this? i dont know if its correct because i run on linux

Local $readctr,$read[8],$username[8],$size[8],$arr_read[8] = ["C:\RF Online\NetLog\rfclient.log", "C:\Program Files\Level Up Games\RF online\NetLog\rfclient.log","D:\RF Online\NetLog\rfclient.log","D:\Program Files\Level Up Games\RF online\NetLog\rfclient.log","C:\Program Files (x86)\Level Up Games\RF online\NetLog\rfclient.log","D:\Program Files (x86)\Level Up Games\RF online\NetLog\rfclient.log","C:\Program Files\RF\RF online\NetLog\rfclient.log","D:\Program Files\RF\RF online\NetLog\rfclient.log"]
 For $i = 0 to 7
     ;ConsoleWrite($arr_read[$i]  & @LF)
     $read[$i] =  FileRead($arr_read[$i])
     $username[$i] = _StringBetween($read[$i], "SetAccountID", "^^", -1)
     $size[$i] = Ubound($username[$i])
 Next
First learn computer science and all the theory. Next develop a programming style. Then forget all that and just hack. -George Carrette[sub]GD Keylogger Creator (never released)[/sub][sub]Garena Autojoin v3.0[/sub]
Link to comment
Share on other sites

the line $username[$i] = _StringBetween($read[$i], "SetAccountID", "^^", -1) is invalid

You cannot refer to $read2 like $read[$i]. I don't think this can be done in AutoIt but I could be wrong.

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

$StringBetween = _StringBetween($read[$i], "SetAccountID", "^^", -1) is invalid
$username[$i] = $StringBetween[0]

You cannot refer to $read2 like $read[$i]. I don't think this can be done in AutoIt but I could be wrong.

In the Second Example this is correct, but if you are talking about having a normal Variable e.g. $Read1 = "Something", $Read2 = "Something" then have a look at Eval() in the Helpfile!

$Read1 = "Read1"
$Read2 = "Read2"
$Read3 = "Read3"
For $A = 1 To 3
    ConsoleWrite(Eval("Read" & $A) & @CRLF)
Next

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...