• Hail, we're RedGuides. We want you to play six (yes, 6!) EverQuest characters at once. We have scripts and a friendly community to help, please join our playstyle and say hello! 👋
  • We've added LLM sections to our Terms & Rules and Resource Rules, for everyone's sanity & in-game safety.
    Read more
    a. Do not replace your voice with an LLM. This goes for your posts and your scripts. Drafting and editing with a tool is fine, but don't take you out of what you share.
    b. Do not replace your EQ character's voice with an LLM. We don't want scripts that speak over /ooc, /shout or other public channels. This has been an unwritten rule that's kept casino scripts off the site for decades, but we're now compelled to make it clear: keep automated communication private.

    Why Does RG Review Scripts?
    Nearly every LLM-written Lua script we see is making your character do impossible things, and rarely in a way that's beneficial to you. We've seen heavy server hammering, /target over impossible distances when /nav spawn would passively accomplish the same thing, a spawn search that fires 20+ times per second, and other pointless actions that are likely annoying GMs.

    You are welcome to use LLMs as a tool to structure, draft, and edit your work, but please read critically before hitting /lua run

Question - Lua & /useitem

Overtimer

Seasoned veteran member
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.
 
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?
 
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