• 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

Lua - Scriber LUA

Kuhle

Sergeant
Joined
Nov 12, 2021
RedCents
1,408¢
Here we go, creating a Lua with very little knowledge of Lua or Programing in general.
I think I've got the basic navigation down. easy enough.
local function navigate() mq.cmdf("/nav target") --ok, so we are moving-- while mq.TLO.Navigation.Active() do mq.delay(50) end mq.delay(50) end

my issue is making a target from a list. this is what I came up with.

local function target(UL, LL) mq.cmdf("/target Merchant.Name") end

The Merchant comes from a list that looks similar to this, but theres many parts depending on class and I think I may run into an issue in the future when I start to add merchants of a different location.

local function ClassMerchantPOK(Class, LL, UL) if Class == "WAR" then local Merchant = { {Name = "Heldin Swordbreaker", LL = 1, UL = 90} } end end

UL and LL are supposed to be user inputs that delineate the lower level and the upper level the user wants to search for.
 
Last edited:
I'm not sure how you want to design it, but I'd honestly just do one table and remove the function. Something like this:

Lua:
local merchlookup = {
  poknowledge = {
      WAR = {
        { Name = 'Heldin Swordbreaker', LowerLevel = 1, UpperLevel = 90},
    },
    DRU = {
        { Name = 'Wanderer Astobin', LowerLevel = 1, UpperLevel = 25 },
        { Name = 'Wanderer Qenda', LowerLevel = 26, UpperLevel = 50 },
        { Name = 'Wanderer Frardok', LowerLevel = 51, UpperLevel = 60 },
        { Name = 'Wanderer Kedrisan', LowerLevel = 61, UpperLevel = 70 },
        { Name = 'Wanderer Thermon', LowerLevel = 71, UpperLevel = 80 },
        { Name = 'Wanderer Abel', LowerLevel = 81, UpperLevel = 90 },
    },
    -- more classes here
  },
  -- more zones here
}
then you can be like
Lua:
local merch = merchlookup[mq.TLO.Zone.ShortName()][mq.TLO.Me.Class()]
(that's not actually right, but you get the idea -- make sure to nil check and all that jazz). That'll eventually just get you a list of merchants in the zone for your class, then you can filter by level input
 
So I took a little bit of what dannuic said and made a few changes of my own to try and make this work. this is what I got... shortened.
[CODE title="Scriber:"]local merchlist = {
POKnowledge = {
WAR = {
'Heldin Swordbreaker' == {90, 90}
},
PAL = {
"Cavalier Waut" == {26, 0},
"Cavalier Aodus" == {51, 25},
"Cavalier Preradus" == {61, 50},
"Cavalier Cerakor" == {71, 60},
"Cavalier Ethigom" == {81, 70},
"Cavalier Tummings" == {91, 80},
"Ulin Velnik" == {91, 0}
},
--More Classes
},
Argath = {
WAR = {
"Some Name" == {95, 91}
}
},
--More Locations
}

local POK = merchlist[1]
local Arg = merchlist[2]
local POKmerch = merchlist[1][ClassSN]['string']
local Argmerch = merchlist[2][ClassSN]['string']

local function LOC()
if POKmerch[1] > MinLevel and POKmerch[2] < MaxLevel then
mq.cmdf('/travelto POKnowledge')
elseif Argmerch[1] > MinLevel and Argmerch[2] > MaxLevel then
mq.cmdf('/travelto Argath')
end
end[/CODE]

the above would hopefully at least get me to the area I'm getting the spells from.
 
that's not quite correct because order isn't guaranteed if you use keys. You need to access the first level with the key, not an index, ie merchlist['POKnowledge']
 
that's not quite correct because order isn't guaranteed if you use keys. You need to access the first level with the key, not an index, ie merchlist['POKnowledge']
Ah ok. From my understanding when I was watching and reading online, the keys were placement of which order they were inserted in the table and try not to use strings because they take longer to function. I'll make the modifications
 
Alright, I've progressed a lot. The issue I've run into is the loop function. everything in it works except for the function inside the loop. it runs the first time but not after.
1643826966121.png
here's the loop. It does everything in the loop except for the rouneq().
1643827032512.png
and here is the rouneq function. Any help would be appreciated
 
When you say "runs the first time", what do you mean? It does everything inside Rouneq and doesn't call it again? It calls it again, but it does nothing during the second call? It never leaves Rouneq in the first place?
 
Not The wisest person in scripting, but your while has doloop in it. You never set a true or escape a false. So this could be it
 
When you say "runs the first time", what do you mean? It does everything inside Rouneq and doesn't call it again? It calls it again, but it does nothing during the second call? It never leaves Rouneq in the first place?
It runs rouneq for the first vendor, when it gets to the second vendor, it does not run it again. I'm not sure if it's not leaving the function in the first place or if it's just skipping the function after the first vendor
 
Not The wisest person in scripting, but your while has doloop in it. You never set a true or escape a false. So this could be it
local DoLoop = True
I know you can't see that so I understand where you're coming from. but yes, it is a true in the statement.
 
Last edited:
you're definitely getting stuck in rouneq, that loop will never break.
So you would say it has something to do with something inside of rouneq fiction and not how the loop is set up
 
ok, so I went into the rouneq function and checked to see if it is actually going back in. this is what I changed and this is whats coming out

1643845489143.png1643845422363.png
Additional info: I went back in and checked to see if its going into the while (doloop) do part of the function and it is. seems to just be skipping the if function from what I can tell
 
Last edited:
Lua - Scriber LUA

Users who are viewing this thread

Back
Top
Cart