|
Post by codefuzer on Dec 5, 2005 19:37:38 GMT -5
Hi, i'm new to lua and i have some problems.
I wanna make a scrip for my rng, so when i get out of arrows it's going to enquipt them.
I was thinking when i get a message that i'm out of arrows the script will start.
I just don't know how to read a line and then compare it with my string and based on that do actions.
Thank you for your time.
Oh and another thing, where can i find the list of keys for Control.control_SetKey function.
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Dec 6, 2005 13:01:04 GMT -5
where can i find the list of keys for Control.control_SetKey function. It's in the documentation where it explains the control library (above the functions listed in it). Lunar Documentation: Control Library
|
|
|
Post by X-Drop on Dec 6, 2005 15:33:58 GMT -5
Here are a few ideas to play with.... Create some empty tables, LineNumber={} Type={} Chat={} etc... Then try a search within the last 5 chat lines, for i=1,5,1 do --checks last 5 chat lines LineNumber[i]=FFXI.chat_GetNewestLineNumber()-(i-1) Type[i]=FFXI.chat_GetLineType(LineNumber[i]) Chat[i]=FFXI.chat_GetLine(LineNumber[i])
--Insert if exp then block end statement here
end Now decide how you want to extract the "Out of Ammo" message from the chat line. - Does it have a uniquie Chat Line ID code?
- Do you want to search for specific word(s)?
If you're looking to search for a particular word or phase, try playing around with "string.find". PatternCheck[i]=string.find(Chat[i],"ammo") --search for pattern Now if the search finds the word "ammo", the statement will give you the numbers of the first and last letter. You can then extract the word if you wanted to. However, if the search does not find the word "ammo", PatternCheck is going to return a nil value. Use that to your advantage when you create your if exp then block end statement by checking against a nil value.
if PatternCheck[i]~=nil then block end
So play around with these ideas and no doubt you'll come up with a solution. Good Luck!
|
|
|
Post by codefuzer on Dec 7, 2005 6:11:36 GMT -5
thank you guys very much
|
|