Sign in to follow this  
Followers 0
Logii

For Loop with Variable

5 posts in this topic




Logii,

Welcome to the AutoIt forum. :)

It is difficult to be specific without more code, but something like this might well work for you: ;)

; Declare an array at the top of your script
Global $aLVI[18]

; Loop 18 times
For $i = 0 To 17 ;  The array runs from 0 - 17 - Step is always 1 unless defined otherwise
    ; Now loop through the array
    If _GUICtrlListView_GetItemText($LV_PLAYERLIST, $LVI[$i]) <> $RECV_UPDATE[2] Then
        _GUICtrlListView_DeleteItem($LV_PLAYERLIST, $LVI[$i])
        $LVI[$i] = _GUICtrlListView_AddItem($LV_PLAYERLIST, $i & " / " & $RECV_UPDATE[2])
    EndIf
Next

Any help? :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Hey, thank you :)

This is what i need! I just needed to change the $aLVI[18] to $LVI[18] :)

If i need more help i'll write in this thread :) (just one post left after that one :/)

Share this post


Link to post
Share on other sites

Hey,

and how does it look when i want to create 18x 2 dimensional arrays?

;Global $IW5MP_PLAYER0[18][45] ------ MemoryRead & Stringsplit are returning 45 Values - i can get one of them with $IW5MP_PLAYER0[9] for example
;For $i = 0 To 18
$IW5MP_PLAYER0 = StringSplit(_MemoryRead("0x" & IniRead(@ScriptDir & "data.ini","PLAYER","0",""), $IW5MPProcess, 'char[1024]'),"")
$IW5MP_PLAYER1 = StringSplit(_MemoryRead("0x" & IniRead(@ScriptDir & "data.ini","PLAYER","1",""), $IW5MPProcess, 'char[1024]'),"")
....
$IW5MP_PLAYER17 = StringSplit(_MemoryRead("0x" & IniRead(@ScriptDir & "data.ini","PLAYER","17",""), $IW5MPProcess, 'char[1024]'),"")
;Next

I cant figure it out :(

Share this post


Link to post
Share on other sites

Logii,

Call of Duty Modern Warfare 3 [iW5MP.exe]

Have you read the Forum Rules? Particularly the bit which says:

"Do not discuss any of the following:

Automating games or game servers. This rule is zero tolerance"

Well, have you ? :huh:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0