Page 1 of 1

ChoiceOption(Variable)

Posted: Sun Dec 29, 2013 8:50 am
by artosaari
Hi there!

I've done quite some forum search, but haven't found anything so far, i wonder if it's possible to use something like this

Code: Select all

VARIABLE = 5;
sendMacro("ChoiceOption(VARIABLE);")
Or maybe there is an alternative to interact with npc bot-sided, because this sendmacro is client-sided?
This Code is for burning Honor Points at the mercheants and would make it much easier to buy different production mats.
Maybe this is a very fundamental coding question, I am sorry for my bad coding skills :(

kind regards

Re: ChoiceOption(Variable)

Posted: Sun Dec 29, 2013 9:06 am
by rock5
You are sending a string in game "ChoiceOption(VARIABLE);" that is executed in game. If VARIABLE is a bot value then it will be nil in the game. What you want to do is use the value held by that variable,eg.

Code: Select all

sendMacro("ChoiceOption("..VARIABLE..");")
See it still sends a string but the game will receive
"ChoiceOption(5);". I hope that clears it up for you.

Note: in this case VARIABLE is a number but if you are sending a string, you have to surround it with quotes. Eg.

Code: Select all

sendMacro("SomeFunction(\""..VARIABLE.."\")") -- Using escaped double quotes \"
or

Code: Select all

sendMacro("SomeFunction('"..VARIABLE.."')") -- Using single quotes '

Re: ChoiceOption(Variable)

Posted: Sun Dec 29, 2013 9:41 am
by artosaari
Thank you so much rock5, works fine!!