Post by prince on Mar 8, 2017 20:19:39 GMT
hi guys,
i need some help in getting a specific location, the location should be returned depending on the value from the spinner, so if for example 5 is choosen from the spinner then the location for 5 should be used.
somewhere in the code:
the result is a nil value in getloc and when i first asign a location to getloc then the result is the asigned value which was not modified by the function above function.
what am i doing wrong?
i need some help in getting a specific location, the location should be returned depending on the value from the spinner, so if for example 5 is choosen from the spinner then the location for 5 should be used.
dialogInit()
Region(390,170,150,40):highlight("rebs att: "..rebcount)
spinnerItems = {"1", "2", "3", "4", "5", "6", "7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30"}
addTextView("Rebellion: ")
addSpinner("Rlevel", spinnerItems, "30")
dialogShow("Select Rebellion Level")
function getreblocation()
if(Rlevel==1)then return reblvlLocation1
elseif(Rlevel==2) then return reblvlLocation2 --or then getloc=reblvlLocation1 but also didnt work
elseif(Rlevel==3)then return reblvlLocation3
elseif(Rlevel==4) then return reblvlLocation4
elseif(Rlevel==5)then return reblvlLocation5
elseif(Rlevel==6) then return reblvlLocation6
elseif(Rlevel==7)then return reblvlLocation7
elseif(Rlevel==8) then return reblvlLocation8
elseif(Rlevel==9)then return reblvlLocation9
elseif(Rlevel==10) then return reblvlLocation10
elseif(Rlevel==11)then return reblvlLocation11
elseif(Rlevel==12) then return reblvlLocation12
elseif(Rlevel==13)then return reblvlLocation13
elseif(Rlevel==14) then return reblvlLocation14
elseif(Rlevel==15)then return reblvlLocation15
elseif(Rlevel==16) then return reblvlLocation16
elseif(Rlevel==17)then return reblvlLocation17
elseif(Rlevel==18) then return reblvlLocation18
elseif(Rlevel==19)then return reblvlLocation19
elseif(Rlevel==20) then return reblvlLocation20
elseif(Rlevel==21)then return reblvlLocation21
elseif(Rlevel==22) then return reblvlLocation22
elseif(Rlevel==23)then return reblvlLocation23
elseif(Rlevel==24) then return reblvlLocation24
elseif(Rlevel==25)then return reblvlLocation25
elseif(Rlevel==26) then return reblvlLocation26
elseif(Rlevel==27)then return reblvlLocation27
elseif(Rlevel==28) then return reblvlLocation28
elseif(Rlevel==29)then return reblvlLocation29
elseif(Rlevel==30) then return reblvlLocation30
else return
end
end
--Locations for Rebellion lvls
reblvlLocation1=Location(458,429)
reblvlLocation2=Location(950,425)
reblvlLocation3=Location(985,739)
reblvlLocation4=Location(977,1186)
reblvlLocation5=Location(789,1018)
reblvlLocation6=Location(590,673)
-- reblvlLocation7=Location()
-- reblvlLocation8=Location()
-- reblvlLocation9=Location()
-- reblvlLocation10=Location()
-- reblvlLocation11=Location(
--etc
somewhere in the code:
getloc=getreblocation()
click(getloc) --also tried click(getreblocation())
the result is a nil value in getloc and when i first asign a location to getloc then the result is the asigned value which was not modified by the function above function.
what am i doing wrong?