Jump to content

Recommended Posts

  • Active Member

Hi guys,

how can I return the first sub_set with option in second page? I want never ending cycle. So you will can do back and forward for ever.

There is my quest:

Thank you for your answers!

Kind Regards ReFresh

Edited by ReFresh
  • Love 1

I'll be always helpful! ? 

Link to comment
Share on other sites

  • Active Member
14 hours ago, kimameixede said:

return sub_set = 1 in where you want to return.

Not working. I want to return this line: sub_set = select("Údolí orků ", "Velká poušť ", "Ledová země ", "DALŠÍ OBLASTI ","ZRUŠIT ")

FROM THIS LINE: sub_set = select("Ohnivá země ", "Zelený les", "Červený les", "ZPĚT", "ZRUŠIT")

I'll be always helpful! ? 

Link to comment
Share on other sites

 

           if map == 1 or map == 3 or map == 21 or map == 23 or map == 41 or map == 43 then

	 

	                local sub_set = 0

	 

	                if pc.get_level() >= 10 then

	            local CTRL = true

	            while(CTRL) do

	                    sub_set = select("Údolí orků ", "Velká poušť ", "Ledová země ", "DALŠÍ OBLASTI ","ZRUŠIT ")

	                    if sub_set == 5 then

	                        return

	                        notice("Teleportér: Tak zatím nashledanou.")

	                    end

	                    if sub_set == 4 then

	                        say_title(mob_name(npc.get_race())..": ")

	                        say_size(350,380)

	                        say("Tak kam tě mám přesunout?")

	                        say_reward("Cena za přesun je "..cost.." Yangů. ")

	                        sub_set = select("Ohnivá země ", "Zelený les", "Červený les", "Červený les", "Červený les", "Červený les", "Červený les", "ZRUŠIT")

	                        if sub_set == 4 then

	                            return

	                            notice("Teleportér: Tak zatím nashledanou.")

	                        end

	            end

	                    end

	                end

 

Take a look at the sub_set index: the second choice will replace the first; you should update the sub_set index:

"sub_set = select("Ohnivá země ", "Zelený les", "Červený les", "Červený les", "Červený les", "Červený les", "Červený les", "ZRUŠIT")+5"

 

So you'll can use sub_set[a] where { a=>1 & a<=5 } means the answers in the first select(), and { a => 6 & a <=13} will represent the second selection function.

NOTE: You'll need to add "CTRL = false" where you want to break the cycle (f.e., if {sub_set => 1 and sub_set<=3} or {sub_set => 6 and sub_set <= 12} then CTRL = false end), otherwise you'll follow in a loop.

 

[€dit]: if you want an assembly-like code, you can use the goto token, user documented here.

 

Example:

local x = 3
local y = 5

::restart::

if (x+3y) < 100 then

               x = x+1
               y = y+1
               
               goto restart

else

               print("now x+3y is >= than 100")
               
end

 


 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.