Hello, everybody.
As many other people playing muds I have recently come to the conclusion that scripting can make your virtual life much easier, esp. that concerns leveling, where a lot of routine work has to be done. Getting to the top level for the first time was quite a lot of fun, but killing the same monsters and wandering around the same rooms all over again just for the sake of getting a top level character of another class or without all these mistakes in stats or skills distribution that new players inevitably make, looked a bit boring. So I set myself to write that easy script, that just walks along the set rout, kills the set monsters and rests when the hp check says so.
As Lua was highly recommended at this site, I first started writing the script in this language, but I was disappointed to find few or scant manuals on Lua. Actually, I'm very far from programming in my real life, I graduated from a language department a few years ago. So to understand the logic and structure of a scripting language I need quite a comprehensive help. Anyway, when I spent half a day trying to figure out how the "if" argument works in Lua, I thought it would be a better idea to stick to AutoIt, another scripting language, with the help of which I have already made some programs of different type. The only problem with it was that it couldn't read lines directly from any client.
So what I’ve done, was a little function in Lua, that puts the demanded line into the clipboard:
function copy (x)
x=x-1
total_lines = GetLinesInBufferCount ()
SetClipboard(GetLineInfo (total_lines - x, 1))
end -- copy
AutoIt sends commands to the client through direct input to the command line, that is, it imitates a user typing. By sending the "/copy()" command it gets data from the game through the clipboard, processes it and sends commands back through the command line. I know how awful that must look like, but it works :)
Still, another method would evidently be much more welcome, since this clipboard/direct input interface appears somewhat abnormal, plus you can't use the computer while the script is working - for it to be able to type things into the client, the latter has to be active all the time, not in the background.
So I would appreciate any suggestions on how to get the external script and the client work together through a more convenient way then the one I have invented.
And thanks for reading the many letters above :)
As many other people playing muds I have recently come to the conclusion that scripting can make your virtual life much easier, esp. that concerns leveling, where a lot of routine work has to be done. Getting to the top level for the first time was quite a lot of fun, but killing the same monsters and wandering around the same rooms all over again just for the sake of getting a top level character of another class or without all these mistakes in stats or skills distribution that new players inevitably make, looked a bit boring. So I set myself to write that easy script, that just walks along the set rout, kills the set monsters and rests when the hp check says so.
As Lua was highly recommended at this site, I first started writing the script in this language, but I was disappointed to find few or scant manuals on Lua. Actually, I'm very far from programming in my real life, I graduated from a language department a few years ago. So to understand the logic and structure of a scripting language I need quite a comprehensive help. Anyway, when I spent half a day trying to figure out how the "if" argument works in Lua, I thought it would be a better idea to stick to AutoIt, another scripting language, with the help of which I have already made some programs of different type. The only problem with it was that it couldn't read lines directly from any client.
So what I’ve done, was a little function in Lua, that puts the demanded line into the clipboard:
function copy (x)
x=x-1
total_lines = GetLinesInBufferCount ()
SetClipboard(GetLineInfo (total_lines - x, 1))
end -- copy
AutoIt sends commands to the client through direct input to the command line, that is, it imitates a user typing. By sending the "/copy()" command it gets data from the game through the clipboard, processes it and sends commands back through the command line. I know how awful that must look like, but it works :)
Still, another method would evidently be much more welcome, since this clipboard/direct input interface appears somewhat abnormal, plus you can't use the computer while the script is working - for it to be able to type things into the client, the latter has to be active all the time, not in the background.
So I would appreciate any suggestions on how to get the external script and the client work together through a more convenient way then the one I have invented.
And thanks for reading the many letters above :)