Code Monkey home page Code Monkey logo

script-api's Introduction

❤ Moe Script API

This is a fluent script api for writing performant, low overhead, MapleStory scripts. We do this by constructing proxy objects that communicate between the api and the script files. The API itself is heavily modelled after nexon's own api, with some minor additions here and there, like text command scripts. Credits to bboki/feras for the below image

Maven

<dependency>
  <groupId>moe.maple</groupId>
  <artifactId>script-api</artifactId>
  <version>1.6.0</version>
</dependency>

Examples

For a more in depth explanation, see the wiki. All scripts extend their base script type, so a script for an Npc would extend the NpcScript, etc. Additionally, all logic is conducted in the Script::work() method. You shouldn't have to extend any underlying logic methods to have functioning scripts, for a more detailed explanation or outlook on scripts, see my main script repo.

script-api's People

Contributors

feras-96 avatar umbreon22 avatar y785 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

script-api's Issues

More Script Actions

Need to expand upon say/askMenu/askYesno to include all the default types.

This is more about adding the messengers with correct/needed parameters.

Missing:

SayImage
AskText
AskNumber
AskQuiz
AskSpeedQuiz
AskAvatar
AskMemberShopAvatar
AskPet
AskPetAll
Script(?)
AskAccept
AskBoxText
AskSlideMenu
AskCenter(?)

Script name based on call

There isn't a way to determine the script name being called.
Normally this isn't needed, but since I added aliases (multiple names -> single script), it is.

This is similar to how the notfound scripts work.

Add script validators

Script validators should validate various things passed to them.
Hair ids, npc ids, etc etc.

Should default to true -- trust the scripts.

Will be useful for various between-version issues.

Consecutive responsive actions cause crashes

Calling two script actions (i.e. say, askYesNo) consecutively may result in messengers sending packets too soon.
Typical usage of the API would look like the below, chained together with andThen

askYesNo("...",()->{...}).andThen(()->say(...))

Erroneous usage would look like

askYesNo("...",()->{...});
say(...);

This should throw an exception.

askMenu index issues

askMenu doesn't use always use the indices sent to the client, it uses an array's. This will cause the script to end on custom indices being sent to the client, i.e.
\#L0# test #lr\n#L1000# test #l
-> The client will send 1000, but the server thinks the max is 1.

Add Client format methods to ScriptStringBuilder

As of right now, Moematter has methods like item() to create strings with the MapleStory client's formatting options.
I'd like shortcuts inside ScriptStringBuilder to append them.
ssb.item(1302000) would equate to ssb.append(Moematter.item(1302000))

ScriptFormatter client features

Add support for all client features under ScriptFormatter.
i.e.
ScriptFormatter.format("#m{}#", fieldId) would be ScriptFormatter.field(fieldId)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.