Isuka2009-03-10 06:03:11
QUOTE (Simimi @ Mar 9 2009, 08:49 PM) <{POST_SNAPBACK}>
I can't think of a single use for SQLite in Mush except for as a database for forging numbers, maybe to later display as a miniwindow histogram of statistical output, per item forged. That makes me sad. Anyone want to pitch some ideas, for fun?
Also, considering some theoretical OOP style curing system (I can't seem to envision how that would look yet) would a change to Ruby for scripting be worth it (assuming the code quality is the same Lua to Ruby) for the OOP aspects of Ruby? Would there be a significant (comparatively) speed hit?
Lastly, I may get flames for this but, is there any chance of getting C# into Mush as a scripting language? (Or anyone know of a C# compatible client?) We use it a lot for all of my programming classes and I find it useful, since I have learned a lot with it already anyway.
Also, considering some theoretical OOP style curing system (I can't seem to envision how that would look yet) would a change to Ruby for scripting be worth it (assuming the code quality is the same Lua to Ruby) for the OOP aspects of Ruby? Would there be a significant (comparatively) speed hit?
Lastly, I may get flames for this but, is there any chance of getting C# into Mush as a scripting language? (Or anyone know of a C# compatible client?) We use it a lot for all of my programming classes and I find it useful, since I have learned a lot with it already anyway.
I don't use sqllite, but I do have my MUSH set up to connect to a MySQL database to automatically reload affliction/diagnose/cure triggers at the beginning of each session, between characters.
I don't really like Ruby, myself. I've had speed issues with it in the past which put me off to it. Also, with a bit of practice you can emulate OOP practices within lua. It's not truly OOP, but it's close. Kind of like doing OOP in C.
Simimi2009-03-10 06:36:10
Yea I can't even think of a way to OOP a system anyway... hmm just wanted to try some of this new stuff. I have some fun ideas for the miniwindows if I can get it down well.
Thanks for the input Isuka!
Thanks for the input Isuka!
Unknown2009-03-10 07:55:35
My Lua combat system is OOP, broken into modules and making use of the module:function syntax, which gives you the intrinsic "self" variable.
The only way to use C# with MUSHclient would be through a UDP socket, since C# isn't a scripting language.
My Score Vitals trigger pattern, copied from my combat system:
The only way to use C# with MUSHclient would be through a UDP socket, since C# isn't a scripting language.
My Score Vitals trigger pattern, copied from my combat system:
CODE
  lines_to_match="4"
  match="^\\|\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\- VITALS\\|\\n\\| Health \\: (\\d+)\\/(\\d+)\\s+Endurance \\: (\\d+)\\/(\\d+)\\s+Power    \\: \\d+p\\s+\\|\\n\\| Mana  \\: (\\d+)\\/(\\d+)\\s+Willpower \\: (\\d+)\\/(\\d+)\\s+Reserves \\: (\\d+)\\%\\s+\\|\\n\\| Ego    \\: (\\d+)\\/(\\d+)\\s+Mindset  \\: \\w+\\s+Esteem  \\: (\\d+)\\%\\s+\\|$"
  match="^\\|\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\- VITALS\\|\\n\\| Health \\: (\\d+)\\/(\\d+)\\s+Endurance \\: (\\d+)\\/(\\d+)\\s+Power    \\: \\d+p\\s+\\|\\n\\| Mana  \\: (\\d+)\\/(\\d+)\\s+Willpower \\: (\\d+)\\/(\\d+)\\s+Reserves \\: (\\d+)\\%\\s+\\|\\n\\| Ego    \\: (\\d+)\\/(\\d+)\\s+Mindset  \\: \\w+\\s+Esteem  \\: (\\d+)\\%\\s+\\|$"
Simimi2009-03-10 14:15:48
Is self like the this in C# by chance?
I'll look at module:function also, after having programming 1 and 2 and database classes, I am trying to think of something more interesting than my old system of passing everything as function args.
I'll look at module:function also, after having programming 1 and 2 and database classes, I am trying to think of something more interesting than my old system of passing everything as function args.
Unknown2009-03-10 15:07:53
Lua's self is similar to this in C-like languages, yes. You can find the module:function syntax described in the Programming in Lua text online.
You might also be interested in a helper library some guys wrote to do OOP stuff in Lua, called LOOP.
You might also be interested in a helper library some guys wrote to do OOP stuff in Lua, called LOOP.
Unknown2009-03-14 10:03:40
So, my power was cut off while my Alacardael world in MUSH was open. I wait for the power to return, then I re-open MUSH. When I try to open my Alacardael world, though, a Mush window opens with "Unexpected file format.", and this:
Line 2440: Unexpected end-of-file looking for Element name (problem in this file)
Halp?
Line 2440: Unexpected end-of-file looking for Element name (problem in this file)
Halp?
Unknown2009-03-14 11:12:55
QUOTE (Alacardael! @ Mar 14 2009, 06:03 AM) <{POST_SNAPBACK}>
So, my power was cut off while my Alacardael world in MUSH was open. I wait for the power to return, then I re-open MUSH. When I try to open my Alacardael world, though, a Mush window opens with "Unexpected file format.", and this:
Line 2440: Unexpected end-of-file looking for Element name (problem in this file)
Halp?
Line 2440: Unexpected end-of-file looking for Element name (problem in this file)
Halp?
It looks like maybe it was in the middle of saving the file when your power died. Open the world file (.mcl) in a text editor and go to that line 2440. If you don't mind posting a couple lines from that location, it'll help determine what's incomplete. However, it still might not help you much because there may be many lines after that missing, too. (Always a great idea to keep backups!)
Isuka2009-03-16 18:56:30
More of a Lua question than a mushclient question:
How do you handle ordered lists in Lua? If I create a dictionary table and try to parse through it with pairs(), it basically sorts through it in whatever way it feels like. Most of the time, this is fine and I don't really care. I've come to a couple of points now, though, where order is actually important (usually for displaying graphical elements that are dynamic in some way) and getting them ordered is more complex than I think it should be.
I was thinking about creating a new class that simplifies the process by keeping a count of elements and adding new ones by creating a single element with a numerical value that references the actual table data: (psudocode)
Of course, this also means writing accessor functions and so forth, and I imagine there's an easier way.
Also, if I end up having to do that, metatable data can help with that, right? newindex?
How do you handle ordered lists in Lua? If I create a dictionary table and try to parse through it with pairs(), it basically sorts through it in whatever way it feels like. Most of the time, this is fine and I don't really care. I've come to a couple of points now, though, where order is actually important (usually for displaying graphical elements that are dynamic in some way) and getting them ordered is more complex than I think it should be.
I was thinking about creating a new class that simplifies the process by keeping a count of elements and adding new ones by creating a single element with a numerical value that references the actual table data: (psudocode)
CODE
table = = value
Of course, this also means writing accessor functions and so forth, and I imagine there's an easier way.
Also, if I end up having to do that, metatable data can help with that, right? newindex?
Unknown2009-03-16 23:05:43
I borrowed some very useful code from the "PHP Tables" topic on this page: http://lua-users.org/wiki/MakingLuaLikePhp
(If you've got a copy of Treant, just look at php.lua!)
(If you've got a copy of Treant, just look at php.lua!)
Isuka2009-03-16 23:52:01
QUOTE (Zarquan @ Mar 16 2009, 04:05 PM) <{POST_SNAPBACK}>
I borrowed some very useful code from the "PHP Tables" topic on this page: http://lua-users.org/wiki/MakingLuaLikePhp
(If you've got a copy of Treant, just look at php.lua!)
(If you've got a copy of Treant, just look at php.lua!)
Awesome, that's very helpful (especially since I work with PHP more than anything else, in general).
Unknown2009-03-18 20:34:57
How do I configure what appears in the gray bar below the command line to display certain things (Namely variables)? The old system I had did it, but I could never figure out how to do it myself.
Isuka2009-03-18 21:33:02
I'm curious as to how other people run their ally/enemy display scripts. After engaging in some combat, I realize now that being able to quickly see who your enemies and your allies are is absolutely paramount, but the only ways that I can think to highlight them seem like they'd slow down my system.
What I'm thinking of doing is writing script functions that alter a string, adding and removing elements in this format:
so that I can drop that into a regex statement in this manner:
and then check the backreference against a string.match like this:
I'm thinking that only checking against capitalized words will reduce the overhead of processing the string.match.
Any advice?
Also: How are you gathering the lists for enemies/allies? Manually? Using city enemies or something?
What I'm thinking of doing is writing script functions that alter a string, adding and removing elements in this format:
CODE
element element element
so that I can drop that into a regex statement in this manner:
CODE
(+)
and then check the backreference against a string.match like this:
CODE
string.match(GetVariable(allylist), "%1")
I'm thinking that only checking against capitalized words will reduce the overhead of processing the string.match.
Any advice?
Also: How are you gathering the lists for enemies/allies? Manually? Using city enemies or something?
Esano2009-03-19 01:12:08
CODE
 Â
  colour_change_type="1"
  enabled="y"
  expand_variables="y"
  group="highlighting"
  keep_evaluating="y"
  match="(@!citizen_celest)\\W"
  name="citizen_celest"
  regexp="y"
  repeat="y"
  sequence="95"
  other_text_colour="dodgerblue"
  >
 Â
 Â
  colour_change_type="1"
  enabled="y"
  expand_variables="y"
  group="highlighting"
  keep_evaluating="y"
  match="(@!citizen_glomdoring)\\W"
  name="citizen_glom"
  regexp="y"
  repeat="y"
  sequence="95"
  other_text_colour="#C255FF"
  >
 Â
 Â
  colour_change_type="1"
  enabled="y"
  expand_variables="y"
  group="highlighting"
  keep_evaluating="y"
  match="(@!citizen_magnagora)\\W"
  name="citizen_mag"
  regexp="y"
  repeat="y"
  sequence="95"
  other_text_colour="#DB0000"
  >
 Â
 Â
  colour_change_type="1"
  enabled="y"
  expand_variables="y"
  group="highlighting"
  keep_evaluating="y"
  match="(@!citizen_serenwilde)\\W"
  name="citizen_seren"
  regexp="y"
  repeat="y"
  sequence="95"
  >
 Â
And populate the citizen_x variables from the citizen lists (I made a trigger and several alts to do that).
Esano2009-03-19 01:16:16
QUOTE (Fireweaver @ Mar 19 2009, 07:34 AM) <{POST_SNAPBACK}>
How do I configure what appears in the gray bar below the command line to display certain things (Namely variables)? The old system I had did it, but I could never figure out how to do it myself.
This is the InfoBar. The Mushclient help files are fairly thorough, once you know what to look for.
Assuming you're using Lua, put a variable in like so:
InfoClear() -- Resets the infobar
Info("Target : "..GetVariable("target")) -- Adds your target to the infobar
I think you'll need to reset that each time you change your target, or possibly off your prompt.
Unknown2009-03-19 01:25:40
Would that go in the variable that I want to display, or a separate variable?
Esano2009-03-19 01:44:30
*cough* I meant there, that to put a variable in, you do that. You don't actually put that in the variable. That's scripting, so you put it in a trigger or an alias.
Unknown2009-03-22 05:10:10
Out of sheer boredom/preparation, here's a regex for capturing momentum:
Promptstring is %8, momentum is %7, when present, it gets set to "" if not present.
CODE
^(\\d+)h\\, (\\d+)m\\, (\\d+)e\\, (\\d+)p\\, (\\d+)en\\, (\\d+)w(?:\\, (\\d+)mo)? (\\w+)\\-$
Promptstring is %8, momentum is %7, when present, it gets set to "" if not present.
Unknown2009-03-22 05:46:15
How do I trigger things to make an echo after a certain amount of time?
So, I want to trigger A pixie shoots blah blah at @target. I want it to echo 10 seconds later, 2 SECONDS UNTIL FAE ATTACK.
So, I want to trigger A pixie shoots blah blah at @target. I want it to echo 10 seconds later, 2 SECONDS UNTIL FAE ATTACK.
Esano2009-03-22 06:30:30
The basic form is DoAfterNote(n,"text")
A more advanced form (with colour!) can be done by combining DoAfterSpecial and ColourNote, like so:
DoAfterSpecial(10,'ColourNote("red","black","PIXIE WILL ATTACK IN TWO SECONDS!")',12)
Note that when using DoAfterSpecial and a script function that has string-based arguments, I suggest using '' for the DoAfterSpecial to surround the function, so as not to interfere with the function itself.
A more advanced form (with colour!) can be done by combining DoAfterSpecial and ColourNote, like so:
DoAfterSpecial(10,'ColourNote("red","black","PIXIE WILL ATTACK IN TWO SECONDS!")',12)
Note that when using DoAfterSpecial and a script function that has string-based arguments, I suggest using '' for the DoAfterSpecial to surround the function, so as not to interfere with the function itself.
Unknown2009-03-22 07:20:24
Thanks a bunch! I don't really understand your note, but anyway. What's the 12 for, at the end?