Skip to content

Index variable that gets set in the scope of each loop, counting starting from 0#90

Open
Tranq1 wants to merge 56 commits intoUOOutlands:outlandsfrom
Tranq1:running-index-variable
Open

Index variable that gets set in the scope of each loop, counting starting from 0#90
Tranq1 wants to merge 56 commits intoUOOutlands:outlandsfrom
Tranq1:running-index-variable

Conversation

@Tranq1
Copy link

@Tranq1 Tranq1 commented Nov 5, 2021

Explanation

With this pull request the variable index would work kind of like a reserved variable. In every kind of loop, the index will automatically get set and correctly assigned within its scope.

Downside

With the name "index" now used, existing scripts might have to rename variables or they might break. This would only happen within loops though.

Example scripts

Rainbow hello:

settimer mytimer 0
while timer mytimer < 10000
    overhead 'hello' index
    wait 200
endwhile

Example with different loops:

createlist mylist
clearlist mylist
pushlist mylist "a"
pushlist mylist "b"
pushlist mylist "c"
pushlist mylist "d"

overhead "nested for loops with index!" 20
for 5
    overhead index 20
    wait 300
    for 2
        overhead index 22
        wait 300
    endfor
endfor

overhead "while loop with index!" 30
settimer mytimer 0
while timer mytimer < 2200
    overhead index 30
    wait 300
endwhile

overhead "foreach loop with index!" 50
foreach x in mylist
    overhead x 50
    overhead index 50
    wait 500
endfor

index_variable

Jaedan and others added 30 commits August 15, 2021 21:29
Stop using the ConfigurationManager because that file changes when the
program is run. This makes it difficult for launchers to ship good
settings files.
This allows us to shift a bunch of code out of the packet handlers and
into the individual files that handle each of these features.
fix dummy save

Fix getName
@anethus
Copy link

anethus commented Dec 14, 2021

Beta Client Build and Release #55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants