Jump to content

Could anyone help me get started with this


Recommended Posts

Just use a Regular expression to get it.

#Include<array.au3> ;; Used here only to display the array.
$sStr = FileRead("somefile.htm")
$aData = StringRegExp($sStr, "Frazion", 3);; "(?i)Frazion" if you don't want a case-sensitive match
_ArrayDisplay($aData)

However I have a feeling there is more to this than what you are giving us because I don't see where finding a single word is going to help you in any way. If you want to replace a single word that's different, all you would need there is $sStr = StringReplace($sStr, "Frazion", "Something Else")

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Just use a Regular expression to get it.

#Include<array.au3> ;; Used here only to display the array.
$sStr = FileRead("somefile.htm")
$aData = StringRegExp($sStr, "Frazion", 3);; "(?i)Frazion" if you don't want a case-sensitive match
_ArrayDisplay($aData)

However I have a feeling there is more to this than what you are giving us because I don't see where finding a single word is going to help you in any way. If you want to replace a single word that's different, all you would need there is $sStr = StringReplace($sStr, "Frazion", "Something Else")

Finding it is not everything I need, finding it and copying the previous line and the following 4 lines (example)

<tr>

1 <td>Jun 13 2011 01:19:18:110PM</td>

0 <td>Frazion</td>

1 <td>Deja-Vu<br /> Fear<br /> </td>

2 <td>Wrecked</td>

3 <td>Cumshotz<br /> Henchness<br /> </td>

4 <td>4 / 2</td>

OR copying the 3 previous lines and the 2 following lines in case we lost :

3 <td>Jun 13 2011 01:17:36:767PM</td>

2 <td>Giant</td>

1 <td>IIluminate<br /> lIIuminate<br /> </td>

0 <td>Frazion</td>

1 <td>~Lotus<br /> </td>

2 <td>4 / 2</td>

Get what I'm saying ?

Link to comment
Share on other sites

Game code?

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

No, read the first post please.

It's a website that displays the wins and loses that have currently been made in a GAME yes, however it isn't game automation in anyway, and I asked the owner for permission.

http://donations.euro-gunz.eu/cw/

Edited by heyhey
Link to comment
Share on other sites

Could you do me a HUGE favor and explain in every line what's happening ?

It's easier if you add this ConsoleWrite($sStringMid & @CRLF) underneath $sStringMid = StringMid($sString, $A, StringLen($sText)) to get an idea of what the internal output looks like. And I really hope this isn't game automation because I detest being made a fool of.

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 parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

It's easier if you add this ConsoleWrite($sStringMid & @CRLF) underneath $sStringMid = StringMid($sString, $A, StringLen($sText)) to get an idea of what the internal output looks like. And I really hope this isn't game automation because I detest being made a fool of.

I'd give my life if this is.

And about the ConsoleWrite, I tried but it just desplayed the txt file in the console .

Link to comment
Share on other sites

Without seeing more of the page source this is as close as it gets. If that data is in a named div tag or something similar then it gets easier.

$aData = StringRegExp($sStr, "(?isU)(<td>[jfmasond].+:\d+[ap]m</td>\s*<td>frazion.+<td>\d\h/\h\d</td>)", 3)

$aData[0] will contain the result

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

OK. When I use this >> _SearchString("This is text which is only text when it could be a string text, oh and did I say text.", "text") I get this output

Output:

This
his 
is i
s is
 is 
is t
s te
 tex
text
ext 
xt w
t wh
 whi
whic
hich
ich 
ch i
h is
 is 
is o
s on
 onl
only
nly 
ly t
y te
 tex
text
ext 
xt w
t wh
 whe
when
hen 
en i
n it
 it 
it c
t co
 cou
coul
ould
uld 
ld b
d be
 be 
be a
e a 
 a s
a st
 str
stri
trin
ring
ing 
ng t
g te
 tex
text
ext,
xt, 
t, o
, oh
 oh 
oh a
h an
 and
and 
nd d
d di
 did
did 
id I
d I 
 I s
I sa
 say
say 
ay t
y te
 tex
text
ext.
xt.
t.
.

But it's probably best to use the SRE by GEOSoft if it works.

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 parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

And what are you implying by "if it works"?

j/k

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Dear guiness, forgive me I didn't understand anything of your last 2 posts. :huh2:

Dear GEOSoft, this got me a little bit farther

$sStr = FileRead("File.txt")
$aData = StringRegExp($sStr, "(?isU)(<td>[jfmasond].+:\d+[ap]m</td>\s*<td>frazion.+<td>\d\h/\h\d</td>)", 3)
FileWrite("Frazion cw's.txt",$aData[0])

Outcome :

<td>Jun 13 2011 07:01:52:750PM</td>

<td>Flatron</td>

<td>Ascetic<br /> [¸®«¡]Batman<br /> </td>

<td>RepDom2</td>

<td><br /> </td>

<td>3 / 0</td>

</tr><tr>

<td>Jun 13 2011 07:01:46:210PM</td>

<td>Frazion</td>

<td>RainisM<br /> PainisM<br /> </td>

<td>±Satirados</td>

<td><br /> </td>

<td>2 / 0</td><td>Jun 13 2011 07:08:05:970PM</td>

<td>-baby-fans-</td>

<td>yuyan<br /> DesoIator<br /> </td>

<td>±Satirados</td>

<td>=Fox=<br /> THEAMOO<br /> </td>

<td>4 / 1</td>

</tr><tr>

<td>Jun 13 2011 07:07:23:197PM</td>

<td>Zanmato</td>

<td>ROBlN<br /> Alijohn<br /> GoldenNinja<br /> </td>

<td>Royalty</td>

<td>Underpro<br /> Serave<br /> </td>

<td>4 / 2</td>

</tr><tr>

<td>Jun 13 2011 07:07:11:917PM</td>

<td>Giant</td>

<td>IIluminate<br /> lIIuminate<br /> </td>

<td>Royal</td>

<td>Nysrogh<br /> Brick<br /> </td>

<td>4 / 0</td>

</tr><tr>

<td>Jun 13 2011 07:06:52:990PM</td>

<td>Wow3Shotted</td>

<td>Meiyo<br /> ACM24PT<br /> </td>

<td>Rykkettard</td>

<td>Ryujl<br /> Sencuelity<br /> </td>

<td>4 / 0</td>

</tr><tr>

<td>Jun 13 2011 07:05:54:487PM</td>

<td>Damned</td>

<td>RoxinoHou<br /> la_bebe01<br /> </td>

<td>±Damage</td>

<td>Mrs]BabyFans<br /> agresivo1234<br /> </td>

<td>4 / 2</td>

</tr><tr>

<td>Jun 13 2011 07:05:20:390PM</td>

<td>Burn</td>

<td>Febens2<br /> Esnakell_x<br /> </td>

<td>Predators</td>

<td><br /> </td>

<td>4 / 2</td>

</tr><tr>

<td>Jun 13 2011 07:05:03:927PM</td>

<td>xKore</td>

<td>Soraya95<br /> Skidasl<br /> </td>

<td>SNSD</td>

<td>DutchNL<br /> </td>

<td>4 / 1</td>

</tr><tr>

<td>Jun 13 2011 07:04:56:883PM</td>

<td>Wegue</td>

<td>Crashed<br /> Korleon<br /> </td>

<td>Kunt</td>

<td>Hunt<br /> Eviction<br /> </td>

<td>4 / 0</td>

</tr><tr>

<td>Jun 13 2011 07:03:25:453PM</td>

<td>-baby-fans-</td>

<td>yuyan<br /> DesoIator<br /> </td>

<td>Frazion</td>

<td>[Vulture]Aim<br /> Sickyy<br /> </td>

<td>4 / 2</td>

</tr><tr>

<td>Jun 13 2011 07:02:13:357PM</td>

<td>Predators</td>

<td>Returns<br /> KrizZ<br /> </td>

<td>Flatron</td>

<td>MashiratiteKagemizake<br /> KingObitu<br /> </td>

<td>4 / 2</td>

</tr><tr>

<td>Jun 13 2011 07:01:52:750PM</td>

<td>Flatron</td>

<td>Ascetic<br /> [¸®«¡]Batman<br /> </td>

<td>RepDom2</td>

<td><br /> </td>

<td>3 / 0</td>

</tr><tr>

<td>Jun 13 2011 07:01:46:210PM</td>

<td>Frazion</td>

<td>RainisM<br /> PainisM<br /> </td>

<td>±Satirados</td>

<td><br /> </td>

<td>2 / 0</td>

First of all, it pretty much copyed way too much, there are differents clanwar above the ones we had to copy.

Secondly, the information the array from guinnes gave me included that there are over 100 clanwars with frazion, and I'm pretty sure it's correct, so it didn't copy all, any idea how to fix that?

I'll include File.txt for you to see how it's build.

Edited by heyhey
Link to comment
Share on other sites

  • Moderators

Your big bold text at the beginning of your thread says basically that this is not game automation.

I'm not sure what you're interpretation of "automation" is or what even a "game" is.

But this is indeed "Game Automation".

You're trying to retrieve "Game" data without doing it manually... Thus "Automating" the retrieval of the game data.

http://www.autoitscript.com/forum/forum-2/announcement-13-forum-rules/

The rules are not left for your interpretation.

I'm surprised at the rest of the people that have even replied in this thread. Most of you report this kind of thread immediately.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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