BackseatScripter
Active Member
Is there a way to set all elements of an array line, in a single command?
i.e. The fishing macro has an array called Fishlist
variable(script) Fishlist Fishes[50]
variable string FishName = "Squid"
variable string Combo1 = "u"
variable string Combo2 = "d"
variable string Combo3 = "l"
variable string Combo4 = "r"
variable string Combo = "xxxx"
;
objectdef Fishlist
{
method Initialize()
{
Name:Set["Empty"]
Combo1:Set["Empty"]
Combo2:Set["Empty"]
Combo3:Set["Empty"]
Combo4:Set["Empty"]
}
method Clear()
{
Name:Set["Empty"]
Combo1:Set["Empty"]
Combo2:Set["Empty"]
Combo3:Set["Empty"]
Combo4:Set["Empty"]
}
variable string Name
variable string Combo1
variable string Combo2
variable string Combo3
variable string Combo4
}
To update each element of the array line it currently uses the following code
Fishes[${Return}].Name:Set[${FishName}]
Fishes[${Return}].Combo1:Set[${Combo1}]
Fishes[${Return}].Combo2:Set[${Combo2}]
Fishes[${Return}].Combo3:Set[${Combo3}]
Fishes[${Return}].Combo4:Set[${Combo4}]
were Return is an integer (1-50)
Is there a way to do something like:
Fishes[1]:Set["Trout",${Combo1},${Combo2},${Combo3},${Combo4}]
and put in a line at a time?
i.e. The fishing macro has an array called Fishlist
variable(script) Fishlist Fishes[50]
variable string FishName = "Squid"
variable string Combo1 = "u"
variable string Combo2 = "d"
variable string Combo3 = "l"
variable string Combo4 = "r"
variable string Combo = "xxxx"
;
objectdef Fishlist
{
method Initialize()
{
Name:Set["Empty"]
Combo1:Set["Empty"]
Combo2:Set["Empty"]
Combo3:Set["Empty"]
Combo4:Set["Empty"]
}
method Clear()
{
Name:Set["Empty"]
Combo1:Set["Empty"]
Combo2:Set["Empty"]
Combo3:Set["Empty"]
Combo4:Set["Empty"]
}
variable string Name
variable string Combo1
variable string Combo2
variable string Combo3
variable string Combo4
}
To update each element of the array line it currently uses the following code
Fishes[${Return}].Name:Set[${FishName}]
Fishes[${Return}].Combo1:Set[${Combo1}]
Fishes[${Return}].Combo2:Set[${Combo2}]
Fishes[${Return}].Combo3:Set[${Combo3}]
Fishes[${Return}].Combo4:Set[${Combo4}]
were Return is an integer (1-50)
Is there a way to do something like:
Fishes[1]:Set["Trout",${Combo1},${Combo2},${Combo3},${Combo4}]
and put in a line at a time?