|
You last visited: Today at 01:21
Advertisement
Big ini read, found data problem
Discussion on Big ini read, found data problem within the AutoIt forum part of the Coders Den category.
08/13/2015, 12:50
|
#16
|
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
|
The code example i've posted is looking for every thing, containing your input...
If you want exact matches, simply remove the wildcards <.<
Code:
#include <array.au3>
_ArrayDisplay(StringRegExp(FileRead('ItemTemplateAll1.ini'), "[1]=("&InputBox("Search for", "Enter your Text:")&")", 3))
|
|
|
08/13/2015, 13:16
|
#17
|
elite*gold: 0
Join Date: Sep 2010
Posts: 473
Received Thanks: 104
|
Your first example just works fine give me all results i want, but i dont know how to put that in variable so i can loop through array and put items i founded in listview like it opens in 1 sec in _ArrayDisplay() with your 1st example.
Code:
Case $hFinddAllButton
$test = GuiCtrlRead($hSearchInput) ; read the search input
_ArrayDisplay(StringRegExp(FileRead($file), "[1]=(.*"&$test&"*)", 3))
; loop through array and populate list
; when click on list item store it in $hNameInput and put ID "[5014]" in $hItemID
|
|
|
08/13/2015, 14:08
|
#18
|
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
|
StringRegExp returns all matches in an array. So you can loop through it, to add stuff to your GUI:
Code:
$matches = StringRegExp(FileRead('ItemTemplateAll1.ini'), "[1]=("&InputBox("Search for", "Enter your Text:")&")", 3)
GUICreate('GUI', 300, 100, Default, Default, 0x10C80000)
$lv = GUICtrlCreateListView('Name', 0, 0, 300, 100)
For $match In $matches
GUICtrlCreateListViewItem($match, $lv)
Next
While GUIGetMsg()<>-3
WEnd
|
|
|
08/13/2015, 23:23
|
#19
|
elite*gold: 0
Join Date: Sep 2010
Posts: 473
Received Thanks: 104
|
My project was to made something like this  but for now still no success
|
|
|
08/14/2015, 09:04
|
#20
|
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
|
Quote:
Originally Posted by mlukac89
My project was to made something like this  but for now still no success 
|
That should be really easy. Just build a regular expression, that reads in all item data at once, parse it, and build an interface around it...
Should be done in a few lines of code.
Edit:
Example Code:
Code:
$matches = StringRegExp(FileRead('ItemTemplateAll1.ini'), "\[(\d+)\]\r\n(?:\d+=.+\r\n)*?1=(.+)\r\n(?:\d+=.+\r\n)+", 3)
GUICreate('GUI', 300, 150, Default, Default, 0x10C80000)
$list = GUICtrlCreateList('', 10, 10, 280, 90)
$input = GUICtrlCreateInput('', 10, 100, 280, 20)
$btnSearch = GUICtrlCreateButton('Search', 10, 125, 140, 20)
$btnSave = GUICtrlCreateButton('Save', 150, 125, 140, 20)
While True
Switch GUIGetMsg()
Case -3
Exit
Case $list
GUICtrlSetData($input, StringRegExpReplace(GUICtrlRead($list), '\[\d+\] ', ''))
Case $btnSearch
GUICtrlSetData($list, '')
For $i=0 To UBound($matches)-1 Step 2
If StringInStr($matches[$i+1], GUICtrlRead($input)) Then GUICtrlSetData($list, '['&$matches[$i]&'] '&$matches[$i+1])
Next
Case $btnSave
IniWrite('ItemTemplateAll1.ini', StringRegExpReplace(GUICtrlRead($list), '\[(\d+)\].+', '$1'), 1, GUICtrlRead($input))
EndSwitch
WEnd
|
|
|
08/14/2015, 12:32
|
#21
|
elite*gold: 0
Join Date: Sep 2010
Posts: 473
Received Thanks: 104
|
Thanks alot man u helped me alot to see how all works and how to handle with all data and array contents.
Cheers
|
|
|
08/15/2015, 22:29
|
#22
|
elite*gold: 0
Join Date: Sep 2010
Posts: 473
Received Thanks: 104
|
Quote:
Originally Posted by lolkop
That should be really easy. Just build a regular expression, that reads in all item data at once, parse it, and build an interface around it...
Should be done in a few lines of code.
Edit:
Example Code:
Code:
$matches = StringRegExp(FileRead('ItemTemplateAll1.ini'), "\[(\d+)\]\r\n(?:\d+=.+\r\n)*?1=(.+)\r\n(?:\d+=.+\r\n)+", 3)
GUICreate('GUI', 300, 150, Default, Default, 0x10C80000)
$list = GUICtrlCreateList('', 10, 10, 280, 90)
$input = GUICtrlCreateInput('', 10, 100, 280, 20)
$btnSearch = GUICtrlCreateButton('Search', 10, 125, 140, 20)
$btnSave = GUICtrlCreateButton('Save', 150, 125, 140, 20)
While True
Switch GUIGetMsg()
Case -3
Exit
Case $list
GUICtrlSetData($input, StringRegExpReplace(GUICtrlRead($list), '\[\d+\] ', ''))
Case $btnSearch
GUICtrlSetData($list, '')
For $i=0 To UBound($matches)-1 Step 2
If StringInStr($matches[$i+1], GUICtrlRead($input)) Then GUICtrlSetData($list, '['&$matches[$i]&'] '&$matches[$i+1])
Next
Case $btnSave
IniWrite('ItemTemplateAll1.ini', StringRegExpReplace(GUICtrlRead($list), '\[(\d+)\].+', '$1'), 1, GUICtrlRead($input))
EndSwitch
WEnd
|
Just 1 more question im working all day on this  and no luck, when i change item and press Save it dont update items like :
1. find results
2. click on item u want to edit
3. edit item
4. update list and show that edited items + previous from first search
Like
Code:
$matches = StringRegExp(FileRead('ItemTemplateAll1.ini'), "\[(\d+)\]\r\n(?:\d+=.+\r\n)*?1=(.+)\r\n(?:\d+=.+\r\n)+", 3)
GUICreate('GUI', 300, 150, Default, Default, 0x10C80000)
$list = GUICtrlCreateList('', 10, 10, 280, 90)
$input = GUICtrlCreateInput('', 10, 100, 280, 20)
GUICtrlSetLimit ($input, 50, 3)
$btnSearch = GUICtrlCreateButton('Search', 10, 125, 140, 20)
$btnSave = GUICtrlCreateButton('Save', 150, 125, 140, 20)
While True
Switch GUIGetMsg()
Case -3
Exit
Case $list
GUICtrlSetData($input, StringRegExpReplace(GUICtrlRead($list), '\[\d+\] ', ''))
Case $btnSearch
GUICtrlSetData($list, '')
For $i=0 To UBound($matches)-1 Step 2
If StringInStr($matches[$i+1], GUICtrlRead($input)) Then GUICtrlSetData($list, '['&$matches[$i]&'] '&$matches[$i+1])
Next
Case $btnSave
IniWrite('ItemTemplateAll1.ini', StringRegExpReplace(GUICtrlRead($list), '\[(\d+)\].+', '$1'), 1, GUICtrlRead($input))
If Not @error Then
; if file sucessfully written
; update list with new data, read from $input and search again
_GUICtrlListBox_ResetContent($list) ; reset list items ( remove )
Else
MsgBox(48, "Error", "Error = " & @error & ", Extended = " & @extended)
EndIf
EndSwitch
WEnd
|
|
|
09/01/2015, 19:48
|
#23
|
elite*gold: 0
Join Date: Sep 2010
Posts: 473
Received Thanks: 104
|
Quote:
Originally Posted by lolkop
That should be really easy. Just build a regular expression, that reads in all item data at once, parse it, and build an interface around it...
Should be done in a few lines of code.
Edit:
Example Code:
Code:
$matches = StringRegExp(FileRead('ItemTemplateAll1.ini'), "\[(\d+)\]\r\n(?:\d+=.+\r\n)*?1=(.+)\r\n(?:\d+=.+\r\n)+", 3)
GUICreate('GUI', 300, 150, Default, Default, 0x10C80000)
$list = GUICtrlCreateList('', 10, 10, 280, 90)
$input = GUICtrlCreateInput('', 10, 100, 280, 20)
$btnSearch = GUICtrlCreateButton('Search', 10, 125, 140, 20)
$btnSave = GUICtrlCreateButton('Save', 150, 125, 140, 20)
While True
Switch GUIGetMsg()
Case -3
Exit
Case $list
GUICtrlSetData($input, StringRegExpReplace(GUICtrlRead($list), '\[\d+\] ', ''))
Case $btnSearch
GUICtrlSetData($list, '')
For $i=0 To UBound($matches)-1 Step 2
If StringInStr($matches[$i+1], GUICtrlRead($input)) Then GUICtrlSetData($list, '['&$matches[$i]&'] '&$matches[$i+1])
Next
Case $btnSave
IniWrite('ItemTemplateAll1.ini', StringRegExpReplace(GUICtrlRead($list), '\[(\d+)\].+', '$1'), 1, GUICtrlRead($input))
EndSwitch
WEnd
|
To dont open new topic, how i can get from this class name ?
Because every section have this keys 78, 80 so how i can recognize it if its founded.
For example i have :
Code:
[section number]
1=Armor of Kildemor
78=2
80=1
[other sections]
1=Armpads of Kildemor
78=2
80=1
[other section]
1=Graves of Kildemor
78=2
80=1
[other section]
1=Boots of Kildemor
78=2
80=1
[other section]
1=Armor of Aaron
78=1
80=1
[other section]
1=Gilliwen Culet
78=8
80=15
so when i find item to get what class item is for.
In ini file is like this i founded all class, so now if i search for item lets say
Kildemor its for 2,1 so its Berserker
Gilliwen is for 8,15 so its Scion
Something like if 78=2 and 80=1 then is Berserker
Code:
1=Name
78=Race
80=Class
=============================
78=1 ; human
80=1 ; knight
80=2 ; archer
80=8 ; mage
78=2 ; orc
80=1 ; berskerer
80=2 ; hunter
80=8 ; sorc
78=4 ; elf
80=1 ; swashbuckler
80=2 ; ranger
80=8 ; elementalist
78=8 ; dragonscion
80=15 ; scion
|
|
|
Similar Threads
|
TF2 Multihack I found (READ first!)
01/09/2020 - Team Fortress 2 - 7 Replies
Hi guys,
I'm collecting VACs on my CS:GO smurf so I'm trying to hack in f2p games. So far I got 2 bans. Anyway, the next candidate is Team Fortress 2 and I found a suitable multi-hack, I've been using it as a rage-hack for a couple of hours and the cheat itself is actually detected as of July 2014.
24 hours have passed and I'm not VACced. Therefore I'm uploading the hack here as a PUBLIC CHEAT for people who want to kill time on fresh Steam Accounts.
Note: Again, this hack is DETECTED...
|
PBDO PROBLEM 06:15:21: Authentication failed (no matching user data found). 06:15:21:
02/19/2013 - DarkOrbit - 4 Replies
#closerequest
|
All times are GMT +1. The time now is 01:22.
|
|