• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Question - Lua & /useitem

Overtimer

Seasoned veteran member
Joined
May 8, 2021
RedCents
748¢
Hi, I am trying to get into Lua programming and I cannot get /useitem to work.

If anyone here can provide me with the proper syntax to use an item like the Bigger Belt of the River & Wee'er Harvester?

I tried going to different Lua projects and I couldn't find any examples.
 
if you were just looking for the absolute bare-bones usage

you can mq.cmd('/useitem "Long Item Name in Quotes"')
 
Yes, I tried using that program, but it will not cast, I get no errors. The program uses variables, I just wanted to bypass that part and see how does Lua use >> /useitem <<

This is what I used.

CheckInventory('Burned Black Bread', 'Wee\'er Harvester', 10);

CheckInventory('Burned Black Bread', "Wee'er Harvester", 10);

CheckInventory('Murky Globe of Water', 'Bigger Belt of the River', 10);
 
Yes, I tried using that program, but it will not cast, I get no errors. The program uses variables, I just wanted to bypass that part and see how does Lua use >> /useitem <<

This is what I used.

CheckInventory('Burned Black Bread', 'Wee\'er Harvester', 10);

CheckInventory('Burned Black Bread', "Wee'er Harvester", 10);

CheckInventory('Murky Globe of Water', 'Bigger Belt of the River', 10);
you're going to need to show the rest of your code

the example i gave would allow to just simply use an item by name, and if you wanted to format the command string you could use cmdf instead of cmd

like:

mq.cmdf('/useitem %s', variable)
or
mq.cmdf('/useitem' ..variable)
 
If I just wanted Lua to cast one time, is this what it will look like?

mq.cmd('/useitem' Bigger Belt of the River)
end


I even tried modifying SummonItem Lua to work without the conditions, it still will not cast.

I know if I type /useitem Bigger Belt of the River in the MQ box it will cast, I am trying to get Lau to do it, and once I get that part working maybe expand on that or see why SummonItem Lua is not working.



FYI the SummonItem Lua is not in the Lua section is in the Public Knowledge area.
 
Disclaimer this is not my code, and I am nowhere near this level of coding. This was posted by someone here and I am trying to learn from it.
It seems it doesn't work right. The best way for me to learn things is to see how other coders do things, and the biggest thing for me is understanding the right syntax to use.
I downloaded the VSC editor and I am using it for this.


Ok guys, now that I am home. I was able to cast those items and troubleshoot the code better with my very very very limited knowledge of luna.
Thank you for the tips. I was able to narrow the code problem to the conditions, something is wrong with them.

Going to add them one by one and figure out what is wrong.

Thank you again.
 
Question on >>> mq.TLO.Me.CombatState() <<<

When I do that command what is the return value going to be? Or better yet any way to echo that value in a safe way?
 
nm, I need to stop being lazy and I did a search on CombatState, I got my answer.
 
Ok, I know what going on now. I cannot change the condition of being in combat or not.

All my toons are showing 0 or COMBAT. Is this a bug, do I need to report this?

I zoned and logged still reporting COMBAT or 0

/echo ${Me.PctAggro}
/echo ${Me.CombatState}
 
Question - Lua & /useitem

Users who are viewing this thread

Back
Top
Cart