Author Topic: I have a bunch of tools in the Lua works  (Read 9729 times)

0 Members and 1 Guest are viewing this topic.

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
I have a bunch of tools in the Lua works
« on: August 23, 2010, 10:22:07 AM »
0
Non-blocking timers, spellcast/runebook subs, finditem suite of subs, etc.  All good stuff coming soon, and meant to look and work more like what everyone is used to from EUO.
Please read the ScriptUO site RULES
Come play RIFT with me!

Scrripty

  • Guest
Re: I have a bunch of tools in the Lua works
« Reply #1 on: August 23, 2010, 12:51:37 PM »
0
Non-blocking timers, spellcast/runebook subs, finditem suite of subs, etc.  All good stuff coming soon, and meant to look and work more like what everyone is used to from EUO.

*STAMP*  Officially converted.  You have been approved to spoon with Cheffe.

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: I have a bunch of tools in the Lua works
« Reply #2 on: August 23, 2010, 02:12:33 PM »
0
*STAMP*  Officially converted.  You have been approved to spoon with Cheffe.

When I port the heartwood quester, you can officially label me converted.  At the moment, I'm amused.  In the mean time, yout position of chief spooner is safe.  :)
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Masscre

  • Gran Master Jester !!
  • Scripthack
  • *
  • Posts: 4615
  • Activity:
    0%
  • Reputation Power: 55
  • Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!
  • Gender: Male
  • Air Guitar Commander !!
  • Respect: +144
  • Referrals: 1
    • View Profile
Re: I have a bunch of tools in the Lua works
« Reply #3 on: August 23, 2010, 02:43:07 PM »
0
Quote
In the mean time, your position of chief spooner is safe.  :)

ROFLMFAO !!!!!!!!!!!!     :P  :P  :P   :P   :P   :P  :P   :P   :P   :P  :P

Offline Paulonius

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: I have a bunch of tools in the Lua works
« Reply #4 on: August 24, 2010, 06:28:33 AM »
0
Guess i need to start learning Lua...
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: I have a bunch of tools in the Lua works
« Reply #5 on: August 24, 2010, 08:07:03 AM »
0
It's probably a good time to learn the language.  As for OEUO, Cheffe is still trying to create a scripting development model, so I'm avoiding creating any large scripts because there is some uncertainty regarding the final vision of OEUO.

But I think tools are safe at the moment to move forward with.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: I have a bunch of tools in the Lua works
« Reply #6 on: August 24, 2010, 11:41:53 AM »
0
BTW, my finditem sub is really turning out nice. ;)
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: I have a bunch of tools in the Lua works
« Reply #7 on: August 24, 2010, 03:36:10 PM »
0
So this will be pretty cool..  Take this little snippet for example:

Code: [Select]
items = {}
count = 0
stack = 0
count, stack, items = TM_FindItem("hvf_pof","cg", "*", 1)
if count > 0 then
  print(string.format("Found: %d, total stack size = %d",count, stack))
end

The first argument is what you might be looking for.  In this case it's ruby stacks and gold stacks.  The second argument suggest that you want to look at both the ground and containers.  The third argument is a wildcard for the containers to look inside all open containers.  You can easily give this a list like "XXXYY1_XXXYY2" and it will only look inside those two containers.  The 4th argument is the distance to look and report found items.

The return values are intersting.  The "count" argument is the resulting count of all items found.  The "stack" argument is a sumation of all stack sizes found for the search.  For this example, the returned value would be the summation of all gold stack values as well as all ruby stack values (yes, I know that doesn't make any sense....).  The final return value "items" is a table of all items returned that matched the search criterion.  You can iterate across this table and see the specific information found:

Code: [Select]
  for x,k in pairs(items) do
    print(string.format("findid for this item is %d", k.findid))
  end

You'll find that you don't have to use the old EUO numbering scheme if you don't want.  The function also works with tables of numbers:

Code: [Select]
items = {}
count = 0
stack = 0
count, stack, items = TM_FindItem({123456, 2340923498},"c", {6767658}, 1)
if count > 0 then

I'll post this up when I have a bit more testing done.
« Last Edit: August 24, 2010, 03:39:38 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: I have a bunch of tools in the Lua works
« Reply #8 on: August 29, 2010, 10:45:36 PM »
0
I also rolled into the finditem subs automatic property scan for each returned item.  One stop shopping.

I've also got the runebook/spellcast subs working well.  It's hard to get the spellcast sub solid, so I tried to very closely port it from the EUO world since that one has been worked to death over the years.  But I've got all the subs you guys are used to using:

TM_TravelFromObject
TM_RandomRunebookTravel
TM_TravelFromNamedRunebook
TM_TravelFromRunebook
TM_GumpWaitAndSize
TM_GumpWait
TM_NewCastSpell

Now I think I'll start working on the rail engine.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Khameleon

  • Script Tester - Team Leader
  • Elite
  • *
  • *
  • Posts: 2574
  • Activity:
    0%
  • Reputation Power: 30
  • Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!
  • Gender: Male
  • Respect: +238
  • Referrals: 0
    • View Profile
Re: I have a bunch of tools in the Lua works
« Reply #9 on: August 30, 2010, 12:36:01 AM »
0
very sweet deal TM...

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: I have a bunch of tools in the Lua works
« Reply #10 on: August 30, 2010, 06:18:01 AM »
0
Very nice ... so is Lua relatively easy once you adjust.
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: I have a bunch of tools in the Lua works
« Reply #11 on: August 30, 2010, 07:47:33 AM »
0
Very nice ... so is Lua relatively easy once you adjust.

Actually it is.  I'm finding it kinda hard to go back to EUO when I've been doing tools in OEUO.  There are some serious annoyances with Lua though.  For this to be a complete scripting language, it really should have a "continue" statement.  It's got a "break", but no continue.  Kinda lame if you ask me.  Also not having a "switch/case" structure seems a little odd.  "elseif" works ok, but it's not as clear.

Just keep your fingers crossed that Cheffe can straighten out the multithreaded issue.  That'll be when I go all-in.  Until then, I'm just dabbling.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: I have a bunch of tools in the Lua works
« Reply #12 on: August 30, 2010, 08:51:28 AM »
0
I'm actually looking forward to scripting directly into OEUO.  The last few things I've written have been ports of existing code.  My runebook subs were pretty convoluted, but bulletproof from EUO, so I wanted to bring that stability directly into OEUO.  Same goes for the journal scanner.  The finditem subs are a little bit better since they are just improving on the existing item locate ability of Lua/OEUO.  Really, there's a little less basic functionality to OEUO, but you can quickly build up waaaay more functionality with simple helper functions.  You'll see what I mean when I publish my finditem stuff.  Should be soon now, I just have to do a bit of documentation.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: I have a bunch of tools in the Lua works
« Reply #13 on: August 30, 2010, 09:10:44 AM »
0
One of the main things i will be looking forward to is just library functions maintainablity.   EUO has needed an include statment desperatly  and that alone is reason to switch once its stable in my book.
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: I have a bunch of tools in the Lua works
« Reply #14 on: August 30, 2010, 09:20:25 AM »
0
My files are starting to bristle with that exact thing.  From my runebook/spellcast subs:

Code: [Select]
dofile("tm_oeuo_advjournalscan10.lua")
dofile("tm_subs_collection5.lua")
---------------------------------------------------------------
function TM_NewCastSpell(whichspell, whichtarget, castretrymax, waitdelay, recovery_delay)
...

I'm pulling in my journal scanner and a subs collection that includes non-blocking timers.

But you're right, definitely needed feature.

Real file handling is what I'm really looking forward to.
Please read the ScriptUO site RULES
Come play RIFT with me!

Tags: