Writing Gearswap Lua

Language: JP EN DE FR
2010-09-08
New Items
users online
Forum » Windower » Support » Writing gearswap lua
Writing gearswap lua
 Odin.Horu
Offline
Server: Odin
Game: FFXI
user: stratusx
Posts: 180
By Odin.Horu 2017-04-29 01:10:18
Link | Quote | Reply
 
Trying to find the page that explains how to write lua code in general for gear swap, I saw it once but can't find it again dispite trying to search everywhere, If its on this site, can we have it sickered?

Also, how the hell do i write brackets () as part of a name without the system considering it part of the code?
 Fenrir.Caiir
VIP
Offline
Server: Fenrir
Game: FFXI
user: Minjo
Posts: 199
By Fenrir.Caiir 2017-04-29 01:26:07
Link | Quote | Reply
 
There are certain things that coding languages do not allow you to do syntax-wise. Parenthesis cannot be used in naming variables or functions. They are reserved for function calls, eg. foo(), paramater lists, eg. foo(this, is, a, param), and expressions. Maybe something else I forgot.

My best suggestion for you would be to look at someone else's gearswap, and then try to mess around with precast, midcast, etc. functions to your own desire. See what you can manage. Try to not use something complicated like Motenten's style for a base.

That said, you can find wonderful documentation here, but there's a lot to take in, especially if you're not familiar with programming languages.
 Odin.Horu
Offline
Server: Odin
Game: FFXI
user: stratusx
Posts: 180
By Odin.Horu 2017-04-29 01:40:56
Link | Quote | Reply
 
Fenrir.Caiir said: »
There are certain things that coding languages do not allow you to do syntax-wise. Parenthesis cannot be used in naming variables or functions. They are reserved for function calls, eg. foo(), paramater lists, eg. foo(this, is, a, param), and expressions. Maybe something else I forgot.

My best suggestion for you would be to look at someone else's gearswap, and then try to mess around with precast, midcast, etc. functions to your own desire. See what you can manage. Try to not use something complicated like Motenten's style for a base.

That said, you can find wonderful documentation here, but there's a lot to take in, especially if you're not familiar with programming languages.
I appreciate your reply, while i am not a programmer, i have been using all information and styles you mentioned in order to build some of my own GS sets for multiple jobs, i am currently building a bard set which worked on my main char however i am making a custom lua for my alt, i have referenced alot of other lua sources and i believe its pretty much set to do what i want, however i realised one of my (has writing inside) which is aimed at more of refering for me rather than being part of the code is gonna mess it up.

What i am seeking is the relevent code that returns a marker to its original form, such as \' means "apostrophe" or ' in its original form, however ' is part of the coding for lua, so you need to write \' to make apostrophes
 Fenrir.Caiir
VIP
Offline
Server: Fenrir
Game: FFXI
user: Minjo
Posts: 199
By Fenrir.Caiir 2017-04-29 01:45:06
Link | Quote | Reply
 
You can use parenthesis in strings as normal, so this is perfectly valid:

x = "(Hello World)"

You can also use them in table keys, but only if you use brackets to index the key:

t = {}
t['(Hello)'] = x
print(t['(Hello)'])

Output:
(Hello World)
 Odin.Horu
Offline
Server: Odin
Game: FFXI
user: stratusx
Posts: 180
By Odin.Horu 2017-04-29 01:50:15
Link | Quote | Reply
 
Fenrir.Caiir said: »
You can use parenthesis in strings as normal, so this is perfectly valid:

x = "(Hello World)"

You can also use them in table keys, but only if you use brackets to index the key:

t = {}
t['(Hello)'] = x
print(t['(Hello)'])

Output:
(Hello World)
I feel you've missed entirely what i'm asking, what i need () for isn't part of the string. its litterally a () that is part of the game. as such, it needs to be a original ()

An example is when i wrote my mages ballad string, it was
windower.send_command('wait 11;input /ma "Mage\'s Ballad III" me')

I had to put Mage\'s instead of Mage's


You nailed it
 Fenrir.Caiir
VIP
Offline
Server: Fenrir
Game: FFXI
user: Minjo
Posts: 199
By Fenrir.Caiir 2017-04-29 01:59:23
Link | Quote | Reply
 
Edit: Sort of think I got it... It's better to ask about what you're trying to accomplish than the issue you may have ran into while trying to solve that problem.

What is a parenthesis coming from the game? Anything you get from the game is just going to be a string, so it would match normally.

https://www.lua.org/pil/2.4.html
Offline
Posts: 77
By sudsi 2017-04-29 02:04:43
Link | Quote | Reply
 
http://supernovaffxi.wikia.com/wiki/Rotha's_GearSwap_Lessons
 Odin.Horu
Offline
Server: Odin
Game: FFXI
user: stratusx
Posts: 180
By Odin.Horu 2017-04-29 02:13:11
Link | Quote | Reply
 
Yoran-Oran (UC)

I'm trying to get a ballad set on him
 Odin.Horu
Offline
Server: Odin
Game: FFXI
user: stratusx
Posts: 180
By Odin.Horu 2017-04-29 02:34:08
Link | Quote | Reply
 
Nvm, your original post before you edited explained it better, since most of this stuff is writen technically, i guess i mentally shut it out because i kept reading that stuff over and over before.

Pretty much () with a parenthesis around it causes the () to act as normal rather than part of the string?

Edit: however if anyone finds the original post i am refering to where one of the dev team explains in heavy detail how to write a script from scratch, please post it here.

Also, Rotha's post is awesome, it covers only the basics.
Offline
By Aeyela 2017-04-29 04:32:27
Link | Quote | Reply
 
windower.send_command('input /ma "Mage\'s Ballad" Yoran-Oran (UC)') would work but I don't believe even Gearswap can bypass the "casting on NPCs by name" thing. But try it. If that doesn't work, make sure you summon him in the same position in party and use <p1>, <p2>, etc, instead of his name. That will definitely work.
 Odin.Horu
Offline
Server: Odin
Game: FFXI
user: stratusx
Posts: 180
By Odin.Horu 2017-04-29 06:23:41
Link | Quote | Reply
 
Thank you too Aeyela for the added suggestions, that'll come in handy for some other setups i'm hoping to make later since i'll need to make a party based setup rather than just for trusts

Edit: Seems Yoran-Oran doesn't need (UC) at the end of his name when referencing him
Log in to post.