Three words in system message, how do I read this line and get the order I need to perform an action for each of the words in order they appear. I used some code of lisa to get the system message.
Tense bow -- alt+1
Stab -- alt+2
Attack -- alt+3
WARNING_MESSAGE |cfffff266Make the following movements in the given order:StabTense bowAttackAttackStabTense bowTense bow|r
for this I need alt2 alt1 alt3 alt3 alt2 /// alt1 alt1 only 5 used to complete
string find stuff help
Re: string find stuff help
Where you posted this had absolutely nothing to do with the topic, so I made a new topic just for you.
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: string find stuff help
The code of yours was in that thread that gave me the message.
I searched some lua programming and found something on findstring(), I need to search each word and some how sort it or something. I have seen people working on other code with messages for the season events I hoped one may have a clue. I will try to figure this out this daily, later I need to finish recovering some code I wrote for daily's functions.
http://lua-users.org/wiki/StringLibraryTutorial this seems to be what I need I will experiment with it some.
I searched some lua programming and found something on findstring(), I need to search each word and some how sort it or something. I have seen people working on other code with messages for the season events I hoped one may have a clue. I will try to figure this out this daily, later I need to finish recovering some code I wrote for daily's functions.
http://lua-users.org/wiki/StringLibraryTutorial this seems to be what I need I will experiment with it some.
Re: string find stuff help
You have StabTense bowAttackAttackStabTense bowTense bow and you want to work out the order of Stab, Tense bow and Attack?
The link you provided has the answer you need, string.find.
So you have the position of the first occurance of Stab and when the string ends you are looking for, the 3rg argument is the position you start searching in the string, so use the info you got from the last search and search again.
and then use the that again for the next search
You now have a nil return which means there are no more occurrences of the string "Stab"
So you now know "Stab" is located at postion 1 and 26 of that string.
That is as much as I am going to say, the rest should be easy enough for you to work out.
The link you provided has the answer you need, string.find.
Code: Select all
Command> local pos, endpos = string.find("StabTense bowAttackAttackStabTense bowTense", "Stab",1) print(pos) print(endpos)
1
4
Command>
Code: Select all
Command> local pos, endpos = string.find("StabTense bowAttackAttackStabTense bowTense", "Stab",4) print(pos) print(endpos)
26
29
Code: Select all
Command> local pos, endpos = string.find("StabTense bowAttackAttackStabTense bowTense", "Stab",29) print(pos) print(endpos)
nil
nil
So you now know "Stab" is located at postion 1 and 26 of that string.
That is as much as I am going to say, the rest should be easy enough for you to work out.
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: string find stuff help
the_error = WARNING_MESSAGE |cfffff266Ma...
Sorry the original tread somehow showed me how to get that message.
I cannot find an example of how to get the error into a variable.
so I can use the string function to find the action.
The eoj and other code samples find just test for the error but do not capture it to a variable.
Sorry the original tread somehow showed me how to get that message.
I cannot find an example of how to get the error into a variable.
so I can use the string function to find the action.
The eoj and other code samples find just test for the error but do not capture it to a variable.
Re: string find stuff help
and what happens when you print the_error ?
print(the_error)
It more than likely prints it on MM because it is a string.
print(the_error)
It more than likely prints it on MM because it is a string.
Code: Select all
local pos, endpos = string.find(the_error, "Stab",1) print(pos) print(endpos)
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: string find stuff help
forget the rest of this thread.
I go to npc, accept quest, then start, a second or 2 later: it post a message that is a warning. I need to get this into a Variable.
After that I can try to write the string code.
I go to npc, accept quest, then start, a second or 2 later: it post a message that is a warning. I need to get this into a Variable.
After that I can try to write the string code.
Who is online
Users browsing this forum: Ahrefs [Bot] and 3 guests