Author Topic: Flow  (Read 9344 times)

0 Members and 1 Guest are viewing this topic.

Offline TidusTopic starter

  • Lazy
  • Administrator
  • *
  • *
  • Posts: 1291
  • Activity:
    0%
  • Reputation Power: 15
  • Tidus is working their way up.Tidus is working their way up.Tidus is working their way up.
  • Gender: Male
  • Mind Blown
  • Respect: +151
  • Referrals: 2
    • View Profile
    • Ultimate Apparel
Flow
« on: October 13, 2010, 04:32:35 PM »
0
Since there is no goto or gosub... how do i do flow on LUA?  Make sure it goes from one sub to the next. I'm guessing subs are just functions and returns are ends.
For those who have fought for it, freedom has a taste the protected will never know ~ Anonymous, Vietnam, 1968

Offline _C2_

  • AFK FtW
  • Global Moderator
  • *
  • *
  • Posts: 4077
  • Activity:
    0%
  • Reputation Power: 48
  • _C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!
  • RIP Pen Trick
  • Respect: +254
  • Referrals: 4
    • View Profile
Re: Flow
« Reply #1 on: October 13, 2010, 04:41:00 PM »
0
Since there is no goto or gosub... how do i do flow on LUA?  Make sure it goes from one sub to the next. I'm guessing subs are just functions and returns are ends.

gosub = function now
return = end

been looking stuff up and chatting with endless

Offline TidusTopic starter

  • Lazy
  • Administrator
  • *
  • *
  • Posts: 1291
  • Activity:
    0%
  • Reputation Power: 15
  • Tidus is working their way up.Tidus is working their way up.Tidus is working their way up.
  • Gender: Male
  • Mind Blown
  • Respect: +151
  • Referrals: 2
    • View Profile
    • Ultimate Apparel
Re: Flow
« Reply #2 on: October 13, 2010, 05:27:38 PM »
0
So does
Code: [Select]
repeat
function now carveleather
until UO.CliLogged == Yes
Work for the goto?
For those who have fought for it, freedom has a taste the protected will never know ~ Anonymous, Vietnam, 1968

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: Flow
« Reply #3 on: October 13, 2010, 05:35:00 PM »
0
So show me this in OEUO:

Code: [Select]
repeat
gosub 1
gosub 2
gosub 3
until #false

sub 1
sub 2
sub 3
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline _C2_

  • AFK FtW
  • Global Moderator
  • *
  • *
  • Posts: 4077
  • Activity:
    0%
  • Reputation Power: 48
  • _C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!
  • RIP Pen Trick
  • Respect: +254
  • Referrals: 4
    • View Profile
Re: Flow
« Reply #4 on: October 13, 2010, 05:43:38 PM »
0
So does
Code: [Select]
repeat
function now carveleather
until UO.CliLogged == Yes
Work for the goto?

not function now.  it is function                    *now it is


repeat
function carveleather
until UO.CliLogged == Yes

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Flow
« Reply #5 on: October 13, 2010, 05:53:13 PM »
0
Specifically for Cerveza's question:

Code: [Select]
function One()
  print("1")
end
---------------------
function Two()
  print("2")
end
---------------------
function Three()
  print("3")
end
---------------------
---------------------
repeat
  One()
  Two()
  Three()
until false

Note you need to put your functions up before the code that actually executes.

« Last Edit: October 13, 2010, 06:02:21 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Flow
« Reply #6 on: October 13, 2010, 05:57:52 PM »
0
So does
Code: [Select]
repeat
function now carveleather
until UO.CliLogged == Yes
Work for the goto?

not function now.  it is function                    *now it is


repeat
function carveleather
until UO.CliLogged == Yes




Code: [Select]
function carveleather
     end

repeat
  carveleather
until UO.CliLogged == Yes
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline _C2_

  • AFK FtW
  • Global Moderator
  • *
  • *
  • Posts: 4077
  • Activity:
    0%
  • Reputation Power: 48
  • _C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!
  • RIP Pen Trick
  • Respect: +254
  • Referrals: 4
    • View Profile
Re: Flow
« Reply #7 on: October 13, 2010, 06:01:00 PM »
0
wow...
so main loops per say are all at the bottom now.  hehe.  comically it makes sense since we all feel like our worlds are upside down  :P

Offline TidusTopic starter

  • Lazy
  • Administrator
  • *
  • *
  • Posts: 1291
  • Activity:
    0%
  • Reputation Power: 15
  • Tidus is working their way up.Tidus is working their way up.Tidus is working their way up.
  • Gender: Male
  • Mind Blown
  • Respect: +151
  • Referrals: 2
    • View Profile
    • Ultimate Apparel
Re: Flow
« Reply #8 on: October 13, 2010, 06:06:42 PM »
0
basically this language reads everything and then acts upon what it needs to.
For those who have fought for it, freedom has a taste the protected will never know ~ Anonymous, Vietnam, 1968

Offline TidusTopic starter

  • Lazy
  • Administrator
  • *
  • *
  • Posts: 1291
  • Activity:
    0%
  • Reputation Power: 15
  • Tidus is working their way up.Tidus is working their way up.Tidus is working their way up.
  • Gender: Male
  • Mind Blown
  • Respect: +151
  • Referrals: 2
    • View Profile
    • Ultimate Apparel
Re: Flow
« Reply #9 on: October 13, 2010, 06:34:52 PM »
0
Would this work?

Code: [Select]
dofile("tm_subs_v31.lua")
function setup
LeatherMenu = MenuInfo:New()
LeatherMenu:TM_MenuFunction("menu Edit RunebookID 12 216 73 yourrunebook")
repeat
if UO.MenuButton ~= N/A
 {
  if UO.MenuButton == GetRunebook
   {
   set UO.targcurs 1
   while UO.TargCurs == 1
       wait 1
   yourrunebook = UO.LTargetID
   LeatherMenu:TM_MenuFunction("menu Edit RunebookID 12 216 73 yourrunebook")
   UO.MenuButton = N/A
   }
  if UO.MenuButton == GetButcher
    {
     set UO.TargCurs 1
   while UO.TargCurs == 1
       wait 1
   cleaver = UO.LTargetID
   LeatherMenu:TM_MenuFunction("menu Edit ButchersID 12 260 73 cleaver")
   UO.MenuButton = N/A
   }
   }
until UO.MenuButton = EUOButton1
UO.MenuButton = N/A
 LeatherMenu:TM_DeleteControl("EUOButton1")
LeatherMenu:TM_MenuFunction("menu get HouseCheck")
   if UO.MenuRes == true
commbox = true
LeatherMenu:TM_MenuFunction("menu get BankCheck")
   if UO.MenuRes == true
commbox = false
LeatherMenu:TM_MenuFunction("menu get Chiv")
   if UO.MenuRes == true
travel = SJ
LeatherMenu:TM_MenuFunction("Menu get Recall")
   if UO.MenuRes == true
travel = RE
LeatherMenu:TM_MenuFunction("menu get bankrunes")
bankrunes = UO.MenuRes
LeatherMenu:TM_MenuFunction("menu get monsterrunes")
runeamounts = UO.MenuRes
LeatherMenu:TM_MenuFunction("menu get houserunes")
houserunes = UO.MenuRes
LeatherMenu:TM_MenuFunction("menu get maxleather")
leather = UO.MenuRes
regularfinal = 0
spinedfinal = 0
hornedfinal = 0
barbedfinal = 0
corpseid = YFM_FEX_QEX
cutleather = JJG
monster = AE_DE_FE_AF_CD_NG_IG_XG_YG_ZF_EG --; Lizardmen_Wyvrnn_Dragon_Cow_Bull_Goat_LLAMA
arti = LSW_YKQ_OKQ_QKQ_MKQ_RSW_QMH_SKQ_ALQ --;The Arties that Drop in Dungeons
delay = 8 --;
ignoretimer = ( #sCnt + 1200 )
wait = You_must_wait_to_perform_another_action
bandies = ZLF
bankposition = 1
houseposition = bankrunes + 1
End
For those who have fought for it, freedom has a taste the protected will never know ~ Anonymous, Vietnam, 1968

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Flow
« Reply #10 on: October 13, 2010, 06:39:39 PM »
0
Run it.  Looks like you have a bunch of "set" commands in there.  In Lua you just need the expression "x = 1" instead of "set x 1"
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Flow
« Reply #11 on: October 13, 2010, 06:41:16 PM »
0
I'm really serious, you shouldn't even attempt a GUI based script until you've played a bit more with the Lua syntax or else you are going to get REALLY frustrated.   Probably more so since we're not sure where Cheffe is headed with the GUI thing anyhow. 
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TidusTopic starter

  • Lazy
  • Administrator
  • *
  • *
  • Posts: 1291
  • Activity:
    0%
  • Reputation Power: 15
  • Tidus is working their way up.Tidus is working their way up.Tidus is working their way up.
  • Gender: Male
  • Mind Blown
  • Respect: +151
  • Referrals: 2
    • View Profile
    • Ultimate Apparel
Re: Flow
« Reply #12 on: October 13, 2010, 06:42:51 PM »
0
yeah...  true..  might just have to make this basic like the first one was....
For those who have fought for it, freedom has a taste the protected will never know ~ Anonymous, Vietnam, 1968

Offline TidusTopic starter

  • Lazy
  • Administrator
  • *
  • *
  • Posts: 1291
  • Activity:
    0%
  • Reputation Power: 15
  • Tidus is working their way up.Tidus is working their way up.Tidus is working their way up.
  • Gender: Male
  • Mind Blown
  • Respect: +151
  • Referrals: 2
    • View Profile
    • Ultimate Apparel
Re: Flow
« Reply #13 on: October 13, 2010, 06:48:39 PM »
0
For those who have fought for it, freedom has a taste the protected will never know ~ Anonymous, Vietnam, 1968

Offline TidusTopic starter

  • Lazy
  • Administrator
  • *
  • *
  • Posts: 1291
  • Activity:
    0%
  • Reputation Power: 15
  • Tidus is working their way up.Tidus is working their way up.Tidus is working their way up.
  • Gender: Male
  • Mind Blown
  • Respect: +151
  • Referrals: 2
    • View Profile
    • Ultimate Apparel
Re: Flow
« Reply #14 on: October 13, 2010, 06:55:40 PM »
0
For those who have fought for it, freedom has a taste the protected will never know ~ Anonymous, Vietnam, 1968

Tags: