PDA

View Full Version : Leveling scripts.



AestheticDeath
04-06-2010, 01:29 PM
Who wants to share some?

AestheticLife
04-06-2010, 01:34 PM
Your mother.

pabstblueribbon
04-06-2010, 01:35 PM
Ah yes. Thanks for reminding me.

Drunken Durfin
04-06-2010, 02:05 PM
I'll post mine after all my guys cap.

If you don't want to wait that long, I accept PayPal.

AnticorRifling
04-06-2010, 02:05 PM
I'm not sure I have them saved anymore but I think I had 1-50 scripted out in a very sexy fashion.

Durgrimst
04-06-2010, 05:12 PM
I'll post mine after all my guys cap.

If you don't want to wait that long, I accept PayPal.

How about we not share them until double cap.

Tordane
04-06-2010, 05:36 PM
How about we not share them until double cap.

Or not at all! If they want to script exp, they can put the time into figuring it out for themselves!

Drunken Durfin
04-06-2010, 07:50 PM
How about we not share them until double cap.

So, eight months?

nub
04-06-2010, 07:58 PM
So it's just going to be a bunch of people script hunting, then when they get to level 100 they will hunt everything that is within that level range? Are levels 0-99 that boring? Or... what's the point, I don't get it, of just script hunting. I mean I sort of do, if you like hunting certain levels, but what joy do you get out of just being afk, doing something else, and never logging on. Or do you do it so that you can hunt with your buddies when they get on?

AestheticLife
04-06-2010, 08:01 PM
They do it so when they get a wild hair, and actually WANT to play, they're prepared to go out and wtfpwn the noobs that don't care as much as they do.

:p

Deathravin
04-06-2010, 08:12 PM
Ya, let me give up my one advantage...

nub
04-06-2010, 08:14 PM
Ya, let me give up my one advantage...

hmm? who mentioned anything like that?

pabstblueribbon
04-06-2010, 08:17 PM
hmm? who mentioned anything like that?

The OP.

Ding.

The fries.

They are done.

nub
04-06-2010, 08:29 PM
The OP.

Ding.

The fries.

They are done.

But it's not an advantage over other people who also have those scripts, which I thought he would have quoted the OP, as... his answer sounded like it could have been answering me, which is why I asked what I did.

pabstblueribbon
04-06-2010, 08:42 PM
I'll ask the questions here!

nub
04-06-2010, 08:47 PM
The internet has killed my grammar, I used to pride myself in it =/

Kranar
04-06-2010, 11:24 PM
I'll be using my own scripting engine.

Once I either get bored of the game or a high enough level, I'll open source it.

egreenleaf
04-07-2010, 12:28 AM
are your scripts THAT good.. or do you just bank on not getting caught?

i used starscream to get lvl 5 to 15, and on lvl 15 they yanked me and gave me a piercing death sting. i didn't even leave it overnight.. stayed at the computer. i literally went to pour myself a soda and came back to find myself in the scripting lounge. GMs are dicks.

AMUSED1
04-07-2010, 05:37 AM
are your scripts THAT good.. or do you just bank on not getting caught?

i used starscream to get lvl 5 to 15, and on lvl 15 they yanked me and gave me a piercing death sting. i didn't even leave it overnight.. stayed at the computer. i literally went to pour myself a soda and came back to find myself in the scripting lounge. GMs are dicks.

You do realize in Shattered they won't bust your ass for scripting AT ALL? And this is why people are already asking/begging/wtfever for leveling scripts NOW.

Drunken Durfin
04-07-2010, 11:21 AM
are your scripts THAT good.. or do you just bank on not getting caught?

I'm betting you got a lot of "does not pay attention in class" notes sent home to your mom.

AnticorRifling
04-07-2010, 11:28 AM
are your scripts THAT good.. or do you just bank on not getting caught?

i used starscream to get lvl 5 to 15, and on lvl 15 they yanked me and gave me a piercing death sting. i didn't even leave it overnight.. stayed at the computer. i literally went to pour myself a soda and came back to find myself in the scripting lounge. GMs are dicks.

You were afk.

Mighty Nikkisaurus
04-07-2010, 12:36 PM
You do realize in Shattered they won't bust your ass for scripting AT ALL? And this is why people are already asking/begging/wtfever for leveling scripts NOW.

No no no.. didn't you realize that they're releasing a new instance of GS that is exactly the same as prime, and splitting the player base, just because they can?

Celephais
04-07-2010, 12:39 PM
I'll be using my own scripting engine.

Once I either get bored of the game or a high enough level, I'll open source it.
The timing on this whole thing is so bad, it's got me wanting to re-vitalize my scripting engine, but at the same time I just don't have a lot of free time.

Out of curiosity what are you writing yours in and what scripting technology are you using? I was using the .NET scripting and code providers, it's pretty cool to be able to have 'scripts' written in Ruby, Python, Javascript, C#, and VB.NET all able to interact with each other.

egreenleaf
04-07-2010, 12:46 PM
I'm betting you got a lot of "does not pay attention in class" notes sent home to your mom.

lol. i'm in class right now!! hahahahaa

egreenleaf
04-07-2010, 12:47 PM
You were afk.

i didn't know that, but thanks for letting me know.

but yeah, the scripting policy is pretty lame. they should work on doing cool shit in-game instead of spending so much man-power on busting people. maybe then we'd have more than 350 people playing (half of those being MA, so more than 150?)

radamanthys
04-07-2010, 12:57 PM
i didn't know that, but thanks for letting me know.

but yeah, the scripting policy is pretty lame. they should work on doing cool shit in-game instead of spending so much man-power on busting people. maybe then we'd have more than 350 people playing (half of those being MA, so more than 150?)

How about creating another instance of the game where people can do whatever they want? Like script, swear, etc. An 'adult' version of the game with basically no GM oversight? Think that'd work?

AestheticDeath
04-08-2010, 03:08 AM
So I guess what I should have asked in the OP, was "How much are you asking?"

Who is willing to sell their services, and would they be custom, or just selling what you have already made.

violent femme
04-08-2010, 09:19 AM
I am told lich has scripts for anything you can ever need or want. I plan to use lich and see for myself.

AnticorRifling
04-08-2010, 10:31 AM
i didn't know that, but thanks for letting me know.

but yeah, the scripting policy is pretty lame. they should work on doing cool shit in-game instead of spending so much man-power on busting people. maybe then we'd have more than 350 people playing (half of those being MA, so more than 150?)

But you were afk.

Kranar
04-08-2010, 11:21 AM
The timing on this whole thing is so bad, it's got me wanting to re-vitalize my scripting engine, but at the same time I just don't have a lot of free time.

I feel the same way about this. Took them sooo long to finally get the ball rolling on Shattered.



Out of curiosity what are you writing yours in and what scripting technology are you using? I was using the .NET scripting and code providers, it's pretty cool to be able to have 'scripts' written in Ruby, Python, Javascript, C#, and VB.NET all able to interact with each other.

I think this is the right idea. I don't care to just wrap one particular scripting language whether it's Ruby or Python/Javascript etc... but instead want to focus on making a framework that can be consumed or extended by a variety of languages. The idea should be to expose two things to the user, one is a set of services related to Gemstone which include things like graph searching, databases for critters, spells, optimizing stats/skills etc... and the other is providing the user with a structured way of organizing their scripts. I don't find the linear approach to writing scripts to be very flexible and will be using an event driven approach. As for the particular language, the core system will be C++ and I will expose all of the services via Swig so that it can be used in any language.

Psinet is actually very close to what I'm describing, but Psinet from what I recall is closed source and I don't think Jamus has released his scripting engine publicly.

kookiegod
04-08-2010, 11:25 AM
Speaking of scripts...

Anyone got a version of guildx thats working? I got a copy but it stopped working when I moved to my new win7 machine, i know its not it, but I can't seem to find the reason for it.

~Paul

Lord Orbstar
04-08-2010, 04:14 PM
I feel the same way about this. Took them sooo long to finally get the ball rolling on Shattered.


I think this is the right idea. I don't care to just wrap one particular scripting language whether it's Ruby or Python/Javascript etc... but instead want to focus on making a framework that can be consumed or extended by a variety of languages. The idea should be to expose two things to the user, one is a set of services related to Gemstone which include things like graph searching, databases for critters, spells, optimizing stats/skills etc... and the other is providing the user with a structured way of organizing their scripts. I don't find the linear approach to writing scripts to be very flexible and will be using an event driven approach. As for the particular language, the core system will be C++ and I will expose all of the services via Swig so that it can be used in any language.

Psinet is actually very close to what I'm describing, but Psinet from what I recall is closed source and I don't think Jamus has released his scripting engine publicly.


I dont even know what the fuck you were talking about. Kranar is deh smart. I iz not.

To me, scripting is finding something on someone's old gemstone III webiste, then Copy + Pasting it into Stormfront. I suck.

Mail me something nice to use? I am just an army guy, not the computer wiz :/

BigWorm
04-08-2010, 05:01 PM
I feel the same way about this. Took them sooo long to finally get the ball rolling on Shattered.


I think this is the right idea. I don't care to just wrap one particular scripting language whether it's Ruby or Python/Javascript etc... but instead want to focus on making a framework that can be consumed or extended by a variety of languages. The idea should be to expose two things to the user, one is a set of services related to Gemstone which include things like graph searching, databases for critters, spells, optimizing stats/skills etc... and the other is providing the user with a structured way of organizing their scripts. I don't find the linear approach to writing scripts to be very flexible and will be using an event driven approach. As for the particular language, the core system will be C++ and I will expose all of the services via Swig so that it can be used in any language.

Psinet is actually very close to what I'm describing, but Psinet from what I recall is closed source and I don't think Jamus has released his scripting engine publicly.

The main task of a GS scripting language is parsing text. Perl/Ruby/Python are superb at this, C++ is quite a bitch (yeah yeah, I know about PCRE, but its not built into the language). I hadn't touched Ruby before I started using Lich, but Ruby is definitely my favorite language now and I think it is great at what it does. I this Jamus' scripting engine is an exercise in futility because he has been too busy re-inventing the wheel to get real useful things done with it.

Deathravin
04-08-2010, 05:40 PM
The main task of a GS scripting language is parsing text. Perl/Ruby/Python are superb at this, C++ is quite a bitch (yeah yeah, I know about PCRE, but its not built into the language). I hadn't touched Ruby before I started using Lich, but Ruby is definitely my favorite language now and I think it is great at what it does. I this Jamus' scripting engine is an exercise in futility because he has been too busy re-inventing the wheel to get real useful things done with it.

But to be fair, average GS players aren't coders and look at our Ruby scripts like a pitch-fork wielding towns person looks at Frankenstein's monster.

Fallen
04-08-2010, 05:53 PM
But to be fair, average GS players aren't coders and look at our Ruby scripts like a pitch-fork wielding towns person looks at Frankenstein's monster.

Bingo.

Lord Orbstar
04-08-2010, 06:01 PM
Deathravin is also wise beyond his tender years. Green Bubbles.

BigWorm
04-08-2010, 06:11 PM
But to be fair, average GS players aren't coders and look at our Ruby scripts like a pitch-fork wielding towns person looks at Frankenstein's monster.

That was directed more at Kranar and you. Especially in Shattered, I could give a fuck less about people who can't script.

Kranar
04-08-2010, 08:26 PM
The main task of a GS scripting language is parsing text.

I have to disagree. I don't think about scripts as being about text, whether it's parsing it or sending commands. That's a very low level detail and should be distinct from the task of writing a script.

In my opinion, the main task of a scripting engine is to abstract those implementation details so that as a scripter you can focus on solving the problem at a much higher level than parsing text and issuing commands.

As an example of an event driven approach to scripting... consider some event handlers for hunting rats. An event handler is just a function that is called by the scripting engine in response to a particular event.



current_target = None

// How we handle entering a new room.
def OnRoomEntered(event):
room = event.GetRoom()

// Check if a rat is in the room.
current_target = FindNpc(RAT, room)
if current_target == None:

// No rat in the room, move to another random room
Move(SelectRandomObviousExit(room))
return

// Subscribe to events related to the target.
Subscribe(current_target)

// Shock it.
CastSpell(WizardSphere.MinorShock, current_target)

// Cast time expired.
def OnCastTimeExpired(event):
if current_target != None:

// This means the cast time expired before the rat died, assume the rat is alive and shock it again.
CastSpell(WizardSphere.MinorShock, current_target)

// Handle the rat dying.
def OnTargetDied(event):

// Reset our current_target
current_target = None

// Search it for loot, for each item found, place it in my backpack.
treasure = Search(current_target)
for i in treasure:
Get(i)
Put(i, container)

// Now skin the rat.
pelt = Skin(current_target)

// If the skin was successful, the pelt variable will store the name of the pelt dropped by a rat, otherwise it will store None.
if pelt != None:
Get(pelt)
Put(pelt, 'backpack')

// Handle our mind going fried.
def OnMindFried(event):
room = GetCurrentRoom()
destination = GetTownCentre(Town.WhenimersLanding)
route = ComputePath(room, destination)
Travel(route)
Rest()

// Handle dying.
def OnDeath(event):
Depart()
room = GetCurrentRoom()
destination = GetTownCentre(Town.WhenimersLanding)
route = ComputePath(room, destination)
Travel(route)
...
...

That's pretty much an example for what I think a scripting engine should be like. The scripting engine needs to understand the semantics of the game and expose those semantics to the user, so that the user isn't sitting there having to match text to a regular expression. Also because it's event driven, you don't have to write your scripts in a linear fashion, things can happen entirely out of order. You just write tiny snippets of code that deal with new events that occur in the game, and whenever that event occurs the engine dispatches to your handler. That way if you die or get knocked down at some arbitrary moment, the engine just jumps to a handler that is specialized to get you back up on your feet and keep on going.

It also promotes writing very tiny customized pieces of code that do one thing and do it well. Effectively your scripting directory will simply contain many small snippets of code describing how your character reacts to one of dozens of events. You simply compose all of those snippets together to create a strategy and you can mix and match different pieces of code together, like one snippet is very good at picking the right attack strategy, another snippet is good at making sure your defenses/spells are always up, another one deals with rare/unexpected events like being knocked down/dying, ambushed by a player etc...

Drisco
04-08-2010, 10:13 PM
Excellent Kranar.. I'll await your PM of scripts you will send me.

Cephalopod
04-08-2010, 10:17 PM
Basically, everything Kranar has there can be done via Lich using his pseudo-code almost as a template. Most patterns (observer, specifically, in this case) are easily implementable in Ruby, although I haven't seen anyone do this in Lich yet.

Kranar
04-08-2010, 10:28 PM
I've never seen anything event driven in Lich. Can you link me to a script that is event driven or provide some code showing how to handle some simple events like entering a room or a handling a mana pulse.

Cephalopod
04-08-2010, 11:06 PM
There's nothing currently event-driven that I'm aware of; most people write straight procedural Lich scripts. Ruby has a lot of capabilities that just haven't been 'tapped' for scripting yet.

In order to implement an event framework like you have in your pseudo-code, you would first need to capture (at the lower level) those events so that you can chain handlers to them by writing some sort of marshal class. Once you wrote this substrate in Lich, you could use Observable to approximate what you've suggested.

There's a useful extension to Observable called Eventful (http://github.com/jcoglan/eventful), which you may want to look at, as it gives a simple example of how you can chain event types.

If I have some time tomorrow, I can slap down a very basic stab at what the marshal class would look like, and how you would attach events to it.

Cephalopod
04-08-2010, 11:18 PM
Actually, looking at the infomon script (which everyone runs), it would be the ideal place to build this sort of event-driven framework, as it's already forking off new threads to deal with spell events, death, etc.

phantasm
04-09-2010, 12:39 AM
i didn't know that, but thanks for letting me know.

but yeah, the scripting policy is pretty lame. they should work on doing cool shit in-game instead of spending so much man-power on busting people. maybe then we'd have more than 350 people playing (half of those being MA, so more than 150?)
Yah, you the man, you got this all figured out. Maybe you can do something to help everyone else understand this deep philosophy you have based your thinking around. If you can't, maybe you should just get angry and be like Oh fuck the world.

Deathravin
04-09-2010, 07:01 AM
I've never seen anything event driven in Lich. Can you link me to a script that is event driven or provide some code showing how to handle some simple events like entering a room or a handling a mana pulse.

You're right. I think every script I've seen is bastardized with procedural code.

Even infomon (keeps track of incoming XML data and pushes data like current health, mana, room etc). Does it with a 'wait until one of these 50 things change, then see what it was, then update this variable.

If there are ways to do it in ruby, Tillmen either doesn't care because what works, works... or doesn't know so hasn't told anybody how to do it yet. It's my guess that Ruby just doesn't work like that and has to rely on procedures.

If anybody figures it out, hit me up, it would make uberbar a lot easier LOL.

Celephais
04-09-2010, 09:50 AM
I've never written any significant Ruby code, but I can tell you that Ruby does indeed support events.

... decided to actually look it up, a stackoverflow question on how to implement an event: http://stackoverflow.com/questions/246091/what-is-the-equivalent-of-net-events-in-ruby

Cephalopod
04-09-2010, 10:27 AM
I've never written any significant Ruby code, but I can tell you that Ruby does indeed support events.

... decided to actually look it up, a stackoverflow question on how to implement an event: http://stackoverflow.com/questions/246091/what-is-the-equivalent-of-net-events-in-ruby

One of these examples is using Observable, which I mentioned. There are better implementations, but using Observable as a mixin would be a very easy and clean way to start.

Kranar
04-09-2010, 10:58 AM
I've never written any significant Ruby code, but I can tell you that Ruby does indeed support events.

Sure, assembly also supports events as well but that's not really important. Heck you could even argue that the WizardFE supports events.

Event driven programming is a style of programming, it's not something that's built into a language. The question isn't is it somehow possible to use Ruby or Python or X, Y, Z to do event driven programming, the question is will using such a paradigm fit right in with the rest of the Lich framework, or will stick out like a sore thumb with no support from the framework?

Lich from what I've seen, has no idea what an event is. Lich is designed with the paradigm that scripts are procedural in nature, basically you write your script to match text and based on what you match you send commands back to the game, rinse and repeat. All the scripts that fit in with the Lich ecosystem are written with this paradigm so to begin using an event driven approach within a framework that has no idea what an event is would be like designing a GUI using functional programming in Visual BASIC.

You have to pick the right tool for the job. Unless I can write a script that can react to a mana pulse as simply and conveniently as:



def OnManaPulse(event):
Say('I now have this much mana:' + event.GetMana())

Then Lich is not event driven in any meaningful way. Once again though, I don't see the main role of a scripting engine to be parsing text. My opinion is a good engine is more of a support structure, providing an ecosystem of services and guiding the user to think and structure their code in a certain way. It needs to establish what its paradigm is and make it easy for the user to consume services and extend those services as well. If I just want a Ruby interpreter, I can download Ruby or Python or use .NET but of course like I said in an earlier post... the scripting engine really shouldn't have much to do with any one particular language, a user should feel free to use a language of his choice and allow many scripts from multiple languages to interact together using a common interface and common design pattern. If when using Lich I have to start using third party libraries and writing code to translate Gemstone text into events... then what exactly is Lich doing to help me out here other than serving as a proxy with a Ruby interpreter in between?

And for those who are experts with Ruby... think of my argument as the difference between Ruby as a language and Ruby on Rails as an overall framework/paradigm. What I'm arguing for is similar to wanting a Ruby on Rails for Gemstone scripting.

Celephais
04-09-2010, 11:21 AM
Sure, assembly also supports events as well but that's not really important. Heck you could even argue that the WizardFE supports events.
Which is why I said it did, without having written any. I was responding to Deathravin's claim that: "It's my guess that Ruby just doesn't work like that and has to rely on procedures."


the question is will using such a paradigm fit right in with the rest of the Lich framework, or will stick out like a sore thumb with no support from the framework?
As for the rest of your point, I agree that it's a matter of fitting the framework, but it's not like someone couldn't layer a framework that promotes event driven paradigms ontop of lich, if they were so inclined.

Cephalopod
04-09-2010, 12:04 PM
The point of using Lich is that it offers a few pre-rolled functions and objects you can use to access game data. If you wanted to write a Ruby interpreter for Gemstone scripting, Lich already has most of the underlying framework to get started. If you're intent on re-writing the game connection layer, that's fine. However, Lich already has a lot of what's necessary for the lower levels and could be used to make an event-driven system by existing Lich users.

With some modifications to the way the infomonitor script works, you could easily define all of the events you want to track as well as event-dispatch chains for those events.

Rather than writing this script:


loop {
if (checkmana > lastmana) then
echo "I now have this much mana: " + checkmana
end
lastmana = checkmana
sleep 1
}


A simple revised infomonitor could be set up to to process event chains, and just register mini-scripts as event handlers. Once this was done for meaningful events, it would very simple to create script snippets as you have above that could be run concurrently and interact with each other.



#ManaEvent.lic
require 'observer'

class ManaEvent
include Observable
def run
loop do
if checkmana != lastmana
# Some logic to determine if its a pulse, or a send?
changed
lastmana = checkmana
notify_observers(checkmana)
end
sleep 1
end
end
end




# In infomonitor.lic, or standalone
ManaEvent = ManaEvent.new
ManaEvent.run


One small abstract class:


#GemstoneEvent.lic
class GemstoneEvent # Abstract GemstoneEvent
def initialize(event)
event.add_observer(self)
end
end


With that done, as a user you could write a mini script like this:


# MyManaPulseEvent.lic
class MyManaPulseEvent < GemstoneEvent
def update(new_data)
echo "I now have this much mana: #{new_data}"
end
end

MyManaPulseEvent.new(ManaEvent)


It's a stupid example (hey, I'm at work!), but the point is that Lich itself is not forced into a procedural methodology. The fact is that procedural scripts are easy and work well for Gemstone scripting, so that's what most people have developed.

Deathravin
04-09-2010, 12:18 PM
All the uber awesomeness Nachos DLC posted

Wow... That's pretty tits man. I think I'm going to rewrite uberbar to incorporate this... after I'm done with preparing for Shattered new character leveling ><.

BigWorm
04-09-2010, 12:25 PM
It's a stupid example (hey, I'm at work!), but the point is that Lich itself is not forced into a procedural methodology. The fact is that procedural scripts are easy and work well for Gemstone scripting, so that's what most people have developed.

That's a good example of event-driven programming. A less contrived event-driven script might be one that automatically refreshes spells/signs/sigils when they drop (I used a two-threaded producer/consumer model for my solution though). Ruby also has really good support for OOP and functional programming. But like Kranar said, most language have decent support for multiple paradigms, a lot of it is a matter of style and preference. I am used to writing OOP Perl, so my lich scripts are usually OOP style Ruby with some functional stuff tossed in.

I feel your pain with looking at everyone's procedural code in lich scripts, but obviously most of these people aren't real programmers. Although Tillmen's trusted scripting stuff helped some, one of my pet peeves with using many of the scripts in the repo is the way they pollute the namespace with symbols because nobody understands scope and makes everything global.

And Kranar, while a good solution pretty much totally abstracts the actual text parsing down to lower level functions and away from the high level scripts, those functions need to be written and they are going to need to parse either XML or game text. GS is a text-based game, so text processing is going to be at its core.

Cephalopod
04-09-2010, 12:27 PM
Wow... That's pretty tits man. I think I'm going to rewrite uberbar to incorporate this... after I'm done with preparing for Shattered new character leveling ><.

As a disclaimer, I haven't used Lich in a while and I don't play GS atm. Just sayin'.

Kranar
04-09-2010, 01:29 PM
Thanks for taking the time to produce that example.

It looks good.

Deathravin
04-09-2010, 01:52 PM
The more I look at that code, I think this is how a lot of infomon does work...

Cephalopod
04-09-2010, 01:59 PM
The more I look at that code, I think this is how a lot of infomon does work...

It is. The checkdisease stuff, for example, would be very easy to rewrite into an observable class.

Tillmen
04-14-2010, 02:58 AM
I don't know.. I'm not sure how much Lich would benefit from an event driven system. Most scripts already respond to events. I'd be surprised if there's a hunting script without this stuck in there somewhere:


Thread.new {
loop {
wait_while { standing? }
waitrt?
fput 'stand'
}
}

It's basically an onFallDown event. It is activated as soon as you fall down no matter what else the script is doing or waiting for.

Or take my loot script for example. It just sits quietly until you kill something. However, unlike the event driven example, it doesn't care if what you killed was your current target. It only cares that you killed it. If someone else kills your current target (say they jump out of hidding and ambush it, and you shouldn't have been attacking it in the first place), the script doesn't loot it. Also, if you kill six things at once with cone of lightning, it takes out your skinning weapon once, skins all six, puts it away, loots all six, and picks up the good loot from only the things you killed. All this happens while some other script does the actual killing, some other script keeps your spells and signs up, and some other script moves you around. In an event driven system, it seems like you'd either not loot five of them, or you'd have six events triggered all trying to do the same thing at once.

What is it that we want a script to do that currently can't be done with Lich, or isn't already being done with Lich?

pabstblueribbon
04-14-2010, 07:55 AM
I don't know.. I'm not sure how much Lich would benefit from an event driven system. Most scripts already respond to events. I'd be surprised if there's a hunting script without this stuck in there somewhere:


Thread.new {
loop {
wait_while { standing? }
waitrt?
fput 'stand'
}
}

It's basically an onFallDown event. It is activated as soon as you fall down no matter what else the script is doing or waiting for.

Or take my loot script for example. It just sits quietly until you kill something. However, unlike the event driven example, it doesn't care if what you killed was your current target. It only cares that you killed it. If someone else kills your current target (say they jump out of hidding and ambush it, and you shouldn't have been attacking it in the first place), the script doesn't loot it. Also, if you kill six things at once with cone of lightning, it takes out your skinning weapon once, skins all six, puts it away, loots all six, and picks up the good loot from only the things you killed. All this happens while some other script does the actual killing, some other script keeps your spells and signs up, and some other script moves you around. In an event driven system, it seems like you'd either not loot five of them, or you'd have six events triggered all trying to do the same thing at once.

What is it that we want a script to do that currently can't be done with Lich, or isn't already being done with Lich?

I'm wondering about this:


Thread.new {
loop {
wait_while { standing? }
waitrt?
fput 'stand'
}
}

What if this is trying to fire when you've lost both your legs or it tries to fire when you're currently trying to beseech or whatever. I guess you could put in more conditionals in the wait_while.

I suppose I should change my code over to this, right now I just define a def called stand and call it first in every "loop" in my hunting script so that it has priority over anything else.

I'm probably doing it wrong.

pabstblueribbon
04-14-2010, 01:05 PM
or, what if your hunting script takes a swing at a critter while you're not standing?

Edit: eh I guess i could make the attack proc make sure you're standing first.

ruineye
04-14-2010, 07:06 PM
If you're intent on re-writing the game connection layer...

This.

Has anyone worked out a single interface to MA 3+ characters? Seems like it *should* be easy, but writing something like this at anything but the connection layer would be non-ideal...

Cephalopod
04-14-2010, 07:18 PM
This.

Has anyone worked out a single interface to MA 3+ characters? Seems like it *should* be easy, but writing something like this at anything but the connection layer would be non-ideal...

Crosscharcom.lic does this handily.

ruineye
04-14-2010, 09:30 PM
Crosscharcom.lic does this handily.

Thanks, will take a look. I run Avalon on a MBP, and have been building off of the YASSE source...