scripter Readme
scripter is a LASERJESUS plugin for the game NexusTK. scripter provides an LUA interface that can be used to perform tasks in NexusTK, using LASERJESUS for access to the unencrypted packet stream. Possible uses for scripter include: bots, macros, and automation of common tasks. Please visit the forums (graciously hosted by VIPERZOO) if you have any questions, comments, or if you wish to share a script you made.
Installation
- Download and install the .NET Framework.
- Extract scripter.zip into your LASERJESUS directory. By default, this is C:\LASERJESUS.
- Add plugins\scripter\scripter.dll to your autoload settings. scripter MUST be on autoload.
- Start up laserjesus and start having fun!
Usage
To run an LUA script in scripter, just type ;loadScript("scripts/myscript.lua"); into the LASERJESUS console. Alerternatively, you can run commands from in-game by whispering to the pseudo-person "scripter" -- in-game transactions will resemble whisper conversations, although they only exist on the client (that is, if there is a person named "scripter" signed on, he will not hear your messages). It is important that you remember the quotes surrounding "scripts/myscript.lua".
If you're interested in writing LUA scripts, or using more commands from in-game, you should read the manual. You might want to skip ahead to Function Reference for examples and information about the various built in commands.
Example Scripts
A couple of example scripts are included in the scripts/ folder. Open up the scripts in notepad or your editor of choice for instructions on how to use the scripts.
Credits
Coded by misterPhyrePhox. Uses LUA 5.1 and TinyXML. Written for LASERJESUS.
Known Issues
- The plugin does not work with multiple copies of nexus.
- If you load the plugin, and then unload the plugin repeatedly, then sometimes, eventually, you get an access violation. I can't seem to find the source of this, and my debugger isn't offering any helpful information, so I haven't been able to resolve this. The solution to this problem is to restart laserjesus when you get an access violation, and then everything should work out OK.
Changelog
- Version 1.05 Bugfixes (Current Release)
- Bugfix: Fixed innacuracy with EFFECT_PACKET.
- Addition: Added tablex package including tablex.select.
- Bugfix: Fixed a bug in the obstacle avoidance of the automation system.
- Bugfix: Thanks to information from VIPERZOO, improved the accuracy of the player's coordinates stored in player.x and player.y.
-
- Bugfix: The variables player.health and player.mana used to be innacurate in some odd cases.
- Addition: Added the packet definition EFFECT_PACKET, which displays spell effects. It is defined in spell.xml.
- Addition: Added the functions go.selectAdjacent, go.selectObjects, and go.findPlayer for convenience. See function reference in the manual for documentation.
- Changed the behavior of go.registry[].kind.
- Version 1.05
- Addition: Added the go package for trakcing game objects (monsters and players).
- Addition: Added the auto package for creating quick "automation" scripts.
- Bugfix: In the older versions, if you logged in, and then re-logged in with a different character, the spell and inventory registries would be corrupted. This is no longer a problem.
- This plugin still doesn't work with multiple copies of nexus -- but if you attempt to load two copies of nexus, it will spout out a nice error message and shut down.
- Addition: Added the Array datatype for use in packet definitions.
- The String datatype now works with null-terminated strings; set the size attribute to "null_terminated."
- Refactor:
- hotkey is now registerHotkey.
- timer is now createTimer.
- trace is now print.
- The char package has been renamed to player.
- broadcast is now broadcastEvent.
The reason that I refactored is that I thought these new variable names made more sense. The old names are still valid, and old scripts should work. If you don't know what refactoring is, its just renaming stuff and moving stuff around to make code more readable.
- The player package now tracks player coordinates.
- Addition: Added function unloadScript.
- Bugfix: Various bugfixes (Thanks for pointing bugs out, pwnedowned!)
- Addition: Added function invo.dropMoney (Contributed by VIPERZOO, thanks!).
- Addition: Added function invo.pickupAll.
- Change: The behavior of registerHotkey has been changed; instead of accepting modifiers and the key as separate arguments, you now pass it one string like "control shift a" -- it also no longer accepts virtual key codes, but it does accept key names like "left" for left arrow key; "control shift left" is valid! Also, it should be backwards compatible; that is, the old way of passing modifiers and keys should still work.
- The error messages are now MIND BOGGLINGLY descriptive; functions now check to see whether they've been passed valid arguments, all error messages come with line numbers and the source of the error, and the packet deserialization code has been majorly revamped to spout out nice errors. Sometimes the errors may sound a bit technical; in that case, please report the error to me!
- Change: You no longer have to provide a sender parameter to dropPacket, although "sender" is still included in the packet table.
- I revised the manual a bit, proofreading it, and adding documentation for the newly added features. I also added the Getting Help section, and a "tutorial" thingy on LUA tables.
- Stack tracebacks are now included in all error messages. If you don't know what a stack traceback is, then look for it in your next error message; it shows what functions called what to get to the current segment of code that errored. They are incredibly helpful when debugging.
- Addition: Added a very simple hunting bot, scripts/huntbot.lua -- remember to configure it before you use it!
- sendKeys has been replaced by sendKey, which is slightly more versatile in that you can do things like sendKey("left") to send the left arrow key.
- Version 1.04
- Greatly increased the versatility of the trace function, so that it can now print ANY value you throw at it, including tables and tables within tables and booleans and nils and whatever.
- More descriptive errors.
- Added the script scripts/bleh.lua, written by me and a friend.
- If you load a script over itself, then the old script will be unloaded.
- Version 1.03
- You can now pass params to your timer callbacks. See timer.
- You can now specify a virtual key code when using sendKeys.
- Version 1.02
- Addition: Added timers. See the timer function.
- You can now use virtual key codes when specifying hotkeys. See the hotkey function.
- Version 1.01
- Bugfix: If you specified the key for a hotkey as something like PLUS, which constitutes two keys, actually (SHIFT+EQUALS), then the thingy would go berserk.
- Updated the documentation for hotkey to be a bit less ambiguous.
- Version 1.0
- Addition: Added the sendKeys function
- Jumped from version 0.1a to 1.0, because I felt like it. Deal.
- Version 0.1a