Rank: Newbie
Groups: Registered
Joined: 9/21/2021(UTC) Posts: 9 Location: Elektrėnai Was thanked: 1 time(s) in 1 post(s)
|
Originally Posted by: Roy Sinclair Originally Posted by: doggy Originally Posted by: titasas
Thanks, but elseif not work for me :| do while True if Input.Find("home-powerplay2.gtzip").Text("pp.Text") >= "0:01" then API.Function("MultiViewOverlayOn", Input:="scoreboard.gtzip", Value:="5") elseif Input.Find("home-powerplay.gtzip").Text("pp.Text") >= "0:01" and Input.Find("home-powerplay2.gtzip").Text("pp.Text") >= "0:01" then API.Function("MultiViewOverlayOn", Input:="scoreboard.gtzip", Value:="1") API.Function("MultiViewOverlayOn", Input:="scoreboard.gtzip", Value:="5") elseif Input.Find("home-powerplay.gtzip").Text("pp.Text") < "0:01" and Input.Find("home-powerplay2.gtzip").Text("pp.Text") >= "0:01" then API.Function("MultiViewOverlayOff", Input:="scoreboard.gtzip", Value:="1") API.Function("MultiViewOverlayOn", Input:="scoreboard.gtzip", Value:="5") and something with setpanX else API.Function("MultiViewOverlayOff", Input:="scoreboard.gtzip", Value:="1") API.Function("MultiViewOverlayOff", Input:="scoreboard.gtzip", Value:="5") end if sleep(500) LoopAnd get Error Line 4 BC30201: Expression expected error Please put code in language syntax highlights for clarity in posting ! Error says it all , there is no expression after if (and use Else if ). it's asking else if what ? Helps to browse through this topic/post to find examples! Studying vb.net (can google for it) helps too Code:If x = 1 then
'do this
Elseif x = 2 then
'do this
Elseif x=3 or x= 4 then
'do that
else
'do something else
end if
Corrected code example, there's no space between else and if in "elseif" and "x = 3 and x = 4" will never be true since x cannot be equal to both 3 and 4 at the same time. Probably would have been ok, but there's always someone who will try an example and spend hours scratching their heads because what's obvious to us is not at all clear to them. Thank you so much to all :) I think it's possible to combine everything into one script, but I didn't get it, but even with two scripts, what I need finally works. I share, maybe it will be useful for someone Code:do while True
if Input.Find("home-powerplay.gtzip").Text("pp.Text") >= "0:01" then
API.Function("MultiViewOverlayOn", Input:="scoreboard.gtzip", Value:="1")
else
API.Function("MultiViewOverlayoff", Input:="scoreboard.gtzip", Value:="1")
end if
sleep(100)
Loop
Code:do while True
if Input.Find("home-powerplay.gtzip").Text("pp.Text") >= "0:01" and Input.Find("home-powerplay2.gtzip").Text("pp.Text") >= "0:01" then
API.Function("MultiViewOverlayOn", Input:="scoreboard.gtzip", Value:="5")
API.function("setpanX", Input:="home-powerplay2.gtzip", Value:="0.102")
elseif Input.Find("home-powerplay.gtzip").Text("pp.Text") < "0:01" and Input.Find("home-powerplay2.gtzip").Text("pp.Text") >= "0:01" then
API.Function("MultiViewOverlayOn", Input:="scoreboard.gtzip", Value:="5")
API.function("setpanX", Input:="home-powerplay2.gtzip", Value:="0")
else
API.Function("MultiViewOverlayOff", Input:="scoreboard.gtzip", Value:="5")
API.function("setpanX", Input:="home-powerplay2.gtzip", Value:="0.102")
end if
sleep(100)
Loop
If anyone can merge into one, I would appreciate it :))
|
1 user thanked titasas for this useful post.
|
|